control-freak-ide/misc/pocs/GoJS/release__/go.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

31718 lines
1.3 MiB

/*
* GoJS v1.3.6 JavaScript Library for HTML Canvas Diagrams
* Northwoods Software, http://www.nwoods.com/
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
* Copyright (C) 1998-2014 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: http://www.gojs.net/1.3.6/doc/license.html.
*/
(function (window) {
var aa, ba = {};
if (void 0 === document.createElement("canvas").getContext)throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");
if (!Object.prototype.__defineGetter__ && !Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
Object.prototype.__defineGetter__ && !Object.defineProperty && (Object.defineProperty = function (a, b, c) {
c.get && a.__defineGetter__(b, c.get);
c.set && a.__defineSetter__(b, c.set)
});
Object.prototype.__lookupGetter__ && !Object.getOwnPropertyDescriptor && (Object.getOwnPropertyDescriptor = function (a, b) {
return{get: a.__lookupGetter__(b), set: a.__lookupSetter__(b)}
});
Object.getPrototypeOf || (Object.getPrototypeOf = function (a) {
return a.__proto__
});
Object.isFrozen || (Object.isFrozen = function (a) {
return!0 === a.fG
});
Object.freeze || (Object.freeze = function (a) {
a.fG = !0
});
Array.isArray || (Array.isArray = function (a) {
return"[object Array]" === Object.prototype.toString.call(a)
});
Function.prototype.bind || (Function.prototype.bind = function (a) {
function b() {
return g.apply(a, e.concat(d.call(arguments)))
}
function c() {
}
var d = Array.prototype.slice, e = d.call(arguments, 1), g = this;
c.prototype = this.prototype;
b.prototype = new c;
return b
});
(function () {
for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c)window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"];
window.requestAnimationFrame || (window.requestAnimationFrame = function (b) {
var c = (new Date).getTime(), g = Math.max(8, 16 - (c - a)), h = window.setTimeout(function () {
b(c + g)
}, g);
a = c + g;
return h
});
window.cancelAnimationFrame || (window.cancelAnimationFrame =
function (a) {
clearTimeout(a)
})
})();
var f = {rz: !1, cJ: !1, xE: !1, LD: !1, QG: !1, assert: !1, QI: null, TI: function () {
}, VI: function () {
}, UI: function () {
}, SI: function () {
}, $I: function () {
}, WI: function () {
}, YI: function () {
}, XI: function () {
}, RI: !1, sJ: !1, pJ: !1, qJ: !1, qH: !1, ZI: function () {
}}, f = null;
ba.Debug = null;
var t = {Hh: Object.freeze([]), Gz: {}, xD: 0, Fz: {}, wD: 0, rD: "...", Nz: {}, Oz: 0, PA: [], nw: null, qp: document.createElement("canvas").getContext("2d"), rp: "", nD: [], KA: "ontouchstart"in window, pF: "ongesturestart"in window, eD: !1, ks: null, ls: null, js: null, wv: "", KF: !1, NF: !1, MF: !1, LF: !1, fD: null, yp: !1, IF: !1, JF: !1, m: function (a) {
f && f.QG && alert(a);
throw Error(a);
}, L: function (a, b) {
if (a.cb) {
var c = "The object is frozen, so its properties cannot be set: " + a.toString();
void 0 !== b && (c += " to value: " + b);
t.m(c)
}
}, j: function (a, b, c, d) {
a instanceof b || (c = t.uh(c), void 0 !== d && (c += "." + d), t.Nb(a, b, c))
}, k: function (a, b, c, d) {
typeof a !== b && (c = t.uh(c), void 0 !== d && (c += "." + d), t.Nb(a, b, c))
}, o: function (a, b, c) {
"number" === typeof a && isFinite(a) || (b = t.uh(b), void 0 !== c && (b += "." + c), t.m(b + " must be a real number type, and not NaN or Infinity: " + a))
}, nb: function (a, b, c, d) {
a instanceof ca && a.Ke === b || (c = t.uh(c), void 0 !== d && (c += "." + d), t.Nb(a, "a constant of class " + t.Fg(b), c))
}, Nb: function (a, b, c, d) {
b = t.uh(b);
c = t.uh(c);
void 0 !== d && (c += "." + d);
t.m(c + " value is not an instance of " +
b + ": " + a)
}, ia: function (a, b, c, d) {
c = t.uh(c);
void 0 !== d && (c += "." + d);
t.m(c + " is not in the range " + b + ": " + a)
}, trace: function (a) {
window && window.console && window.console.log(a)
}, jb: function (a) {
return"object" === typeof a && null !== a
}, lc: null, Bm: function (a, b, c, d) {
for (b = 0; b < a.length; b++) {
var e = a[b];
t.jb(e) && (e = t.jf(e, c, d));
a[b] = e
}
return d || t.lc(a) ? a : window.ko.observableArray(a)
}, jf: function (a, b, c) {
if (a)for (var d in a)"__gohashid" !== d && (a[d] = t.YH(a, d, b, c));
return a
}, YH: function (a, b, c, d) {
var e = a[b], g;
g = t.lc(e) ?
e : Array.isArray(e) ? t.Bm(e, b, c, d) : window.ko.observable(e);
if (d) {
if (d = g.fB) {
h = c.__gohashid;
d[h] && (d[h].dispose(), delete d[h]);
var h = !1, k;
for (k in d) {
h = !0;
break
}
}
!h && g.Et && (g.Et.dispose(), delete g.Et)
} else {
g.Et || (g.Et = g.subscribe(function (a) {
g.Kn = a
}, null, "beforeChange"));
d = g.fB;
d || (g.fB = d = {});
var h = c.__gohashid;
d[h] || (d[h] = g.subscribe(function (d) {
c.ow(a, b, g.Kn, d)
}))
}
return g
}, isArray: function (a) {
return Array.isArray(a) || t.lc && t.lc(a) || a instanceof NodeList || a instanceof HTMLCollection
}, OH: function (a) {
return Array.isArray(a) ||
t.lc && t.lc(a)
}, is: function (a, b, c) {
t.isArray(a) || t.Nb(a, "Array or NodeList or HTMLCollection", b, c)
}, wb: function (a) {
t.lc && t.lc(a) && (a = a());
return a.length
}, mb: function (a, b) {
t.lc && t.lc(a) && (a = a());
Array.isArray(a);
return a[b]
}, IC: function (a, b, c) {
t.lc && t.lc(a) && (a = a());
Array.isArray(a) ? a[b] = c : t.m("Cannot replace an object in an HTMLCollection or NodeList at " + b)
}, pz: function (a, b) {
t.lc && t.lc(a) && (a = a());
if (Array.isArray(a))return a.indexOf(b);
for (var c = a.length, d = 0; d < c; d++)if (a[d] === b)return d;
return-1
},
oi: function (a, b, c) {
t.lc && t.lc(a) && (a = a());
Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : t.m("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b)
}, pi: function (a, b) {
t.lc && t.lc(a) && (a = a());
Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : t.m("Cannot remove an object from an HTMLCollection or NodeList at " + b)
}, ex: [], M: function () {
var a = t.ex.pop();
return void 0 === a ? new v : a
}, cc: function (a, b) {
var c = t.ex.pop();
if (void 0 === c)return new v(a, b);
c.x = a;
c.y = b;
return c
}, B: function (a) {
t.ex.push(a)
},
bB: [], jl: function () {
var a = t.bB.pop();
return void 0 === a ? new da : a
}, Rj: function (a) {
t.bB.push(a)
}, gx: [], rf: function () {
var a = t.gx.pop();
return void 0 === a ? new w : a
}, Zj: function (a, b, c, d) {
var e = t.gx.pop();
if (void 0 === e)return new w(a, b, c, d);
e.x = a;
e.y = b;
e.width = c;
e.height = d;
return e
}, Jc: function (a) {
t.gx.push(a)
}, cB: [], Ng: function () {
var a = t.cB.pop();
return void 0 === a ? new ga : a
}, Oe: function (a) {
t.cB.push(a)
}, hx: null, u: function () {
var a = t.hx;
return null !== a ? (t.hx = null, a) : new ha
}, v: function (a) {
a.reset();
t.hx = a
}, aB: [],
yb: function () {
var a = t.aB.pop();
return void 0 === a ? [] : a
}, xa: function (a) {
a.length = 0;
t.aB.push(a)
}, dB: 1, uc: function (a) {
a.__gohashid = t.dB++
}, zs: function (a) {
var b = a.__gohashid;
void 0 === b && (b = t.dB++, a.__gohashid = b);
return b
}, jc: function (a) {
return a.__gohashid
}, g: function (a, b, c) {
"name" !== b && "length" !== b && (a[b] = c)
}, ea: function (a, b) {
b.ox = a;
ba[a] = b
}, Ja: function (a, b) {
function c() {
}
c.prototype = b.prototype;
a.prototype = new c;
a.prototype.constructor = a
}, sh: function (a) {
a.kG = !0
}, defineProperty: function (a, b, c, d, e) {
t.k(a,
"function", "Util.defineProperty:classfunc");
t.k(b, "object", "Util.defineProperty:propobj");
t.k(c, "function", "Util.defineProperty:getter");
t.k(d, "function", "Util.defineProperty:setter");
for (var g in b) {
var h = b[g];
b = {get: c, set: d};
if (void 0 !== e)for (var k in e)b[k] = e[k];
Object.defineProperty(a.prototype, g, b);
e = Object.getOwnPropertyDescriptor(a.prototype, g);
h && e && Object.defineProperty(a.prototype, h, e);
if (f && h) {
var l = h.charAt(0).toUpperCase() + h.slice(1);
h == l && t.m('Defining capitalized property "' + l + '"!?');
Object.defineProperty(a.prototype, l, {get: function () {
t.m('Getting the property "' + l + '" is probably not what you intended: it is capitalized but should spelled "' + h + '"')
}, set: function () {
t.m('Setting the property "' + l + '" is probably not what you intended: it is capitalized but should spelled "' + h + '"')
}})
}
break
}
}, A: function (a, b, c, d) {
t.k(a, "function", "Util.defineReadOnlyProperty:classfunc");
t.k(b, "object", "Util.defineReadOnlyProperty:propobj");
t.k(c, "function", "Util.defineReadOnlyProperty:getter");
for (var e in b) {
var g =
b[e];
b = {get: c, set: function (a) {
t.m('The property "' + g + '" is read-only and cannot be set to ' + a)
}};
if (void 0 !== d)for (var h in d)b[h] = d[h];
Object.defineProperty(a.prototype, e, b);
d = Object.getOwnPropertyDescriptor(a.prototype, e);
g && d && Object.defineProperty(a.prototype, g, d);
if (f && g) {
var k = g.charAt(0).toUpperCase() + g.slice(1);
Object.defineProperty(a.prototype, k, {get: function () {
t.m('Getting the property "' + k + '" is probably not what you intended: it is capitalized but should spelled "' + g + '"')
}, set: function () {
t.m('Setting the read-only property "' +
k + '" is probably not what you intended: it is capitalized but should spelled "' + g + '", and cannot be set anyway')
}})
}
break
}
}, ce: function (a, b) {
for (var c in b)b[c] = !0;
a.prototype.eC = b
}, uh: function (a) {
return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? t.Fg(a) : null === a ? "*" : ""
}, Fg: function (a) {
if ("function" === typeof a) {
if (a.ox)return a.ox;
if (a.name)return a.name;
var b = a.toString(), c = b.indexOf("(");
if (b = b.substring(9, c).trim())return a.ox = b
} else if ("object" === typeof a && a.constructor)return t.Fg(a.constructor);
return typeof a
}, w: function (a, b, c) {
t.k(a, "function", "Util.defineEnumValue:classfunc");
t.k(b, "string", "Util.defineEnumValue:name");
t.k(c, "number", "Util.defineEnumValue:num");
c = new ca(a, b, c);
Object.freeze(c);
a[b] = c;
var d = a.qt;
d || (d = new ia("string", ca), a.qt = d);
d.add(b, c);
return c
}, tm: function (a, b) {
if (!b)return null;
t.k(a, "function", "Util.findEnumValueForName:classfunc");
t.k(b, "string", "Util.findEnumValueForName:name");
var c = a.qt;
return c ? c.wa(b) : null
}, YG: function (a, b, c, d) {
var e = {}, g;
for (g in a) {
for (var h =
!1, k = 1; k < arguments.length; k++)if (arguments[k] === g) {
h = !0;
break
}
h || (e[g] = a[g])
}
return e
}, ab: function (a, b) {
if (!a || !b)return null;
var c = void 0;
try {
"function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ? (c = a.getAttribute(b), null === c && (c = void 0)) : (c = a[b], t.lc && t.lc(c) && (c = c()))
} catch (d) {
f && t.trace("property get error: " + d.toString())
}
return c
}, Pa: function (a, b, c) {
if (a && b)try {
if ("function" === typeof b)b(a, c); else if ("function" === typeof a.setAttribute)a.setAttribute(b, c); else if (t.lc) {
var d = a[b];
t.lc(d) ?
d(c) : a[b] = c
} else a[b] = c
} catch (e) {
f && t.trace("property set error: " + e.toString())
}
}, vw: function (a, b) {
t.k(a, "object", "Setting properties requires Objects as arguments");
t.k(b, "object", "Setting properties requires Objects as arguments");
var c = f;
c || (f = t);
var d = a instanceof y, e = a instanceof z, g;
for (g in b) {
g || t.m("Setting properties requires non-empty property names");
var h = a, k = g;
if (d || e) {
var l = g.indexOf(".");
if (0 < l) {
var m = g.substring(0, l);
d ? h = a.ee(m) : (h = a[m]) || (h = a.zb[m]);
h ? k = g.substr(l + 1) : t.m("Unable to find object named: " +
m + " in " + a.toString() + " when trying to set property: " + g)
}
}
if ("_" !== k[0] && !t.Tv(h, k))if (e && t.Tv(a.zb, k))h = a.zb; else if (e && ja(a, k)) {
a.jz(k, b[k]);
continue
} else t.m('Trying to set undefined property "' + k + '" on object: ' + h.toString());
h[k] = b[g];
"_" === k[0] && (l = h.ul, l || (l = [], h.ul = l), l.push(k))
}
f = c;
return a
}, Tv: function (a, b) {
for (var c = Object.getPrototypeOf(a); c && c !== Function;) {
if (c.hasOwnProperty(b))return!0;
var d = c.eC;
if (d && d[b])return!0;
c = Object.getPrototypeOf(c)
}
return!1
}, NC: function (a, b) {
if (!t.jb(b) ||
b instanceof Element || b instanceof CanvasRenderingContext2D)return"";
var c = "", d;
for (d in b)if ("string" !== typeof d)"" === c && (c = b + "\n"), c += " " + d + " is not a string property\n"; else if ("_" !== d.charAt(0) && !(2 >= d.length)) {
var e = t.ab(b, d);
null === e || "function" === typeof e || t.Tv(b, d) || ("" === c && (c = b + "\n"), c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n")
}
return c
}, vv: function (a, b) {
if (b && "number" !== typeof b && "string" !== typeof b && "boolean" !== typeof b && "function" !== typeof b)if (void 0 !== t.jc(b)) {
if (!t.Ru.contains(b))if (t.Ru.add(b),
t.ru.add(t.NC(a, b)), b instanceof A || b instanceof ka || b instanceof ia)for (var c = b.l; c.next();)t.vv(a + "[" + c.key + "]", c.value); else for (c in b) {
var d = t.ab(b, c);
if (void 0 !== d && null !== d && t.jb(d) && d !== b.eC) {
if (b instanceof la) {
if (d === b.Fn)continue
} else if (b instanceof y) {
if ("data" === c || d === b.wl)continue;
if ("itemArray" === c || d === b.ej)continue;
if (b instanceof B && d === b.mj)continue
} else if (!(b instanceof z))if (b instanceof oa) {
if ("archetypeGroupData" === c || d === b.kx)continue
} else if (b instanceof pa) {
if ("archetypeLinkData" ===
c || d === b.Ct)continue;
if ("archetypeLabelNodeData" === c || d === b.Bt)continue
} else if (b instanceof qa) {
if ("archetypeNodeData" === c || d === b.Ni)continue
} else if (b instanceof C) {
if ("nodeDataArray" === c || d === b.Fe)continue;
if ("linkDataArray" === c || d === b.wg || d === b.Kl)continue;
if (d === b.pc)continue;
if (d === b.Yg)continue
} else if (b instanceof ra || b instanceof sa || b instanceof ta)continue;
t.vv(a + "." + c, d)
}
}
} else if (Array.isArray(b))for (c = 0; c < b.length; c++)t.vv(a + "[" + c + "]", b[c]); else t.ru.add(t.NC(a, b))
}, TG: function (a) {
void 0 ===
t.Ru ? t.Ru = new ka : t.Ru.clear();
t.ru = new ua;
t.vv("", a);
a = t.ru.toString();
t.ru = null;
return a
}, rI: function (a) {
for (var b = [], c = 0; 256 > c; c++)b[c] = c;
for (var d = 0, e, c = 0; 256 > c; c++)d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e;
for (var d = c = 0, g = "", h = 0; h < a.length; h++)c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, g += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]);
return g
}, FH: function (a) {
for (var b = [], c = 0; 256 > c; c++)b["0123456789abcdef".charAt(c >> 4) + "0123456789abcdef".charAt(c & 15)] = String.fromCharCode(c);
a.length % 2 && (a = "0" + a);
for (var d = [], e = 0, c = 0; c < a.length; c += 2)d[e++] = b[a.substr(c, 2)];
a = d.join("");
return"" === a ? "0" : a
}, Ka: function (a) {
return t.rI(t.FH(a))
}, ol: null, nv: "7da71ca0ad381e90", UG: "@COLOR1", VG: "@COLOR2"};
t.ol = function () {
var a = document.createElement("canvas"), b = a.getContext("2d");
b[t.Ka("7ca11abfd022028846")] = t.Ka("398c3597c01238");
for (var c = ["5da73c80a3330d854f9e5e671d6633", "32ab5ff3b26f42dc0ed90f22402913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++)b[t.Ka("7ca11abfd7330390")](t.Ka(c[d - 1]), 10, 15 * d + 0);
b[t.Ka("7ca11abfd022028846")] = t.Ka("39f046ebb36e4b");
for (d = 1; 5 > d; d++)b[t.Ka("7ca11abfd7330390")](t.Ka(c[d -
1]), 10, 15 * d + 0);
if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0])t.w = function (a, b) {
var c = new ca(a, b, 2);
Object.freeze(c);
a[b] = c;
var d = a.qt;
d || (d = new ia("string", ca), a.qt = d);
d.add(b, c);
return c
};
return a
}();
function ca(a, b, c) {
t.uc(this);
this.hB = a;
this.Mb = b;
this.pG = c
}
ca.prototype.toString = function () {
return t.Fg(this.hB) + "." + this.Mb
};
t.A(ca, {Ke: "classType"}, function () {
return this.hB
});
t.A(ca, {name: "name"}, function () {
return this.Mb
});
t.A(ca, {value: "value"}, function () {
return this.pG
});
function ua() {
this.gB = []
}
ua.prototype.toString = function () {
return this.gB.join("")
};
ua.prototype.add = function (a) {
a && this.gB.push(a)
};
function va() {
}
t.A(va, {l: "iterator"}, function () {
return this
});
va.prototype.reset = va.prototype.reset = function () {
};
va.prototype.next = va.prototype.hasNext = va.prototype.next = function () {
return!1
};
va.prototype.first = va.prototype.Ya = function () {
return null
};
t.A(va, {count: "count"}, function () {
return 0
});
va.prototype.rg = function () {
};
va.prototype.toString = function () {
return"EmptyIterator"
};
t.Pg = new va;
function ya(a) {
this.key = -1;
this.value = a
}
t.ce(ya, {key: !0, value: !0});
t.A(ya, {l: "iterator"}, function () {
return this
});
ya.prototype.reset = ya.prototype.reset = function () {
this.key = -1
};
ya.prototype.next = ya.prototype.hasNext = ya.prototype.next = function () {
return-1 === this.key ? (this.key = 0, !0) : !1
};
ya.prototype.first = ya.prototype.Ya = function () {
this.key = 0;
return this.value
};
t.A(ya, {count: "count"}, function () {
return 1
});
ya.prototype.rg = function () {
this.value = null
};
ya.prototype.toString = function () {
return"SingletonIterator(" + this.value + ")"
};
function za(a) {
this.uf = a;
this.On = null;
this.reset()
}
t.ce(za, {key: !0, value: !0});
t.A(za, {l: "iterator"}, function () {
return this
});
t.g(za, "predicate", za.prototype.dl);
t.defineProperty(za, {dl: "predicate"}, function () {
return this.On
}, function (a) {
this.On = a
});
za.prototype.reset = za.prototype.reset = function () {
var a = this.uf;
a.eh = null;
this.eb = a.Pb;
this.ne = -1
};
za.prototype.next = za.prototype.hasNext = za.prototype.next = function () {
var a = this.uf;
a.Pb !== this.eb && t.m("the List has been modified during iteration");
var a = a.p, b = a.length, c = ++this.ne, d = this.On;
if (null !== d)for (; c < b;) {
var e = a[c];
if (d(e))return this.key = this.ne = c, this.value = e, !0;
c++
} else {
if (c < b)return this.key = c, this.value = a[c], !0;
this.rg()
}
return!1
};
za.prototype.first = za.prototype.Ya = function () {
var a = this.uf;
this.eb = a.Pb;
this.ne = 0;
var a = a.p, b = a.length, c = this.On;
if (null !== c) {
for (var d = 0; d < b;) {
var e = a[d];
if (c(e))return this.key = this.ne = d, this.value = e;
d++
}
return null
}
return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null
};
t.A(za, {count: "count"}, function () {
var a = this.On;
if (null !== a) {
for (var b = 0, c = this.uf.p, d = c.length, e = 0; e < d; e++)a(c[e]) && b++;
return b
}
return this.uf.p.length
});
za.prototype.rg = function () {
this.key = -1;
this.value = null;
this.eb = -1;
this.On = null;
this.uf.eh = this
};
za.prototype.toString = function () {
return"ListIterator@" + this.ne + "/" + this.uf.count
};
function Aa(a) {
this.uf = a;
this.reset()
}
t.ce(Aa, {key: !0, value: !0});
t.A(Aa, {l: "iterator"}, function () {
return this
});
Aa.prototype.reset = Aa.prototype.reset = function () {
var a = this.uf;
a.ky = null;
this.eb = a.Pb;
this.ne = a.p.length
};
Aa.prototype.next = Aa.prototype.hasNext = Aa.prototype.next = function () {
var a = this.uf;
a.Pb !== this.eb && t.m("the List has been modified during iteration");
var b = --this.ne;
if (0 <= b)return this.key = b, this.value = a.p[b], !0;
this.rg();
return!1
};
Aa.prototype.first = Aa.prototype.Ya = function () {
var a = this.uf;
this.eb = a.Pb;
var b = a.p;
this.ne = a = b.length - 1;
return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null
};
t.A(Aa, {count: "count"}, function () {
return this.uf.p.length
});
Aa.prototype.rg = function () {
this.key = -1;
this.value = null;
this.eb = -1;
this.uf.ky = this
};
Aa.prototype.toString = function () {
return"ListIteratorBackwards(" + this.ne + "/" + this.uf.count + ")"
};
function A(a) {
t.uc(this);
this.cb = !1;
this.p = [];
this.Pb = 0;
this.ky = this.eh = null;
void 0 === a || null === a ? this.Z = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.Z = a : t.ia(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.Z = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : t.ia(a, "null, a primitive type name, or a class type",
"List constructor: type")
}
t.ea("List", A);
A.prototype.og = function (a) {
null !== this.Z && ("string" === typeof this.Z ? typeof a === this.Z && null !== a || t.Nb(a, this.Z) : a instanceof this.Z || t.Nb(a, this.Z))
};
A.prototype.Bd = function () {
var a = this.Pb;
a++;
999999999 < a && (a = 0);
this.Pb = a
};
A.prototype.freeze = A.prototype.freeze = function () {
this.cb = !0;
return this
};
A.prototype.thaw = A.prototype.Qa = function () {
this.cb = !1;
return this
};
A.prototype.toString = function () {
return"List(" + t.uh(this.Z) + ")#" + t.jc(this)
};
A.prototype.add = A.prototype.add = function (a) {
null !== a && (f && this.og(a), t.L(this, a), this.p.push(a), this.Bd())
};
A.prototype.addAll = A.prototype.He = function (a) {
if (null === a)return this;
t.L(this);
var b = this.p;
if (t.isArray(a))for (var c = t.wb(a), d = 0; d < c; d++) {
var e = t.mb(a, d);
f && this.og(e);
b.push(e)
} else for (a = a.l; a.next();)e = a.value, f && this.og(e), b.push(e);
this.Bd();
return this
};
A.prototype.clear = A.prototype.clear = function () {
t.L(this);
this.p.length = 0;
this.Bd()
};
A.prototype.contains = A.prototype.has = A.prototype.contains = function (a) {
if (null === a)return!1;
f && this.og(a);
return-1 !== this.p.indexOf(a)
};
A.prototype.indexOf = A.prototype.indexOf = function (a) {
if (null === a)return-1;
f && this.og(a);
return this.p.indexOf(a)
};
A.prototype.elt = A.prototype.get = A.prototype.ta = function (a) {
f && t.o(a, A, "elt:i");
var b = this.p;
(0 > a || a >= b.length) && t.ia(a, "0 <= i < length", A, "elt:i");
return b[a]
};
A.prototype.setElt = A.prototype.set = A.prototype.jg = function (a, b) {
f && (this.og(b), t.o(a, A, "setElt:i"));
var c = this.p;
(0 > a || a >= c.length) && t.ia(a, "0 <= i < length", A, "setElt:i");
t.L(this, a);
c[a] = b
};
A.prototype.first = A.prototype.Ya = function () {
var a = this.p;
return 0 === a.length ? null : a[0]
};
A.prototype.insertAt = A.prototype.Fd = function (a, b) {
f && (this.og(b), t.o(a, A, "insertAt:i"));
0 > a && t.ia(a, ">= 0", A, "insertAt:i");
t.L(this, a);
var c = this.p;
a >= c.length ? c.push(b) : c.splice(a, 0, b);
this.Bd();
return!0
};
A.prototype.remove = A.prototype["delete"] = A.prototype.remove = function (a) {
if (null === a)return!1;
f && this.og(a);
t.L(this, a);
var b = this.p;
a = b.indexOf(a);
if (-1 === a)return!1;
a === b.length - 1 ? b.pop() : b.splice(a, 1);
this.Bd();
return!0
};
A.prototype.removeAt = A.prototype.ud = function (a) {
f && t.o(a, A, "removeAt:i");
var b = this.p;
(0 > a || a >= b.length) && t.ia(a, "0 <= i < length", A, "removeAt:i");
t.L(this, a);
a === b.length - 1 ? b.pop() : b.splice(a, 1);
this.Bd()
};
A.prototype.removeRange = A.prototype.removeRange = function (a, b) {
f && (t.o(a, A, "removeRange:from"), t.o(b, A, "removeRange:to"));
var c = this.p;
(0 > a || a >= c.length) && t.ia(a, "0 <= from < length", A, "elt:from");
(0 > b || b >= c.length) && t.ia(b, "0 <= to < length", A, "elt:to");
t.L(this, a);
var d = c.slice((b || a) + 1 || c.length);
c.length = 0 > a ? c.length + a : a;
c.push.apply(c, d);
this.Bd()
};
A.prototype.copy = function () {
for (var a = new A(this.Z), b = this.p, c = this.count, d = 0; d < c; d++)a.add(b[d]);
return a
};
A.prototype.toArray = A.prototype.Ve = function () {
for (var a = this.p, b = this.count, c = Array(b), d = 0; d < b; d++)c[d] = a[d];
return c
};
A.prototype.toSet = function () {
for (var a = new ka(this.Z), b = this.p, c = this.count, d = 0; d < c; d++)a.add(b[d]);
return a
};
A.prototype.sort = A.prototype.sort = function (a) {
f && t.k(a, "function", A, "sort:sortfunc");
t.L(this);
this.p.sort(a);
this.Bd();
return this
};
A.prototype.sortRange = A.prototype.sp = function (a, b, c) {
var d = this.p, e = d.length;
void 0 === b && (b = 0);
void 0 === c && (c = e);
f && (t.k(a, "function", A, "sortRange:sortfunc"), t.o(b, A, "sortRange:from"), t.o(c, A, "sortRange:to"));
t.L(this);
var g = c - b;
if (1 >= g)return this;
(0 > b || b >= e - 1) && t.ia(b, "0 <= from < length", A, "sortRange:from");
if (2 === g)return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Bd()), this;
if (0 === b)if (c >= e)d.sort(a); else for (g = d.slice(0, c), g.sort(a), a = 0; a < c; a++)d[a] = g[a]; else if (c >= e)for (g = d.slice(b), g.sort(a),
a = b; a < e; a++)d[a] = g[a - b]; else for (g = d.slice(b, c), g.sort(a), a = b; a < c; a++)d[a] = g[a - b];
this.Bd();
return this
};
A.prototype.reverse = A.prototype.reverse = function () {
t.L(this);
this.p.reverse();
this.Bd();
return this
};
t.A(A, {count: "count"}, function () {
return this.p.length
});
t.A(A, {size: "size"}, function () {
return this.p.length
});
t.A(A, {length: "length"}, function () {
return this.p.length
});
t.A(A, {l: "iterator"}, function () {
if (0 >= this.p.length)return t.Pg;
var a = this.eh;
return null !== a ? (a.reset(), a) : new za(this)
});
t.A(A, {Am: "iteratorBackwards"}, function () {
if (0 >= this.p.length)return t.Pg;
var a = this.ky;
return null !== a ? (a.reset(), a) : new Aa(this)
});
function Ca(a) {
this.q = a;
this.reset()
}
t.ce(Ca, {key: !0, value: !0});
t.A(Ca, {l: "iterator"}, function () {
return this
});
Ca.prototype.reset = Ca.prototype.reset = function () {
var a = this.q;
a.eh = null;
this.eb = a.Pb;
this.Vd = null
};
Ca.prototype.next = Ca.prototype.hasNext = Ca.prototype.next = function () {
var a = this.q;
a.Pb !== this.eb && t.m("the Set has been modified during iteration");
var b = this.Vd, b = null === b ? a.me : b.nj;
if (null !== b)return this.Vd = b, this.value = b.value, this.key = b.key, !0;
this.rg();
return!1
};
Ca.prototype.first = Ca.prototype.Ya = function () {
var a = this.q;
this.eb = a.Pb;
a = a.me;
if (null !== a) {
this.Vd = a;
var b = a.value;
this.key = a.key;
return this.value = b
}
return null
};
t.A(Ca, {count: "count"}, function () {
return this.q.bd
});
Ca.prototype.rg = function () {
this.value = null;
this.eb = -1;
this.q.eh = this
};
Ca.prototype.toString = function () {
return null !== this.Vd ? "SetIterator@" + this.Vd.value : "SetIterator"
};
function ka(a) {
t.uc(this);
this.cb = !1;
void 0 === a || null === a ? this.Z = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.Z = a : t.ia(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.Z = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : t.ia(a, "null, a primitive type name, or a class type", "Set constructor: type");
this.Oc = {};
this.bd = 0;
this.eh = null;
this.Pb = 0;
this.gh = this.me = null
}
t.ea("Set", ka);
ka.prototype.og = function (a) {
null !== this.Z && ("string" === typeof this.Z ? typeof a === this.Z && null !== a || t.Nb(a, this.Z) : a instanceof this.Z || t.Nb(a, this.Z))
};
ka.prototype.Bd = function () {
var a = this.Pb;
a++;
999999999 < a && (a = 0);
this.Pb = a
};
ka.prototype.freeze = ka.prototype.freeze = function () {
this.cb = !0;
return this
};
ka.prototype.thaw = ka.prototype.Qa = function () {
this.cb = !1;
return this
};
ka.prototype.toString = function () {
return"Set(" + t.uh(this.Z) + ")#" + t.jc(this)
};
ka.prototype.add = ka.prototype.add = function (a) {
if (null === a)return!1;
f && this.og(a);
t.L(this, a);
var b = a;
t.jb(a) && (b = t.zs(a));
return void 0 === this.Oc[b] ? (this.bd++, a = new Da(a, a), this.Oc[b] = a, b = this.gh, null === b ? this.me = a : (a.Pn = b, b.nj = a), this.gh = a, this.Bd(), !0) : !1
};
ka.prototype.addAll = ka.prototype.He = function (a) {
if (null === a)return this;
t.L(this);
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.add(t.mb(a, c)); else for (a = a.l; a.next();)this.add(a.value);
return this
};
ka.prototype.contains = ka.prototype.has = ka.prototype.contains = function (a) {
if (null === a)return!1;
f && this.og(a);
var b = a;
return t.jb(a) && (b = t.jc(a), void 0 === b) ? !1 : void 0 !== this.Oc[b]
};
ka.prototype.containsAll = function (a) {
if (null === a)return!0;
for (a = a.l; a.next();)if (!this.contains(a.value))return!1;
return!0
};
ka.prototype.containsAny = function (a) {
if (null === a)return!0;
for (a = a.l; a.next();)if (this.contains(a.value))return!0;
return!1
};
ka.prototype.first = ka.prototype.Ya = function () {
var a = this.me;
return null === a ? null : a.value
};
ka.prototype.remove = ka.prototype["delete"] = ka.prototype.remove = function (a) {
if (null === a)return!1;
f && this.og(a);
t.L(this, a);
var b = a;
if (t.jb(a) && (b = t.jc(a), void 0 === b))return!1;
a = this.Oc[b];
if (void 0 === a)return!1;
var c = a.nj, d = a.Pn;
null !== c && (c.Pn = d);
null !== d && (d.nj = c);
this.me === a && (this.me = c);
this.gh === a && (this.gh = d);
delete this.Oc[b];
this.bd--;
this.Bd();
return!0
};
ka.prototype.removeAll = function (a) {
if (null === a)return this;
t.L(this);
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.remove(t.mb(a, c)); else for (a = a.l; a.next();)this.remove(a.value);
return this
};
ka.prototype.retainAll = function (a) {
if (null === a || 0 === this.count)return this;
t.L(this);
var b = new ka(this.Z);
b.He(a);
a = new A(this.Z);
for (var c = this.l; c.next();)b.contains(c.value) || a.add(c.value);
for (b = a.l; b.next();)this.remove(b.value);
return this
};
ka.prototype.clear = ka.prototype.clear = function () {
t.L(this);
this.Oc = {};
this.bd = 0;
this.gh = this.me = null;
this.Bd()
};
ka.prototype.copy = function () {
var a = new ka(this.Z), b = this.Oc, c;
for (c in b)a.add(b[c].value);
return a
};
ka.prototype.toArray = ka.prototype.Ve = function () {
var a = Array(this.bd), b = this.Oc, c = 0, d;
for (d in b)a[c] = b[d].value, c++;
return a
};
ka.prototype.toList = function () {
var a = new A(this.Z), b = this.Oc, c;
for (c in b)a.add(b[c]);
return a
};
t.A(ka, {count: "count"}, function () {
return this.bd
});
t.A(ka, {size: "size"}, function () {
return this.bd
});
t.A(ka, {l: "iterator"}, function () {
if (0 >= this.bd)return t.Pg;
var a = this.eh;
return null !== a ? (a.reset(), a) : new Ca(this)
});
function Ea(a) {
this.xc = a;
this.reset()
}
t.ce(Ea, {key: !0, value: !0});
t.A(Ea, {l: "iterator"}, function () {
return this
});
Ea.prototype.reset = Ea.prototype.reset = function () {
this.eb = this.xc.Pb;
this.Vd = null
};
Ea.prototype.next = Ea.prototype.hasNext = Ea.prototype.next = function () {
var a = this.xc;
a.Pb !== this.eb && t.m("the Map has been modified during iteration");
var b = this.Vd, b = null === b ? a.me : b.nj;
if (null !== b)return this.Vd = b, this.value = this.key = a = b.key, !0;
this.rg();
return!1
};
Ea.prototype.first = Ea.prototype.Ya = function () {
var a = this.xc;
this.eb = a.Pb;
a = a.me;
return null !== a ? (this.Vd = a, this.value = this.key = a = a.key) : null
};
t.A(Ea, {count: "count"}, function () {
return this.xc.bd
});
Ea.prototype.rg = function () {
this.value = null;
this.eb = -1
};
Ea.prototype.toString = function () {
return null !== this.Vd ? "MapKeySetIterator@" + this.Vd.value : "MapKeySetIterator"
};
function Fa(a) {
t.uc(this);
this.cb = !0;
this.xc = a
}
t.Ja(Fa, ka);
Fa.prototype.freeze = function () {
return this
};
Fa.prototype.Qa = function () {
return this
};
Fa.prototype.toString = function () {
return"MapKeySet(" + this.xc.toString() + ")"
};
Fa.prototype.add = Fa.prototype.set = Fa.prototype.add = function () {
t.m("This Set is read-only: " + this.toString());
return!1
};
Fa.prototype.contains = Fa.prototype.has = Fa.prototype.contains = function (a) {
return this.xc.contains(a)
};
Fa.prototype.remove = Fa.prototype["delete"] = Fa.prototype.remove = function () {
t.m("This Set is read-only: " + this.toString());
return!1
};
Fa.prototype.clear = Fa.prototype.clear = function () {
t.m("This Set is read-only: " + this.toString())
};
Fa.prototype.first = Fa.prototype.Ya = function () {
var a = this.xc.me;
return null !== a ? a.key : null
};
Fa.prototype.copy = function () {
return new Fa(this.xc)
};
Fa.prototype.toSet = function () {
var a = new ka(this.xc.fh), b = this.xc.Oc, c;
for (c in b)a.add(b[c].key);
return a
};
Fa.prototype.toArray = Fa.prototype.Ve = function () {
var a = this.xc.Oc, b = Array(this.xc.bd), c = 0, d;
for (d in a)b[c] = a[d].key, c++;
return b
};
Fa.prototype.toList = function () {
var a = new A(this.Z), b = this.xc.Oc, c;
for (c in b)a.add(b[c].key);
return a
};
t.A(Fa, {count: "count"}, function () {
return this.xc.bd
});
t.A(Fa, {size: "size"}, function () {
return this.xc.bd
});
t.A(Fa, {l: "iterator"}, function () {
return 0 >= this.xc.bd ? t.Pg : new Ea(this.xc)
});
function Da(a, b) {
this.key = a;
this.value = b;
this.Pn = this.nj = null
}
t.ce(Da, {key: !0, value: !0});
Da.prototype.toString = function () {
return"{" + this.key + ":" + this.value + "}"
};
function Ha(a) {
this.xc = a;
this.reset()
}
t.ce(Ha, {key: !0, value: !0});
t.A(Ha, {l: "iterator"}, function () {
return this
});
Ha.prototype.reset = Ha.prototype.reset = function () {
var a = this.xc;
a.eh = null;
this.eb = a.Pb;
this.Vd = null
};
Ha.prototype.next = Ha.prototype.hasNext = Ha.prototype.next = function () {
var a = this.xc;
a.Pb !== this.eb && t.m("the Map has been modified during iteration");
var b = this.Vd, b = null === b ? a.me : b.nj;
if (null !== b)return this.Vd = b, this.key = b.key, this.value = b.value, !0;
this.rg();
return!1
};
Ha.prototype.first = Ha.prototype.Ya = function () {
var a = this.xc;
this.eb = a.Pb;
a = a.me;
if (null !== a) {
this.Vd = a;
var b = a.key;
this.key = b;
this.value = a.value;
return b
}
return null
};
t.A(Ha, {count: "count"}, function () {
return this.xc.bd
});
Ha.prototype.rg = function () {
this.value = this.key = null;
this.eb = -1;
this.xc.eh = this
};
Ha.prototype.toString = function () {
return null !== this.Vd ? "MapIterator@" + this.Vd : "MapIterator"
};
function ia(a, b) {
t.uc(this);
this.cb = !1;
void 0 === a || null === a ? this.fh = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.fh = a : t.ia(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.fh = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : t.ia(a, "null, a primitive type name, or a class type", "Map constructor: keytype");
void 0 === b || null === b ? this.mi = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" ===
b || "function" === b ? this.mi = b : t.ia(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.mi = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : t.ia(b, "null, a primitive type name, or a class type", "Map constructor: valtype");
this.Oc = {};
this.bd = 0;
this.eh = null;
this.Pb = 0;
this.gh = this.me = null
}
t.ea("Map", ia);
function Ia(a, b) {
null !== a.fh && ("string" === typeof a.fh ? typeof b === a.fh && null !== b || t.Nb(b, a.fh) : b instanceof a.fh || t.Nb(b, a.fh))
}
ia.prototype.Bd = function () {
var a = this.Pb;
a++;
999999999 < a && (a = 0);
this.Pb = a
};
ia.prototype.freeze = ia.prototype.freeze = function () {
this.cb = !0;
return this
};
ia.prototype.thaw = ia.prototype.Qa = function () {
this.cb = !1;
return this
};
ia.prototype.toString = function () {
return"Map(" + t.uh(this.fh) + "," + t.uh(this.mi) + ")#" + t.jc(this)
};
ia.prototype.add = ia.prototype.set = ia.prototype.add = function (a, b) {
f && (Ia(this, a), null !== this.mi && ("string" === typeof this.mi ? typeof b === this.mi && null !== b || t.Nb(b, this.mi) : b instanceof this.mi || t.Nb(b, this.mi)));
t.L(this, a);
var c = a;
t.jb(a) && (c = t.zs(a));
var d = this.Oc[c];
if (void 0 === d)return this.bd++, d = new Da(a, b), this.Oc[c] = d, c = this.gh, null === c ? this.me = d : (d.Pn = c, c.nj = d), this.gh = d, this.Bd(), !0;
d.value = b;
return!1
};
ia.prototype.addAll = ia.prototype.He = function (a) {
if (null === a)return this;
f && t.j(a, ia, ia, "addAll:map");
for (a = a.l; a.next();)this.add(a.key, a.value);
return this
};
ia.prototype.contains = ia.prototype.has = ia.prototype.contains = function (a) {
f && Ia(this, a);
var b = a;
return t.jb(a) && (b = t.jc(a), void 0 === b) ? !1 : void 0 !== this.Oc[b]
};
ia.prototype.getValue = ia.prototype.get = ia.prototype.wa = function (a) {
f && Ia(this, a);
var b = a;
if (t.jb(a) && (b = t.jc(a), void 0 === b))return null;
a = this.Oc[b];
return void 0 === a ? null : a.value
};
ia.prototype.remove = ia.prototype["delete"] = ia.prototype.remove = function (a) {
if (null === a)return!1;
f && Ia(this, a);
t.L(this, a);
var b = a;
if (t.jb(a) && (b = t.jc(a), void 0 === b))return!1;
a = this.Oc[b];
if (void 0 === a)return!1;
var c = a.nj, d = a.Pn;
null !== c && (c.Pn = d);
null !== d && (d.nj = c);
this.me === a && (this.me = c);
this.gh === a && (this.gh = d);
delete this.Oc[b];
this.bd--;
this.Bd();
return!0
};
ia.prototype.clear = ia.prototype.clear = function () {
t.L(this);
this.Oc = {};
this.bd = 0;
this.gh = this.me = null;
this.Bd()
};
ia.prototype.copy = function () {
var a = new ia(this.fh, this.mi), b = this.Oc, c;
for (c in b) {
var d = b[c];
a.add(d.key, d.value)
}
return a
};
ia.prototype.toArray = ia.prototype.Ve = function () {
var a = this.Oc, b = Array(this.bd), c = 0, d;
for (d in a) {
var e = a[d];
b[c] = new Da(e.key, e.value);
c++
}
return b
};
ia.prototype.toKeySet = ia.prototype.ml = function () {
return new Fa(this)
};
t.A(ia, {count: "count"}, function () {
return this.bd
});
t.A(ia, {size: "size"}, function () {
return this.bd
});
t.A(ia, {l: "iterator"}, function () {
if (0 >= this.count)return t.Pg;
var a = this.eh;
return null !== a ? (a.reset(), a) : new Ha(this)
});
function v(a, b) {
void 0 === a || void 0 === b ? this.y = this.x = 0 : !f || "number" === typeof a && "number" === typeof b ? (this.x = a, this.y = b) : t.m("Invalid arguments to Point constructor")
}
t.ea("Point", v);
t.sh(v);
t.ce(v, {x: !0, y: !0});
v.prototype.assign = function (a) {
this.x = a.x;
this.y = a.y
};
v.prototype.q = function (a, b) {
this.x = a;
this.y = b
};
v.prototype.setTo = v.prototype.pp = function (a, b) {
f && (t.k(a, "number", v, "setTo:x"), t.k(b, "number", v, "setTo:y"));
t.L(this);
this.x = a;
this.y = b;
return this
};
v.prototype.set = v.prototype.set = function (a) {
f && t.j(a, v, v, "set:p");
t.L(this);
this.x = a.x;
this.y = a.y;
return this
};
v.prototype.copy = function () {
var a = new v;
a.x = this.x;
a.y = this.y;
return a
};
v.prototype.Ia = function () {
this.cb = !0;
Object.freeze(this);
return this
};
v.prototype.W = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
v.prototype.freeze = function () {
this.cb = !0;
return this
};
v.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
return this
};
v.parse = function (a) {
if ("string" === typeof a) {
a = a.split(" ");
for (var b = 0, c = 0; "" === a[b];)b++;
var d = a[b++];
d && (c = parseFloat(d));
for (var e = 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
return new v(c, e)
}
return new v
};
v.stringify = function (a) {
return a instanceof v ? a.x.toString() + " " + a.y.toString() : a.toString()
};
v.prototype.toString = function () {
return"Point(" + this.x + "," + this.y + ")"
};
v.prototype.equals = v.prototype.K = function (a) {
return a instanceof v ? this.x === a.x && this.y === a.y : !1
};
v.prototype.equalTo = function (a, b) {
return this.x === a && this.y === b
};
v.prototype.Pj = function (a) {
return D.Fa(this.x, a.x) && D.Fa(this.y, a.y)
};
v.prototype.xi = function (a) {
return D.I(this.x, a.x) && D.I(this.y, a.y)
};
v.prototype.add = v.prototype.add = function (a) {
f && t.j(a, v, v, "add:p");
t.L(this);
this.x += a.x;
this.y += a.y;
return this
};
v.prototype.subtract = v.prototype.it = function (a) {
f && t.j(a, v, v, "subtract:p");
t.L(this);
this.x -= a.x;
this.y -= a.y;
return this
};
v.prototype.offset = v.prototype.offset = function (a, b) {
f && (t.o(a, v, "offset:dx"), t.o(b, v, "offset:dy"));
t.L(this);
this.x += a;
this.y += b;
return this
};
v.prototype.rotate = v.prototype.rotate = function (a) {
f && t.o(a, v, "rotate:angle");
t.L(this);
if (0 === a)return this;
var b = this.x, c = this.y;
if (0 === b && 0 === c)return this;
var d;
90 === a ? (a = 0, d = 1) : 180 === a ? (a = -1, d = 0) : 270 === a ? (a = 0, d = -1) : (d = a * Math.PI / 180, a = Math.cos(d), d = Math.sin(d));
this.x = a * b - d * c;
this.y = d * b + a * c;
return this
};
v.prototype.scale = v.prototype.scale = function (a, b) {
f && (t.o(a, v, "scale:sx"), t.o(b, v, "scale:sy"));
this.x *= a;
this.y *= b;
return this
};
v.prototype.distanceSquaredPoint = v.prototype.Nj = function (a) {
f && t.j(a, v, v, "distanceSquaredPoint:p");
var b = a.x - this.x;
a = a.y - this.y;
return b * b + a * a
};
v.prototype.distanceSquared = v.prototype.os = function (a, b) {
f && (t.o(a, v, "distanceSquared:px"), t.o(b, v, "distanceSquared:py"));
var c = a - this.x, d = b - this.y;
return c * c + d * d
};
v.prototype.normalize = v.prototype.normalize = function () {
t.L(this);
var a = this.x, b = this.y, c = Math.sqrt(a * a + b * b);
0 < c && (this.x = a / c, this.y = b / c);
return this
};
v.prototype.directionPoint = v.prototype.ui = function (a) {
f && t.j(a, v, v, "directionPoint:p");
return La(a.x - this.x, a.y - this.y)
};
v.prototype.direction = v.prototype.direction = function (a, b) {
f && (t.o(a, v, "direction:px"), t.o(b, v, "direction:py"));
return La(a - this.x, b - this.y)
};
function La(a, b) {
if (0 === a)return 0 < b ? 90 : 0 > b ? 270 : 0;
if (0 === b)return 0 < a ? 0 : 180;
if (isNaN(a) || isNaN(b))return 0;
var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c);
return c
}
v.prototype.projectOntoLineSegment = function (a, b, c, d) {
f && (t.o(a, v, "projectOntoLineSegment:px"), t.o(b, v, "projectOntoLineSegment:py"), t.o(c, v, "projectOntoLineSegment:qx"), t.o(d, v, "projectOntoLineSegment:qy"));
D.Gm(a, b, c, d, this.x, this.y, this);
return this
};
v.prototype.projectOntoLineSegmentPoint = function (a, b) {
f && (t.j(a, v, v, "projectOntoLineSegmentPoint:p"), t.j(b, v, v, "projectOntoLineSegmentPoint:q"));
D.Gm(a.x, a.y, b.x, b.y, this.x, this.y, this);
return this
};
v.prototype.snapToGrid = function (a, b, c, d) {
f && (t.o(a, v, "snapToGrid:originx"), t.o(b, v, "snapToGrid:originy"), t.o(c, v, "snapToGrid:cellwidth"), t.o(d, v, "snapToGrid:cellheight"));
D.rs(this.x, this.y, a, b, c, d, this);
return this
};
v.prototype.snapToGridPoint = function (a, b) {
f && (t.j(a, v, v, "snapToGridPoint:p"), t.j(b, da, v, "snapToGridPoint:q"));
D.rs(this.x, this.y, a.x, a.y, b.width, b.height, this);
return this
};
v.prototype.setRectSpot = v.prototype.et = function (a, b) {
f && (t.j(a, w, v, "setRectSpot:r"), t.j(b, H, v, "setRectSpot:spot"));
t.L(this);
this.x = a.x + b.x * a.width + b.offsetX;
this.y = a.y + b.y * a.height + b.offsetY;
return this
};
v.prototype.setSpot = v.prototype.ft = function (a, b, c, d, e) {
f && (t.o(a, v, "setSpot:x"), t.o(b, v, "setSpot:y"), t.o(c, v, "setSpot:w"), t.o(d, v, "setSpot:h"), (0 > c || 0 > d) && t.m("Point.setSpot:Width and height cannot be negative"), t.j(e, H, v, "setSpot:spot"));
t.L(this);
this.x = a + e.x * c + e.offsetX;
this.y = b + e.y * d + e.offsetY;
return this
};
v.prototype.transform = function (a) {
f && t.j(a, ga, v, "transform:t");
a.Ra(this);
return this
};
function Oa(a, b) {
f && t.j(b, ga, v, "transformInverted:t");
b.Ai(a);
return a
}
var Pa;
v.distanceLineSegmentSquared = Pa = function (a, b, c, d, e, g) {
f && (t.o(a, v, "distanceLineSegmentSquared:px"), t.o(b, v, "distanceLineSegmentSquared:py"), t.o(c, v, "distanceLineSegmentSquared:ax"), t.o(d, v, "distanceLineSegmentSquared:ay"), t.o(e, v, "distanceLineSegmentSquared:bx"), t.o(g, v, "distanceLineSegmentSquared:by"));
var h = e - c, k = g - d, l = h * h + k * k;
c -= a;
d -= b;
var m = -c * h - d * k;
if (0 >= m || m >= l)return h = e - a, k = g - b, Math.min(c * c + d * d, h * h + k * k);
a = h * d - k * c;
return a * a / l
};
var Qa;
v.distanceSquared = Qa = function (a, b, c, d) {
f && (t.o(a, v, "distanceSquared:px"), t.o(b, v, "distanceSquared:py"), t.o(c, v, "distanceSquared:qx"), t.o(d, v, "distanceSquared:qy"));
a = c - a;
b = d - b;
return a * a + b * b
};
var Ta;
v.direction = Ta = function (a, b, c, d) {
f && (t.o(a, v, "direction:px"), t.o(b, v, "direction:py"), t.o(c, v, "direction:qx"), t.o(d, v, "direction:qy"));
a = c - a;
b = d - b;
if (0 === a)return 0 < b ? 90 : 0 > b ? 270 : 0;
if (0 === b)return 0 < a ? 0 : 180;
if (isNaN(a) || isNaN(b))return 0;
d = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d);
return d
};
v.prototype.isReal = v.prototype.P = function () {
return isFinite(this.x) && isFinite(this.y)
};
function da(a, b) {
void 0 === a || void 0 === b ? this.height = this.width = 0 : !f || "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.width = a, this.height = b) : t.m("Invalid arguments to Size constructor")
}
t.ea("Size", da);
t.sh(da);
t.ce(da, {width: !0, height: !0});
da.prototype.assign = function (a) {
this.width = a.width;
this.height = a.height
};
da.prototype.q = function (a, b) {
this.width = a;
this.height = b
};
da.prototype.setTo = da.prototype.pp = function (a, b) {
f && (t.k(a, "number", da, "setTo:w"), t.k(b, "number", da, "setTo:h"));
0 > a && t.ia(a, ">= 0", da, "setTo:w");
0 > b && t.ia(b, ">= 0", da, "setTo:h");
t.L(this);
this.width = a;
this.height = b;
return this
};
da.prototype.set = da.prototype.set = function (a) {
f && t.j(a, da, da, "set:s");
t.L(this);
this.width = a.width;
this.height = a.height;
return this
};
da.prototype.copy = function () {
var a = new da;
a.width = this.width;
a.height = this.height;
return a
};
da.prototype.Ia = function () {
this.cb = !0;
Object.freeze(this);
return this
};
da.prototype.W = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
da.prototype.freeze = function () {
this.cb = !0;
return this
};
da.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
return this
};
da.parse = function (a) {
if ("string" === typeof a) {
a = a.split(" ");
for (var b = 0, c = 0; "" === a[b];)b++;
var d = a[b++];
d && (c = parseFloat(d));
for (var e = 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
return new da(c, e)
}
return new da
};
da.stringify = function (a) {
return a instanceof da ? a.width.toString() + " " + a.height.toString() : a.toString()
};
da.prototype.toString = function () {
return"Size(" + this.width + "," + this.height + ")"
};
da.prototype.equals = da.prototype.K = function (a) {
return a instanceof da ? this.width === a.width && this.height === a.height : !1
};
da.prototype.equalTo = function (a, b) {
return this.width === a && this.height === b
};
da.prototype.Pj = function (a) {
return D.Fa(this.width, a.width) && D.Fa(this.height, a.height)
};
da.prototype.xi = function (a) {
return D.I(this.width, a.width) && D.I(this.height, a.height)
};
da.prototype.isReal = da.prototype.P = function () {
return isFinite(this.width) && isFinite(this.height)
};
function w(a, b, c, d) {
void 0 === a ? this.height = this.width = this.y = this.x = 0 : a instanceof v ? b instanceof v ? (this.x = Math.min(a.x, b.x), this.y = Math.min(a.y, b.y), this.width = Math.abs(a.x - b.x), this.height = Math.abs(a.y - b.y)) : b instanceof da ? (this.x = a.x, this.y = a.y, this.width = b.width, this.height = b.height) : t.m("Incorrect arguments supplied") : !f || "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.x = a, this.y = b, this.width = c, this.height = d) : t.m("Invalid arguments to Rect constructor")
}
t.ea("Rect", w);
t.sh(w);
t.ce(w, {x: !0, y: !0, width: !0, height: !0});
w.prototype.assign = function (a) {
this.x = a.x;
this.y = a.y;
this.width = a.width;
this.height = a.height
};
w.prototype.q = function (a, b, c, d) {
this.x = a;
this.y = b;
this.width = c;
this.height = d
};
function Ua(a, b, c) {
a.width = b;
a.height = c
}
w.prototype.setTo = w.prototype.pp = function (a, b, c, d) {
f && (t.k(a, "number", w, "setTo:x"), t.k(b, "number", w, "setTo:y"), t.k(c, "number", w, "setTo:w"), t.k(d, "number", w, "setTo:h"));
0 > c && t.ia(c, ">= 0", w, "setTo:w");
0 > d && t.ia(d, ">= 0", w, "setTo:h");
t.L(this);
this.x = a;
this.y = b;
this.width = c;
this.height = d;
return this
};
w.prototype.set = w.prototype.set = function (a) {
f && t.j(a, w, w, "set:r");
t.L(this);
this.x = a.x;
this.y = a.y;
this.width = a.width;
this.height = a.height;
return this
};
w.prototype.setPoint = w.prototype.pf = function (a) {
f && t.j(a, v, w, "setPoint:p");
t.L(this);
this.x = a.x;
this.y = a.y;
return this
};
w.prototype.setSize = function (a) {
f && t.j(a, da, w, "setSize:s");
t.L(this);
this.width = a.width;
this.height = a.height;
return this
};
w.prototype.copy = function () {
var a = new w;
a.x = this.x;
a.y = this.y;
a.width = this.width;
a.height = this.height;
return a
};
w.prototype.Ia = function () {
this.cb = !0;
Object.freeze(this);
return this
};
w.prototype.W = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
w.prototype.freeze = function () {
this.cb = !0;
return this
};
w.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
return this
};
w.parse = function (a) {
if ("string" === typeof a) {
a = a.split(" ");
for (var b = 0, c = 0; "" === a[b];)b++;
var d = a[b++];
d && (c = parseFloat(d));
for (var e = 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
for (var g = 0; "" === a[b];)b++;
(d = a[b++]) && (g = parseFloat(d));
for (var h = 0; "" === a[b];)b++;
(d = a[b++]) && (h = parseFloat(d));
return new w(c, e, g, h)
}
return new w
};
w.stringify = function (a) {
return a instanceof w ? a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() : a.toString()
};
w.prototype.toString = function () {
return"Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")"
};
w.prototype.equals = w.prototype.K = function (a) {
return a instanceof w ? this.x === a.x && this.y === a.y && this.width === a.width && this.height === a.height : !1
};
w.prototype.equalTo = function (a, b, c, d) {
return this.x === a && this.y === b && this.width === c && this.height === d
};
w.prototype.Pj = function (a) {
return D.Fa(this.x, a.x) && D.Fa(this.y, a.y) && D.Fa(this.width, a.width) && D.Fa(this.height, a.height)
};
w.prototype.xi = function (a) {
return D.I(this.x, a.x) && D.I(this.y, a.y) && D.I(this.width, a.width) && D.I(this.height, a.height)
};
w.prototype.containsPoint = w.prototype.Da = function (a) {
f && t.j(a, v, w, "containsPoint:p");
return this.x <= a.x && this.x + this.width >= a.x && this.y <= a.y && this.y + this.height >= a.y
};
w.prototype.containsRect = w.prototype.Jj = function (a) {
f && t.j(a, w, w, "containsRect:r");
return this.x <= a.x && a.x + a.width <= this.x + this.width && this.y <= a.y && a.y + a.height <= this.y + this.height
};
w.prototype.contains = w.prototype.contains = function (a, b, c, d) {
f ? (t.o(a, w, "contains:x"), t.o(b, w, "contains:y"), void 0 === c ? c = 0 : t.o(c, w, "contains:w"), void 0 === d ? d = 0 : t.o(d, w, "contains:h"), (0 > c || 0 > d) && t.m("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
return this.x <= a && a + c <= this.x + this.width && this.y <= b && b + d <= this.y + this.height
};
w.prototype.reset = function () {
t.L(this);
this.height = this.width = this.y = this.x = 0
};
w.prototype.offset = w.prototype.offset = function (a, b) {
f && (t.o(a, w, "offset:dx"), t.o(b, w, "offset:dy"));
t.L(this);
this.x += a;
this.y += b;
return this
};
w.prototype.inflate = w.prototype.Gg = function (a, b) {
f && (t.o(a, w, "inflate:w"), t.o(b, w, "inflate:h"));
return Va(this, b, a, b, a)
};
w.prototype.addMargin = w.prototype.lv = function (a) {
f && t.j(a, Wa, w, "addMargin:m");
return Va(this, a.top, a.right, a.bottom, a.left)
};
w.prototype.subtractMargin = w.prototype.FI = function (a) {
f && t.j(a, Wa, w, "subtractMargin:m");
return Va(this, -a.top, -a.right, -a.bottom, -a.left)
};
w.prototype.grow = function (a, b, c, d) {
f && (t.o(a, w, "grow:t"), t.o(b, w, "grow:r"), t.o(c, w, "grow:b"), t.o(d, w, "grow:l"));
return Va(this, a, b, c, d)
};
function Va(a, b, c, d, e) {
t.L(a);
var g = a.width;
c + e <= -g ? (a.x += g / 2, a.width = 0) : (a.x -= e, a.width += c + e);
c = a.height;
b + d <= -c ? (a.y += c / 2, a.height = 0) : (a.y -= b, a.height += b + d);
return a
}
w.prototype.intersectRect = function (a) {
f && t.j(a, w, w, "intersectRect:r");
return Xa(this, a.x, a.y, a.width, a.height)
};
w.prototype.intersect = function (a, b, c, d) {
f && (t.o(a, w, "intersect:x"), t.o(b, w, "intersect:y"), t.o(c, w, "intersect:w"), t.o(d, w, "intersect:h"), (0 > c || 0 > d) && t.m("Rect.intersect:Width and height cannot be negative"));
return Xa(this, a, b, c, d)
};
function Xa(a, b, c, d, e) {
t.L(a);
var g = Math.max(a.x, b), h = Math.max(a.y, c);
b = Math.min(a.x + a.width, b + d);
c = Math.min(a.y + a.height, c + e);
a.x = g;
a.y = h;
a.width = Math.max(0, b - g);
a.height = Math.max(0, c - h);
return a
}
w.prototype.intersectsRect = w.prototype.Cf = function (a) {
f && t.j(a, w, w, "intersectsRect:r");
return this.VD(a.x, a.y, a.width, a.height)
};
w.prototype.intersects = w.prototype.VD = function (a, b, c, d) {
f && (t.o(a, w, "intersects:x"), t.o(b, w, "intersects:y"), t.o(a, w, "intersects:w"), t.o(b, w, "intersects:h"), (0 > c || 0 > d) && t.m("Rect.intersects:Width and height cannot be negative"));
var e = this.width, g = this.x;
if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e))return!1;
a = this.height;
c = this.y;
return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0
};
function ab(a, b) {
var c = a.width, d = b.width + 10 + 10, e = a.x, g = b.x - 10;
if (e > d + g || g > c + e)return!1;
c = a.height;
d = b.height + 10 + 10;
e = a.y;
g = b.y - 10;
return e > d + g || g > c + e ? !1 : !0
}
w.prototype.unionPoint = w.prototype.Li = function (a) {
f && t.j(a, v, w, "unionPoint:p");
return db(this, a.x, a.y, 0, 0)
};
w.prototype.unionRect = w.prototype.ak = function (a) {
f && t.j(a, w, w, "unionRect:r");
return db(this, a.x, a.y, a.width, a.height)
};
w.prototype.union = w.prototype.EF = function (a, b, c, d) {
t.L(this);
f ? (t.o(a, w, "union:x"), t.o(b, w, "union:y"), void 0 === c ? c = 0 : t.o(c, w, "union:w"), void 0 === d ? d = 0 : t.o(d, w, "union:h"), (0 > c || 0 > d) && t.m("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
return db(this, a, b, c, d)
};
function db(a, b, c, d, e) {
var g = Math.min(a.x, b), h = Math.min(a.y, c);
b = Math.max(a.x + a.width, b + d);
c = Math.max(a.y + a.height, c + e);
a.x = g;
a.y = h;
a.width = b - g;
a.height = c - h;
return a
}
w.prototype.setSpot = w.prototype.ft = function (a, b, c) {
f && (t.o(a, w, "setSpot:x"), t.o(b, w, "setSpot:y"), t.j(c, H, w, "setSpot:spot"));
t.L(this);
this.x = a - c.offsetX - c.x * this.width;
this.y = b - c.offsetY - c.y * this.height;
return this
};
var eb;
w.contains = eb = function (a, b, c, d, e, g, h, k) {
f ? (t.o(a, w, "contains:rx"), t.o(b, w, "contains:ry"), t.o(c, w, "contains:rw"), t.o(d, w, "contains:rh"), t.o(e, w, "contains:x"), t.o(g, w, "contains:y"), void 0 === h ? h = 0 : t.o(h, w, "contains:w"), void 0 === k ? k = 0 : t.o(k, w, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && t.m("Rect.contains:Width and height cannot be negative")) : (void 0 === h && (h = 0), void 0 === k && (k = 0));
return a <= e && e + h <= a + c && b <= g && g + k <= b + d
};
w.intersects = function (a, b, c, d, e, g, h, k) {
f && (t.o(a, w, "intersects:rx"), t.o(b, w, "intersects:ry"), t.o(c, w, "intersects:rw"), t.o(d, w, "intersects:rh"), t.o(e, w, "intersects:x"), t.o(g, w, "intersects:y"), t.o(h, w, "intersects:w"), t.o(k, w, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && t.m("Rect.intersects:Width and height cannot be negative"));
c += a;
h += e;
if (a > h || e > c)return!1;
a = d + b;
k += g;
return b > k || g > a ? !1 : !0
};
t.g(w, "left", w.prototype.left);
t.defineProperty(w, {left: "left"}, function () {
return this.x
}, function (a) {
t.L(this, a);
f && t.k(a, "number", w, "left");
this.x = a
});
t.g(w, "top", w.prototype.top);
t.defineProperty(w, {top: "top"}, function () {
return this.y
}, function (a) {
t.L(this, a);
f && t.k(a, "number", w, "top");
this.y = a
});
t.g(w, "right", w.prototype.right);
t.defineProperty(w, {right: "right"}, function () {
return this.x + this.width
}, function (a) {
t.L(this, a);
f && t.o(a, w, "right");
this.x += a - (this.x + this.width)
});
t.g(w, "bottom", w.prototype.bottom);
t.defineProperty(w, {bottom: "bottom"}, function () {
return this.y + this.height
}, function (a) {
t.L(this, a);
f && t.o(a, w, "top");
this.y += a - (this.y + this.height)
});
t.g(w, "position", w.prototype.position);
t.defineProperty(w, {position: "position"}, function () {
return new v(this.x, this.y)
}, function (a) {
t.L(this, a);
f && t.j(a, v, w, "position");
this.x = a.x;
this.y = a.y
});
t.g(w, "size", w.prototype.size);
t.defineProperty(w, {size: "size"}, function () {
return new da(this.width, this.height)
}, function (a) {
t.L(this, a);
f && t.j(a, da, w, "size");
this.width = a.width;
this.height = a.height
});
t.g(w, "center", w.prototype.sz);
t.defineProperty(w, {sz: "center"}, function () {
return new v(this.x + this.width / 2, this.y + this.height / 2)
}, function (a) {
t.L(this, a);
f && t.j(a, v, w, "center");
this.x = a.x - this.width / 2;
this.y = a.y - this.height / 2
});
t.g(w, "centerX", w.prototype.Aa);
t.defineProperty(w, {Aa: "centerX"}, function () {
return this.x + this.width / 2
}, function (a) {
t.L(this, a);
f && t.o(a, w, "centerX");
this.x = a - this.width / 2
});
t.g(w, "centerY", w.prototype.Ma);
t.defineProperty(w, {Ma: "centerY"}, function () {
return this.y + this.height / 2
}, function (a) {
t.L(this, a);
f && t.o(a, w, "centerY");
this.y = a - this.height / 2
});
w.prototype.isReal = w.prototype.P = function () {
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height)
};
w.prototype.isEmpty = function () {
return 0 === this.width && 0 === this.height
};
function Wa(a, b, c, d) {
void 0 === a ? this.left = this.bottom = this.right = this.top = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : t.m("Invalid arguments to Margin constructor")
}
t.ea("Margin", Wa);
t.sh(Wa);
t.ce(Wa, {top: !0, right: !0, bottom: !0, left: !0});
Wa.prototype.assign = function (a) {
this.top = a.top;
this.right = a.right;
this.bottom = a.bottom;
this.left = a.left
};
Wa.prototype.setTo = Wa.prototype.pp = function (a, b, c, d) {
f && (t.k(a, "number", Wa, "setTo:t"), t.k(b, "number", Wa, "setTo:r"), t.k(c, "number", Wa, "setTo:b"), t.k(d, "number", Wa, "setTo:l"));
t.L(this);
this.top = a;
this.right = b;
this.bottom = c;
this.left = d;
return this
};
Wa.prototype.set = Wa.prototype.set = function (a) {
f && t.j(a, Wa, Wa, "assign:m");
t.L(this);
this.top = a.top;
this.right = a.right;
this.bottom = a.bottom;
this.left = a.left;
return this
};
Wa.prototype.copy = function () {
var a = new Wa;
a.top = this.top;
a.right = this.right;
a.bottom = this.bottom;
a.left = this.left;
return a
};
Wa.prototype.Ia = function () {
this.cb = !0;
Object.freeze(this);
return this
};
Wa.prototype.W = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
Wa.prototype.freeze = function () {
this.cb = !0;
return this
};
Wa.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
return this
};
Wa.parse = function (a) {
if ("string" === typeof a) {
a = a.split(" ");
for (var b = 0, c = 0; "" === a[b];)b++;
var d = a[b++];
d && (c = parseFloat(d));
for (var e = void 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
for (var g = void 0; "" === a[b];)b++;
(d = a[b++]) && (g = parseFloat(d));
for (var h = void 0; "" === a[b];)b++;
(d = a[b++]) && (h = parseFloat(d));
return new Wa(c, e, g, h)
}
return new Wa
};
Wa.stringify = function (a) {
return a instanceof Wa ? a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() : a.toString()
};
Wa.prototype.toString = function () {
return"Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")"
};
Wa.prototype.equals = Wa.prototype.K = function (a) {
return a instanceof Wa ? this.top === a.top && this.right === a.right && this.bottom === a.bottom && this.left === a.left : !1
};
Wa.prototype.equalTo = function (a, b, c, d) {
return this.top === a && this.right === b && this.bottom === c && this.left === d
};
Wa.prototype.Pj = function (a) {
return D.Fa(this.top, a.top) && D.Fa(this.right, a.right) && D.Fa(this.bottom, a.bottom) && D.Fa(this.left, a.left)
};
Wa.prototype.xi = function (a) {
return D.I(this.top, a.top) && D.I(this.right, a.right) && D.I(this.bottom, a.bottom) && D.I(this.left, a.left)
};
Wa.prototype.isReal = Wa.prototype.P = function () {
return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left)
};
function ga() {
this.m11 = 1;
this.m21 = this.m12 = 0;
this.m22 = 1;
this.dy = this.dx = 0
}
t.sh(ga);
t.ce(ga, {m11: !0, m12: !0, m21: !0, m22: !0, dx: !0, dy: !0});
ga.prototype.set = ga.prototype.set = function (a) {
f && t.j(a, ga, ga, "set:t");
this.m11 = a.m11;
this.m12 = a.m12;
this.m21 = a.m21;
this.m22 = a.m22;
this.dx = a.dx;
this.dy = a.dy;
return this
};
ga.prototype.copy = function () {
var a = new ga;
a.m11 = this.m11;
a.m12 = this.m12;
a.m21 = this.m21;
a.m22 = this.m22;
a.dx = this.dx;
a.dy = this.dy;
return a
};
ga.prototype.toString = function () {
return"Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")"
};
ga.prototype.equals = ga.prototype.K = function (a) {
return a instanceof ga ? this.m11 === a.m11 && this.m12 === a.m12 && this.m21 === a.m21 && this.m22 === a.m22 && this.dx === a.dx && this.dy === a.dy : !1
};
ga.prototype.reset = ga.prototype.reset = function () {
this.m11 = 1;
this.m21 = this.m12 = 0;
this.m22 = 1;
this.dy = this.dx = 0
};
ga.prototype.multiply = ga.prototype.multiply = function (a) {
f && t.j(a, ga, ga, "multiply:matrix");
var b = this.m12 * a.m11 + this.m22 * a.m12, c = this.m11 * a.m21 + this.m21 * a.m22, d = this.m12 * a.m21 + this.m22 * a.m22, e = this.m11 * a.dx + this.m21 * a.dy + this.dx, g = this.m12 * a.dx + this.m22 * a.dy + this.dy;
this.m11 = this.m11 * a.m11 + this.m21 * a.m12;
this.m12 = b;
this.m21 = c;
this.m22 = d;
this.dx = e;
this.dy = g;
return this
};
ga.prototype.multiplyInverted = ga.prototype.vE = function (a) {
f && t.j(a, ga, ga, "multiplyInverted:matrix");
var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21), c = a.m22 * b, d = -a.m12 * b, e = -a.m21 * b, g = a.m11 * b, h = b * (a.m21 * a.dy - a.m22 * a.dx), k = b * (a.m12 * a.dx - a.m11 * a.dy);
a = this.m12 * c + this.m22 * d;
b = this.m11 * e + this.m21 * g;
e = this.m12 * e + this.m22 * g;
g = this.m11 * h + this.m21 * k + this.dx;
h = this.m12 * h + this.m22 * k + this.dy;
this.m11 = this.m11 * c + this.m21 * d;
this.m12 = a;
this.m21 = b;
this.m22 = e;
this.dx = g;
this.dy = h;
return this
};
ga.prototype.invert = ga.prototype.Qz = function () {
var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21), b = -this.m12 * a, c = -this.m21 * a, d = this.m11 * a, e = a * (this.m21 * this.dy - this.m22 * this.dx), g = a * (this.m12 * this.dx - this.m11 * this.dy);
this.m11 = this.m22 * a;
this.m12 = b;
this.m21 = c;
this.m22 = d;
this.dx = e;
this.dy = g
};
ga.prototype.rotate = ga.prototype.rotate = function (a, b, c) {
f && (t.o(a, ga, "rotate:angle"), t.o(b, ga, "rotate:rx"), t.o(c, ga, "rotate:ry"));
this.translate(b, c);
var d;
0 === a ? (a = 1, d = 0) : 90 === a ? (a = 0, d = 1) : 180 === a ? (a = -1, d = 0) : 270 === a ? (a = 0, d = -1) : (d = a * Math.PI / 180, a = Math.cos(d), d = Math.sin(d));
var e = this.m12 * a + this.m22 * d, g = this.m11 * -d + this.m21 * a, h = this.m12 * -d + this.m22 * a;
this.m11 = this.m11 * a + this.m21 * d;
this.m12 = e;
this.m21 = g;
this.m22 = h;
this.translate(-b, -c)
};
ga.prototype.translate = ga.prototype.translate = function (a, b) {
f && (t.o(a, ga, "translate:x"), t.o(b, ga, "translate:y"));
this.dx += this.m11 * a + this.m21 * b;
this.dy += this.m12 * a + this.m22 * b
};
ga.prototype.scale = ga.prototype.scale = function (a, b) {
void 0 === b && (b = a);
f && (t.o(a, ga, "translate:sx"), t.o(b, ga, "translate:sy"));
this.m11 *= a;
this.m12 *= a;
this.m21 *= b;
this.m22 *= b
};
ga.prototype.transformPoint = ga.prototype.Ra = function (a) {
f && t.j(a, v, ga, "transformPoint:p");
var b = a.x, c = a.y;
a.x = b * this.m11 + c * this.m21 + this.dx;
a.y = b * this.m12 + c * this.m22 + this.dy;
return a
};
ga.prototype.invertedTransformPoint = ga.prototype.Ai = function (a) {
f && t.j(a, v, ga, "invertedTransformPoint:p");
var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21), c = -this.m12 * b, d = this.m11 * b, e = b * (this.m12 * this.dx - this.m11 * this.dy), g = a.x, h = a.y;
a.x = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx);
a.y = g * c + h * d + e;
return a
};
ga.prototype.transformRect = ga.prototype.zF = function (a) {
f && t.j(a, w, ga, "transformRect:rect");
var b = a.x, c = a.y, d = b + a.width, e = c + a.height, g = this.m11, h = this.m12, k = this.m21, l = this.m22, m = this.dx, n = this.dy, p = b * g + c * k + m, q = b * h + c * l + n, r = d * g + c * k + m, c = d * h + c * l + n, s = b * g + e * k + m, b = b * h + e * l + n, g = d * g + e * k + m, d = d * h + e * l + n, e = p, h = q, p = Math.min(p, r), e = Math.max(e, r), h = Math.min(h, c), q = Math.max(q, c), p = Math.min(p, s), e = Math.max(e, s), h = Math.min(h, b), q = Math.max(q, b), p = Math.min(p, g), e = Math.max(e, g), h = Math.min(h, d), q = Math.max(q, d);
a.x = p;
a.y =
h;
a.width = e - p;
a.height = q - h
};
ga.prototype.isIdentity = ga.prototype.Es = function () {
return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy
};
function H(a, b, c, d) {
void 0 === a ? this.offsetY = this.offsetX = this.y = this.x = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d)
}
t.ea("Spot", H);
t.sh(H);
t.ce(H, {x: !0, y: !0, offsetX: !0, offsetY: !0});
H.prototype.assign = function (a) {
this.x = a.x;
this.y = a.y;
this.offsetX = a.offsetX;
this.offsetY = a.offsetY
};
H.prototype.setTo = H.prototype.pp = function (a, b, c, d) {
f && (nb(a, "setTo:x"), nb(b, "setTo:y"), qb(c, "setTo:offx"), qb(d, "setTo:offy"));
t.L(this);
this.x = a;
this.y = b;
this.offsetX = c;
this.offsetY = d;
return this
};
H.prototype.set = H.prototype.set = function (a) {
f && t.j(a, H, H, "set:s");
t.L(this);
this.x = a.x;
this.y = a.y;
this.offsetX = a.offsetX;
this.offsetY = a.offsetY;
return this
};
H.prototype.copy = function () {
var a = new H;
a.x = this.x;
a.y = this.y;
a.offsetX = this.offsetX;
a.offsetY = this.offsetY;
return a
};
H.prototype.Ia = function () {
this.cb = !0;
Object.freeze(this);
return this
};
H.prototype.W = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
H.prototype.freeze = function () {
this.cb = !0;
return this
};
H.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
return this
};
function rb(a, b) {
a.x = NaN;
a.y = NaN;
a.offsetX = b;
return a
}
function nb(a, b) {
(isNaN(a) || 1 < a || 0 > a) && t.ia(a, "0 <= " + b + " <= 1", H, b)
}
function qb(a, b) {
(isNaN(a) || Infinity === a || -Infinity === a) && t.ia(a, "real number, not NaN or Infinity", H, b)
}
var sb;
H.parse = sb = function (a) {
if ("string" === typeof a) {
a = a.trim();
if ("None" === a)return t.NONE;
if ("TopLeft" === a)return t.Yw;
if ("Top" === a || "TopCenter" === a || "MiddleTop" === a)return t.Ep;
if ("TopRight" === a)return t.$w;
if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a)return t.Bp;
if ("Center" === a)return t.Mw;
if ("Right" === a || "RightCenter" === a || "MiddleRight" === a)return t.Cp;
if ("BottomLeft" === a)return t.Hw;
if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a)return t.Ap;
if ("BottomRight" === a)return t.Jw;
if ("TopSide" ===
a)return t.bx;
if ("LeftSide" === a)return t.Qw;
if ("RightSide" === a)return t.Ww;
if ("BottomSide" === a)return t.Lw;
if ("TopBottomSides" === a)return t.Xw;
if ("LeftRightSides" === a)return t.Pw;
if ("TopLeftSides" === a)return t.Zw;
if ("TopRightSides" === a)return t.ax;
if ("BottomLeftSides" === a)return t.Iw;
if ("BottomRightSides" === a)return t.Kw;
if ("NotTopSide" === a)return t.Uw;
if ("NotLeftSide" === a)return t.Sw;
if ("NotRightSide" === a)return t.Tw;
if ("NotBottomSide" === a)return t.Rw;
if ("AllSides" === a)return t.Gw;
if ("Default" ===
a)return t.Nw;
a = a.split(" ");
for (var b = 0, c = 0; "" === a[b];)b++;
var d = a[b++];
d && (c = parseFloat(d));
for (var e = 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
for (var g = 0; "" === a[b];)b++;
(d = a[b++]) && (g = parseFloat(d));
for (var h = 0; "" === a[b];)b++;
(d = a[b++]) && (h = parseFloat(d));
return new H(c, e, g, h)
}
return new H
};
H.stringify = function (a) {
return a instanceof H ? a.jd() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() : a.toString()
};
H.prototype.toString = function () {
return this.jd() ? 0 === this.offsetX && 0 === this.offsetY ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.K(t.NONE) ? "None" : this.K(t.Yw) ? "TopLeft" : this.K(t.Ep) ? "Top" : this.K(t.$w) ? "TopRight" : this.K(t.Bp) ? "Left" : this.K(t.Mw) ? "Center" : this.K(t.Cp) ? "Right" : this.K(t.Hw) ? "BottomLeft" : this.K(t.Ap) ? "Bottom" : this.K(t.Jw) ? "BottomRight" : this.K(t.bx) ? "TopSide" : this.K(t.Qw) ? "LeftSide" : this.K(t.Ww) ? "RightSide" : this.K(t.Lw) ? "BottomSide" :
this.K(t.Xw) ? "TopBottomSides" : this.K(t.Pw) ? "LeftRightSides" : this.K(t.Zw) ? "TopLeftSides" : this.K(t.ax) ? "TopRightSides" : this.K(t.Iw) ? "BottomLeftSides" : this.K(t.Kw) ? "BottomRightSides" : this.K(t.Uw) ? "NotTopSide" : this.K(t.Sw) ? "NotLeftSide" : this.K(t.Tw) ? "NotRightSide" : this.K(t.Rw) ? "NotBottomSide" : this.K(t.Gw) ? "AllSides" : this.K(t.Nw) ? "Default" : "None"
};
H.prototype.equals = H.prototype.K = function (a) {
return a instanceof H ? (this.x === a.x || isNaN(this.x) && isNaN(a.x)) && (this.y === a.y || isNaN(this.y) && isNaN(a.y)) && this.offsetX === a.offsetX && this.offsetY === a.offsetY : !1
};
H.prototype.opposite = function () {
return new H(0.5 - (this.x - 0.5), 0.5 - (this.y - 0.5), -this.offsetX, -this.offsetY)
};
H.prototype.includesSide = function (a) {
if (!this.No() || !a.No())return!1;
a = a.offsetY;
return(this.offsetY & a) === a
};
H.prototype.isSpot = H.prototype.jd = function () {
return!isNaN(this.x) && !isNaN(this.y)
};
H.prototype.isNoSpot = H.prototype.hd = function () {
return isNaN(this.x) || isNaN(this.y)
};
H.prototype.isSide = H.prototype.No = function () {
return this.hd() && 1 === this.offsetX && 0 !== this.offsetY
};
H.prototype.isDefault = H.prototype.Ac = function () {
return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY
};
t.vd = 1;
t.$c = 2;
t.nd = 4;
t.md = 8;
t.NONE = rb(new H(0, 0, 0, 0), 0).Ia();
t.Nw = rb(new H(0, 0, -1, 0), -1).Ia();
t.Yw = (new H(0, 0, 0, 0)).Ia();
t.Ep = (new H(0.5, 0, 0, 0)).Ia();
t.$w = (new H(1, 0, 0, 0)).Ia();
t.Bp = (new H(0, 0.5, 0, 0)).Ia();
t.Mw = (new H(0.5, 0.5, 0, 0)).Ia();
t.Cp = (new H(1, 0.5, 0, 0)).Ia();
t.Hw = (new H(0, 1, 0, 0)).Ia();
t.Ap = (new H(0.5, 1, 0, 0)).Ia();
t.Jw = (new H(1, 1, 0, 0)).Ia();
t.bx = rb(new H(0, 0, 1, t.vd), 1).Ia();
t.Qw = rb(new H(0, 0, 1, t.$c), 1).Ia();
t.Ww = rb(new H(0, 0, 1, t.nd), 1).Ia();
t.Lw = rb(new H(0, 0, 1, t.md), 1).Ia();
t.Xw = rb(new H(0, 0, 1, t.vd | t.md), 1).Ia();
t.Pw = rb(new H(0, 0, 1, t.$c | t.nd), 1).Ia();
t.Zw = rb(new H(0, 0, 1, t.vd | t.$c), 1).Ia();
t.ax = rb(new H(0, 0, 1, t.vd | t.nd), 1).Ia();
t.Iw = rb(new H(0, 0, 1, t.md | t.$c), 1).Ia();
t.Kw = rb(new H(0, 0, 1, t.md | t.nd), 1).Ia();
t.Uw = rb(new H(0, 0, 1, t.$c | t.nd | t.md), 1).Ia();
t.Sw = rb(new H(0, 0, 1, t.vd | t.nd | t.md), 1).Ia();
t.Tw = rb(new H(0, 0, 1, t.vd | t.$c | t.md), 1).Ia();
t.Rw = rb(new H(0, 0, 1, t.vd | t.$c | t.nd), 1).Ia();
t.Gw = rb(new H(0, 0, 1, t.vd | t.$c | t.nd | t.md), 1).Ia();
var wb;
H.None = wb = t.NONE;
var xb;
H.Default = xb = t.Nw;
var yb;
H.TopLeft = yb = t.Yw;
var Eb;
H.TopCenter = Eb = t.Ep;
var Gb;
H.TopRight = Gb = t.$w;
H.LeftCenter = t.Bp;
var Hb;
H.Center = Hb = t.Mw;
H.RightCenter = t.Cp;
var Jb;
H.BottomLeft = Jb = t.Hw;
var Kb;
H.BottomCenter = Kb = t.Ap;
var Pb;
H.BottomRight = Pb = t.Jw;
var Qb;
H.MiddleTop = Qb = t.Ep;
var Sb;
H.MiddleLeft = Sb = t.Bp;
var Tb;
H.MiddleRight = Tb = t.Cp;
var Ub;
H.MiddleBottom = Ub = t.Ap;
H.Top = t.Ep;
var Vb;
H.Left = Vb = t.Bp;
var Wb;
H.Right = Wb = t.Cp;
H.Bottom = t.Ap;
var Zb;
H.TopSide = Zb = t.bx;
var $b;
H.LeftSide = $b = t.Qw;
var ac;
H.RightSide = ac = t.Ww;
var bc;
H.BottomSide = bc = t.Lw;
H.TopBottomSides = t.Xw;
H.LeftRightSides = t.Pw;
H.TopLeftSides = t.Zw;
H.TopRightSides = t.ax;
H.BottomLeftSides = t.Iw;
H.BottomRightSides = t.Kw;
H.NotTopSide = t.Uw;
H.NotLeftSide = t.Sw;
H.NotRightSide = t.Tw;
H.NotBottomSide = t.Rw;
var cc;
H.AllSides = cc = t.Gw;
function fc() {
this.Se = [1, 0, 0, 1, 0, 0]
}
fc.prototype.copy = function () {
var a = new fc;
a.Se[0] = this.Se[0];
a.Se[1] = this.Se[1];
a.Se[2] = this.Se[2];
a.Se[3] = this.Se[3];
a.Se[4] = this.Se[4];
a.Se[5] = this.Se[5];
return a
};
function gc(a) {
this.type = a;
this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0;
this.RC = []
}
gc.prototype.addColorStop = function (a, b) {
this.RC.push({offset: a, color: b})
};
function nc(a) {
this.fillStyle = "#000000";
this.font = "15px sans-serif";
this.globalAlpha = 1;
this.lineCap = "butt";
this.dw = 0;
this.lineJoin = "miter";
this.lineWidth = 1;
this.miterLimit = 10;
this.shadowBlur = 0;
this.shadowColor = "rgba(0, 0, 0, 0)";
this.shadowOffsetY = this.shadowOffsetX = 0;
this.strokeStyle = "#000000";
this.textAlign = "start";
this.path = [];
this.ti = new fc;
this.stack = [];
this.ag = [];
this.fF = this.ED = this.xv = 0;
this.Iv = a;
this.hI = "http://www.w3.org/2000/svg";
this.jt = oc(this, "svg", {width: this.Iv.width + "px", height: this.Iv.height +
"px", wJ: "0 0 " + this.Iv.width + " " + this.Iv.height})
}
aa = nc.prototype;
aa.arc = function (a, b, c, d, e, g) {
pc(this, a, b, c, d, e, g)
};
aa.beginPath = function () {
this.path = []
};
aa.bezierCurveTo = function (a, b, c, d, e, g) {
this.path.push(["C", a, b, c, d, e, g])
};
aa.clearRect = function () {
};
aa.clip = function () {
vc(this, "clipPath", this.path, new fc)
};
aa.closePath = function () {
this.path.push(["z"])
};
aa.createLinearGradient = function (a, b, c, d) {
var e = new gc("linear");
e.x1 = a;
e.y1 = b;
e.x2 = c;
e.y2 = d;
return e
};
aa.createPattern = function () {
};
aa.createRadialGradient = function (a, b, c, d, e, g) {
var h = new gc("radial");
h.x1 = a;
h.y1 = b;
h.r1 = c;
h.x2 = d;
h.y2 = e;
h.r2 = g;
return h
};
aa.drawImage = function (a, b, c, d, e, g, h, k, l) {
debugger;
a = [b, c, d, e, g, h, k, l, a];
b = this.ti;
e = a[8];
c = {x: 0, y: 0, width: e.naturalWidth, height: e.naturalHeight, href: e.src};
d = "";
g = a[6] / a[2];
h = a[7] / a[3];
if (0 !== a[4] || 0 !== a[5])d += " translate(" + a[4] + ", " + a[5] + ")";
if (1 !== g || 1 !== h)d += " scale(" + g + ", " + h + ")";
if (0 !== a[0] || 0 !== a[1])d += " translate(" + -a[0] + ", " + -a[1] + ")";
if (0 !== a[0] || 0 !== a[1] || a[2] !== e.naturalWidth || a[3] !== e.naturalHeight)e = "CLIP" + this.xv, this.xv++, g = oc(this, "clipPath", {id: e}), g.appendChild(oc(this, "rect", {x: a[0], y: a[1],
width: a[2], height: a[3]})), this.jt.appendChild(g), c["clip-path"] = "url(#" + e + ")";
wc(this, "image", c, b, d);
this.addElement("image", c)
};
aa.fill = function () {
vc(this, "fill", this.path, this.ti)
};
aa.fillRect = function (a, b, c, d) {
xc(this, "fill", [a, b, c, d], this.ti)
};
aa.fillText = function (a, b, c) {
a = [a, b, c];
b = this.textAlign;
"left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle");
b = {x: a[1], y: a[2], style: "font: " + this.font, "text-anchor": b};
wc(this, "fill", b, this.ti);
this.addElement("text", b, a[0])
};
aa.lineTo = function (a, b) {
this.path.push(["L", a, b])
};
aa.moveTo = function (a, b) {
this.path.push(["M", a, b])
};
aa.quadraticCurveTo = function (a, b, c, d) {
this.path.push(["Q", a, b, c, d])
};
aa.rect = function (a, b, c, d) {
this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"])
};
aa.restore = function () {
this.ti = this.stack.pop();
this.path = this.stack.pop();
var a = this.stack.pop();
this.fillStyle = a.fillStyle;
this.font = a.font;
this.globalAlpha = a.globalAlpha;
this.lineCap = a.lineCap;
this.dw = a.dw;
this.lineJoin = a.lineJoin;
this.lineWidth = a.lineWidth;
this.miterLimit = a.miterLimit;
this.shadowBlur = a.shadowBlur;
this.shadowColor = a.shadowColor;
this.shadowOffsetX = a.shadowOffsetX;
this.shadowOffsetY = a.shadowOffsetY;
this.strokeStyle = a.strokeStyle;
this.textAlign = a.textAlign
};
aa.save = function () {
this.stack.push({fillStyle: this.fillStyle, font: this.font, globalAlpha: this.globalAlpha, lineCap: this.lineCap, dw: this.dw, lineJoin: this.lineJoin, lineWidth: this.lineWidth, miterLimit: this.miterLimit, shadowBlur: this.shadowBlur, shadowColor: this.shadowColor, shadowOffsetX: this.shadowOffsetX, shadowOffsetY: this.shadowOffsetY, strokeStyle: this.strokeStyle, textAlign: this.textAlign});
for (var a = [], b = 0; b < this.path.length; b++)a.push(this.path[b]);
this.stack.push(a);
this.stack.push(this.ti.copy())
};
aa.setTransform = function (a, b, c, d, e, g) {
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || zc(this, a, b, c, d, e, g)
};
aa.stroke = function () {
vc(this, "stroke", this.path, this.ti)
};
aa.strokeRect = function (a, b, c, d) {
xc(this, "stroke", [a, b, c, d], this.ti)
};
function oc(a, b, c, d) {
a = document.createElementNS(a.hI, b);
if (c)for (var e in c)a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]);
d && (a.textContent = d);
return a
}
aa.addElement = function (a, b, c) {
a = oc(this, a, b, c);
0 < this.ag.length ? this.ag[this.ag.length - 1].appendChild(a) : this.jt.appendChild(a);
return a
};
function wc(a, b, c, d, e) {
1 !== a.globalAlpha && (c.opacity = a.globalAlpha);
"fill" == b ? (/^rgba\(/.test(a.fillStyle) ? (a = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + a[1] + "," + a[2] + "," + a[3] + ")", c["fill-opacity"] = a[4]) : c.fill = a.fillStyle instanceof gc ? Ac(a, a.fillStyle) : a.fillStyle, c.stroke = "none") : "stroke" == b && (c.fill = "none", /^rgba\(/.test(a.strokeStyle) ? (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]) : c.stroke = a.strokeStyle instanceof gc ? Ac(a, a.strokeStyle) : a.strokeStyle, c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit);
d = d.Se;
d = "matrix(" + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ", " + d[4] + ", " + d[5] + ")";
void 0 !== e && (d += e);
c.transform = d
}
function Ac(a, b) {
var c = "GRAD" + a.ED;
a.ED++;
var d;
if ("linear" === b.type)d = {x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, id: c, gradientUnits: "userSpaceOnUse"}, d = oc(a, "linearGradient", d); else if ("radial" === b.type)d = {x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, r1: b.r1, r2: b.r2, id: c}, d = oc(a, "radialGradient", d); else throw Error("invalid gradient");
for (var e = b.RC, g = e.length, h = [], k = 0; k < g; k++) {
var l = e[k], m = l.color, l = {offset: l.offset, "stop-color": m};
/^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m),
l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]);
h.push(l)
}
h.sort(function (a, b) {
return a.offset > b.offset ? 1 : -1
});
for (k = 0; k < g; k++)d.appendChild(oc(a, "stop", h[k]));
a.jt.appendChild(d);
return"url(#" + c + ")"
}
function xc(a, b, c, d) {
c = {x: c[0], y: c[1], width: c[2], height: c[3]};
wc(a, b, c, d);
a.addElement("rect", c)
}
function vc(a, b, c, d) {
for (var e = [], g = 0; g < c.length; g++) {
var h = Array.prototype.slice.call(c[g]), k = [h.shift()];
if ("A" == k[0])k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift()); else for (; h.length;)k.push(h.shift() + "," + h.shift());
e.push(k.join(" "))
}
c = {d: e.join(" ")};
wc(a, b, c, d);
"clipPath" === b ? (b = "CLIP" + a.xv, a.xv++, d = oc(a, "clipPath", {id: b}), d.appendChild(oc(a, "path", c)), a.jt.appendChild(d), 0 < a.ag.length && a.ag[a.ag.length - 1].setAttributeNS(null, "clip-path", "url(#" + b +
")")) : a.addElement("path", c)
}
function pc(a, b, c, d, e, g, h) {
var k = Math.abs(e - g);
if (e != g) {
var l = b + d * Math.cos(g);
g = c + d * Math.sin(g);
k >= 2 * Math.PI ? (pc(a, b, c, d, e, e + Math.PI, h), pc(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, g])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k == !!h ? 0 : 1, 0 != a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, g]))
}
}
function zc(a, b, c, d, e, g, h) {
var k = new fc;
k.Se = [b, c, d, e, g, h];
b = {};
wc(a, "g", b, k);
k = a.addElement("g", b);
a.ag.push(k)
}
aa.Xa = function () {
var a = "SHADOW" + this.fF;
this.fF++;
var b = this.addElement("filter", {id: a, width: "250%", height: "250%"}, null), c, d, e, g, h;
if (0 != this.shadowOffsetX || 0 != this.shadowOffsetY)c = oc(this, "feGaussianBlur", {"in": "SourceAlpha", result: "blur", uJ: this.shadowBlur / 2}), d = oc(this, "feFlood", {"in": "blur", result: "flood", "flood-color": this.shadowColor}), e = oc(this, "feComposite", {"in": "flood", in2: "blur", operator: "in", result: "comp"}), g = oc(this, "feOffset", {"in": "comp", result: "offsetBlur", dx: this.shadowOffsetX, dy: this.shadowOffsetY}),
h = oc(this, "feMerge", {}), h.appendChild(oc(this, "feMergeNode", {"in": "offsetBlur"})), h.appendChild(oc(this, "feMergeNode", {"in": "SourceGraphic"})), b.appendChild(c), b.appendChild(d), b.appendChild(e), b.appendChild(g), b.appendChild(h);
0 < this.ag.length && this.ag[this.ag.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")")
};
var D = {sa: 4 * ((Math.sqrt(2) - 1) / 3), bk: (new v(0, 0)).Ia(), YF: (new w(0, 0, 0, 0)).Ia(), Fp: (new Wa(0, 0, 0, 0)).Ia(), WF: (new Wa(2, 2, 2, 2)).Ia(), XF: (new da(Infinity, Infinity)).Ia(), UF: (new v(-Infinity, -Infinity)).Ia(), TF: (new v(Infinity, Infinity)).Ia(), Qm: (new da(0, 0)).Ia(), Vw: (new da(1, 1)).Ia(), Dp: (new da(6, 6)).Ia(), Ow: (new da(8, 8)).Ia(), VF: (new v(NaN, NaN)).Ia(), ZA: null, sqrt: function (a) {
if (0 >= a)return 0;
var b = D.ZA;
if (null === b) {
for (var b = [], c = 0; 2E3 >= c; c++)b[c] = Math.sqrt(c);
D.ZA = b
}
return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c |
0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a)
}, I: function (a, b) {
var c = a - b;
return 0.5 > c && -0.5 < c
}, Fa: function (a, b) {
var c = a - b;
return 5E-8 > c && -5E-8 < c
}, td: function (a, b, c, d, e, g, h) {
0 >= e && (e = 1E-6);
var k, l, m, n;
a < c ? (l = a, k = c) : (l = c, k = a);
b < d ? (n = b, m = d) : (n = d, m = b);
if (a === c)return n <= h && h <= m && a - e <= g && g <= a + e;
if (b === d)return l <= g && g <= k && b - e <= h && h <= b + e;
k += e;
l -= e;
if (l <= g && g <= k && (m += e, n -= e, n <= h && h <= m))if (k - l > m - n)if (a - c > e || c - a > e) {
if (g = (d - b) / (c - a) * (g - a) + b, g - e <= h && h <= g + e)return!0
} else return!0; else if (b - d > e || d - b > e) {
if (h = (c -
a) / (d - b) * (h - b) + a, h - e <= g && g <= h + e)return!0
} else return!0;
return!1
}, tv: function (a, b, c, d, e, g, h, k, l, m, n, p) {
if (D.td(a, b, h, k, p, c, d) && D.td(a, b, h, k, p, e, g))return D.td(a, b, h, k, p, m, n);
var q = (a + c) / 2, r = (b + d) / 2, s = (c + e) / 2, u = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (q + s) / 2;
c = (r + u) / 2;
var s = (s + e) / 2, u = (u + g) / 2, x = (d + s) / 2, E = (c + u) / 2;
return D.tv(a, b, q, r, d, c, x, E, l, m, n, p) || D.tv(x, E, s, u, e, g, h, k, l, m, n, p)
}, SG: function (a, b, c, d, e, g, h, k, l) {
var m = (c + e) / 2, n = (d + g) / 2;
l.x = (((a + c) / 2 + m) / 2 + (m + (e + h) / 2) / 2) / 2;
l.y = (((b + d) / 2 + n) / 2 + (n + (g + k) / 2) / 2) / 2;
return l
},
RG: function (a, b, c, d, e, g, h, k) {
var l = (c + e) / 2, m = (d + g) / 2;
return Ta(((a + c) / 2 + l) / 2, ((b + d) / 2 + m) / 2, (l + (e + h) / 2) / 2, (m + (g + k) / 2) / 2)
}, oo: function (a, b, c, d, e, g, h, k, l, m) {
if (D.td(a, b, h, k, l, c, d) && D.td(a, b, h, k, l, e, g))db(m, a, b, 0, 0), db(m, h, k, 0, 0); else {
var n = (a + c) / 2, p = (b + d) / 2, q = (c + e) / 2, r = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (n + q) / 2;
c = (p + r) / 2;
var q = (q + e) / 2, r = (r + g) / 2, s = (d + q) / 2, u = (c + r) / 2;
D.oo(a, b, n, p, d, c, s, u, l, m);
D.oo(s, u, q, r, e, g, h, k, l, m)
}
return m
}, te: function (a, b, c, d, e, g, h, k, l, m) {
if (D.td(a, b, h, k, l, c, d) && D.td(a, b, h, k, l, e, g))0 ===
m.length && m.push([a, b]), m.push([h, k]); else {
var n = (a + c) / 2, p = (b + d) / 2, q = (c + e) / 2, r = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (n + q) / 2;
c = (p + r) / 2;
var q = (q + e) / 2, r = (r + g) / 2, s = (d + q) / 2, u = (c + r) / 2;
D.te(a, b, n, p, d, c, s, u, l, m);
D.te(s, u, q, r, e, g, h, k, l, m)
}
return m
}, pA: function (a, b, c, d, e, g, h, k, l, m) {
if (D.td(a, b, e, g, m, c, d))return D.td(a, b, e, g, m, k, l);
var n = (a + c) / 2, p = (b + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
var q = (n + c) / 2, r = (p + d) / 2;
return D.pA(a, b, n, p, q, r, h, k, l, m) || D.pA(q, r, c, d, e, g, h, k, l, m)
}, tJ: function (a, b, c, d, e, g, h) {
h.x = ((a + c) / 2 + (c + e) / 2) / 2;
h.y = ((b +
d) / 2 + (d + g) / 2) / 2;
return h
}, oA: function (a, b, c, d, e, g, h, k) {
if (D.td(a, b, e, g, h, c, d))db(k, a, b, 0, 0), db(k, e, g, 0, 0); else {
var l = (a + c) / 2, m = (b + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
var n = (l + c) / 2, p = (m + d) / 2;
D.oA(a, b, l, m, n, p, h, k);
D.oA(n, p, c, d, e, g, h, k)
}
return k
}, hp: function (a, b, c, d, e, g, h, k) {
if (D.td(a, b, e, g, h, c, d))0 === k.length && k.push([a, b]), k.push([e, g]); else {
var l = (a + c) / 2, m = (b + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
var n = (l + c) / 2, p = (m + d) / 2;
D.hp(a, b, l, m, n, p, h, k);
D.hp(n, p, c, d, e, g, h, k)
}
return k
}, gs: function (a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
0 >= q &&
(q = 1E-6);
if (D.td(a, b, h, k, q, c, d) && D.td(a, b, h, k, q, e, g)) {
var s = (a - h) * (m - p) - (b - k) * (l - n);
if (!s)return!1;
q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s;
s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s;
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) {
if (b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h)return!1
} else if (a < h ? l = a : (l = h, h = a), q < l || q > h)return!1;
r.x = q;
r.y = s;
return!0
}
var s = (a + c) / 2, u = (b + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
var x = (s + c) / 2, E = (u + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
var F = (x + c) / 2, G = (E + d) / 2, L = (n - l) * (n - l) + (p - m) * (p - m), N = !1;
D.gs(a, b, s, u, x, E, F, G,
l, m, n, p, q, r) && (a = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), a < L && (L = a, N = !0));
b = r.x;
s = r.y;
D.gs(F, G, c, d, e, g, h, k, l, m, n, p, q, r) && (a = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), a < L ? N = !0 : (r.x = b, r.y = s));
return N
}, hs: function (a, b, c, d, e, g, h, k, l, m, n, p, q) {
var r = 0;
0 >= q && (q = 1E-6);
if (D.td(a, b, h, k, q, c, d) && D.td(a, b, h, k, q, e, g)) {
q = (a - h) * (m - p) - (b - k) * (l - n);
if (!q)return r;
var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q, u = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q;
if (s >= n)return r;
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) {
if (b < k ? (l = b, a = k) : (l = k, a = b), u < l || u > a)return r
} else if (a <
h ? (l = a, a = h) : l = h, s < l || s > a)return r;
0 < q ? r++ : 0 > q && r--
} else {
var s = (a + c) / 2, u = (b + d) / 2, x = (c + e) / 2, E = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (s + x) / 2;
c = (u + E) / 2;
var x = (x + e) / 2, E = (E + g) / 2, F = (d + x) / 2, G = (c + E) / 2, r = r + D.hs(a, b, s, u, d, c, F, G, l, m, n, p, q), r = r + D.hs(F, G, x, E, e, g, h, k, l, m, n, p, q)
}
return r
}, Gm: function (a, b, c, d, e, g, h) {
if (D.Fa(a, c)) {
var k;
b < d ? (k = b, c = d) : (k = d, c = b);
d = g;
if (d < k)return h.x = a, h.y = k, !1;
if (d > c)return h.x = a, h.y = c, !1;
h.x = a;
h.y = d;
return!0
}
if (D.Fa(b, d)) {
a < c ? k = a : (k = c, c = a);
d = e;
if (d < k)return h.x = k, h.y = b, !1;
if (d > c)return h.x =
c, h.y = b, !1;
h.x = d;
h.y = b;
return!0
}
k = ((a - e) * (a - c) + (b - g) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b));
if (-5E-6 > k)return h.x = a, h.y = b, !1;
if (1.000005 < k)return h.x = c, h.y = d, !1;
h.x = a + k * (c - a);
h.y = b + k * (d - b);
return!0
}, Lg: function (a, b, c, d, e, g, h, k, l) {
if (D.I(a, c) && D.I(b, d))return l.x = a, l.y = b, !1;
if (D.Fa(e, h)) {
if (D.Fa(a, c))return D.Gm(a, b, c, d, e, g, l), !1;
g = (d - b) / (c - a) * (e - a) + b;
return D.Gm(a, b, c, d, e, g, l)
}
k = (k - g) / (h - e);
if (D.Fa(a, c)) {
g = k * (a - e) + g;
b < d ? (h = b, c = d) : (h = d, c = b);
if (g < h)return l.x = a, l.y = h, !1;
if (g > c)return l.x = a, l.y = c, !1;
l.x = a;
l.y = g;
return!0
}
h = (d - b) / (c - a);
if (D.Fa(k, h))return D.Gm(a, b, c, d, e, g, l), !1;
e = (h * a - k * e + g - b) / (h - k);
if (D.Fa(h, 0)) {
a < c ? h = a : (h = c, c = a);
if (e < h)return l.x = h, l.y = b, !1;
if (e > c)return l.x = c, l.y = b, !1;
l.x = e;
l.y = b;
return!0
}
g = h * (e - a) + b;
return D.Gm(a, b, c, d, e, g, l)
}, hJ: function (a, b, c, d, e) {
return D.Lg(c.x, c.y, d.x, d.y, a.x, a.y, b.x, b.y, e)
}, fJ: function (a, b, c, d, e, g, h, k, l, m) {
function n(c, d) {
var e = (c - a) * (c - a) + (d - b) * (d - b);
e < p && (p = e, l.x = c, l.y = d)
}
var p = Infinity;
n(l.x, l.y);
var q, r, s, u;
e < h ? (q = e, r = h) : (q = h, r = e);
g < k ? (s = e, u = h) : (s = h, u =
e);
q = (r - q) / 2 + m;
m = (u - s) / 2 + m;
e = (e + h) / 2;
g = (g + k) / 2;
if (0 === q || 0 === m)return l;
if (0.5 > (c > a ? c - a : a - c)) {
q = 1 - (c - e) * (c - e) / (q * q);
if (0 > q)return l;
q = Math.sqrt(q);
d = -m * q + g;
n(c, m * q + g);
n(c, d)
} else {
c = (d - b) / (c - a);
d = 1 / (q * q) + c * c / (m * m);
k = 2 * c * (b - c * a) / (m * m) - 2 * c * g / (m * m) - 2 * e / (q * q);
q = k * k - 4 * d * (2 * c * a * g / (m * m) - 2 * b * g / (m * m) + g * g / (m * m) + e * e / (q * q) - 1 + (b - c * a) * (b - c * a) / (m * m));
if (0 > q)return l;
q = Math.sqrt(q);
m = (-k + q) / (2 * d);
n(m, c * m - c * a + b);
q = (-k - q) / (2 * d);
n(q, c * q - c * a + b)
}
return l
}, Go: function (a, b, c, d, e, g, h, k, l) {
var m = 1E21, n = a, p = b;
if (D.Lg(a, b, a,
d, e, g, h, k, l)) {
var q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g);
q < m && (m = q, n = l.x, p = l.y)
}
D.Lg(c, b, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
D.Lg(a, b, c, b, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
D.Lg(a, d, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
l.x = n;
l.y = p;
return 1E21 > m
}, Vv: function (a, b, c) {
var d = b.x, e = b.y, g = c.x, h = c.y, k = a.left, l = a.right, m = a.top, n = a.bottom;
return d === g ? (e < h ? (a = e, g = h) : (a = h, g = e), k <= d && d <= l && a <= n && g >= m) :
e === h ? (d < g ? a = d : (a = g, g = d), m <= e && e <= n && a <= l && g >= k) : a.Da(b) || a.Da(c) || D.Uv(k, m, l, m, d, e, g, h) || D.Uv(l, m, l, n, d, e, g, h) || D.Uv(l, n, k, n, d, e, g, h) || D.Uv(k, n, k, m, d, e, g, h) ? !0 : !1
}, Uv: function (a, b, c, d, e, g, h, k) {
return 0 >= D.zv(a, b, c, d, e, g) * D.zv(a, b, c, d, h, k) && 0 >= D.zv(e, g, h, k, a, b) * D.zv(e, g, h, k, c, d)
}, zv: function (a, b, c, d, e, g) {
c -= a;
d -= b;
a = e - a;
b = g - b;
g = a * d - b * c;
0 === g && (g = a * c + b * d, 0 < g && (g = (a - c) * c + (b - d) * d, 0 > g && (g = 0)));
return 0 > g ? -1 : 0 < g ? 1 : 0
}, Ts: function (a) {
0 > a && (a += 360);
360 <= a && (a -= 360);
return a
}, aD: function (a, b, c, d, e, g) {
var h =
Math.PI;
g || (d *= h / 180, e *= h / 180);
g = d < e ? 1 : -1;
var k = [], l = h / 2, m = d;
for (d = Math.min(2 * h + 1E-5, Math.abs(e - d)); 1E-5 < d;)e = m + g * Math.min(d, l), k.push(D.aH(c, m, e, a, b)), d -= Math.abs(e - m), m = e;
return k
}, aH: function (a, b, c, d, e) {
var g = (c - b) / 2, h = a * Math.cos(g), k = a * Math.sin(g), l = 0.5522847498 * Math.tan(g), m = h + l * k, h = -k + l * h, k = -h, l = g + b, g = Math.cos(l), l = Math.sin(l);
return{x1: d + a * Math.cos(b), y1: e + a * Math.sin(b), x2: d + m * g - h * l, y2: e + m * l + h * g, Rd: d + m * g - k * l, Sd: e + m * l + k * g, Jb: d + a * Math.cos(c), Kb: e + a * Math.sin(c)}
}, rs: function (a, b, c, d, e, g, h) {
c =
Math.floor((a - c) / e) * e + c;
d = Math.floor((b - d) / g) * g + d;
var k = c;
c + e - a < e / 2 && (k = c + e);
a = d;
d + g - b < g / 2 && (a = d + g);
h.q(k, a);
return h
}, BD: function (a, b) {
var c = Math.max(a, b), d = Math.min(a, b), e = 1, g = 1;
do e = c % d, c = g = d, d = e; while (0 < e);
return g
}, nH: function (a, b, c, d) {
var e = 0 > c, g = 0 > d, h, k;
a < b ? (h = 1, k = 0) : (h = 0, k = 1);
var l, m;
l = 0 === h ? a : b;
m = 0 === h ? c : d;
if (0 === h ? e : g)m = -m;
h = k;
c = 0 === h ? c : d;
if (0 === h ? e : g)c = -c;
return D.oH(l, 0 === h ? a : b, m, c, 0, 0)
}, oH: function (a, b, c, d, e, g) {
if (0 < d)if (0 < c) {
g = a * a;
e = b * b;
a *= c;
var h = b * d, k = -e + h, l = -e + Math.sqrt(a * a + h * h);
b = k;
for (var m = 0; 9999999999 > m; ++m) {
b = 0.5 * (k + l);
if (b === k || b === l)break;
var n = a / (b + g), p = h / (b + e), n = n * n + p * p - 1;
if (0 < n)k = b; else if (0 > n)l = b; else break
}
c = g * c / (b + g) - c;
d = e * d / (b + e) - d;
c = Math.sqrt(c * c + d * d)
} else c = Math.abs(d - b); else d = a * a - b * b, e = a * c, e < d ? (d = e / d, e = a * d, g = b * Math.sqrt(Math.abs(1 - d * d)), c = e - c, c = Math.sqrt(c * c + g * g)) : c = Math.abs(c - a);
return c
}};
function I(a) {
1 < arguments.length && t.m("Geometry constructor can take at most one optional argument, the Geometry type.");
t.uc(this);
void 0 === a ? a = Bc : f && t.nb(a, I, I, "constructor:type");
this.Z = a;
this.pd = this.cd = this.ic = this.Yb = 0;
this.sk = new A(Cc);
this.Wt = this.sk.Pb;
this.It = (new w).freeze();
this.Va = !0;
this.hi = yb;
this.ii = Pb;
this.eu = this.fu = NaN;
this.Wd = D.Qm;
this.fc = Fc
}
t.ea("Geometry", I);
t.sh(I);
I.prototype.copy = function () {
var a = new I;
a.Z = this.Z;
a.Yb = this.Yb;
a.ic = this.ic;
a.cd = this.cd;
a.pd = this.pd;
for (var b = this.sk, c = b.length, d = a.sk, e = 0; e < c; e++) {
var g = b.p[e].copy();
d.add(g)
}
a.Wt = this.Wt;
a.It.assign(this.It);
a.Va = this.Va;
a.hi = this.hi.W();
a.ii = this.ii.W();
a.fu = this.fu;
a.eu = this.eu;
a.Wd = this.Wd.W();
a.fc = this.fc;
return a
};
var Gc;
I.Line = Gc = t.w(I, "Line", 0);
var Hc;
I.Rectangle = Hc = t.w(I, "Rectangle", 1);
var Ic;
I.Ellipse = Ic = t.w(I, "Ellipse", 2);
var Bc;
I.Path = Bc = t.w(I, "Path", 3);
I.prototype.Ia = function () {
this.freeze();
Object.freeze(this);
return this
};
I.prototype.freeze = function () {
this.cb = !0;
var a = this.ob;
a.freeze();
for (var b = a.length, c = 0; c < b; c++)a.p[c].freeze();
return this
};
I.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
var a = this.ob;
a.Qa();
for (var b = a.length, c = 0; c < b; c++)a.p[c].Qa();
return this
};
I.prototype.equalsApprox = I.prototype.Pj = function (a) {
if (!(a instanceof I))return!1;
if (this.type !== a.type)return this.type === Gc && a.type === Bc ? Jc(this, a) : a.type === Gc && this.type === Bc ? Jc(a, this) : !1;
if (this.type === Bc) {
var b = this.ob;
a = a.ob;
var c = b.length;
if (c !== a.length)return!1;
for (var d = 0; d < c; d++)if (!b.p[d].Pj(a.p[d]))return!1;
return!0
}
return D.I(this.la, a.la) && D.I(this.ma, a.ma) && D.I(this.D, a.D) && D.I(this.F, a.F)
};
function Jc(a, b) {
if (a.type !== Gc || b.type !== Bc)return!1;
if (1 === b.ob.count) {
var c = b.ob.ta(0);
if (1 === c.Ca.count && D.I(a.la, c.la) && D.I(a.ma, c.ma) && (c = c.Ca.ta(0), c.type === Kc && D.I(a.D, c.D) && D.I(a.F, c.F)))return!0
}
return!1
}
var Lc;
I.stringify = Lc = function (a) {
return a.toString()
};
I.prototype.toString = function (a) {
switch (this.type) {
case Gc:
return void 0 === a ? "M" + this.la.toString() + " " + this.ma.toString() + "L" + this.D.toString() + " " + this.F.toString() : "M" + this.la.toFixed(a) + " " + this.ma.toFixed(a) + "L" + this.D.toFixed(a) + " " + this.F.toFixed(a);
case Hc:
var b = new w(this.la, this.ma, 0, 0);
b.EF(this.D, this.F, 0, 0);
return void 0 === a ? "M" + b.x.toString() + " " + b.y.toString() + "H" + b.right.toString() + "V" + b.bottom.toString() + "H" + b.left.toString() + "z" : "M" + b.x.toFixed(a) + " " + b.y.toFixed(a) + "H" + b.right.toFixed(a) +
"V" + b.bottom.toFixed(a) + "H" + b.left.toFixed(a) + "z";
case Ic:
b = new w(this.la, this.ma, 0, 0);
b.EF(this.D, this.F, 0, 0);
if (void 0 === a) {
var c = b.left.toString() + " " + (b.y + b.height / 2).toString(), d = b.right.toString() + " " + (b.y + b.height / 2).toString();
return"M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c
}
c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
d = b.right.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
return"M" + c + "A" +
(b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c;
case Bc:
for (var b = "", c = this.ob, d = c.length, e = 0; e < d; e++) {
var g = c.p[e];
0 < e && (b += " x ");
g.Lo && (b += "F ");
b += g.toString(a)
}
return b;
default:
return this.type.toString()
}
};
var Mc;
I.fillPath = Mc = function (a) {
"string" !== typeof a && t.Nb(a, "string", I, "fillPath:str");
a = a.split(/[Xx]/);
for (var b = a.length, c = "", d = 0; d < b; d++)var e = a[d], c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e);
return c
};
var Nc;
I.parse = Nc = function (a, b) {
function c() {
return n >= x - 1 ? !0 : null !== m[n + 1].match(/[A-Za-z]/)
}
function d() {
n++;
return m[n]
}
function e() {
var a = new v(parseFloat(d()), parseFloat(d()));
p === p.toLowerCase() && (a.x = u.x + a.x, a.y = u.y + a.y);
return a
}
function g() {
return u = e()
}
function h() {
return s = e()
}
function k() {
var a = [parseFloat(d()), parseFloat(d()), parseFloat(d()), parseFloat(d()), parseFloat(d())];
c() || (a.push(parseFloat(d())), c() || a.push(parseFloat(d())));
p === p.toLowerCase() && (a[2] += u.x, a[3] += u.y);
return a
}
function l() {
return"c" !==
q.toLowerCase() && "s" !== q.toLowerCase() ? u : new v(2 * u.x - s.x, 2 * u.y - s.y)
}
void 0 === b && (b = !1);
"string" !== typeof a && t.Nb(a, "string", I, "parse:str");
a = a.replace(/,/gm, " ");
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm, "$1 $2");
a = a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");
a = a.replace(/([0-9])([+\-])/gm, "$1 $2");
a =
a.replace(/(\.[0-9]*)(\.)/gm, "$1 $2");
a = a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 ");
a = a.replace(/[\s\r\t\n]+/gm, " ");
a = a.replace(/^\s+|\s+$/g, "");
for (var m = a.split(" "), n = -1, p = "", q = "", r = new v(0, 0), s = new v(0, 0), u = new v(0, 0), x = m.length, E = t.u(), F, G = !1, L = !1, N = !0; !(n >= x - 1);)if (q = p, p = d(), "" !== p)switch (p.toUpperCase()) {
case "X":
N = !0;
L = G = !1;
break;
case "M":
F = g();
null === E.Lb || !0 === N ? (J(E, F.x, F.y, G, !1, !L), N = !1) : E.moveTo(F.x, F.y);
for (r = u; !c();)F = g(), E.lineTo(F.x, F.y);
break;
case "L":
for (; !c();)F =
g(), E.lineTo(F.x, F.y);
break;
case "H":
for (; !c();)u = F = new v((p === p.toLowerCase() ? u.x : 0) + parseFloat(d()), u.y), E.lineTo(u.x, u.y);
break;
case "V":
for (; !c();)u = F = new v(u.x, (p === p.toLowerCase() ? u.y : 0) + parseFloat(d())), E.lineTo(u.x, u.y);
break;
case "C":
for (; !c();) {
var V = e(), T = h();
F = g();
K(E, V.x, V.y, T.x, T.y, F.x, F.y)
}
break;
case "S":
for (; !c();)V = l(), T = h(), F = g(), K(E, V.x, V.y, T.x, T.y, F.x, F.y);
break;
case "Q":
for (; !c();)T = h(), F = g(), Tc(E, T.x, T.y, F.x, F.y);
break;
case "T":
for (; !c();)s = T = l(), F = g(), Tc(E, T.x, T.y, F.x, F.y);
break;
case "B":
for (; !c();)F = k(), E.arcTo(F[0], F[1], F[2], F[3], F[4], F[5], F[6]);
break;
case "A":
for (; !c();) {
var V = Math.abs(parseFloat(d())), T = Math.abs(parseFloat(d())), W = parseFloat(d()), ea = !!parseFloat(d()), R = !!parseFloat(d());
F = g();
Uc(E, V, T, W, ea, R, F.x, F.y)
}
break;
case "Z":
M(E);
u = r;
break;
case "F":
F = null;
for (V = 1; m[n + V];)if (null !== m[n + V].match(/[Uu]/))V++; else if (null === m[n + V].match(/[A-Za-z]/))V++; else {
F = m[n + V];
break
}
F.match(/[Mm]/) ? G = !0 : Vc(E);
break;
case "U":
F = null;
for (V = 1; m[n + V];)if (null !== m[n + V].match(/[Ff]/))V++;
else if (null === m[n + V].match(/[A-Za-z]/))V++; else {
F = m[n + V];
break
}
F.match(/[Mm]/) ? L = !0 : E.Xa(!1)
}
r = E.s;
t.v(E);
if (b)for (E = r.ob.l; E.next();)E.value.Lo = !0;
return r
};
function Wc(a, b) {
for (var c = a.length, d = t.M(), e = 0; e < c; e++) {
var g = a[e];
d.x = g.x1;
d.y = g.y1;
b.Ra(d);
g.x1 = d.x;
g.y1 = d.y;
d.x = g.x2;
d.y = g.y2;
b.Ra(d);
g.x2 = d.x;
g.y2 = d.y;
d.x = g.Rd;
d.y = g.Sd;
b.Ra(d);
g.Rd = d.x;
g.Sd = d.y;
d.x = g.Jb;
d.y = g.Kb;
b.Ra(d);
g.Jb = d.x;
g.Kb = d.y
}
t.B(d)
}
I.prototype.Uz = function () {
if (this.Va)return!0;
var a = this.ob;
if (this.Wt !== a.Pb)return!0;
for (var b = a.length, c = 0; c < b; c++)if (a.p[c].Uz())return!0;
return!1
};
I.prototype.RA = function () {
this.Va = !1;
var a = this.ob;
this.Wt = a.Pb;
for (var b = a.length, c = 0; c < b; c++)a.p[c].RA()
};
I.prototype.df = function () {
var a = this.It;
a.Qa();
a.q(0, 0, this.Wd.width, this.Wd.height);
Xc(this, a, !1);
db(a, 0, 0, 0, 0);
a.freeze()
};
I.prototype.computeBoundsWithoutOrigin = I.prototype.XG = function () {
var a = new w;
Xc(this, a, !0);
return a
};
function Xc(a, b, c) {
switch (a.type) {
case Gc:
case Hc:
case Ic:
c ? b.q(a.Yb, a.ic, 0, 0) : db(b, a.Yb, a.ic, 0, 0);
db(b, a.cd, a.pd, 0, 0);
break;
case Bc:
a = a.ob;
for (var d = a.length, e = 0; e < d; e++) {
var g = a.p[e];
c && 0 === e ? b.q(g.la, g.ma, 0, 0) : db(b, g.la, g.ma, 0, 0);
for (var h = g.Ca, k = h.length, l = g.la, m = g.ma, n = 0; n < k; n++) {
var p = h.p[n];
switch (p.type) {
case Kc:
case Yc:
l = p.D;
m = p.F;
db(b, l, m, 0, 0);
break;
case Zc:
D.oo(l, m, p.pb, p.Gb, p.je, p.ke, p.D, p.F, 0.5, b);
l = p.D;
m = p.F;
break;
case $c:
D.oA(l, m, p.pb, p.Gb, p.D, p.F, 0.5, b);
l = p.D;
m = p.F;
break;
case ad:
case bd:
for (var p =
p.type === ad ? cd(p, g) : id(p, g, l, m), q = p.length, r = null, s = 0; s < q; s++)r = p[s], D.oo(r.x1, r.y1, r.x2, r.y2, r.Rd, r.Sd, r.Jb, r.Kb, 0.5, b);
null !== r && (l = r.Jb, m = r.Kb);
break;
default:
t.m("Unknown Segment type: " + p.type)
}
}
}
break;
default:
t.m("Unknown Geometry type: " + a.type)
}
}
I.prototype.normalize = I.prototype.normalize = function () {
t.L(this);
var a = this.XG();
this.offset(-a.x, -a.y);
return new v(-a.x, -a.y)
};
I.prototype.offset = I.prototype.offset = function (a, b) {
t.L(this);
f && (t.o(a, I, "offset"), t.o(b, I, "offset"));
this.transform(1, 0, 0, 1, a, b)
};
I.prototype.scale = I.prototype.scale = function (a, b) {
t.L(this);
f && (t.o(a, I, "scale:x"), t.o(b, I, "scale:y"), 0 >= a && t.ia(a, "scale must be greater than zero", I, "scale:x"), 0 >= b && t.ia(b, "scale must be greater than zero", I, "scale:y"));
this.transform(a, 0, 0, b, 0, 0)
};
I.prototype.rotate = I.prototype.rotate = function (a, b, c) {
t.L(this);
void 0 === b && (b = 0);
void 0 === c && (c = 0);
f && (t.o(a, I, "rotate:angle"), t.o(b, I, "rotate:x"), t.o(c, I, "rotate:y"));
var d = t.Ng();
d.reset();
d.rotate(a, b, c);
this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
t.Oe(d)
};
I.prototype.transform = I.prototype.transform = function (a, b, c, d, e, g) {
var h, k;
switch (this.type) {
case Gc:
case Hc:
case Ic:
h = this.Yb;
k = this.ic;
this.Yb = h * a + k * c + e;
this.ic = h * b + k * d + g;
h = this.cd;
k = this.pd;
this.cd = h * a + k * c + e;
this.pd = h * b + k * d + g;
break;
case Bc:
for (var l = this.ob, m = l.length, n = 0; n < m; n++) {
var p = l.p[n];
h = p.la;
k = p.ma;
p.la = h * a + k * c + e;
p.ma = h * b + k * d + g;
for (var p = p.Ca, q = p.length, r = 0; r < q; r++) {
var s = p.p[r];
switch (s.type) {
case Kc:
case Yc:
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case Zc:
h = s.pb;
k = s.Gb;
s.pb = h * a +
k * c + e;
s.Gb = h * b + k * d + g;
h = s.je;
k = s.ke;
s.je = h * a + k * c + e;
s.ke = h * b + k * d + g;
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case $c:
h = s.pb;
k = s.Gb;
s.pb = h * a + k * c + e;
s.Gb = h * b + k * d + g;
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case ad:
h = s.Aa;
k = s.Ma;
s.Aa = h * a + k * c + e;
s.Ma = h * b + k * d + g;
s.radiusX *= Math.sqrt(a * a + c * c);
void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d));
break;
case bd:
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
s.radiusX *= Math.sqrt(a * a + c * c);
s.radiusY *= Math.sqrt(b * b + d * d);
break;
default:
t.m("Unknown Segment type: " + s.type)
}
}
}
}
this.Va = !0
};
I.prototype.Xr = function (a, b) {
var c = this.Yb, d = this.ic, e = this.cd, g = this.pd, h = Math.min(c, e), k = Math.min(d, g), c = Math.abs(e - c), d = Math.abs(g - d), g = t.M();
g.x = h;
g.y = k;
b.Ra(g);
e = new Cc(g.x, g.y);
g.x = h + c;
g.y = k;
b.Ra(g);
e.Ca.add(new O(Kc, g.x, g.y));
g.x = h + c;
g.y = k + d;
b.Ra(g);
e.Ca.add(new O(Kc, g.x, g.y));
g.x = h;
g.y = k + d;
b.Ra(g);
e.Ca.add((new O(Kc, g.x, g.y)).close());
t.B(g);
a.type = Bc;
a.ob.add(e);
return a
};
I.prototype.Da = function (a, b, c, d) {
var e = a.x, g = a.y, h = this.Hb.x - 20;
a = a.y;
for (var k = 0, l, m, n, p, q, r, s, u = this.ob.p, x = u.length, E = 0; E < x; E++) {
var F = u[E];
if (F.Lo) {
if (c && F.Da(e, g, b))return!0;
var G = F.Ca;
l = F.la;
m = F.ma;
for (var L = l, N = m, V = 0; V <= G.length; V++) {
V !== G.length ? (n = G.p[V], p = n.type, r = n.D, s = n.F) : (p = Kc, r = L, s = N);
switch (p) {
case Yc:
q = kd(e, g, h, a, l, m, L, N);
if (!0 === q)return!0;
k += q;
L = r;
N = s;
break;
case Kc:
q = kd(e, g, h, a, l, m, r, s);
if (!0 === q)return!0;
k += q;
break;
case Zc:
q = D.hs(l, m, n.pb, n.Gb, n.je, n.ke, r, s, h, a, e, g, 0.5);
k += q;
break;
case $c:
q = D.hs(l, m, (l + 2 * n.pb) / 3, (m + 2 * n.Gb) / 3, (n.pb + 2 * r) / 3, (n.pb + 2 * r) / 3, r, s, h, a, e, g, 0.5);
k += q;
break;
case ad:
case bd:
p = n.type === ad ? cd(n, F) : id(n, F, l, m);
for (var T = p.length, W = null, ea = 0; ea < T; ea++) {
W = p[ea];
if (0 === ea) {
q = kd(e, g, h, a, l, m, W.x1, W.y1);
if (!0 === q)return!0;
k += q
}
q = D.hs(W.x1, W.y1, W.x2, W.y2, W.Rd, W.Sd, W.Jb, W.Kb, h, a, e, g, 0.5);
k += q
}
null !== W && (r = W.Jb, s = W.Kb);
break;
default:
t.m("Unknown Segment type: " + n.type)
}
l = r;
m = s
}
if (0 !== k)return!0;
k = 0
} else if (F.Da(e, g, d ? b : b + 2))return!0
}
return 0 !== k
};
function kd(a, b, c, d, e, g, h, k) {
if (D.td(e, g, h, k, 0.05, a, b))return!0;
var l = (a - c) * (g - k);
if (0 === l)return 0;
var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - g * h)) / l;
b = (a * d - b * c) * (g - k) / l;
if (m >= a)return 0;
if ((e > h ? e - h : h - e) < (g > k ? g - k : k - g)) {
if (g < k ? (a = g, e = k) : (a = k, e = g), b < a || b > e)return 0
} else if (e < h ? (a = e, e = h) : a = h, m < a || m > e)return 0;
return 0 < l ? 1 : -1
}
function ld(a, b, c, d) {
for (var e = a.ob.length, g = 0; g < e; g++)if (a.ob.p[g].Da(b, c, d))return!0;
return!1
}
I.prototype.getPointAlongPath = function (a) {
(0 > a || 1 < a) && t.ia(a, "0 <= fraction <= 1", I, "getPointAlongPath:fraction");
var b = this.ob.Ya(), c = t.yb(), d = [];
d.push([b.la, b.ma]);
for (var e = b.la, g = b.ma, h = e, k = g, l = b.Ca.p, m = l.length, n = 0; n < m; n++) {
var p = l[n];
switch (p.Z) {
case Yc:
c.push(d);
d = [];
d.push([p.D, p.F]);
e = p.D;
g = p.F;
h = e;
k = g;
break;
case Kc:
d.push([p.D, p.F]);
e = p.D;
g = p.F;
break;
case Zc:
D.te(e, g, p.zg, p.Ag, p.Gk, p.Hk, p.pe, p.qe, 0.5, d);
e = p.D;
g = p.F;
break;
case $c:
D.hp(e, g, p.zg, p.Ag, p.pe, p.qe, 0.5, d);
e = p.D;
g = p.F;
break;
case ad:
for (var q =
cd(p, b), r = q.length, s = 0; s < r; s++) {
var u = q[s];
D.te(e, g, u.x2, u.y2, u.Rd, u.Sd, u.Jb, u.Kb, 0.5, d);
e = u.Jb;
g = u.Kb
}
break;
case bd:
q = id(p, b, e, g);
r = q.length;
for (s = 0; s < r; s++)u = q[s], D.te(e, g, u.x2, u.y2, u.Rd, u.Sd, u.Jb, u.Kb, 0.5, d), e = u.Jb, g = u.Kb;
break;
default:
t.m("Segment not of valid type")
}
p.dh && d.push([h, k])
}
c.push(d);
m = 0;
e = c.length;
b = null;
for (g = 0; g < e; g++)for (h = c[g], k = h.length, n = 0; n < k; n++)d = h[n], 0 !== n && (l = Math.sqrt(Qa(b[0], b[1], d[0], d[1])), m += l), b = d;
a *= m;
for (g = m = 0; g < e; g++)for (h = c[g], k = h.length, n = 0; n < k; n++) {
d = h[n];
if (0 !== n) {
l = Math.sqrt(Qa(b[0], b[1], d[0], d[1]));
if (m + l > a)return n = (a - m) / l, t.xa(c), new v(b[0] + (d[0] - b[0]) * n, b[1] + (d[1] - b[1]) * n);
m += l
}
b = d
}
t.xa(c);
return null
};
t.g(I, "type", I.prototype.type);
t.defineProperty(I, {type: "type"}, function () {
return this.Z
}, function (a) {
this.Z !== a && (f && t.nb(a, I, I, "type"), t.L(this, a), this.Z = a, this.Va = !0)
});
t.g(I, "startX", I.prototype.la);
t.defineProperty(I, {la: "startX"}, function () {
return this.Yb
}, function (a) {
this.Yb !== a && (f && t.o(a, I, "startX"), t.L(this, a), this.Yb = a, this.Va = !0)
});
t.g(I, "startY", I.prototype.ma);
t.defineProperty(I, {ma: "startY"}, function () {
return this.ic
}, function (a) {
this.ic !== a && (f && t.o(a, I, "startY"), t.L(this, a), this.ic = a, this.Va = !0)
});
t.g(I, "endX", I.prototype.D);
t.defineProperty(I, {D: "endX"}, function () {
return this.cd
}, function (a) {
this.cd !== a && (f && t.o(a, I, "endX"), t.L(this, a), this.cd = a, this.Va = !0)
});
t.g(I, "endY", I.prototype.F);
t.defineProperty(I, {F: "endY"}, function () {
return this.pd
}, function (a) {
this.pd !== a && (f && t.o(a, I, "endY"), t.L(this, a), this.pd = a, this.Va = !0)
});
t.g(I, "figures", I.prototype.ob);
t.defineProperty(I, {ob: "figures"}, function () {
return this.sk
}, function (a) {
this.sk !== a && (f && t.j(a, A, I, "figures"), t.L(this, a), this.sk = a, this.Va = !0)
});
t.defineProperty(I, {G: "spot1"}, function () {
return this.hi
}, function (a) {
f && t.j(a, H, I, "spot1");
t.L(this, a);
this.hi = a.W()
});
t.defineProperty(I, {H: "spot2"}, function () {
return this.ii
}, function (a) {
f && t.j(a, H, I, "spot2");
t.L(this, a);
this.ii = a.W()
});
t.A(I, {Hb: "bounds"}, function () {
this.Uz() && (this.RA(), this.df());
return this.It
});
t.g(I, "minSize", I.prototype.Te);
t.defineProperty(I, {Te: "minSize"}, function () {
return this.Wd
}, function (a) {
this.Wd.K(a) || (f && t.j(a, da, I, "minSize"), a = a.W(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.Wd = a)
});
function Cc(a, b, c) {
t.uc(this);
void 0 === c && (c = !0);
this.Bl = c;
this.xn = !0;
void 0 !== a ? (f && t.o(a, Cc, "sx"), this.Yb = a) : this.Yb = 0;
void 0 !== b ? (f && t.o(b, Cc, "sy"), this.ic = b) : this.ic = 0;
this.Cr = new A(O);
this.Su = this.Cr.Pb;
this.Va = !0
}
t.ea("PathFigure", Cc);
t.sh(Cc);
Cc.prototype.copy = function () {
var a = new Cc;
a.Bl = this.Bl;
a.xn = this.xn;
a.Yb = this.Yb;
a.ic = this.ic;
for (var b = this.Cr, c = b.length, d = a.Cr, e = 0; e < c; e++) {
var g = b.p[e].copy();
d.add(g)
}
a.Su = this.Su;
a.Va = this.Va;
return a
};
Cc.prototype.equalsApprox = Cc.prototype.Pj = function (a) {
if (!(a instanceof Cc && D.I(this.la, a.la) && D.I(this.ma, a.ma)))return!1;
var b = this.Ca;
a = a.Ca;
var c = b.length;
if (c !== a.length)return!1;
for (var d = 0; d < c; d++)if (!b.p[d].Pj(a.p[d]))return!1;
return!0
};
aa = Cc.prototype;
aa.toString = function (a) {
for (var b = void 0 === a ? "M" + this.la.toString() + " " + this.ma.toString() : "M" + this.la.toFixed(a) + " " + this.ma.toFixed(a), c = this.Ca, d = c.length, e = 0; e < d; e++)b += " " + c.p[e].toString(a);
return b
};
aa.freeze = function () {
this.cb = !0;
var a = this.Ca;
a.freeze();
for (var b = a.length, c = 0; c < b; c++)a.p[c].freeze();
return this
};
aa.Qa = function () {
this.cb = !1;
var a = this.Ca;
a.Qa();
for (var b = a.length, c = 0; c < b; c++)a.p[c].Qa();
return this
};
aa.Uz = function () {
if (this.Va)return!0;
var a = this.Ca;
if (this.Su !== a.Pb)return!0;
for (var b = a.length, c = 0; c < b; c++)if (a.p[c].Va)return!0;
return!1
};
aa.RA = function () {
this.Va = !1;
var a = this.Ca;
this.Su = a.Pb;
for (var b = a.length, c = 0; c < b; c++) {
var d = a.p[c];
d.Va = !1;
d.Oi = null
}
};
t.g(Cc, "isFilled", Cc.prototype.Lo);
t.defineProperty(Cc, {Lo: "isFilled"}, function () {
return this.Bl
}, function (a) {
f && t.k(a, "boolean", Cc, "isFilled");
t.L(this, a);
this.Bl = a
});
t.g(Cc, "isShadowed", Cc.prototype.Ei);
t.defineProperty(Cc, {Ei: "isShadowed"}, function () {
return this.xn
}, function (a) {
f && t.k(a, "boolean", Cc, "isShadowed");
t.L(this, a);
this.xn = a
});
t.g(Cc, "startX", Cc.prototype.la);
t.defineProperty(Cc, {la: "startX"}, function () {
return this.Yb
}, function (a) {
f && t.o(a, Cc, "startX");
t.L(this, a);
this.Yb = a;
this.Va = !0
});
t.g(Cc, "startY", Cc.prototype.ma);
t.defineProperty(Cc, {ma: "startY"}, function () {
return this.ic
}, function (a) {
f && t.o(a, Cc, "startY");
t.L(this, a);
this.ic = a;
this.Va = !0
});
t.g(Cc, "segments", Cc.prototype.Ca);
t.defineProperty(Cc, {Ca: "segments"}, function () {
return this.Cr
}, function (a) {
f && t.j(a, A, Cc, "segments");
t.L(this, a);
this.Cr = a;
this.Va = !0
});
Cc.prototype.Da = function (a, b, c) {
for (var d = this.la, e = this.ma, g = d, h = e, k = this.Ca.p, l = k.length, m = 0; m < l; m++) {
var n = k[m];
switch (n.type) {
case Yc:
g = n.D;
h = n.F;
d = n.D;
e = n.F;
break;
case Kc:
if (D.td(d, e, n.D, n.F, c, a, b))return!0;
d = n.D;
e = n.F;
break;
case Zc:
if (D.tv(d, e, n.pb, n.Gb, n.je, n.ke, n.D, n.F, 0.5, a, b, c))return!0;
d = n.D;
e = n.F;
break;
case $c:
if (D.pA(d, e, n.pb, n.Gb, n.D, n.F, 0.5, a, b, c))return!0;
d = n.D;
e = n.F;
break;
case ad:
case bd:
for (var p = n.type === ad ? cd(n, this) : id(n, this, d, e), q = p.length, r = null, s = 0; s < q; s++)if (r = p[s], 0 === s &&
D.td(d, e, r.x1, r.y1, c, a, b) || D.tv(r.x1, r.y1, r.x2, r.y2, r.Rd, r.Sd, r.Jb, r.Kb, 0.5, a, b, c))return!0;
null !== r && (d = r.Jb, e = r.Kb);
break;
default:
t.m("Unknown Segment type: " + n.type)
}
if (n.Ds && (d !== g || e !== h) && D.td(d, e, g, h, c, a, b))return!0
}
return!1
};
function O(a, b, c, d, e, g, h, k) {
t.uc(this);
void 0 === a ? a = Kc : f && t.nb(a, O, O, "constructor:type");
this.Z = a;
a === ad ? (void 0 !== b ? (f && t.o(b, O, "ex"), this.re = b) : this.re = 0, void 0 !== c ? (f && t.o(c, O, "ey"), this.se = c) : this.se = 0, void 0 !== d && (f && t.o(d, O, "x1"), this.Ym = d), void 0 !== e && (f && t.o(e, O, "y1"), this.Zm = e), void 0 !== g && (f && t.o(g, O, "x2"), this.qj = Math.max(g || 0, 0)), void 0 !== h && "number" === typeof h ? (f && t.o(h, O, "y2"), this.rj = Math.max(h || 0, 0)) : this.rj = this.qj) : a === bd ? (void 0 !== b && f && t.o(b, O, "ex"), void 0 !== c && f && t.o(c, O, "ey"),
void 0 !== d && f && t.o(d, O, "x1"), void 0 !== e && f && t.o(e, O, "y1"), this.pe = b || 0, this.qe = c || 0, this.qj = Math.max(d || 0, 0), this.rj = Math.max(e || 0, 0), this.re = h ? 1 : 0, this.se = k ? 1 : 0, a = (g || 0) % 360, 0 > a && (a += 360), this.ao = a) : (void 0 !== b ? (f && t.o(b, O, "ex"), this.pe = b) : this.pe = 0, void 0 !== c ? (f && t.o(c, O, "ey"), this.qe = c) : this.qe = 0, void 0 !== d && (f && t.o(d, O, "x1"), this.zg = d), void 0 !== e && (f && t.o(e, O, "y1"), this.Ag = e), void 0 !== g && (f && t.o(g, O, "x2"), this.Gk = g), void 0 !== h && "number" === typeof h && (f && t.o(h, O, "y2"), this.Hk = h));
this.Va = !0;
this.dh = !1;
this.Oi = null
}
t.ea("PathSegment", O);
t.sh(O);
O.prototype.copy = function () {
var a = new O;
a.Z = this.Z;
this.Z === ad ? (a.re = this.re, a.se = this.se, a.Ym = this.Ym, a.Zm = this.Zm, a.qj = this.qj, a.rj = this.rj) : this.Z === bd ? (a.re = this.re, a.se = this.se, a.pe = this.pe, a.qe = this.qe, a.qj = this.qj, a.rj = this.rj, a.ao = this.ao) : (a.pe = this.pe, a.qe = this.qe, a.zg = this.zg, a.Ag = this.Ag, a.Gk = this.Gk, a.Hk = this.Hk);
a.Va = this.Va;
a.dh = this.dh;
return a
};
O.prototype.equalsApprox = O.prototype.Pj = function (a) {
if (!(a instanceof O) || this.type !== a.type || this.Ds !== a.Ds)return!1;
switch (this.type) {
case Yc:
case Kc:
return D.I(this.D, a.D) && D.I(this.F, a.F);
case Zc:
return D.I(this.D, a.D) && D.I(this.F, a.F) && D.I(this.pb, a.pb) && D.I(this.Gb, a.Gb) && D.I(this.je, a.je) && D.I(this.ke, a.ke);
case $c:
return D.I(this.D, a.D) && D.I(this.F, a.F) && D.I(this.pb, a.pb) && D.I(this.Gb, a.Gb);
case ad:
return D.I(this.kg, a.kg) && D.I(this.Dh, a.Dh) && D.I(this.Aa, a.Aa) && D.I(this.Ma, a.Ma) && D.I(this.radiusX,
a.radiusX) && D.I(this.radiusY, a.radiusY);
case bd:
return this.Xv === a.Xv && this.Zv === a.Zv && D.I(this.Fw, a.Fw) && D.I(this.D, a.D) && D.I(this.F, a.F) && D.I(this.radiusX, a.radiusX) && D.I(this.radiusY, a.radiusY);
default:
return!1
}
};
O.prototype.toString = function (a) {
switch (this.type) {
case Yc:
a = void 0 === a ? "M" + this.D.toString() + " " + this.F.toString() : "M" + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case Kc:
a = void 0 === a ? "L" + this.D.toString() + " " + this.F.toString() : "L" + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case Zc:
a = void 0 === a ? "C" + this.pb.toString() + " " + this.Gb.toString() + " " + this.je.toString() + " " + this.ke.toString() + " " + this.D.toString() + " " + this.F.toString() : "C" + this.pb.toFixed(a) + " " + this.Gb.toFixed(a) + " " + this.je.toFixed(a) +
" " + this.ke.toFixed(a) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case $c:
a = void 0 === a ? "Q" + this.pb.toString() + " " + this.Gb.toString() + " " + this.D.toString() + " " + this.F.toString() : "Q" + this.pb.toFixed(a) + " " + this.Gb.toFixed(a) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case ad:
a = void 0 === a ? "B" + this.kg.toString() + " " + this.Dh.toString() + " " + this.Aa.toString() + " " + this.Ma.toString() + " " + this.radiusX : "B" + this.kg.toFixed(a) + " " + this.Dh.toFixed(a) + " " + this.Aa.toFixed(a) + " " + this.Ma.toFixed(a) +
" " + this.radiusX;
break;
case bd:
a = void 0 === a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.Fw.toString() + " " + (this.Zv ? 1 : 0) + " " + (this.Xv ? 1 : 0) + " " + this.D.toString() + " " + this.F.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.Fw.toFixed(a) + " " + (this.Zv ? 1 : 0) + " " + (this.Xv ? 1 : 0) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
default:
a = this.type.toString()
}
return a + (this.dh ? "z" : "")
};
var Yc;
O.Move = Yc = t.w(O, "Move", 0);
var Kc;
O.Line = Kc = t.w(O, "Line", 1);
var Zc;
O.Bezier = Zc = t.w(O, "Bezier", 2);
var $c;
O.QuadraticBezier = $c = t.w(O, "QuadraticBezier", 3);
var ad;
O.Arc = ad = t.w(O, "Arc", 4);
var bd;
O.SvgArc = bd = t.w(O, "SvgArc", 4);
O.prototype.freeze = function () {
this.cb = !0;
return this
};
O.prototype.Qa = function () {
this.cb = !1;
return this
};
O.prototype.close = O.prototype.close = function () {
this.dh = !0;
return this
};
function cd(a, b) {
if (null !== a.Oi && !1 === b.Va)return a.Oi;
var c = a.radiusX, d = a.radiusY;
void 0 === d && (d = c);
var e = a.Ym, g = a.Zm, h = D.aD(0, 0, c < d ? c : d, a.kg, a.kg + a.Dh);
if (c !== d) {
var k = t.Ng();
k.reset();
c < d ? k.scale(1, d / c) : k.scale(c / d, 1);
for (var c = h.length, d = t.M(), l = 0; l < c; l++) {
var m = h[l];
d.x = m.x1;
d.y = m.y1;
k.Ra(d);
m.x1 = d.x;
m.y1 = d.y;
d.x = m.x2;
d.y = m.y2;
k.Ra(d);
m.x2 = d.x;
m.y2 = d.y;
d.x = m.Rd;
d.y = m.Sd;
k.Ra(d);
m.Rd = d.x;
m.Sd = d.y;
d.x = m.Jb;
d.y = m.Kb;
k.Ra(d);
m.Jb = d.x;
m.Kb = d.y
}
t.B(d);
t.Oe(k)
}
k = h.length;
for (c = 0; c < k; c++)d = h[c], d.x1 +=
e, d.y1 += g, d.x2 += e, d.y2 += g, d.Rd += e, d.Sd += g, d.Jb += e, d.Kb += g;
a.Oi = h;
return a.Oi
}
function id(a, b, c, d) {
function e(a, b) {
return(a[0] * b[1] < a[1] * b[0] ? -1 : 1) * Math.acos(g(a, b))
}
function g(a, b) {
return(a[0] * b[0] + a[1] * b[1]) / (Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2)) * Math.sqrt(Math.pow(b[0], 2) + Math.pow(b[1], 2)))
}
if (null !== a.Oi && !1 === b.Va)return a.Oi;
b = a.qj;
var h = a.rj, k = Math.PI / 180 * a.ao, l = a.kg, m = a.se, n = a.pe, p = a.qe, q = Math.cos(k) * (c - n) / 2 + Math.sin(k) * (d - p) / 2, r = -Math.sin(k) * (c - n) / 2 + Math.cos(k) * (d - p) / 2, s = Math.pow(q, 2) / Math.pow(b, 2) + Math.pow(r, 2) / Math.pow(h, 2);
1 < s && (b *= Math.sqrt(s), h *= Math.sqrt(s));
s = (l === m ? -1 : 1) * Math.sqrt((Math.pow(b, 2) * Math.pow(h, 2) - Math.pow(b, 2) * Math.pow(r, 2) - Math.pow(h, 2) * Math.pow(q, 2)) / (Math.pow(b, 2) * Math.pow(r, 2) + Math.pow(h, 2) * Math.pow(q, 2)));
isNaN(s) && (s = 0);
l = s * b * r / h;
s = s * -h * q / b;
isNaN(l) && (l = 0);
isNaN(s) && (s = 0);
c = (c + n) / 2 + Math.cos(k) * l - Math.sin(k) * s;
d = (d + p) / 2 + Math.sin(k) * l + Math.cos(k) * s;
k = e([1, 0], [(q - l) / b, (r - s) / h]);
p = [(q - l) / b, (r - s) / h];
r = [(-q - l) / b, (-r - s) / h];
q = e(p, r);
-1 >= g(p, r) && (q = Math.PI);
1 <= g(p, r) && (q = 0);
0 === m && 0 < q && (q -= 2 * Math.PI);
1 === m && 0 > q && (q += 2 * Math.PI);
m = b > h ? 1 : b / h;
r = b > h ? h / b : 1;
b = D.aD(0, 0, b > h ? b : h, k, k + q, !0);
h = t.Ng();
h.reset();
h.translate(c, d);
h.rotate(a.ao, 0, 0);
h.scale(m, r);
Wc(b, h);
t.Oe(h);
a.Oi = b;
return a.Oi
}
t.g(O, "isClosed", O.prototype.Ds);
t.defineProperty(O, {Ds: "isClosed"}, function () {
return this.dh
}, function (a) {
this.dh !== a && (this.dh = a, this.Va = !0)
});
t.g(O, "type", O.prototype.type);
t.defineProperty(O, {type: "type"}, function () {
return this.Z
}, function (a) {
f && t.nb(a, O, O, "type");
t.L(this, a);
this.Z = a;
this.Va = !0
});
t.g(O, "endX", O.prototype.D);
t.defineProperty(O, {D: "endX"}, function () {
return this.pe
}, function (a) {
f && t.o(a, O, "endX");
t.L(this, a);
this.pe = a;
this.Va = !0
});
t.g(O, "endY", O.prototype.F);
t.defineProperty(O, {F: "endY"}, function () {
return this.qe
}, function (a) {
f && t.o(a, O, "endY");
t.L(this, a);
this.qe = a;
this.Va = !0
});
t.defineProperty(O, {pb: "point1X"}, function () {
return this.zg
}, function (a) {
f && t.o(a, O, "point1X");
t.L(this, a);
this.zg = a;
this.Va = !0
});
t.defineProperty(O, {Gb: "point1Y"}, function () {
return this.Ag
}, function (a) {
f && t.o(a, O, "point1Y");
t.L(this, a);
this.Ag = a;
this.Va = !0
});
t.defineProperty(O, {je: "point2X"}, function () {
return this.Gk
}, function (a) {
f && t.o(a, O, "point2X");
t.L(this, a);
this.Gk = a;
this.Va = !0
});
t.defineProperty(O, {ke: "point2Y"}, function () {
return this.Hk
}, function (a) {
f && t.o(a, O, "point2Y");
t.L(this, a);
this.Hk = a;
this.Va = !0
});
t.defineProperty(O, {Aa: "centerX"}, function () {
return this.Ym
}, function (a) {
f && t.o(a, O, "centerX");
t.L(this, a);
this.Ym = a;
this.Va = !0
});
t.defineProperty(O, {Ma: "centerY"}, function () {
return this.Zm
}, function (a) {
f && t.o(a, O, "centerY");
t.L(this, a);
this.Zm = a;
this.Va = !0
});
t.defineProperty(O, {radiusX: "radiusX"}, function () {
return this.qj
}, function (a) {
f && t.o(a, O, "radiusX");
0 > a && t.ia(a, ">= zero", O, "radiusX");
t.L(this, a);
this.qj = a;
this.Va = !0
});
t.defineProperty(O, {radiusY: "radiusY"}, function () {
return this.rj
}, function (a) {
f && t.o(a, O, "radiusY");
0 > a && t.ia(a, ">= zero", O, "radiusY");
t.L(this, a);
this.rj = a;
this.Va = !0
});
t.defineProperty(O, {kg: "startAngle"}, function () {
return this.re
}, function (a) {
this.re !== a && (t.L(this, a), f && t.o(a, O, "startAngle"), a %= 360, 0 > a && (a += 360), this.re = a, this.Va = !0)
});
t.defineProperty(O, {Dh: "sweepAngle"}, function () {
return this.se
}, function (a) {
f && t.o(a, O, "sweepAngle");
t.L(this, a);
360 < a && (a = 360);
-360 > a && (a = -360);
this.se = a;
this.Va = !0
});
t.defineProperty(O, {Xv: "isClockwiseArc"}, function () {
return!!this.se
}, function (a) {
t.L(this, a);
this.se = a ? 1 : 0;
this.Va = !0
});
t.defineProperty(O, {Zv: "isLargeArc"}, function () {
return!!this.re
}, function (a) {
t.L(this, a);
this.re = a ? 1 : 0;
this.Va = !0
});
t.defineProperty(O, {Fw: "xAxisRotation"}, function () {
return this.ao
}, function (a) {
f && t.o(a, O, "xAxisRotation");
a %= 360;
0 > a && (a += 360);
t.L(this, a);
this.ao = a;
this.Va = !0
});
function md() {
this.ba = null;
this.bz = (new v(0, 0)).freeze();
this.Hx = (new v(0, 0)).freeze();
this.Ft = this.uu = 0;
this.iu = "";
this.fv = this.Tt = !1;
this.Qt = this.Ht = 0;
this.Pi = this.$t = !1;
this.lq = null;
this.dv = 0;
this.Tf = this.bv = null
}
t.ea("InputEvent", md);
md.prototype.copy = function () {
var a = new md;
a.ba = this.ba;
a.bz = this.Zc.copy().freeze();
a.Hx = this.V.copy().freeze();
a.uu = this.uu;
a.Ft = this.Ft;
a.iu = this.iu;
a.Tt = this.Tt;
a.fv = this.fv;
a.Ht = this.Ht;
a.Qt = this.Qt;
a.$t = this.$t;
a.Pi = this.Pi;
a.lq = this.lq;
a.dv = this.dv;
a.bv = this.bv;
a.Tf = this.Tf;
return a
};
md.prototype.toString = function () {
var a = "^";
this.Mc && (a += "M:" + this.Mc);
this.button && (a += "B:" + this.button);
this.key && (a += "K:" + this.key);
this.ve && (a += "C:" + this.ve);
this.Mj && (a += "D:" + this.Mj);
this.ze && (a += "h");
this.bubbles && (a += "b");
null !== this.V && (a += "@" + this.V.toString());
return a
};
t.g(md, "diagram", md.prototype.h);
t.defineProperty(md, {h: "diagram"}, function () {
return this.ba
}, function (a) {
this.ba = a
});
t.g(md, "viewPoint", md.prototype.Zc);
t.defineProperty(md, {Zc: "viewPoint"}, function () {
return this.bz
}, function (a) {
t.j(a, v, md, "viewPoint");
this.bz.assign(a)
});
t.g(md, "documentPoint", md.prototype.V);
t.defineProperty(md, {V: "documentPoint"}, function () {
return this.Hx
}, function (a) {
t.j(a, v, md, "documentPoint");
this.Hx.assign(a)
});
t.g(md, "modifiers", md.prototype.Mc);
t.defineProperty(md, {Mc: "modifiers"}, function () {
return this.uu
}, function (a) {
this.uu = a
});
t.g(md, "button", md.prototype.button);
t.defineProperty(md, {button: "button"}, function () {
return this.Ft
}, function (a) {
this.Ft = a
});
t.g(md, "key", md.prototype.key);
t.defineProperty(md, {key: "key"}, function () {
return this.iu
}, function (a) {
this.iu = a
});
t.g(md, "down", md.prototype.Oj);
t.defineProperty(md, {Oj: "down"}, function () {
return this.Tt
}, function (a) {
this.Tt = a
});
t.g(md, "up", md.prototype.Mi);
t.defineProperty(md, {Mi: "up"}, function () {
return this.fv
}, function (a) {
this.fv = a
});
t.g(md, "clickCount", md.prototype.ve);
t.defineProperty(md, {ve: "clickCount"}, function () {
return this.Ht
}, function (a) {
this.Ht = a
});
t.g(md, "delta", md.prototype.Mj);
t.defineProperty(md, {Mj: "delta"}, function () {
return this.Qt
}, function (a) {
this.Qt = a
});
t.g(md, "handled", md.prototype.ze);
t.defineProperty(md, {ze: "handled"}, function () {
return this.$t
}, function (a) {
this.$t = a
});
t.g(md, "bubbles", md.prototype.bubbles);
t.defineProperty(md, {bubbles: "bubbles"}, function () {
return this.Pi
}, function (a) {
this.Pi = a
});
t.g(md, "event", md.prototype.event);
t.defineProperty(md, {event: "event"}, function () {
return this.lq
}, function (a) {
this.lq = a
});
t.A(md, {aw: "isTouchEvent"}, function () {
var a = window.TouchEvent;
return a && this.event instanceof a
});
t.g(md, "timestamp", md.prototype.timestamp);
t.defineProperty(md, {timestamp: "timestamp"}, function () {
return this.dv
}, function (a) {
this.dv = a
});
t.g(md, "targetDiagram", md.prototype.lg);
t.defineProperty(md, {lg: "targetDiagram"}, function () {
return this.bv
}, function (a) {
this.bv = a
});
t.g(md, "targetObject", md.prototype.Nd);
t.defineProperty(md, {Nd: "targetObject"}, function () {
return this.Tf
}, function (a) {
this.Tf = a
});
t.g(md, "control", md.prototype.control);
t.defineProperty(md, {control: "control"}, function () {
return 0 !== (this.Mc & 1)
}, function (a) {
this.Mc = a ? this.Mc | 1 : this.Mc & -2
});
t.g(md, "shift", md.prototype.shift);
t.defineProperty(md, {shift: "shift"}, function () {
return 0 !== (this.Mc & 4)
}, function (a) {
this.Mc = a ? this.Mc | 4 : this.Mc & -5
});
t.g(md, "alt", md.prototype.alt);
t.defineProperty(md, {alt: "alt"}, function () {
return 0 !== (this.Mc & 2)
}, function (a) {
this.Mc = a ? this.Mc | 2 : this.Mc & -3
});
t.g(md, "meta", md.prototype.Em);
t.defineProperty(md, {Em: "meta"}, function () {
return 0 !== (this.Mc & 8)
}, function (a) {
this.Mc = a ? this.Mc | 8 : this.Mc & -9
});
t.g(md, "left", md.prototype.left);
t.defineProperty(md, {left: "left"}, function () {
return 0 === this.button
}, function (a) {
this.button = a ? 0 : 2
});
t.g(md, "middle", md.prototype.dI);
t.defineProperty(md, {dI: "middle"}, function () {
return 1 === this.button
}, function (a) {
this.button = a ? 1 : 0
});
t.g(md, "right", md.prototype.right);
t.defineProperty(md, {right: "right"}, function () {
return 2 === this.button
}, function (a) {
this.button = a ? 2 : 0
});
function nd() {
this.ba = null;
this.Mb = "";
this.Hu = this.Yu = null;
this.Gt = !1
}
t.ea("DiagramEvent", nd);
nd.prototype.copy = function () {
var a = new nd;
a.ba = this.ba;
a.Mb = this.Mb;
a.Yu = this.Yu;
a.Hu = this.Hu;
a.Gt = this.Gt;
return a
};
nd.prototype.toString = function () {
var a = "*" + this.name;
this.cancel && (a += "x");
null !== this.Aw && (a += ":" + this.Aw.toString());
null !== this.mw && (a += "(" + this.mw.toString() + ")");
return a
};
t.g(nd, "diagram", nd.prototype.h);
t.defineProperty(nd, {h: "diagram"}, function () {
return this.ba
}, function (a) {
this.ba = a
});
t.g(nd, "name", nd.prototype.name);
t.defineProperty(nd, {name: "name"}, function () {
return this.Mb
}, function (a) {
this.Mb = a
});
t.g(nd, "subject", nd.prototype.Aw);
t.defineProperty(nd, {Aw: "subject"}, function () {
return this.Yu
}, function (a) {
this.Yu = a
});
t.g(nd, "parameter", nd.prototype.mw);
t.defineProperty(nd, {mw: "parameter"}, function () {
return this.Hu
}, function (a) {
this.Hu = a
});
t.g(nd, "cancel", nd.prototype.cancel);
t.defineProperty(nd, {cancel: "cancel"}, function () {
return this.Gt
}, function (a) {
this.Gt = a
});
function od() {
this.clear()
}
t.ea("ChangedEvent", od);
var pd;
od.Transaction = pd = t.w(od, "Transaction", -1);
var qd;
od.Property = qd = t.w(od, "Property", 0);
var rd;
od.Insert = rd = t.w(od, "Insert", 1);
var sd;
od.Remove = sd = t.w(od, "Remove", 2);
od.prototype.clear = od.prototype.clear = function () {
this.Sp = qd;
this.Sl = this.tu = "";
this.xu = this.yu = this.Eu = this.Kn = this.Du = this.ba = this.Xd = null
};
od.prototype.copy = function () {
var a = new od;
a.Xd = this.Xd;
a.ba = this.ba;
a.Sp = this.Sp;
a.tu = this.tu;
a.Sl = this.Sl;
a.Du = this.Du;
var b = this.Kn;
a.Kn = t.jb(b) && "function" === typeof b.W ? b.W() : b;
b = this.Eu;
a.Eu = t.jb(b) && "function" === typeof b.W ? b.W() : b;
b = this.yu;
a.yu = t.jb(b) && "function" === typeof b.W ? b.W() : b;
b = this.xu;
a.xu = t.jb(b) && "function" === typeof b.W ? b.W() : b;
return a
};
od.prototype.toString = function () {
var a = "", a = this.ed === pd ? a + "* " : this.ed === qd ? a + (null !== this.da ? "!m" : "!d") : a + ((null !== this.da ? "!m" : "!d") + this.ed);
this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName);
this.lf && this.lf !== this.propertyName && (a += " " + this.lf);
a += ": ";
this.ed === pd ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += td(this.object)), null !== this.oldValue && (a += " old: " + td(this.oldValue)), null !== this.Gf && (a += " " + this.Gf), null !== this.newValue &&
(a += " new: " + td(this.newValue)), null !== this.Ef && (a += " " + this.Ef));
return a
};
od.prototype.getValue = od.prototype.wa = function (a) {
return a ? this.oldValue : this.newValue
};
od.prototype.getParam = function (a) {
return a ? this.Gf : this.Ef
};
od.prototype.canUndo = od.prototype.canUndo = function () {
return null !== this.da || null !== this.h ? !0 : !1
};
od.prototype.undo = od.prototype.undo = function () {
this.canUndo() && (null !== this.da ? this.da.changeState(this, !0) : null !== this.h && this.h.changeState(this, !0))
};
od.prototype.canRedo = od.prototype.canRedo = function () {
return null !== this.da || null !== this.h ? !0 : !1
};
od.prototype.redo = od.prototype.redo = function () {
this.canRedo() && (null !== this.da ? this.da.changeState(this, !1) : null !== this.h && this.h.changeState(this, !1))
};
t.g(od, "model", od.prototype.da);
t.defineProperty(od, {da: "model"}, function () {
return this.Xd
}, function (a) {
this.Xd = a
});
t.g(od, "diagram", od.prototype.h);
t.defineProperty(od, {h: "diagram"}, function () {
return this.ba
}, function (a) {
this.ba = a
});
t.g(od, "change", od.prototype.ed);
t.defineProperty(od, {ed: "change"}, function () {
return this.Sp
}, function (a) {
f && t.nb(a, od, od, "change");
this.Sp = a
});
t.g(od, "modelChange", od.prototype.lf);
t.defineProperty(od, {lf: "modelChange"}, function () {
return this.tu
}, function (a) {
f && t.k(a, "string", od, "modelChange");
this.tu = a
});
t.g(od, "propertyName", od.prototype.propertyName);
t.defineProperty(od, {propertyName: "propertyName"}, function () {
return this.Sl
}, function (a) {
f && "string" !== typeof a && t.j(a, Function, od, "propertyName");
this.Sl = a
});
t.g(od, "isTransactionFinished", od.prototype.RH);
t.A(od, {RH: "isTransactionFinished"}, function () {
return this.Sp === pd && ("CommittedTransaction" === this.Sl || "FinishedUndo" === this.Sl || "FinishedRedo" === this.Sl)
});
t.g(od, "object", od.prototype.object);
t.defineProperty(od, {object: "object"}, function () {
return this.Du
}, function (a) {
this.Du = a
});
t.g(od, "oldValue", od.prototype.oldValue);
t.defineProperty(od, {oldValue: "oldValue"}, function () {
return this.Kn
}, function (a) {
this.Kn = a
});
t.g(od, "oldParam", od.prototype.Gf);
t.defineProperty(od, {Gf: "oldParam"}, function () {
return this.Eu
}, function (a) {
this.Eu = a
});
t.g(od, "newValue", od.prototype.newValue);
t.defineProperty(od, {newValue: "newValue"}, function () {
return this.yu
}, function (a) {
this.yu = a
});
t.g(od, "newParam", od.prototype.Ef);
t.defineProperty(od, {Ef: "newParam"}, function () {
return this.xu
}, function (a) {
this.xu = a
});
function C(a) {
1 < arguments.length && t.m("Model constructor can only take one optional argument, the Array of node data.");
t.uc(this);
this.Bx = this.Mb = "";
this.zk = this.OB = !1;
this.py = {};
this.Fe = [];
this.pc = new ia(null, Object);
this.Ol = "key";
this.Lt = this.mu = null;
this.fr = "category";
this.Yg = new ia(null, ka);
this.jj = null;
this.gi = !1;
this.az = null;
this.va = new ud;
void 0 !== a && (this.eg = a)
}
t.ea("Model", C);
C.prototype.clear = C.prototype.clear = function () {
this.Kd && t.Bm(this.Fe, "nodeDataArray", this, !0);
this.Fe = [];
this.pc.clear();
this.Yg.clear();
this.va.clear()
};
aa = C.prototype;
aa.ot = function () {
var a = "";
"" !== this.name && (a += ',\n "name": ' + this.quote(this.name));
"" !== this.qm && (a += ',\n "dataFormat": ' + this.quote(this.qm));
this.Ua && (a += ',\n "isReadOnly": ' + this.Ua);
"key" !== this.Ii && "string" === typeof this.Ii && (a += ',\n "nodeKeyProperty": ' + this.quote(this.Ii));
"category" !== this.cl && "string" === typeof this.cl && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.cl));
return a
};
aa.UA = function () {
var a = "", b = this.bA, c = !1, d;
for (d in b)if (!zd(d, b[d])) {
c = !0;
break
}
c && (a = ',\n "modelData": ' + Ad(this, b));
return a + ',\n "nodeDataArray": ' + Bd(this, this.eg, !0)
};
aa.Xs = function (a) {
a.name && (this.name = a.name);
a.dataFormat && (this.qm = a.dataFormat);
a.isReadOnly && (this.Ua = a.isReadOnly);
a.nodeKeyProperty && (this.Ii = a.nodeKeyProperty);
a.nodeCategoryProperty && (this.cl = a.nodeCategoryProperty)
};
aa.qA = function (a) {
var b = a.modelData;
b && (Cd(this, b), this.bA = b);
if (a = a.nodeDataArray)Cd(this, a), this.eg = a
};
aa.toString = function (a) {
void 0 === a && (a = 0);
if (1 < a)return this.MA();
var b = ("" !== this.name ? this.name : "") + " Model";
if (0 < a) {
b += "\n node data:";
a = this.eg;
var c = t.wb(a), d;
for (d = 0; d < c; d++)var e = t.mb(a, d), b = b + (" " + this.Ib(e) + ":" + td(e))
}
return b
};
C.prototype.toJson = C.prototype.MA = function (a) {
void 0 === a && (a = this.constructor === C ? "go.Model" : this.constructor === P ? "go.GraphLinksModel" : this.constructor === Dd ? "go.TreeModel" : t.Fg(this));
return'{ "class": ' + this.quote(a) + this.ot() + this.UA() + "}"
};
C.fromJson = function (a, b) {
void 0 === b && (b = null);
b && t.j(b, C, C, "fromJson:model");
var c = null;
if ("string" === typeof a)if (window && window.JSON && window.JSON.parse)try {
c = window.JSON.parse(a)
} catch (d) {
f && t.trace("JSON.parse error: " + d.toString())
} else t.trace("WARNING: no JSON.parse available"); else"object" === typeof a ? c = a : t.m("Unable to construct a Model from: " + a);
if (null === b) {
var e;
e = null;
var g = c["class"];
if ("string" === typeof g)try {
var h = null;
0 === g.indexOf("go.") ? (g = g.substr(3), h = ba[g]) : (h = ba[g]) || (h = window[g]);
"function" === typeof h && (e = new h)
} catch (k) {
}
null === e || e instanceof C ? b = e : t.m("Unable to construct a Model of declared class: " + c["class"])
}
null === b && (b = new P);
b.Xs(c);
b.qA(c);
return b
};
function Cd(a, b) {
if (t.isArray(b))for (var c = t.wb(b), d = 0; d < c; d++) {
var e = t.mb(b, d);
t.jb(e) && t.IC(b, d, Cd(a, e))
} else if (t.jb(b)) {
for (d in b)if (e = b[d], t.jb(e) && (e = Cd(a, e), b[d] = e, "points" === d && Array.isArray(e))) {
for (var g = !0, h = 0; h < e.length; h++)if ("number" !== typeof e[h]) {
g = !1;
break
}
if (g) {
g = new A(v);
for (h = 0; h < e.length / 2; h++) {
var k = new v(e[2 * h], e[2 * h + 1]);
g.add(k)
}
g.freeze();
b[d] = g
}
}
if ("object" !== typeof b)c = b; else {
d = b;
e = b["class"];
if ("NaN" === e)d = NaN; else if ("go.Point" === e)d = new v(Md(b.x), Md(b.y)); else if ("go.Size" ===
e)d = new da(Md(b.width), Md(b.height)); else if ("go.Rect" === e)d = new w(Md(b.x), Md(b.y), Md(b.width), Md(b.height)); else if ("go.Margin" === e)d = new Wa(Md(b.top), Md(b.right), Md(b.bottom), Md(b.left)); else if ("go.Spot" === e)d = "string" === typeof b["enum"] ? sb(b["enum"]) : new H(Md(b.x), Md(b.y), Md(b.offsetX), Md(b.offsetY)); else if ("go.Brush" === e) {
if (d = new Nd, d.type = t.tm(Nd, b.type), b.start instanceof H && (d.start = b.start), b.end instanceof H && (d.end = b.end), "number" === typeof b.startRadius && (d.tp = Md(b.startRadius)), "number" === typeof b.endRadius && (d.wo = Md(b.endRadius)), e = b.colorStops)for (c in e)d.addColorStop(parseFloat(c), e[c])
} else"go.Geometry" === e && (d = "string" === typeof b.path ? Nc(b.path) : new I, d.type = t.tm(I, b.type), "number" === typeof b.startX && (d.la = Md(b.startX)), "number" === typeof b.startY && (d.ma = Md(b.startY)), "number" === typeof b.endX && (d.D = Md(b.endX)), "number" === typeof b.endY && (d.F = Md(b.endY)), b.spot1 instanceof H && (d.G = b.spot1), b.spot2 instanceof H && (d.H = b.spot2));
c = d
}
return c
}
return b
}
C.prototype.quote = function (a) {
for (var b = "", c = a.length, d = 0; d < c; d++)var e = a[d], b = '"' === e || "\\" === e ? b + ("\\" + e) : "\b" === e ? b + "\\b" : "\f" === e ? b + "\\f" : "\n" === e ? b + "\\n" : "\r" === e ? b + "\\r" : "\t" === e ? b + "\\t" : b + e;
return'"' + b + '"'
};
C.prototype.writeJsonValue = C.prototype.Ew = function (a) {
return void 0 === a ? "undefined" : null === a ? "null" : !0 === a ? "true" : !1 === a ? "false" : "string" === typeof a ? this.quote(a) : "number" === typeof a ? Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : isNaN(a) ? '{"class":"NaN"}' : a.toString() : t.isArray(a) ? Bd(this, a) : t.jb(a) ? Ad(this, a) : "function" === typeof a ? "null" : a.toString()
};
function Bd(a, b, c) {
var d = t.wb(b), e = "[ ";
c && 1 < d && (e += "\n");
for (var g = 0; g < d; g++) {
var h = t.mb(b, g);
void 0 !== h && (0 < g && (e += ",", c && (e += "\n")), e += a.Ew(h))
}
c && 1 < d && (e += "\n");
return e + " ]"
}
function zd(a, b) {
return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1
}
function Od(a) {
return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a
}
function Ad(a, b) {
var c = b;
if (c instanceof v)b = {"class": "go.Point", x: Od(c.x), y: Od(c.y)}; else if (c instanceof da)b = {"class": "go.Size", width: Od(c.width), height: Od(c.height)}; else if (c instanceof w)b = {"class": "go.Rect", x: Od(c.x), y: Od(c.y), width: Od(c.width), height: Od(c.height)}; else if (c instanceof Wa)b = {"class": "go.Margin", top: Od(c.top), right: Od(c.right), bottom: Od(c.bottom), left: Od(c.left)}; else if (c instanceof H)b = c.jd() ? {"class": "go.Spot", x: Od(c.x), y: Od(c.y), offsetX: Od(c.offsetX), offsetY: Od(c.offsetY)} :
{"class": "go.Spot", "enum": c.toString()}; else if (c instanceof Nd) {
b = {"class": "go.Brush", type: c.type.name};
if (c.type === Pd)b.color = c.color; else if (c.type === Qd || c.type === Rd)b.start = c.start, b.end = c.end, c.type === Rd && (0 !== c.tp && (b.startRadius = Od(c.tp)), isNaN(c.wo) || (b.endRadius = Od(c.wo)));
if (null !== c.qo) {
for (var d = {}, c = c.qo.l; c.next();)d[c.key.toString()] = c.value;
b.colorStops = d
}
} else if (c instanceof I)b = {"class": "go.Geometry", type: c.type.name}, 0 !== c.la && (b.startX = Od(c.la)), 0 !== c.ma && (b.startY = Od(c.ma)),
0 !== c.D && (b.endX = Od(c.D)), 0 !== c.F && (b.endY = Od(c.F)), c.G.K(yb) || (b.spot1 = c.G), c.H.K(Pb) || (b.spot2 = c.H), c.type === Bc && (b.path = Lc(c)); else if (c instanceof Q || c instanceof z || c instanceof Sd || c instanceof C || c instanceof Td || c instanceof oa || c instanceof fe || c instanceof ra || c instanceof ud || c instanceof ge)return t.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()), "{}";
var d = "{", e = !0, g;
for (g in b)if (c = t.ab(b, g), !zd(g, c))if (e ?
e = !1 : d += ", ", d += '"' + g + '":', "points" === g && c instanceof A && c.Z === v) {
for (var h = "[", c = c.l; c.next();) {
var k = c.value;
1 < h.length && (h += ",");
h += a.Ew(k.x);
h += ",";
h += a.Ew(k.y)
}
h += "]";
d += h
} else d += a.Ew(c);
return d + "}"
}
function Md(a) {
return"number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a)
}
t.g(C, "name", C.prototype.name);
t.defineProperty(C, {name: "name"}, function () {
return this.Mb
}, function (a) {
var b = this.Mb;
b !== a && (t.k(a, "string", C, "name"), this.Mb = a, this.i("name", b, a))
});
t.g(C, "dataFormat", C.prototype.qm);
t.defineProperty(C, {qm: "dataFormat"}, function () {
return this.Bx
}, function (a) {
var b = this.Bx;
b !== a && (t.k(a, "string", C, "dataFormat"), this.Bx = a, this.i("dataFormat", b, a))
});
t.g(C, "knockoutJS", C.prototype.Kd);
t.defineProperty(C, {Kd: "knockoutJS"}, function () {
return this.OB
}, function (a) {
this.OB = a;
t.lc || (t.lc = "object" === typeof window.ko && "function" === typeof window.ko.isObservable ? window.ko.isObservable : null, a && null === t.lc && t.trace("No value for ko.isObservable: is KnockoutJS library not loaded?"))
});
t.g(C, "isReadOnly", C.prototype.Ua);
t.defineProperty(C, {Ua: "isReadOnly"}, function () {
return this.zk
}, function (a) {
var b = this.zk;
b !== a && (t.k(a, "boolean", C, "isReadOnly"), this.zk = a, this.i("isReadOnly", b, a))
});
t.g(C, "modelData", C.prototype.bA);
t.defineProperty(C, {bA: "modelData"}, function () {
return this.py
}, function (a) {
var b = this.py;
b !== a && (t.k(a, "object", C, "modelData"), this.py = a, this.i("modelData", b, a))
});
C.prototype.addChangedListener = C.prototype.iz = function (a) {
t.k(a, "function", C, "addChangedListener:listener");
null === this.jj && (this.jj = new A("function"));
this.jj.add(a)
};
C.prototype.removeChangedListener = C.prototype.uA = function (a) {
t.k(a, "function", C, "removeChangedListener:listener");
null !== this.jj && (this.jj.remove(a), 0 === this.jj.count && (this.jj = null))
};
C.prototype.uv = function (a) {
this.xb || this.va.KD(a);
if (null !== this.jj) {
var b = this.jj, c = b.length;
if (1 === c)b = b.ta(0), b(a); else if (0 !== c)for (var d = b.Ve(), e = 0; e < c; e++)b = d[e], b(a)
}
};
C.prototype.raiseChangedEvent = C.prototype.Yc = function (a, b, c, d, e, g, h) {
he(this, "", a, b, c, d, e, g, h)
};
C.prototype.raiseChanged = C.prototype.i = function (a, b, c, d, e) {
he(this, "", qd, a, this, b, c, d, e)
};
C.prototype.raiseDataChanged = C.prototype.ow = function (a, b, c, d, e, g) {
he(this, "", qd, b, a, c, d, e, g)
};
function he(a, b, c, d, e, g, h, k, l) {
void 0 === k && (k = null);
void 0 === l && (l = null);
var m = new od;
m.da = a;
m.ed = c;
m.lf = b;
m.propertyName = d;
m.object = e;
m.oldValue = g;
m.Gf = k;
m.newValue = h;
m.Ef = l;
a.uv(m)
}
t.g(C, "undoManager", C.prototype.va);
t.defineProperty(C, {va: "undoManager"}, function () {
return this.az
}, function (a) {
var b = this.az;
b !== a && (t.j(a, ud, C, "undoManager"), null !== b && b.vI(this), this.az = a, null !== a && a.vG(this))
});
t.g(C, "skipsUndoManager", C.prototype.xb);
t.defineProperty(C, {xb: "skipsUndoManager"}, function () {
return this.gi
}, function (a) {
t.k(a, "boolean", C, "skipsUndoManager");
this.gi = a
});
C.prototype.changeState = function (a, b) {
if (null !== a && a.da === this)if (a.ed === qd) {
var c = a.object, d = a.propertyName, e = a.wa(b);
t.Pa(c, d, e)
} else a.ed === rd ? "nodeDataArray" === a.lf ? (c = a.newValue, t.jb(c) && (d = this.Ib(c), void 0 !== d && (b ? (this.Kd && t.jf(c, this, !0), t.pi(this.Fe, a.Ef), this.pc.remove(d)) : (this.Kd && t.jf(c, this, !1), t.oi(this.Fe, a.Ef, c), this.pc.add(d, c))))) : "" === a.lf ? (c = a.object, !t.isArray(c) && a.propertyName && (c = t.ab(a.object, a.propertyName)), t.isArray(c) && (d = a.newValue, e = a.Ef, b ? t.pi(c, e) : t.oi(c, e, d))) :
t.m("unknown ChangedEvent.Insert object: " + a.toString()) : a.ed === sd ? "nodeDataArray" === a.lf ? (c = a.oldValue, t.jb(c) && (d = this.Ib(c), void 0 !== d && (b ? (this.Kd && t.jf(c, this, !1), t.oi(this.Fe, a.Gf, c), this.pc.add(d, c)) : (this.Kd && t.jf(c, this, !0), t.pi(this.Fe, a.Gf), this.pc.remove(d))))) : "" === a.lf ? (c = a.object, !t.isArray(c) && a.propertyName && (c = t.ab(a.object, a.propertyName)), t.isArray(c) && (d = a.oldValue, e = a.Gf, b ? t.oi(c, e, d) : t.pi(c, e))) : t.m("unknown ChangedEvent.Remove object: " + a.toString()) : a.ed !== pd && t.m("unknown ChangedEvent: " +
a.toString())
};
C.prototype.startTransaction = C.prototype.mc = function (a) {
return this.va.mc(a)
};
C.prototype.commitTransaction = C.prototype.xe = function (a) {
return this.va.xe(a)
};
C.prototype.rollbackTransaction = C.prototype.$s = function () {
return this.va.$s()
};
C.prototype.updateTargetBindings = C.prototype.Eb = function (a, b) {
void 0 === b && (b = "");
he(this, "SourceChanged", pd, b, a, null, null)
};
t.g(C, "nodeKeyProperty", C.prototype.Ii);
t.defineProperty(C, {Ii: "nodeKeyProperty"}, function () {
return this.Ol
}, function (a) {
var b = this.Ol;
b !== a && (ie(a, C, "nodeKeyProperty"), 0 < this.pc.count && t.m("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Ol = a, this.i("nodeKeyProperty", b, a))
});
function ie(a, b, c) {
"string" !== typeof a && "function" !== typeof a && t.Nb(a, "string or function", b, c)
}
C.prototype.getKeyForNodeData = C.prototype.Ib = function (a) {
if (null !== a) {
var b = this.Ol;
if ("" !== b && (b = t.ab(a, b), void 0 !== b)) {
if (je(b))return b;
t.m("Key value for node data " + a + " is not a number or a string: " + b)
}
}
};
C.prototype.setKeyForNodeData = C.prototype.EA = function (a, b) {
null === b && (b = void 0);
void 0 === b || je(b) || t.Nb(b, "number or string", C, "setKeyForNodeData:key");
if (null !== a) {
var c = this.Ol;
if ("" !== c)if (this.be(a)) {
var d = t.ab(a, c);
d !== b && null === this.ff(b) && (t.Pa(a, c, b), this.pc.remove(d), this.pc.add(b, a), he(this, "nodeKey", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c), this.Ys(d, b))
} else t.Pa(a, c, b)
}
};
t.g(C, "makeUniqueKeyFunction", C.prototype.bI);
t.defineProperty(C, {bI: "makeUniqueKeyFunction"}, function () {
return this.mu
}, function (a) {
var b = this.mu;
b !== a && (null !== a && t.k(a, "function", C, "makeUniqueKeyFunction"), this.mu = a, this.i("makeUniqueKeyFunction", b, a))
});
function je(a) {
return"number" === typeof a || "string" === typeof a
}
C.prototype.containsNodeData = C.prototype.be = function (a) {
a = this.Ib(a);
return void 0 === a ? !1 : this.pc.contains(a)
};
C.prototype.findNodeDataForKey = C.prototype.ff = function (a) {
null === a && t.m("Model.findNodeDataForKey:key must not be null");
return void 0 !== a && je(a) ? this.pc.wa(a) : null
};
t.g(C, "nodeDataArray", C.prototype.eg);
t.defineProperty(C, {eg: "nodeDataArray"}, function () {
return this.Fe
}, function (a) {
var b = this.Fe;
if (b !== a) {
t.is(a, C, "nodeDataArray");
this.Kd && t.lc && (null !== b && t.Bm(b, "nodeDataArray", this, !0), a = t.Bm(a, "nodeDataArray", this, !1));
this.pc.clear();
this.QA();
for (var c = t.wb(a), d = 0; d < c; d++) {
var e = t.mb(a, d);
if (!t.jb(e)) {
t.m("Model.nodeDataArray must only contain Objects, not: " + e);
return
}
t.zs(e)
}
this.Fe = a;
for (var g = new A(Object), d = 0; d < c; d++) {
var e = t.mb(a, d), h = this.Ib(e);
void 0 === h ? g.add(e) : null !== this.pc.wa(h) ?
g.add(e) : this.pc.add(h, e)
}
for (d = g.l; d.next();)e = d.value, this.kE(e), g = this.Ib(e), this.pc.add(g, e);
he(this, "nodeDataArray", qd, "nodeDataArray", this, b, a);
for (d = 0; d < c; d++)e = t.mb(a, d), this.kp(e), this.jp(e);
this.OC();
t.OH(a) || (this.Ua = !0)
}
});
C.prototype.makeNodeDataKeyUnique = C.prototype.kE = function (a) {
if (null !== a) {
var b = this.Ol;
if ("" !== b) {
var c = this.Ib(a);
if (void 0 === c || this.pc.contains(c)) {
var d = this.mu;
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.pc.contains(c))) {
t.Pa(a, b, c);
return
}
if ("string" === typeof c) {
for (d = 2; this.pc.contains(c + d);)d++;
t.Pa(a, b, c + d)
} else if (void 0 === c || "number" === typeof c) {
for (d = -this.pc.count - 1; this.pc.contains(d);)d--;
t.Pa(a, b, d)
} else t.m("Model.getKeyForNodeData returned something other than a string or a number: " +
c)
}
}
}
};
C.prototype.addNodeData = C.prototype.dm = function (a) {
if (null !== a) {
this.Kd && t.jf(a, this, !1);
t.zs(a);
var b = this.Ib(a);
if (void 0 === b || this.pc.wa(b) !== a)this.kE(a), b = this.Ib(a), this.pc.add(b, a), b = t.wb(this.Fe), t.oi(this.Fe, b, a), he(this, "nodeDataArray", rd, "nodeDataArray", this, null, a, null, b), this.kp(a), this.jp(a)
}
};
C.prototype.addNodeDataCollection = function (a) {
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.dm(t.mb(a, c)); else for (a = a.l; a.next();)this.dm(a.value)
};
C.prototype.removeNodeData = C.prototype.pw = function (a) {
if (null !== a) {
var b = this.Ib(a);
void 0 !== b && this.pc.contains(b) && (this.Kd && t.jf(a, this, !0), this.pc.remove(b), b = t.pz(this.Fe, a), 0 > b || (t.pi(this.Fe, b), he(this, "nodeDataArray", sd, "nodeDataArray", this, a, null, b, null), this.nt(a)))
}
};
C.prototype.removeNodeDataCollection = function (a) {
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.pw(t.mb(a, c)); else for (a = a.l; a.next();)this.pw(a.value)
};
aa = C.prototype;
aa.Ys = function (a, b) {
var c = ke(this, a);
c instanceof ka && this.Yg.add(b, c)
};
aa.QA = function () {
};
aa.kp = function () {
};
aa.jp = function () {
};
aa.nt = function () {
};
function le(a, b, c) {
if (void 0 !== b) {
var d = a.Yg.wa(b);
null === d && (d = new ka, a.Yg.add(b, d));
d.add(c)
}
}
function ue(a, b, c) {
if (void 0 !== b) {
var d = a.Yg.wa(b);
d instanceof ka && (void 0 === c || null === c ? a.Yg.remove(b) : (d.remove(c), 0 === d.count && a.Yg.remove(b)))
}
}
function ke(a, b) {
if (void 0 === b)return null;
var c = a.Yg.wa(b);
return c instanceof ka ? c : null
}
C.prototype.clearUnresolvedReferences = C.prototype.OC = function (a) {
void 0 === a ? this.Yg.clear() : this.Yg.remove(a)
};
t.g(C, "copyNodeDataFunction", C.prototype.$G);
t.defineProperty(C, {$G: "copyNodeDataFunction"}, function () {
return this.Lt
}, function (a) {
var b = this.Lt;
b !== a && (null !== a && t.k(a, "function", C, "copyNodeDataFunction"), this.Lt = a, this.i("copyNodeDataFunction", b, a))
});
C.prototype.copyNodeData = C.prototype.Kj = function (a) {
if (null === a)return null;
var b = null, b = this.Lt;
if (null !== b)b = b(a, this); else {
var b = new a.constructor, c;
for (c in a)t.Pa(b, c, t.ab(a, c));
this.Kd && t.jf(b, this, !1)
}
b && t.uc(b);
return b
};
C.prototype.setDataProperty = C.prototype.ww = function (a, b, c) {
f && (t.k(a, "object", C, "setDataProperty:data"), t.k(b, "string", C, "setDataProperty:propname"), "" === b && t.m("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.be(a))if (b === this.Ii)this.EA(a, c); else {
if (b === this.cl) {
this.uw(a, c);
return
}
} else!t.yp && a instanceof Q && (t.yp = !0, t.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), t.trace(" Is that really your intent?"));
var d =
t.ab(a, b);
d !== c && (t.Pa(a, b, c), this.ow(a, b, d, c))
};
C.prototype.addArrayItem = function (a, b) {
this.KH(a, -1, b)
};
C.prototype.insertArrayItem = C.prototype.KH = function (a, b, c) {
f && (t.is(a, C, "insertArrayItem:arr"), t.o(b, C, "insertArrayItem:idx"));
a === this.Fe && t.m("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");
0 > b && (b = t.wb(a));
t.oi(a, b, c);
he(this, "", rd, "", a, null, c, null, b)
};
C.prototype.removeArrayItem = function (a, b) {
void 0 === b && (b = -1);
f && (t.is(a, C, "removeArrayItem:arr"), t.o(b, C, "removeArrayItem:idx"));
a === this.Fe && t.m("Model.removeArrayItem should not be called on the Model.nodeDataArray");
-1 === b && (b = t.wb(a) - 1);
var c = t.mb(a, b);
t.pi(a, b);
he(this, "", sd, "", a, c, null, b, null)
};
t.g(C, "nodeCategoryProperty", C.prototype.cl);
t.defineProperty(C, {cl: "nodeCategoryProperty"}, function () {
return this.fr
}, function (a) {
var b = this.fr;
b !== a && (ie(a, C, "nodeCategoryProperty"), this.fr = a, this.i("nodeCategoryProperty", b, a))
});
C.prototype.getCategoryForNodeData = C.prototype.getCategoryForNodeData = function (a) {
if (null === a)return"";
var b = this.fr;
if ("" === b)return"";
b = t.ab(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getCategoryForNodeData found a non-string category for " + a + ": " + b);
return""
};
C.prototype.setCategoryForNodeData = C.prototype.uw = function (a, b) {
t.k(b, "string", C, "setCategoryForNodeData:cat");
if (null !== a) {
var c = this.fr;
if ("" !== c)if (this.be(a)) {
var d = t.ab(a, c);
void 0 === d && (d = "");
d !== b && (t.Pa(a, c, b), he(this, "nodeCategory", qd, c, a, d, b))
} else t.Pa(a, c, b)
}
};
function P(a, b) {
2 < arguments.length && t.m("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");
C.call(this);
this.wg = [];
this.Kl = new ka(Object);
this.Ni = this.Kt = null;
this.fj = "from";
this.ij = "to";
this.Oq = this.Nq = "";
this.Kq = "category";
this.ih = this.Au = "";
this.zu = "isGroup";
this.oj = "group";
this.wx = !1;
void 0 !== a && (this.eg = a);
void 0 !== b && (this.Fi = b)
}
t.ea("GraphLinksModel", P);
t.Ja(P, C);
P.prototype.clear = P.prototype.clear = function () {
C.prototype.clear.call(this);
this.Kd && t.Bm(this.wg, "linkDataArray", this, !0);
this.wg = [];
this.Kl.clear()
};
aa = P.prototype;
aa.toString = function (a) {
void 0 === a && (a = 0);
if (2 <= a)return this.MA();
var b = ("" !== this.name ? this.name : "") + " GraphLinksModel";
if (0 < a) {
b += "\n node data:";
a = this.eg;
var c = t.wb(a), d;
for (d = 0; d < c; d++)var e = t.mb(a, d), b = b + (" " + this.Ib(e) + ":" + td(e));
b += "\n link data:";
a = this.Fi;
c = t.wb(a);
for (d = 0; d < c; d++)e = t.mb(a, d), b += " " + this.wm(e) + "--\x3e" + this.xm(e)
}
return b
};
aa.ot = function () {
var a = C.prototype.ot.call(this), b = "";
"category" !== this.Qo && "string" === typeof this.Qo && (b += ',\n "linkCategoryProperty": ' + this.quote(this.Qo));
"from" !== this.Ro && "string" === typeof this.Ro && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.Ro));
"to" !== this.Wo && "string" === typeof this.Wo && (b += ',\n "linkToKeyProperty": ' + this.quote(this.Wo));
"" !== this.So && "string" === typeof this.So && (b += ',\n "linkFromPortIdProperty": ' + this.quote(this.So));
"" !== this.Xo && "string" === typeof this.Xo && (b +=
',\n "linkToPortIdProperty": ' + this.quote(this.Xo));
"" !== this.Ss && "string" === typeof this.Ss && (b += ',\n "nodeIsLinkLabelProperty": ' + this.quote(this.Ss));
"" !== this.To && "string" === typeof this.To && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.To));
"isGroup" !== this.ep && "string" === typeof this.ep && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.ep));
"group" !== this.dp && "string" === typeof this.dp && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.dp));
return a + b
};
aa.UA = function () {
var a = C.prototype.UA.call(this), b = ',\n "linkDataArray": ' + Bd(this, this.Fi, !0);
return a + b
};
aa.Xs = function (a) {
C.prototype.Xs.call(this, a);
a.linkFromKeyProperty && (this.Ro = a.linkFromKeyProperty);
a.linkToKeyProperty && (this.Wo = a.linkToKeyProperty);
a.linkFromPortIdProperty && (this.So = a.linkFromPortIdProperty);
a.linkToPortIdProperty && (this.Xo = a.linkToPortIdProperty);
a.linkCategoryProperty && (this.Qo = a.linkCategoryProperty);
a.nodeIsLinkLabelProperty && (this.Ss = a.nodeIsLinkLabelProperty);
a.linkLabelKeysProperty && (this.To = a.linkLabelKeysProperty);
a.nodeIsGroupProperty && (this.ep = a.nodeIsGroupProperty);
a.nodeGroupKeyProperty && (this.dp = a.nodeGroupKeyProperty)
};
aa.qA = function (a) {
C.prototype.qA.call(this, a);
if (a = a.linkDataArray)Cd(this, a), this.Fi = a
};
P.prototype.changeState = function (a, b) {
if (a.ed === rd) {
var c = null;
"linkDataArray" === a.lf ? c = this.wg : "linkLabelKeys" === a.lf && (c = this.Yk(a.object));
if (t.isArray(c)) {
b ? (this.Kd && t.jb(a.newValue) && t.jf(a.newValue, this, !0), t.pi(c, a.Ef)) : (this.Kd && t.jb(a.newValue) && t.jf(a.newValue, this, !1), t.oi(c, a.Ef, a.newValue));
return
}
} else if (a.ed === sd && (c = null, "linkDataArray" === a.lf ? c = this.wg : "linkLabelKeys" === a.lf && (c = this.Yk(a.object)), t.isArray(c))) {
b ? (this.Kd && t.jb(a.oldValue) && t.jf(a.oldValue, this, !1), t.oi(c, a.Gf,
a.oldValue)) : (this.Kd && t.jb(a.oldValue) && t.jf(a.oldValue, this, !0), t.pi(c, a.Gf));
return
}
C.prototype.changeState.call(this, a, b)
};
t.g(P, "archetypeNodeData", P.prototype.fs);
t.defineProperty(P, {fs: "archetypeNodeData"}, function () {
return this.Ni
}, function (a) {
var b = this.Ni;
b !== a && (null !== a && t.j(a, Object, P, "archetypeNodeData"), this.Ni = a, this.i("archetypeNodeData", b, a))
});
P.prototype.Dm = function (a) {
if (void 0 !== a) {
var b = this.Ni;
if (null !== b) {
var c = this.ff(a);
null === c && (c = this.Kj(b), t.Pa(c, this.Ol, a), this.dm(c))
}
return a
}
};
t.g(P, "linkFromKeyProperty", P.prototype.Ro);
t.defineProperty(P, {Ro: "linkFromKeyProperty"}, function () {
return this.fj
}, function (a) {
var b = this.fj;
b !== a && (ie(a, P, "linkFromKeyProperty"), this.fj = a, this.i("linkFromKeyProperty", b, a))
});
P.prototype.getFromKeyForLinkData = P.prototype.wm = function (a) {
if (null !== a) {
var b = this.fj;
if ("" !== b && (b = t.ab(a, b), void 0 !== b)) {
if (je(b))return b;
t.m("FromKey value for link data " + a + " is not a number or a string: " + b)
}
}
};
P.prototype.setFromKeyForLinkData = P.prototype.BA = function (a, b) {
null === b && (b = void 0);
void 0 === b || je(b) || t.Nb(b, "number or string", P, "setFromKeyForLinkData:key");
if (null !== a) {
var c = this.fj;
if ("" !== c)if (b = this.Dm(b), this.si(a)) {
var d = t.ab(a, c);
d !== b && (ue(this, d, a), t.Pa(a, c, b), null === this.ff(b) && le(this, b, a), he(this, "linkFromKey", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
t.g(P, "linkToKeyProperty", P.prototype.Wo);
t.defineProperty(P, {Wo: "linkToKeyProperty"}, function () {
return this.ij
}, function (a) {
var b = this.ij;
b !== a && (ie(a, P, "linkToKeyProperty"), this.ij = a, this.i("linkToKeyProperty", b, a))
});
P.prototype.getToKeyForLinkData = P.prototype.xm = function (a) {
if (null !== a) {
var b = this.ij;
if ("" !== b && (b = t.ab(a, b), void 0 !== b)) {
if (je(b))return b;
t.m("ToKey value for link data " + a + " is not a number or a string: " + b)
}
}
};
P.prototype.setToKeyForLinkData = P.prototype.GA = function (a, b) {
null === b && (b = void 0);
void 0 === b || je(b) || t.Nb(b, "number or string", P, "setToKeyForLinkData:key");
if (null !== a) {
var c = this.ij;
if ("" !== c)if (b = this.Dm(b), this.si(a)) {
var d = t.ab(a, c);
d !== b && (ue(this, d, a), t.Pa(a, c, b), null === this.ff(b) && le(this, b, a), he(this, "linkToKey", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
t.g(P, "linkFromPortIdProperty", P.prototype.So);
t.defineProperty(P, {So: "linkFromPortIdProperty"}, function () {
return this.Nq
}, function (a) {
var b = this.Nq;
b !== a && (ie(a, P, "linkFromPortIdProperty"), this.Nq = a, this.i("linkFromPortIdProperty", b, a))
});
P.prototype.getFromPortIdForLinkData = P.prototype.yH = function (a) {
if (null === a)return"";
var b = this.Nq;
if ("" === b)return"";
a = t.ab(a, b);
return void 0 === a ? "" : a
};
P.prototype.setFromPortIdForLinkData = P.prototype.CA = function (a, b) {
t.k(b, "string", P, "setFromPortIdForLinkData:portname");
if (null !== a) {
var c = this.Nq;
if ("" !== c)if (this.si(a)) {
var d = t.ab(a, c);
void 0 === d && (d = "");
d !== b && (t.Pa(a, c, b), he(this, "linkFromPortId", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
t.g(P, "linkToPortIdProperty", P.prototype.Xo);
t.defineProperty(P, {Xo: "linkToPortIdProperty"}, function () {
return this.Oq
}, function (a) {
var b = this.Oq;
b !== a && (ie(a, P, "linkToPortIdProperty"), this.Oq = a, this.i("linkToPortIdProperty", b, a))
});
P.prototype.getToPortIdForLinkData = P.prototype.BH = function (a) {
if (null === a)return"";
var b = this.Oq;
if ("" === b)return"";
a = t.ab(a, b);
return void 0 === a ? "" : a
};
P.prototype.setToPortIdForLinkData = P.prototype.HA = function (a, b) {
t.k(b, "string", P, "setToPortIdForLinkData:portname");
if (null !== a) {
var c = this.Oq;
if ("" !== c)if (this.si(a)) {
var d = t.ab(a, c);
void 0 === d && (d = "");
d !== b && (t.Pa(a, c, b), he(this, "linkToPortId", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
t.g(P, "nodeIsLinkLabelProperty", P.prototype.Ss);
t.defineProperty(P, {Ss: "nodeIsLinkLabelProperty"}, function () {
return this.Au
}, function (a) {
var b = this.Au;
b !== a && (ie(a, P, "nodeIsLinkLabelProperty"), this.Au = a, this.i("nodeIsLinkLabelProperty", b, a))
});
P.prototype.isLinkLabelForNodeData = P.prototype.NH = function (a) {
if (null === a)return!1;
var b = this.Au;
return"" === b ? !1 : t.ab(a, b) ? !0 : !1
};
t.g(P, "linkLabelKeysProperty", P.prototype.To);
t.defineProperty(P, {To: "linkLabelKeysProperty"}, function () {
return this.ih
}, function (a) {
var b = this.ih;
b !== a && (ie(a, P, "linkLabelKeysProperty"), this.ih = a, this.i("linkLabelKeysProperty", b, a))
});
P.prototype.getLabelKeysForLinkData = P.prototype.Yk = function (a) {
if (null === a)return t.Hh;
var b = this.ih;
if ("" === b)return t.Hh;
a = t.ab(a, b);
return void 0 === a ? t.Hh : a
};
P.prototype.setLabelKeysForLinkData = P.prototype.dF = function (a, b) {
t.is(b, P, "setLabelKeysForLinkData:arr");
if (null !== a) {
var c = this.ih;
if ("" !== c)if (this.si(a)) {
var d = t.ab(a, c);
void 0 === d && (d = t.Hh);
if (d !== b) {
for (var e = t.wb(d), g = 0; g < e; g++) {
var h = t.mb(d, g);
ue(this, h, a)
}
t.Pa(a, c, b);
e = t.wb(b);
for (g = 0; g < e; g++)h = t.mb(b, g), null === this.ff(h) && le(this, h, a);
he(this, "linkLabelKeys", qd, c, a, d, b);
"string" === typeof c && this.Eb(a, c)
}
} else t.Pa(a, c, b)
}
};
P.prototype.addLabelKeyForLinkData = P.prototype.DC = function (a, b) {
if (null !== b && void 0 !== b && (je(b) || t.Nb(b, "number or string", P, "addLabelKeyForLinkData:key"), null !== a)) {
var c = this.ih;
if ("" !== c) {
var d = t.ab(a, c);
void 0 === d ? this.dF(a, [b]) : t.isArray(d) ? 0 <= t.pz(d, b) || (t.oi(d, Infinity, b), this.si(a) && (null === this.ff(b) && le(this, b, a), he(this, "linkLabelKeys", rd, c, a, null, b))) : t.m(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a)
}
}
};
P.prototype.removeLabelKeyForLinkData = P.prototype.uI = function (a, b) {
if (null !== b && void 0 !== b && (je(b) || t.Nb(b, "number or string", P, "removeLabelKeyForLinkData:key"), null !== a)) {
var c = this.ih;
if ("" !== c) {
var d = t.ab(a, c);
if (t.isArray(d)) {
var e = t.pz(d, b);
0 > e || (t.pi(d, e), this.si(a) && (ue(this, b, a), he(this, "linkLabelKeys", sd, c, a, b, null)))
} else void 0 !== d && t.m(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a)
}
}
};
t.g(P, "linkDataArray", P.prototype.Fi);
t.defineProperty(P, {Fi: "linkDataArray"}, function () {
return this.wg
}, function (a) {
var b = this.wg;
if (b !== a) {
t.is(a, P, "linkDataArray");
this.Kd && t.lc && (null !== b && t.Bm(b, "linkDataArray", this, !0), a = t.Bm(a, "linkDataArray", this, !1));
for (var c = t.wb(a), d = 0; d < c; d++) {
var e = t.mb(a, d);
if (!t.jb(e)) {
t.m("GraphLinksModel.linkDataArray must only contain Objects, not: " + e);
return
}
t.zs(e)
}
this.wg = a;
for (var g = new ka(Object), d = 0; d < c; d++)e = t.mb(a, d), g.add(e);
this.Kl = g;
he(this, "linkDataArray", qd, "linkDataArray", this, b, a);
for (d =
0; d < c; d++)e = t.mb(a, d), ve(this, e)
}
});
P.prototype.containsLinkData = P.prototype.si = function (a) {
return null === a ? !1 : this.Kl.contains(a)
};
P.prototype.addLinkData = P.prototype.kv = function (a) {
if (null !== a) {
this.Kd && t.jf(a, this, !1);
if (void 0 === t.jc(a))t.uc(a); else if (this.si(a))return;
this.Kl.add(a);
var b = t.wb(this.wg);
t.oi(this.wg, b, a);
he(this, "linkDataArray", rd, "linkDataArray", this, null, a, null, b);
ve(this, a)
}
};
P.prototype.addLinkDataCollection = function (a) {
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.kv(t.mb(a, c)); else for (a = a.l; a.next();)this.kv(a.value)
};
P.prototype.removeLinkData = P.prototype.vA = function (a) {
if (null !== a) {
this.Kd && t.jf(a, this, !0);
this.Kl.remove(a);
var b = this.wg.indexOf(a);
if (!(0 > b)) {
t.pi(this.wg, b);
he(this, "linkDataArray", sd, "linkDataArray", this, a, null, b, null);
b = this.wm(a);
ue(this, b, a);
b = this.xm(a);
ue(this, b, a);
var c = this.Yk(a);
if (t.isArray(c))for (var d = t.wb(c), e = 0; e < d; e++)b = t.mb(c, e), ue(this, b, a)
}
}
};
P.prototype.removeLinkDataCollection = function (a) {
if (t.isArray(a))for (var b = t.wb(a), c = 0; c < b; c++)this.vA(t.mb(a, c)); else for (a = a.l; a.next();)this.vA(a.value)
};
function ve(a, b) {
var c = a.wm(b), c = a.Dm(c);
null === a.ff(c) && le(a, c, b);
c = a.xm(b);
c = a.Dm(c);
null === a.ff(c) && le(a, c, b);
var d = a.Yk(b);
if (t.isArray(d))for (var e = t.wb(d), g = 0; g < e; g++)c = t.mb(d, g), null === a.ff(c) && le(a, c, b)
}
t.g(P, "copyLinkDataFunction", P.prototype.ZG);
t.defineProperty(P, {ZG: "copyLinkDataFunction"}, function () {
return this.Kt
}, function (a) {
var b = this.Kt;
b !== a && (null !== a && t.k(a, "function", P, "copyLinkDataFunction"), this.Kt = a, this.i("copyLinkDataFunction", b, a))
});
P.prototype.copyLinkData = P.prototype.ZC = function (a) {
if (null === a)return null;
var b = null, b = this.Kt;
if (null !== b)b = b(a, this); else {
var b = new a.constructor, c;
for (c in a)t.Pa(b, c, t.ab(a, c));
this.Kd && t.jf(b, this, !1)
}
b && (t.uc(b), "" !== this.fj && t.Pa(b, this.fj, void 0), "" !== this.ij && t.Pa(b, this.ij, void 0), "" !== this.ih && t.Pa(b, this.ih, []));
return b
};
t.g(P, "nodeIsGroupProperty", P.prototype.ep);
t.defineProperty(P, {ep: "nodeIsGroupProperty"}, function () {
return this.zu
}, function (a) {
var b = this.zu;
b !== a && (ie(a, P, "nodeIsGroupProperty"), this.zu = a, this.i("nodeIsGroupProperty", b, a))
});
P.prototype.isGroupForNodeData = P.prototype.Sz = function (a) {
if (null === a)return!1;
var b = this.zu;
return"" === b ? !1 : t.ab(a, b) ? !0 : !1
};
t.g(P, "nodeGroupKeyProperty", P.prototype.dp);
t.defineProperty(P, {dp: "nodeGroupKeyProperty"}, function () {
return this.oj
}, function (a) {
var b = this.oj;
b !== a && (ie(a, P, "nodeGroupKeyProperty"), this.oj = a, this.i("nodeGroupKeyProperty", b, a))
});
t.g(P, "copiesGroupKeyOfNodeData", P.prototype.Qk);
t.defineProperty(P, {Qk: "copiesGroupKeyOfNodeData"}, function () {
return this.wx
}, function (a) {
this.wx !== a && (t.k(a, "boolean", P, "copiesGroupKeyOfNodeData"), this.wx = a)
});
P.prototype.getGroupKeyForNodeData = P.prototype.Fo = function (a) {
if (null !== a) {
var b = this.oj;
if ("" !== b && (b = t.ab(a, b), void 0 !== b)) {
if (je(b))return b;
t.m("GroupKey value for node data " + a + " is not a number or a string: " + b)
}
}
};
P.prototype.setGroupKeyForNodeData = P.prototype.DA = function (a, b) {
null === b && (b = void 0);
void 0 === b || je(b) || t.Nb(b, "number or string", P, "setGroupKeyForNodeData:key");
if (null !== a) {
var c = this.oj;
if ("" !== c)if (this.be(a)) {
var d = t.ab(a, c);
d !== b && (ue(this, d, a), t.Pa(a, c, b), null === this.ff(b) && le(this, b, a), he(this, "nodeGroupKey", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
P.prototype.copyNodeData = P.prototype.Kj = function (a) {
if (null === a)return null;
a = C.prototype.Kj.call(this, a);
this.Qk || "" === this.oj || t.Pa(a, this.oj, void 0);
return a
};
P.prototype.setDataProperty = P.prototype.ww = function (a, b, c) {
f && (t.k(a, "object", P, "setDataProperty:data"), t.k(b, "string", P, "setDataProperty:propname"), "" === b && t.m("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.be(a))if (b === this.Ii)this.EA(a, c); else {
if (b === this.cl) {
this.uw(a, c);
return
}
if (b === this.dp) {
this.DA(a, c);
return
}
b === this.ep && t.m("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b)
} else if (this.si(a)) {
if (b ===
this.Ro) {
this.BA(a, c);
return
}
if (b === this.Wo) {
this.GA(a, c);
return
}
if (b === this.So) {
this.CA(a, c);
return
}
if (b === this.Xo) {
this.HA(a, c);
return
}
if (b === this.Qo) {
this.cF(a, c);
return
}
if (b === this.To) {
this.dF(a, c);
return
}
} else!t.yp && a instanceof Q && (t.yp = !0, t.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), t.trace(" Is that really your intent?"));
var d = t.ab(a, b);
d !== c && (t.Pa(a, b, c), this.ow(a, b, d, c))
};
aa = P.prototype;
aa.Ys = function (a, b) {
C.prototype.Ys.call(this, a, b);
for (var c = this.pc.l; c.next();)this.xA(c.value, a, b);
for (c = this.Kl.l; c.next();) {
var d = c.value, e = a, g = b;
if (this.wm(d) === e) {
var h = this.fj;
t.Pa(d, h, g);
he(this, "linkFromKey", qd, h, d, e, g);
"string" === typeof h && this.Eb(d, h)
}
this.xm(d) === e && (h = this.ij, t.Pa(d, h, g), he(this, "linkToKey", qd, h, d, e, g), "string" === typeof h && this.Eb(d, h));
var k = this.Yk(d);
if (t.isArray(k))for (var l = t.wb(k), h = this.ih, m = 0; m < l; m++)t.mb(k, m) === e && (t.IC(k, m, g), he(this, "linkLabelKeys", rd, h, d,
e, g))
}
};
aa.xA = function (a, b, c) {
if (this.Fo(a) === b) {
var d = this.oj;
t.Pa(a, d, c);
he(this, "nodeGroupKey", qd, d, a, b, c);
"string" === typeof d && this.Eb(a, d)
}
};
aa.QA = function () {
C.prototype.QA.call(this);
for (var a = this.Fi, b = t.wb(a), c = 0; c < b; c++) {
var d = t.mb(a, c);
ve(this, d)
}
};
aa.kp = function (a) {
C.prototype.kp.call(this, a);
a = this.Ib(a);
var b = ke(this, a);
if (null !== b) {
for (var c = new A(Object), b = b.l; b.next();) {
var d = b.value;
if (this.be(d)) {
if (this.Fo(d) === a) {
var e = this.oj;
he(this, "nodeGroupKey", qd, e, d, a, a);
"string" === typeof e && this.Eb(d, e);
c.add(d)
}
} else {
this.wm(d) === a && (e = this.fj, he(this, "linkFromKey", qd, e, d, a, a), "string" === typeof e && this.Eb(d, e), c.add(d));
this.xm(d) === a && (e = this.ij, he(this, "linkToKey", qd, e, d, a, a), "string" === typeof e && this.Eb(d, e), c.add(d));
var g = this.Yk(d);
if (t.isArray(g))for (var h = t.wb(g), e = this.ih, k = 0; k < h; k++)t.mb(g, k) === a && (he(this, "linkLabelKeys", rd, e, d, a, a), c.add(d))
}
}
for (c = c.l; c.next();)ue(this, a, c.value)
}
};
aa.jp = function (a) {
C.prototype.jp.call(this, a);
var b = this.Fo(a);
null === this.ff(b) && le(this, b, a)
};
aa.nt = function (a) {
C.prototype.nt.call(this, a);
var b = this.Fo(a);
ue(this, b, a)
};
t.g(P, "linkCategoryProperty", P.prototype.Qo);
t.defineProperty(P, {Qo: "linkCategoryProperty"}, function () {
return this.Kq
}, function (a) {
var b = this.Kq;
b !== a && (ie(a, P, "linkCategoryProperty"), this.Kq = a, this.i("linkCategoryProperty", b, a))
});
P.prototype.getCategoryForLinkData = P.prototype.getCategoryForLinkData = function (a) {
if (null === a)return"";
var b = this.Kq;
if ("" === b)return"";
b = t.ab(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getCategoryForLinkData found a non-string category for " + a + ": " + b);
return""
};
P.prototype.setCategoryForLinkData = P.prototype.cF = function (a, b) {
t.k(b, "string", P, "setCategoryForLinkData:cat");
if (null !== a) {
var c = this.Kq;
if ("" === c)return"";
if (this.si(a)) {
var d = t.ab(a, c);
void 0 === d && (d = "");
d !== b && (t.Pa(a, c, b), he(this, "linkCategory", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
function Dd(a) {
1 < arguments.length && t.m("TreeModel constructor can only take one optional argument, the Array of node data.");
C.call(this);
this.pj = "parent";
this.yx = !1;
this.jr = "parentLinkCategory";
void 0 !== a && (this.eg = a)
}
t.ea("TreeModel", Dd);
t.Ja(Dd, C);
Dd.prototype.toString = function (a) {
void 0 === a && (a = 0);
if (2 <= a)return this.MA();
var b = ("" !== this.name ? this.name : "") + " TreeModel";
if (0 < a) {
b += "\n node data:";
a = this.eg;
var c = t.wb(a), d;
for (d = 0; d < c; d++)var e = t.mb(a, d), b = b + (" " + this.Ib(e) + ":" + td(e))
}
return b
};
Dd.prototype.ot = function () {
var a = C.prototype.ot.call(this), b = "";
"parent" !== this.fp && "string" === typeof this.fp && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.fp));
return a + b
};
Dd.prototype.Xs = function (a) {
C.prototype.Xs.call(this, a);
a.nodeParentKeyProperty && (this.fp = a.nodeParentKeyProperty)
};
Dd.prototype.Dm = function (a) {
return a
};
t.g(Dd, "nodeParentKeyProperty", Dd.prototype.fp);
t.defineProperty(Dd, {fp: "nodeParentKeyProperty"}, function () {
return this.pj
}, function (a) {
var b = this.pj;
b !== a && (ie(a, Dd, "nodeParentKeyProperty"), this.pj = a, this.i("nodeParentKeyProperty", b, a))
});
t.g(Dd, "copiesParentKeyOfNodeData", Dd.prototype.Rk);
t.defineProperty(Dd, {Rk: "copiesParentKeyOfNodeData"}, function () {
return this.yx
}, function (a) {
this.yx !== a && (t.k(a, "boolean", Dd, "copiesParentKeyOfNodeData"), this.yx = a)
});
Dd.prototype.getParentKeyForNodeData = Dd.prototype.Ho = function (a) {
if (null !== a) {
var b = this.pj;
if ("" !== b && (b = t.ab(a, b), void 0 !== b)) {
if (je(b))return b;
t.m("ParentKey value for node data " + a + " is not a number or a string: " + b)
}
}
};
Dd.prototype.setParentKeyForNodeData = Dd.prototype.Ah = function (a, b) {
null === b && (b = void 0);
void 0 === b || je(b) || t.Nb(b, "number or string", Dd, "setParentKeyForNodeData:key");
if (null !== a) {
var c = this.pj;
if ("" !== c)if (b = this.Dm(b), this.be(a)) {
var d = t.ab(a, c);
d !== b && (ue(this, d, a), t.Pa(a, c, b), null === this.ff(b) && le(this, b, a), he(this, "nodeParentKey", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
t.g(Dd, "parentLinkCategoryProperty", Dd.prototype.qI);
t.defineProperty(Dd, {qI: "parentLinkCategoryProperty"}, function () {
return this.jr
}, function (a) {
var b = this.jr;
b !== a && (ie(a, Dd, "parentLinkCategoryProperty"), this.jr = a, this.i("parentLinkCategoryProperty", b, a))
});
Dd.prototype.getParentLinkCategoryForNodeData = Dd.prototype.AH = function (a) {
if (null === a)return"";
var b = this.jr;
if ("" === b)return"";
b = t.ab(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b);
return""
};
Dd.prototype.setParentLinkCategoryForNodeData = Dd.prototype.AI = function (a, b) {
t.k(b, "string", Dd, "setParentLinkCategoryForNodeData:cat");
if (null !== a) {
var c = this.jr;
if ("" === c)return"";
if (this.be(a)) {
var d = t.ab(a, c);
void 0 === d && (d = "");
d !== b && (t.Pa(a, c, b), he(this, "parentLinkCategory", qd, c, a, d, b), "string" === typeof c && this.Eb(a, c))
} else t.Pa(a, c, b)
}
};
Dd.prototype.copyNodeData = Dd.prototype.Kj = function (a) {
if (null === a)return null;
a = C.prototype.Kj.call(this, a);
this.Rk || "" === this.pj || t.Pa(a, this.pj, void 0);
return a
};
Dd.prototype.setDataProperty = Dd.prototype.ww = function (a, b, c) {
f && (t.k(a, "object", Dd, "setDataProperty:data"), t.k(b, "string", Dd, "setDataProperty:propname"), "" === b && t.m("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.be(a))if (b === this.Ii)this.EA(a, c); else {
if (b === this.cl) {
this.uw(a, c);
return
}
if (b === this.fp) {
this.Ah(a, c);
return
}
} else!t.yp && a instanceof Q && (t.yp = !0, t.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'),
t.trace(" Is that really your intent?"));
var d = t.ab(a, b);
d !== c && (t.Pa(a, b, c), this.ow(a, b, d, c))
};
aa = Dd.prototype;
aa.Ys = function (a, b) {
C.prototype.Ys.call(this, a, b);
for (var c = this.pc.l; c.next();)this.xA(c.value, a, b)
};
aa.xA = function (a, b, c) {
if (this.Ho(a) === b) {
var d = this.pj;
t.Pa(a, d, c);
he(this, "nodeParentKey", qd, d, a, b, c);
"string" === typeof d && this.Eb(a, d)
}
};
aa.kp = function (a) {
C.prototype.kp.call(this, a);
a = this.Ib(a);
var b = ke(this, a);
if (null !== b) {
for (var c = new A(Object), b = b.l; b.next();) {
var d = b.value;
if (this.be(d) && this.Ho(d) === a) {
var e = this.pj;
he(this, "nodeParentKey", qd, e, d, a, a);
"string" === typeof e && this.Eb(d, e);
c.add(d)
}
}
for (c = c.l; c.next();)ue(this, a, c.value)
}
};
aa.jp = function (a) {
C.prototype.jp.call(this, a);
var b = this.Ho(a), b = this.Dm(b);
null === this.ff(b) && le(this, b, a)
};
aa.nt = function (a) {
C.prototype.nt.call(this, a);
var b = this.Ho(a);
ue(this, b, a)
};
function we(a, b, c) {
t.uc(this);
void 0 === a ? a = "" : t.k(a, "string", we, "constructor:targetprop");
void 0 === b ? b = a : t.k(b, "string", we, "constructor:sourceprop");
void 0 === c ? c = null : null !== c && t.k(c, "function", we, "constructor:conv");
this.oC = "";
this.Tf = null;
this.cv = a;
this.av = this.Ry = 0;
this.lC = null;
this.Vu = b;
this.ux = c;
this.oy = xe;
this.mx = null
}
t.ea("Binding", we);
var xe;
we.OneWay = xe = t.w(we, "OneWay", 1);
var ye;
we.TwoWay = ye = t.w(we, "TwoWay", 2);
we.parseEnum = function (a, b) {
t.k(a, "function", we, "parseEnum:ctor");
t.nb(b, a, we, "parseEnum:defval");
return function (c) {
return t.tm(a, c) || b
}
};
var td;
we.toString = td = function (a) {
var b = a;
t.jb(a) && (a.text ? b = a.text : a.name ? b = a.name : void 0 !== a.key ? b = a.key : void 0 !== a.id ? b = a.id : a.constructor === Object && (a.Text ? b = a.Text : a.Name ? b = a.Name : void 0 !== a.Key ? b = a.Key : void 0 !== a.Id ? b = a.Id : void 0 !== a.ID && (b = a.ID)));
return void 0 === b ? "undefined" : null === b ? "null" : b.toString()
};
we.prototype.toString = function () {
return"Binding(" + this.Mm + " " + this.kt + ":" + this.IA + ")"
};
we.prototype.freeze = function () {
this.cb = !0;
return this
};
we.prototype.Qa = function () {
this.cb = !1;
return this
};
t.g(we, "targetId", we.prototype.Mm);
t.defineProperty(we, {Mm: null}, function () {
return this.oC
}, function (a) {
t.L(this);
t.k(a, "string", we, "targetId");
this.oC = a
});
t.g(we, "targetProperty", we.prototype.kt);
t.defineProperty(we, {kt: "targetProperty"}, function () {
return this.cv
}, function (a) {
t.L(this);
t.k(a, "string", we, "targetProperty");
this.cv = a
});
t.g(we, "sourceName", we.prototype.ht);
t.defineProperty(we, {ht: "sourceName"}, function () {
return this.lC
}, function (a) {
t.L(this);
t.k(a, "string", we, "sourceName");
this.lC = a
});
t.g(we, "sourceProperty", we.prototype.IA);
t.defineProperty(we, {IA: "sourceProperty"}, function () {
return this.Vu
}, function (a) {
t.L(this);
t.k(a, "string", we, "sourceProperty");
this.Vu = a
});
t.g(we, "converter", we.prototype.WC);
t.defineProperty(we, {WC: "converter"}, function () {
return this.ux
}, function (a) {
t.L(this);
null !== a && t.k(a, "function", we, "converter");
this.ux = a
});
t.g(we, "backConverter", we.prototype.MC);
t.defineProperty(we, {MC: "backConverter"}, function () {
return this.mx
}, function (a) {
t.L(this);
null !== a && t.k(a, "function", we, "backConverter");
this.mx = a
});
t.g(we, "mode", we.prototype.mode);
t.defineProperty(we, {mode: "mode"}, function () {
return this.oy
}, function (a) {
t.L(this);
t.nb(a, we, we, "mode");
this.oy = a
});
we.prototype.makeTwoWay = function (a) {
void 0 === a && (a = null);
null !== a && t.k(a, "function", we, "makeTwoWay");
this.mode = ye;
this.MC = a;
return this
};
we.prototype.ofObject = we.prototype.jA = function (a) {
void 0 === a && (a = "");
f && t.k(a, "string", we, "ofObject:srcname");
this.ht = a;
return this
};
we.prototype.updateTarget = we.prototype.GF = function (a, b, c) {
var d = this.Vu;
if (!c || d === c) {
c = this.cv;
var e = this.ux;
if (null !== e || "" !== c) {
f && "string" === typeof c && ("function" === typeof a.setAttribute || "_" === c[0] || t.Tv(a, c) ? "name" === c && a instanceof Q && t.trace("Binding error: cannot modify GraphObject.name on " + a.toString()) : t.trace("Binding error: undefined target property: " + c + " on " + a.toString()));
var g = b;
"" !== d && (g = t.ab(b, d));
if (void 0 !== g)if (null === e)"" !== c && t.Pa(a, c, g); else try {
if ("" !== c) {
var h = e(g, a);
f && void 0 === h && t.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e);
t.Pa(a, c, h)
} else e(g, a)
} catch (k) {
f && t.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e)
}
}
}
};
we.prototype.updateSource = we.prototype.FF = function (a, b, c, d) {
if (this.oy === ye) {
var e = this.cv;
if (!c || e === c) {
c = this.Vu;
var g = this.mx;
if (null !== g || "" !== c) {
var h = a;
"" !== e && (h = t.ab(a, e));
if (void 0 !== h)if (null === g)d && d.da ? (f && d.da.Ii === c && d.da.be(b) && t.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), d.da.ww(b, c, h)) : t.Pa(b, c, h); else try {
if ("" !== c) {
var k = g(h, b);
d && d.da ? (f && (d.da.Ii === c && d.da.be(b) && t.trace("Binding error: cannot have TwoWay Binding on node data key property: " +
this.toString()), void 0 === k && t.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), d.da.ww(b, c, k)) : t.Pa(b, c, k)
} else g(h, b)
} catch (l) {
f && t.trace("Binding error: " + l.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g)
}
}
}
}
};
function ge() {
this.bG = (new A(od)).freeze();
this.Mb = "";
this.HB = !1
}
t.ea("Transaction", ge);
ge.prototype.toString = function (a) {
var b = "Transaction: " + this.name + " " + this.rh.count.toString() + (this.Ko ? "" : ", incomplete");
if (void 0 !== a && 0 < a)for (var c = this.rh.count, d = 0; d < c; d++) {
var e = this.rh.ta(d);
null !== e && (b += "\n " + e.toString(a - 1))
}
return b
};
ge.prototype.clear = ge.prototype.clear = function () {
var a = this.rh;
a.Qa();
for (var b = a.count - 1; 0 <= b; b--) {
var c = a.ta(b);
null !== c && c.clear()
}
a.clear();
a.freeze()
};
ge.prototype.canUndo = ge.prototype.canUndo = function () {
return this.Ko
};
ge.prototype.undo = ge.prototype.undo = function () {
if (this.canUndo())for (var a = this.rh.count - 1; 0 <= a; a--) {
var b = this.rh.ta(a);
null !== b && b.undo()
}
};
ge.prototype.canRedo = ge.prototype.canRedo = function () {
return this.Ko
};
ge.prototype.redo = ge.prototype.redo = function () {
if (this.canRedo())for (var a = this.rh.count, b = 0; b < a; b++) {
var c = this.rh.ta(b);
null !== c && c.redo()
}
};
t.A(ge, {rh: "changes"}, function () {
return this.bG
});
t.g(ge, "name", ge.prototype.name);
t.defineProperty(ge, {name: "name"}, function () {
return this.Mb
}, function (a) {
this.Mb = a
});
t.g(ge, "isComplete", ge.prototype.Ko);
t.defineProperty(ge, {Ko: "isComplete"}, function () {
return this.HB
}, function (a) {
this.HB = a
});
function ud() {
this.qy = new ka(C);
this.Th = !1;
this.eG = (new A(ge)).freeze();
this.wk = -1;
this.RB = 999;
this.Uh = !1;
this.Pt = null;
this.Jk = 0;
this.nx = !1;
f && (this.nx = !0);
this.yg = (new A("string")).freeze();
this.Jn = new A("number");
this.Ox = !0
}
t.ea("UndoManager", ud);
ud.prototype.toString = function (a) {
for (var b = "UndoManager " + this.Uj + "<" + this.history.count + "<=" + this.$z, b = b + "[", c = this.wE.count, d = 0; d < c; d++)0 < d && (b += " "), b += this.wE.ta(d);
b += "]";
if (void 0 !== a && 0 < a)for (c = this.history.count, d = 0; d < c; d++)b += "\n " + this.history.ta(d).toString(a - 1);
return b
};
ud.prototype.clear = ud.prototype.clear = function () {
var a = this.history;
a.Qa();
for (var b = a.count - 1; 0 <= b; b--) {
var c = a.ta(b);
null !== c && c.clear()
}
a.clear();
this.wk = -1;
a.freeze();
this.Uh = !1;
this.Pt = null;
this.Jk = 0;
this.yg.Qa();
this.yg.clear();
this.yg.freeze();
this.Jn.clear()
};
ud.prototype.addModel = ud.prototype.vG = function (a) {
this.qy.add(a)
};
ud.prototype.removeModel = ud.prototype.vI = function (a) {
this.qy.remove(a)
};
ud.prototype.startTransaction = ud.prototype.mc = function (a) {
void 0 === a && (a = "");
null === a && (a = "");
if (this.kb)return!1;
!0 === this.Ox && (this.Ox = !1, this.Jk++, this.Fc("StartingFirstTransaction", a, this.Uk), 0 < this.Jk && this.Jk--);
this.isEnabled && (this.yg.Qa(), this.yg.add(a), this.yg.freeze(), null === this.Uk ? this.Jn.add(0) : this.Jn.add(this.Uk.rh.count));
this.Jk++;
var b = 1 === this.nl;
b && this.Fc("StartedTransaction", a, this.Uk);
return b
};
ud.prototype.commitTransaction = ud.prototype.xe = function (a) {
return ze(this, !0, a)
};
ud.prototype.rollbackTransaction = ud.prototype.$s = function () {
return ze(this, !1, "")
};
function ze(a, b, c) {
if (a.kb)return!1;
a.tz && 1 > a.nl && t.trace("Ending transaction without having started a transaction: " + c);
var d = 1 === a.nl;
d && b && a.isEnabled && a.Fc("CommittingTransaction", c, a.Uk);
var e = 0;
if (0 < a.nl && (a.Jk--, a.isEnabled)) {
var g = a.yg.count;
0 < g && ("" === c && (c = a.yg.ta(0)), a.yg.Qa(), a.yg.ud(g - 1), a.yg.freeze());
g = a.Jn.count;
0 < g && (e = a.Jn.ta(g - 1), a.Jn.ud(g - 1))
}
g = a.Uk;
if (d) {
if (b) {
if (a.isEnabled && null !== g) {
b = g;
b.Ko = !0;
b.name = c;
d = a.history;
d.Qa();
for (e = d.count - 1; e > a.Uj; e--)g = d.ta(e), null !== g && g.clear(),
d.ud(e);
e = a.$z;
0 === e && (e = 1);
0 < e && d.count >= e && (g = d.ta(0), null !== g && g.clear(), d.ud(0), a.wk--);
d.add(b);
a.wk++;
d.freeze();
g = b
}
a.Fc("CommittedTransaction", c, g)
} else {
a.Uh = !0;
try {
a.isEnabled && null !== g && (g.Ko = !0, g.undo())
} finally {
a.Fc("RolledBackTransaction", c, g), a.Uh = !1
}
null !== g && g.clear()
}
a.Pt = null;
return!0
}
if (a.isEnabled && !b && null !== g) {
a = e;
c = g.rh;
for (b = c.count - 1; b >= a; b--)d = c.ta(b), null !== d && d.undo(), c.Qa(), c.ud(b);
c.freeze()
}
return!1
}
ud.prototype.canUndo = ud.prototype.canUndo = function () {
if (!this.isEnabled || 0 < this.nl || this.kb)return!1;
var a = this.yF;
return null !== a && a.canUndo() ? !0 : !1
};
ud.prototype.undo = ud.prototype.undo = function () {
if (this.canUndo()) {
var a = this.yF;
try {
this.Fc("StartingUndo", "Undo", a), this.Uh = !0, this.wk--, a.undo()
} catch (b) {
t.trace("undo error: " + b.toString())
} finally {
this.Uh = !1, this.Fc("FinishedUndo", "Undo", a)
}
}
};
ud.prototype.canRedo = ud.prototype.canRedo = function () {
if (!this.isEnabled || 0 < this.nl || this.kb)return!1;
var a = this.xF;
return null !== a && a.canRedo() ? !0 : !1
};
ud.prototype.redo = ud.prototype.redo = function () {
if (this.canRedo()) {
var a = this.xF;
try {
this.Fc("StartingRedo", "Redo", a), this.Uh = !0, this.wk++, a.redo()
} catch (b) {
t.trace("redo error: " + b.toString())
} finally {
this.Uh = !1, this.Fc("FinishedRedo", "Redo", a)
}
}
};
ud.prototype.Fc = function (a, b, c) {
void 0 === c && (c = null);
var d = new od;
d.ed = pd;
d.propertyName = a;
d.object = c;
d.oldValue = b;
for (a = this.eI; a.next();)b = a.value, d.da = b, b.uv(d)
};
ud.prototype.handleChanged = ud.prototype.KD = function (a) {
if (this.isEnabled && !this.kb && !this.skipsEvent(a)) {
var b = this.Uk;
null === b && (this.Pt = b = new ge);
var c = a.copy(), b = b.rh;
b.Qa();
b.add(c);
b.freeze();
this.tz && 0 >= this.nl && !this.Ox && (a = a.h, null !== a && !1 === a.Nf || t.trace("Change not within a transaction: " + c.toString()))
}
};
ud.prototype.skipsEvent = function (a) {
if (null === a || 0 > a.ed.value)return!0;
a = a.object;
if (a instanceof Q) {
if (a = a.layer, null !== a && a.kc)return!0
} else if (a instanceof Sd && a.kc)return!0;
return!1
};
t.A(ud, {eI: "models"}, function () {
return this.qy.l
});
t.g(ud, "isEnabled", ud.prototype.isEnabled);
t.defineProperty(ud, {isEnabled: "isEnabled"}, function () {
return this.Th
}, function (a) {
this.Th = a
});
t.A(ud, {yF: "transactionToUndo"}, function () {
return 0 <= this.Uj && this.Uj <= this.history.count - 1 ? this.history.ta(this.Uj) : null
});
t.A(ud, {xF: "transactionToRedo"}, function () {
return this.Uj < this.history.count - 1 ? this.history.ta(this.Uj + 1) : null
});
t.A(ud, {kb: "isUndoingRedoing"}, function () {
return this.Uh
});
t.A(ud, {history: "history"}, function () {
return this.eG
});
t.g(ud, "maxHistoryLength", ud.prototype.$z);
t.defineProperty(ud, {$z: "maxHistoryLength"}, function () {
return this.RB
}, function (a) {
this.RB = a
});
t.A(ud, {Uj: "historyIndex"}, function () {
return this.wk
});
t.A(ud, {Uk: "currentTransaction"}, function () {
return this.Pt
});
t.A(ud, {nl: "transactionLevel"}, function () {
return this.Jk
});
t.A(ud, {MH: "isInTransaction"}, function () {
return 0 < this.Jk
});
t.defineProperty(ud, {tz: "checksTransactionLevel"}, function () {
return this.nx
}, function (a) {
this.nx = a
});
t.A(ud, {wE: "nestedTransactionNames"}, function () {
return this.yg
});
function oa() {
0 < arguments.length && t.m("CommandHandler constructor cannot take any arguments.");
this.ba = null;
this.vx = this.xx = this.sB = this.kB = !1;
this.Dk = this.kx = null;
this.zC = 1.05;
this.rB = 1;
this.ly = NaN;
this.PB = null;
this.AC = NaN
}
t.ea("CommandHandler", oa);
oa.prototype.toString = function () {
return"CommandHandler"
};
t.A(oa, {h: "diagram"}, function () {
return this.ba
});
oa.prototype.Ce = function (a) {
f && null !== a && t.j(a, z, oa, "setDiagram");
this.ba = a
};
oa.prototype.doKeyDown = function () {
var a = this.h;
if (null !== a) {
var b = a.R, c = a.Dl ? b.Em : b.control, d = b.shift, e = b.alt, g = b.key;
!c || "C" !== g && "Insert" !== g ? c && "X" === g || d && "Del" === g ? this.canCutSelection() && this.cutSelection() : "Del" === g ? this.canDeleteSelection() && this.deleteSelection() : c && "V" === g || d && "Insert" === g ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === g || e && d && "Backspace" === g ? this.canRedo() && this.redo() : c && "Z" === g || e && "Backspace" === g ? this.canUndo() && this.undo() : c && "A" === g ? this.canSelectAll() &&
this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.cf && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.cf && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.bf && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.bf && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.bf ? a.scroll("page", "left") : a.cf && a.scroll("page", "up") : "PageDown" === g ? d && a.bf ? a.scroll("page", "right") : a.cf && a.scroll("page", "down") : "Home" ===
g ? (b = a.gd, c && a.cf ? a.position = new v(a.position.x, b.y) : !c && a.bf && (a.position = new v(b.x, a.position.y))) : "End" === g ? (b = a.gd, d = a.lb, c && a.cf ? a.position = new v(d.x, b.bottom - d.height) : !c && a.bf && (a.position = new v(b.right - d.width, d.y))) : "Subtract" === g ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === g ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === g ? this.canResetZoom() && this.resetZoom() : d && "Z" === g ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === g ? this.canGroupSelection() && this.groupSelection() : c &&
d && "G" === g ? this.canUngroupSelection() && this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection()
}
};
oa.prototype.doKeyUp = function () {
var a = this.h;
null !== a && (a.R.bubbles = !0)
};
oa.prototype.stopCommand = function () {
var a = this.h;
if (null !== a) {
var b = a.Na;
b instanceof Ae && a.Ie && a.uz();
null !== b && b.doCancel()
}
};
oa.prototype.canStopCommand = function () {
return!0
};
oa.prototype.selectAll = function () {
var a = this.h;
if (null !== a) {
a.ra();
try {
a.Tc = "wait";
a.Ea("ChangingSelection");
for (var b = a.gp; b.next();)b.value.Za = !0;
for (b = a.Ji; b.next();)b.value.Za = !0;
for (b = a.links; b.next();)b.value.Za = !0
} finally {
a.Ea("ChangedSelection"), a.Tc = ""
}
}
};
oa.prototype.canSelectAll = function () {
var a = this.h;
return null !== a && a.Ie
};
oa.prototype.deleteSelection = function () {
var a = this.h;
if (null !== a && !a.Ea("SelectionDeleting", a.selection))try {
a.Tc = "wait";
a.mc("Delete");
a.Ea("ChangingSelection");
for (var b = new ka(B), c = a.selection.l; c.next();)Be(b, c.value, !0, this.mD ? Infinity : 0, function (a) {
return a.canDelete()
});
a.wA(b, !0);
a.Ea("SelectionDeleted", b)
} finally {
a.Ea("ChangedSelection"), a.xe("Delete"), a.Tc = ""
}
};
oa.prototype.canDeleteSelection = function () {
var a = this.h;
return null === a || a.Ua || a.Qe || !a.Nk || 0 === a.selection.count ? !1 : !0
};
function Be(a, b, c, d, e) {
if (!(a.contains(b) || (void 0 === e && (e = null), null !== e && !e(b) || b instanceof Ce)))if (a.add(b), b instanceof S) {
if (c && b instanceof U)for (var g = b.Lc; g.next();) {
var h = g.value;
Be(a, h, c, d, e)
}
for (h = b.ie; h.next();)if (g = h.value, !a.contains(g)) {
var k = g.ca, l = g.ga;
null !== k && a.contains(k) && null !== l && a.contains(l) ? Be(a, g, c, d, e) : null !== k && null !== l || Be(a, g, c, d, e)
}
if (1 < d)for (b = b.uD(); b.next();)h = b.value, Be(a, h, c, d - 1, e)
} else if (b instanceof X)for (h = b.Wj; h.next();)Be(a, h.value, c, d, e)
}
oa.prototype.copyParts = function (a, b, c) {
var d = new ia(B, B);
for (a = a.l; a.next();) {
var e = a.value;
De(this, e, b, d, c)
}
if (null !== b) {
c = b.da;
a = !1;
null !== b.zb.de && (a = b.zb.de.wi);
for (var g = new ka(X), h = new ia(X, X), k = d.l; k.next();)if (e = k.value, e instanceof X)a || null !== e.ca && null !== e.ga || g.add(e); else if (c instanceof Dd && e instanceof S && null !== e.data) {
var l = e, e = k.key, m = e.vD();
null !== m && ((m = d.wa(m)) ? (c.Ah(l.data, c.Ib(m.data)), l = b.Af(l.data), e = e.us(), null !== e && null !== l && h.add(e, l)) : c.Ah(l.data, void 0))
}
0 < g.count && b.wA(g,
!1);
if (0 < h.count)for (b = h.l; b.next();)d.add(b.key, b.value)
}
for (b = d.l; b.next();)b.value.Eb();
return d
};
function De(a, b, c, d, e) {
if (null === b || e && !b.canCopy())return null;
if (d.contains(b))return a = d.wa(b), a instanceof B ? a : null;
var g = null, h = b.data;
if (null !== h && null !== c) {
var k = c.da;
b instanceof X ? k instanceof P && (h = k.ZC(h), t.jb(h) && (k.kv(h), g = c.Af(h))) : (h = k.Kj(h), t.jb(h) && (k.dm(h), g = c.yi(h)))
} else Ee(b), g = b.copy(), null !== c && g instanceof B && c.add(g);
if (!(g instanceof B))return null;
g.Za = !1;
d.add(b, g);
if (b instanceof S) {
for (k = b.ie; k.next();) {
h = k.value;
if (h.ca === b) {
var l = d.wa(h);
null !== l && (l.ca = g)
}
h.ga === b &&
(l = d.wa(h), null !== l && (l.ga = g))
}
if (b instanceof U && g instanceof U)for (b = b.Lc; b.next();)k = De(a, b.value, c, d, e), k instanceof X || null === k || (k.ib = g)
} else if (b instanceof X)for (k = b.ca, null !== k && (k = d.wa(k), null !== k && (g.ca = k)), k = b.ga, null !== k && (k = d.wa(k), null !== k && (g.ga = k)), b = b.Wj; b.next();)k = De(a, b.value, c, d, e), null !== k && (k.kd = g);
return g
}
oa.prototype.copySelection = function () {
var a = this.h;
if (null !== a) {
for (var b = new ka(B), a = a.selection.l; a.next();)Be(b, a.value, !0, this.YC ? Infinity : 0, function (a) {
return a.canCopy()
});
this.copyToClipboard(b)
}
};
oa.prototype.canCopySelection = function () {
var a = this.h;
return null !== a && a.Ej && a.ov && 0 !== a.selection.count ? !0 : !1
};
oa.prototype.cutSelection = function () {
this.copySelection();
this.deleteSelection()
};
oa.prototype.canCutSelection = function () {
var a = this.h;
return null !== a && !a.Ua && !a.Qe && a.Ej && a.Nk && a.ov && 0 !== a.selection.count ? !0 : !1
};
oa.prototype.copyToClipboard = function (a) {
var b = this.h;
if (null !== b) {
var c = null;
if (null === a)t.js = null, t.wv = ""; else {
var c = b.da, d = !1, e = !1, g = null;
try {
c instanceof Dd && (d = c.Rk, c.Rk = this.yz), c instanceof P && (e = c.Qk, c.Qk = this.xz), g = b.copyParts(a, null, !0)
} finally {
c instanceof Dd && (c.Rk = d), c instanceof P && (c.Qk = e), c = new A(B), c.He(g), t.js = c, t.wv = b.da.qm
}
}
b.Ea("ClipboardChanged", c)
}
};
oa.prototype.pasteFromClipboard = function () {
var a = new ka(B), b = t.js;
if (null === b)return a;
var c = this.h;
if (null === c || t.wv !== c.da.qm)return a;
var d = c.da, e = !1, g = !1, h = null;
try {
d instanceof Dd && (e = d.Rk, d.Rk = this.yz), d instanceof P && (g = d.Qk, d.Qk = this.xz), h = c.copyParts(b, c, !1)
} finally {
for (d instanceof Dd && (d.Rk = e), d instanceof P && (d.Qk = g), b = h.l; b.next();)c = b.value, d = b.key, c.location.P() || (d.location.P() ? c.location = d.location : !c.position.P() && d.position.P() && (c.position = d.position)), a.add(c)
}
return a
};
oa.prototype.pasteSelection = function (a) {
var b = this.h;
if (null !== b)try {
b.Tc = "wait";
b.mc("Paste");
b.Ea("ChangingSelection");
var c = this.pasteFromClipboard();
0 < c.count && Fe(b);
for (var d = c.l; d.next();)d.value.Za = !0;
b.Ea("ChangedSelection");
if (a instanceof v) {
var e = b.computePartsBounds(b.selection);
if (e) {
var g = b.zb.de, h = g.computeEffectiveCollection(b.selection);
g.moveParts(h, new v(a.x - e.Aa, a.y - e.Ma), !1)
}
}
b.Ea("ClipboardPasted", c)
} finally {
b.xe("Paste"), b.Tc = ""
}
};
oa.prototype.canPasteSelection = function () {
var a = this.h;
return null === a || a.Ua || a.Qe || !a.em || !a.ov || null === t.js || t.wv !== a.da.qm ? !1 : !0
};
oa.prototype.undo = function () {
var a = this.h;
null !== a && a.va.undo()
};
oa.prototype.canUndo = function () {
var a = this.h;
return null === a || a.Ua || a.Qe ? !1 : a.lz && a.va.canUndo()
};
oa.prototype.redo = function () {
var a = this.h;
null !== a && a.va.redo()
};
oa.prototype.canRedo = function () {
var a = this.h;
return null === a || a.Ua || a.Qe ? !1 : a.lz && a.va.canRedo()
};
oa.prototype.decreaseZoom = function (a) {
void 0 === a && (a = 1 / this.pt);
t.o(a, oa, "decreaseZoom:factor");
var b = this.h;
null !== b && b.im === Ge && (a *= b.scale, a < b.cg || a > b.bg || (b.scale = a))
};
oa.prototype.canDecreaseZoom = function (a) {
void 0 === a && (a = 1 / this.pt);
t.o(a, oa, "canDecreaseZoom:factor");
var b = this.h;
if (null === b || b.im !== Ge)return!1;
a *= b.scale;
return a < b.cg || a > b.bg ? !1 : b.no
};
oa.prototype.increaseZoom = function (a) {
void 0 === a && (a = this.pt);
t.o(a, oa, "increaseZoom:factor");
var b = this.h;
null !== b && b.im === Ge && (a *= b.scale, a < b.cg || a > b.bg || (b.scale = a))
};
oa.prototype.canIncreaseZoom = function (a) {
void 0 === a && (a = this.pt);
t.o(a, oa, "canIncreaseZoom:factor");
var b = this.h;
if (null === b || b.im !== Ge)return!1;
a *= b.scale;
return a < b.cg || a > b.bg ? !1 : b.no
};
oa.prototype.resetZoom = function (a) {
void 0 === a && (a = this.gD);
t.o(a, oa, "resetZoom:newscale");
var b = this.h;
null === b || a < b.cg || a > b.bg || (b.scale = a)
};
oa.prototype.canResetZoom = function (a) {
void 0 === a && (a = 1);
t.o(a, oa, "canResetZoom:newscale");
var b = this.h;
return null === b || a < b.cg || a > b.bg ? !1 : b.no
};
oa.prototype.zoomToFit = function () {
var a = this.h;
if (null !== a) {
var b = a.scale, c = a.position;
b !== this.AC || isNaN(this.ly) ? (this.ly = b, this.PB = c.copy(), a.zoomToFit(), a.Hi(), this.AC = a.scale) : (a.scale = this.ly, a.position = this.PB)
}
};
oa.prototype.canZoomToFit = function () {
var a = this.h;
return null === a ? !1 : a.no
};
oa.prototype.collapseTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.mc("Collapse Tree");
var c = new A(S);
if (a instanceof S && a.Kc)a.collapseTree(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof S && d.Kc && (d.collapseTree(), c.add(d))
}
b.Ea("TreeCollapsed", c);
b.xe("Collapse Tree")
};
oa.prototype.canCollapseTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua)return!1;
if (a instanceof S) {
if (!a.Kc)return!1;
if (0 < a.Pv().count)return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof S && b.Kc && 0 < b.Pv().count)return!0;
return!1
};
oa.prototype.expandTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.mc("Expand Tree");
var c = new A(S);
if (a instanceof S && !a.Kc)a.expandTree(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof S && !d.Kc && (d.expandTree(), c.add(d))
}
b.Ea("TreeExpanded", c);
b.xe("Expand Tree")
};
oa.prototype.canExpandTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua)return!1;
if (a instanceof S) {
if (a.Kc)return!1;
if (0 < a.Pv().count)return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof S && !b.Kc && 0 < b.Pv().count)return!0;
return!1
};
oa.prototype.groupSelection = function () {
var a = this.h;
if (null !== a) {
var b = a.da;
if (null !== b && b instanceof P) {
var c = this.nz;
if (null !== c) {
var d = null;
try {
a.Tc = "wait";
a.mc("Group");
a.Ea("ChangingSelection");
for (var e = new A(B), g = a.selection.l; g.next();) {
var h = g.value;
h.Jd() && h.canGroup() && e.add(h)
}
for (var k = new A(B), l = e.l; l.next();) {
for (var m = l.value, h = !1, g = e.l; g.next();)if (m.Fs(g.value)) {
h = !0;
break
}
h || k.add(m)
}
if (0 < k.count) {
g = k.l;
g.next();
var n = g.value.ib;
if (null !== n)for (; null !== n;) {
g = k.l;
g.next();
for (e = !1; g.next();)if (m = g.value, !m.Fs(n)) {
e = !0;
break
}
if (e)n = n.ib; else break
}
if (c instanceof U)Ee(c), d = c.copy(), d instanceof U && a.add(d); else if (b.Sz(c)) {
var p = b.Kj(c);
t.jb(p) && (b.dm(p), d = a.Ov(p))
}
if (d instanceof U) {
null !== n && this.isValidMember(n, d) && (d.ib = n);
for (g = k.l; g.next();)m = g.value, this.isValidMember(d, m) && (m.ib = d);
a.select(d)
}
}
a.Ea("ChangedSelection");
a.Ea("SelectionGrouped", d)
} finally {
a.xe("Group"), a.Tc = ""
}
}
}
}
};
oa.prototype.canGroupSelection = function () {
var a = this.h;
if (null === a || a.Ua || a.Qe || !a.em || !a.fo)return!1;
var b = a.da;
if (null === b || !(b instanceof P) || null === this.nz)return!1;
for (a = a.selection.l; a.next();)if (b = a.value, b.Jd() && b.canGroup())return!0;
return!1
};
function He(a) {
var b = t.yb();
for (a = a.l; a.next();) {
var c = a.value;
c instanceof X || b.push(c)
}
a = new ka(B);
for (var c = b.length, d = 0; d < c; d++) {
for (var e = b[d], g = !0, h = 0; h < c; h++)if (e.Fs(b[h])) {
g = !1;
break
}
g && a.add(e)
}
t.xa(b);
return a
}
oa.prototype.isValidMember = function (a, b) {
if (null === b || a === b || b instanceof X)return!1;
if (null !== a) {
if (a === b || a.Fs(b))return!1;
var c = a.Ks;
if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data)return!1
}
c = this.Ks;
return null !== c ? c(a, b) : !0
};
oa.prototype.ungroupSelection = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null !== b) {
var c = b.da;
if (null !== c && c instanceof P)try {
b.Tc = "wait";
b.mc("Ungroup");
b.Ea("ChangingSelection");
var d = new A(U);
if (a instanceof U)d.add(a); else for (var e = b.selection.l; e.next();) {
var g = e.value;
g instanceof U && g.canUngroup() && d.add(g)
}
if (0 < d.count)for (b.uz(), e = d.l; e.next();) {
var h = e.value, k = h.data, l = h.ib, m = null !== l && null !== l.data ? c.Ib(l.data) : void 0, n = new A(B);
n.He(h.Lc);
for (var p = n.l; p.next();) {
var q = p.value;
if (!(q instanceof X)) {
var r = q.data;
null !== r ? c.DA(r, m) : q.ib = l;
q.Za = !0
}
}
null !== k ? c.pw(k) : b.remove(h)
}
b.Ea("ChangedSelection");
b.Ea("SelectionUngrouped", d, n)
} finally {
b.xe("Ungroup"), b.Tc = ""
}
}
};
oa.prototype.canUngroupSelection = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua || b.Qe || !b.Nk || !b.mo)return!1;
var c = b.da;
if (null === c || !(c instanceof P))return!1;
if (a instanceof U) {
if (a.canUngroup())return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof U && b.canUngroup())return!0;
return!1
};
oa.prototype.addTopLevelParts = function (a, b) {
for (var c = !0, d = He(a).l; d.next();) {
var e = d.value;
null !== e.ib && (!b || this.isValidMember(null, e) ? e.ib = null : c = !1)
}
return c
};
oa.prototype.collapseSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.mc("Collapse SubGraph");
var c = new A(U);
if (a instanceof U && a.gf)a.collapseSubGraph(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof U && d.gf && (d.collapseSubGraph(), c.add(d))
}
b.Ea("SubGraphCollapsed", c);
b.xe("Collapse SubGraph")
};
oa.prototype.canCollapseSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua)return!1;
if (a instanceof U)return a.gf ? !0 : !1;
for (a = b.selection.l; a.next();)if (b = a.value, b instanceof U && b.gf)return!0;
return!1
};
oa.prototype.expandSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.mc("Expand SubGraph");
var c = new A(U);
if (a instanceof U && !a.gf)a.expandSubGraph(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof U && !d.gf && (d.expandSubGraph(), c.add(d))
}
b.Ea("SubGraphExpanded", c);
b.xe("Expand SubGraph")
};
oa.prototype.canExpandSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua)return!1;
if (a instanceof U)return a.gf ? !1 : !0;
for (a = b.selection.l; a.next();)if (b = a.value, b instanceof U && !b.gf)return!0;
return!1
};
oa.prototype.editTextBlock = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null !== b) {
var c = b.zb.Bw;
if (null !== c) {
if (null === a) {
a = b.selection.l;
for (var d = null; a.next();) {
var e = a.value;
if (e.canEdit()) {
d = e;
break
}
}
if (null === d)return;
a = Ue(d, function (a) {
return a instanceof la && a.Hv
})
}
null !== a && a instanceof la && (c.mg = a, b.Na = c)
}
}
};
oa.prototype.canEditTextBlock = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ua || b.Qe || !b.lo || null === b.zb.Bw)return!1;
if (a instanceof la) {
if (a = a.S, null !== a && a.canEdit())return!0
} else for (b = b.selection.l; b.next();)if (a = b.value, a.canEdit() && (a = Ue(a, function (a) {
return a instanceof la && a.Hv
}), null !== a))return!0;
return!1
};
oa.prototype.showContextMenu = function (a) {
var b = this.h;
if (null !== b) {
var c = b.zb.Bv;
if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.Ya() : b), a = c.findObjectWithContextMenu(a), null !== a)) {
var d = new md, e = null;
a instanceof Q ? e = a.$a(Hb) : b.wn || (e = b.lb, e = new v(e.x + e.width / 2, e.y + e.height / 2));
null !== e && (d.Zc = b.xp(e), d.V = e, b.hc = d);
b.Na = c;
Ve(c, !1, a)
}
}
};
oa.prototype.canShowContextMenu = function (a) {
var b = this.h;
if (null === b)return!1;
var c = b.zb.Bv;
if (null === c)return!1;
void 0 === a && (a = 0 < b.selection.count ? b.selection.Ya() : b);
return null === c.findObjectWithContextMenu(a) ? !1 : !0
};
t.g(oa, "copiesTree", oa.prototype.YC);
t.defineProperty(oa, {YC: "copiesTree"}, function () {
return this.kB
}, function (a) {
this.kB = a
});
t.g(oa, "deletesTree", oa.prototype.mD);
t.defineProperty(oa, {mD: "deletesTree"}, function () {
return this.sB
}, function (a) {
this.sB = a
});
t.g(oa, "copiesParentKey", oa.prototype.yz);
t.defineProperty(oa, {yz: "copiesParentKey"}, function () {
return this.xx
}, function (a) {
this.xx !== a && (t.k(a, "boolean", oa, "copiesParentKey"), this.xx = a)
});
t.g(oa, "copiesGroupKey", oa.prototype.xz);
t.defineProperty(oa, {xz: "copiesGroupKey"}, function () {
return this.vx
}, function (a) {
this.vx !== a && (t.k(a, "boolean", oa, "copiesGroupKey"), this.vx = a)
});
t.g(oa, "archetypeGroupData", oa.prototype.nz);
t.defineProperty(oa, {nz: "archetypeGroupData"}, function () {
return this.kx
}, function (a) {
null !== a && t.j(a, Object, oa, "archetypeGroupData");
var b = this.h;
null !== b && (b = b.da, b instanceof P && (a instanceof U || b.Sz(a) || t.m("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a)));
this.kx = a
});
t.g(oa, "memberValidation", oa.prototype.Ks);
t.defineProperty(oa, {Ks: "memberValidation"}, function () {
return this.Dk
}, function (a) {
null !== a && t.k(a, "function", oa, "memberValidation");
this.Dk = a
});
t.g(oa, "defaultScale", oa.prototype.gD);
t.defineProperty(oa, {gD: "defaultScale"}, function () {
return this.rB
}, function (a) {
t.o(a, oa, "defaultScale");
0 < a || t.m("defaultScale must be larger than zero, not: " + a);
this.rB = a
});
t.g(oa, "zoomFactor", oa.prototype.pt);
t.defineProperty(oa, {pt: "zoomFactor"}, function () {
return this.zC
}, function (a) {
t.o(a, oa, "zoomFactor");
1 < a || t.m("zoomFactor must be larger than 1.0, not: " + a);
this.zC = a
});
function Td() {
0 < arguments.length && t.m("Tool constructor cannot take any arguments.");
t.uc(this);
this.ba = null;
this.Mb = "";
this.Th = !0;
this.FB = !1;
this.wC = null;
this.iv = -1
}
t.ea("Tool", Td);
Td.prototype.Ce = function (a) {
f && null !== a && t.j(a, z, Td, "setDiagram");
this.ba = a
};
Td.prototype.toString = function () {
return"" !== this.name ? this.name + " Tool" : t.Fg(Object.getPrototypeOf(this))
};
Td.prototype.updateAdornments = function () {
};
Td.prototype.canStart = function () {
return this.isEnabled
};
Td.prototype.doStart = function () {
};
Td.prototype.doActivate = function () {
this.na = !0
};
Td.prototype.doDeactivate = function () {
this.na = !1
};
Td.prototype.doStop = function () {
};
Td.prototype.doCancel = function () {
this.stopTool()
};
Td.prototype.stopTool = function () {
var a = this.h;
null !== a && a.Na === this && (a.Na = null, a.Tc = "")
};
Td.prototype.doMouseDown = function () {
!this.na && this.canStart() && this.doActivate()
};
Td.prototype.doMouseMove = function () {
};
Td.prototype.doMouseUp = function () {
this.stopTool()
};
Td.prototype.doMouseWheel = function () {
};
Td.prototype.doKeyDown = function () {
var a = this.h;
null !== a && "Esc" === a.R.key && this.doCancel()
};
Td.prototype.doKeyUp = function () {
};
Td.prototype.startTransaction = Td.prototype.mc = function (a) {
this.We = null;
var b = this.h;
return null === b ? !1 : b.mc(a)
};
Td.prototype.stopTransaction = Td.prototype.Yj = function () {
var a = this.h;
return null === a ? !1 : null === this.We ? a.$s() : a.xe(this.We)
};
Td.prototype.standardMouseSelect = function () {
var a = this.h;
if (null !== a && a.Ie) {
var b = a.R, c = a.ss(b.V, !1);
if (null !== c)if (a.Dl ? b.Em : b.control) {
a.Ea("ChangingSelection");
for (b = c; null !== b && !b.canSelect();)b = b.ib;
null !== b && (b.Za = !b.Za);
a.Ea("ChangedSelection")
} else if (b.shift) {
if (!c.Za) {
a.Ea("ChangingSelection");
for (b = c; null !== b && !b.canSelect();)b = b.ib;
null !== b && (b.Za = !0);
a.Ea("ChangedSelection")
}
} else {
if (!c.Za) {
for (b = c; null !== b && !b.canSelect();)b = b.ib;
null !== b && a.select(b)
}
} else!b.left || (a.Dl ? b.Em : b.control) ||
b.shift || a.uz()
}
};
Td.prototype.standardMouseClick = function (a, b) {
void 0 === a && (a = null);
void 0 === b && (b = function (a) {
return!a.layer.kc
});
var c = this.h;
if (null !== c) {
var d = c.R, e = c.fe(d.V, a, b);
d.Nd = e;
We(e, d, c)
}
};
function We(a, b, c) {
var d = 0;
b.left ? d = 1 === b.ve ? 1 : 2 === b.ve ? 2 : 1 : b.right && 1 === b.ve && (d = 3);
var e = "";
if (null !== a) {
switch (d) {
case 1:
e = "ObjectSingleClicked";
break;
case 2:
e = "ObjectDoubleClicked";
break;
case 3:
e = "ObjectContextClicked"
}
0 !== d && c.Ea(e, a)
} else {
switch (d) {
case 1:
e = "BackgroundSingleClicked";
break;
case 2:
e = "BackgroundDoubleClicked";
break;
case 3:
e = "BackgroundContextClicked"
}
0 !== d && c.Ea(e)
}
if (null !== a)for (; null !== a;) {
e = null;
switch (d) {
case 1:
e = a.click;
break;
case 2:
e = a.sm ? a.sm : a.click;
break;
case 3:
e = a.ms
}
if (null !==
e && (e(b, a), b.ze))break;
a = a.fa
} else {
e = null;
switch (d) {
case 1:
e = c.click;
break;
case 2:
e = c.sm ? c.sm : c.click;
break;
case 3:
e = c.ms
}
null !== e && e(b)
}
}
Td.prototype.standardMouseOver = function () {
var a = this.h;
if (null !== a) {
var b = a.R;
if (null !== b.h) {
var c = a.fe(b.V, null, null);
b.Nd = c;
var d = a.xb;
a.xb = !0;
var e = !1;
if (c !== a.so) {
var g = a.so;
a.nA = g;
a.so = c;
for (this.doCurrentObjectChanged(g, c); null !== g;) {
var h = g.eA;
if (null !== h) {
if (c === g)break;
if (null !== c && c.Ci(g))break;
h(b, g, c);
e = !0;
if (b.ze)break
}
g = g.fa
}
for (g = a.nA; null !== c;) {
h = c.dA;
if (null !== h) {
if (g === c)break;
if (null !== g && g.Ci(c))break;
h(b, c, g);
e = !0;
if (b.ze)break
}
c = c.fa
}
c = a.so
}
if (null !== c) {
g = c;
for (h = ""; null !== g;) {
h =
g.cursor;
if ("" !== h)break;
g = g.fa
}
a.Tc = h;
for (g = c; null !== g;) {
h = g.Os;
if (null !== h && (h(b, g), e = !0, b.ze))break;
g = g.fa
}
} else a.Tc = "", h = a.Os, null !== h && (h(b), e = !0);
e && a.Hf();
a.xb = d
}
}
};
Td.prototype.doCurrentObjectChanged = function () {
};
Td.prototype.standardMouseWheel = function () {
var a = this.h;
if (null !== a) {
var b = a.R, c = b.Mj;
if (0 !== c && a.gd.P()) {
var d = a.zb.Fm;
if (a.no && (d === Xe && !b.shift || d === Ye && b.control))d = a.Gh, a.Gh = b.Zc, 0 < c ? a.Le.increaseZoom() : a.Le.decreaseZoom(), a.Gh = d, b.bubbles = !1; else if (d === Xe && b.shift || d === Ye && !b.control) {
var d = a.position.copy(), e = 0 < c ? c : -c;
if (!b.shift && a.cf) {
var g = a.op, e = e / 40 * g;
0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)
} else b.shift && a.bf && (g = a.np, e = e / 40 * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel",
"right", e));
a.position.K(d) || (b.bubbles = !1)
}
}
}
};
Td.prototype.standardWaitAfter = function (a) {
t.k(a, "number", Td, "standardWaitAfter:delay");
this.cancelWaitAfter();
var b = this;
this.iv = window.setTimeout(function () {
b.doWaitAfter()
}, a)
};
Td.prototype.cancelWaitAfter = function () {
-1 !== this.iv && window.clearTimeout(this.iv);
this.iv = -1
};
Td.prototype.doWaitAfter = function () {
};
Td.prototype.findToolHandleAt = function (a, b) {
var c = this.h;
if (null === c)return null;
c = c.fe(a, null, function (a) {
a = a.S;
return null === a ? !1 : null !== a.Hc
});
if (null === c)return null;
var d = c.S;
return null === d || d.Ic !== b ? null : c
};
Td.prototype.isBeyondDragSize = function (a, b) {
var c = this.h;
if (null === c)return!1;
void 0 === a && (a = c.zc.Zc);
void 0 === b && (b = c.R.Zc);
var d = c.zb.pD, c = d.width, d = d.height;
t.KA && (c += 6, d += 6);
return Math.abs(b.x - a.x) > c || Math.abs(b.y - a.y) > d
};
t.A(Td, {h: "diagram"}, function () {
return this.ba
});
t.g(Td, "name", Td.prototype.name);
t.defineProperty(Td, {name: "name"}, function () {
return this.Mb
}, function (a) {
this.Mb = a
});
t.g(Td, "isEnabled", Td.prototype.isEnabled);
t.defineProperty(Td, {isEnabled: "isEnabled"}, function () {
return this.Th
}, function (a) {
this.Th = a
});
t.g(Td, "isActive", Td.prototype.na);
t.defineProperty(Td, {na: "isActive"}, function () {
return this.FB
}, function (a) {
this.FB = a
});
t.g(Td, "transactionResult", Td.prototype.We);
t.defineProperty(Td, {We: "transactionResult"}, function () {
return this.wC
}, function (a) {
this.wC = a
});
function Ze() {
0 < arguments.length && t.m("DraggingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "Dragging";
this.jB = !0;
this.Cl = this.Kp = this.xB = !1;
this.$x = !0;
this.Rx = (new da(NaN, NaN)).freeze();
this.Sx = yb;
this.Tx = (new v(NaN, NaN)).freeze();
this.wB = !1;
this.uB = this.iB = this.vB = this.mB = this.fi = null;
this.hq = this.IB = !1;
this.Tn = new v(NaN, NaN);
this.Wu = new v;
this.Zu = !1;
this.Uu = !0;
this.jn = 100;
this.vl = this.Ju = null
}
t.ea("DraggingTool", Ze);
t.Ja(Ze, Td);
t.g(Ze, "copiesEffectiveCollection", Ze.prototype.XC);
t.defineProperty(Ze, {XC: "copiesEffectiveCollection"}, function () {
return this.jB
}, function (a) {
this.jB = a
});
t.g(Ze, "dragsTree", Ze.prototype.qD);
t.defineProperty(Ze, {qD: "dragsTree"}, function () {
return this.xB
}, function (a) {
this.xB = a
});
t.g(Ze, "isGridSnapEnabled", Ze.prototype.Mo);
t.defineProperty(Ze, {Mo: "isGridSnapEnabled"}, function () {
return this.Cl
}, function (a) {
this.Cl !== a && (t.k(a, "boolean", Ze, "isGridSnapEnabled"), this.Cl = a)
});
t.g(Ze, "isGridSnapRealtime", Ze.prototype.XD);
t.defineProperty(Ze, {XD: "isGridSnapRealtime"}, function () {
return this.$x
}, function (a) {
this.$x !== a && (t.k(a, "boolean", Ze, "isGridSnapRealtime"), this.$x = a)
});
t.g(Ze, "gridSnapCellSize", Ze.prototype.Lz);
t.defineProperty(Ze, {Lz: "gridSnapCellSize"}, function () {
return this.Rx
}, function (a) {
this.Rx.K(a) || (t.j(a, da, Ze, "gridSnapCellSize"), this.Rx = a = a.W())
});
t.g(Ze, "gridSnapCellSpot", Ze.prototype.FD);
t.defineProperty(Ze, {FD: "gridSnapCellSpot"}, function () {
return this.Sx
}, function (a) {
this.Sx.K(a) || (t.j(a, H, Ze, "gridSnapCellSpot"), this.Sx = a = a.W())
});
t.g(Ze, "gridSnapOrigin", Ze.prototype.GD);
t.defineProperty(Ze, {GD: "gridSnapOrigin"}, function () {
return this.Tx
}, function (a) {
this.Tx.K(a) || (t.j(a, v, Ze, "gridSnapOrigin"), this.Tx = a = a.W())
});
t.g(Ze, "dragsLink", Ze.prototype.wi);
t.defineProperty(Ze, {wi: "dragsLink"}, function () {
return this.wB
}, function (a) {
this.wB = a
});
t.g(Ze, "currentPart", Ze.prototype.to);
t.defineProperty(Ze, {to: "currentPart"}, function () {
return this.mB
}, function (a) {
this.mB = a
});
t.g(Ze, "copiedParts", Ze.prototype.fd);
t.defineProperty(Ze, {fd: "copiedParts"}, function () {
return this.iB
}, function (a) {
this.iB = a
});
t.g(Ze, "draggedParts", Ze.prototype.rc);
t.defineProperty(Ze, {rc: "draggedParts"}, function () {
return this.vB
}, function (a) {
this.vB = a
});
t.g(Ze, "draggedLink", Ze.prototype.Uc);
t.defineProperty(Ze, {Uc: "draggedLink"}, function () {
return this.uB
}, function (a) {
this.uB = a
});
t.g(Ze, "isDragOutStarted", Ze.prototype.Yv);
t.defineProperty(Ze, {Yv: "isDragOutStarted"}, function () {
return this.IB
}, function (a) {
this.IB = a
});
t.g(Ze, "startPoint", Ze.prototype.Ki);
t.defineProperty(Ze, {Ki: "startPoint"}, function () {
return this.Wu
}, function (a) {
this.Wu.K(a) || (t.j(a, v, Ze, "startPoint"), this.Wu = a = a.W())
});
t.g(Ze, "delay", Ze.prototype.Fv);
t.defineProperty(Ze, {Fv: "delay"}, function () {
return this.jn
}, function (a) {
this.jn = a
});
Ze.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || !a.Ok && !a.Ej && !a.pv || !a.Ie)return!1;
var b = a.R;
return!b.left || a.Na !== this && (!this.isBeyondDragSize() || b.aw && b.timestamp - a.zc.timestamp < this.jn) ? !1 : null !== this.findDraggablePart()
};
Ze.prototype.findDraggablePart = function () {
var a = this.h;
if (null === a)return null;
a = a.ss(a.zc.V, !1);
if (null === a)return null;
for (; null !== a && !a.canSelect();)a = a.ib;
return null !== a && (a.canMove() || a.canCopy()) ? a : null
};
Ze.prototype.standardMouseSelect = function () {
var a = this.h;
if (null !== a && a.Ie) {
var b = a.ss(a.zc.V, !1);
if (null !== b) {
for (; null !== b && !b.canSelect();)b = b.ib;
this.to = b;
this.to.Za || (a.Ea("ChangingSelection"), b = a.R, (a.Dl ? b.Em : b.control) || b.shift || Fe(a), this.to.Za = !0, a.Ea("ChangedSelection"))
}
}
};
Ze.prototype.doActivate = function () {
var a = this.h;
if (null !== a) {
this.standardMouseSelect();
var b = this.to;
null !== b && (b.canMove() || b.canCopy()) && (this.na = !0, this.Tn.set(a.position), $e(this, a.selection), this.vl = this.Ju = null, this.rc = this.computeEffectiveCollection(a.selection), a.Jy = !0, af(this, this.rc), this.mc("Drag"), this.Ki = a.zc.V, a.sd = !0, a.pv && (this.Yv = !0, this.hq = !1, bf = this, cf = this.h))
}
};
function $e(a, b) {
if (a.wi) {
var c = a.h;
null !== c && c.Fj && (c.da instanceof P && 1 === b.count && b.Ya()instanceof X ? (a.Uc = b.Ya(), a.Uc.canRelinkFrom() && a.Uc.canRelinkTo() && a.Uc.ue(), a.fi = c.zb.tA, null === a.fi && (a.fi = new df, a.fi.h = c)) : (a.Uc = null, a.fi = null))
}
}
Ze.prototype.computeEffectiveCollection = function (a) {
var b = null !== this.h && this.h.Na === this, c = new ia(B, Object);
if (null === a)return c;
for (var d = a.l; d.next();) {
var e = d.value;
ef(this, c, e, b)
}
if (null !== this.Uc && this.wi)return c;
for (d = a.l; d.next();)e = d.value, e instanceof X && (a = e, b = a.ca, null === b || c.contains(b) ? (b = a.ga, null === b || c.contains(b) || c.remove(a)) : c.remove(a));
return c
};
function ff(a) {
return void 0 === a ? {point: D.bk, Iy: D.bk} : {point: a.copy(), Iy: D.bk}
}
function ef(a, b, c, d) {
if (!b.contains(c) && (!d || c.canMove() || c.canCopy()))if (c instanceof S) {
b.add(c, ff(c.location));
if (c instanceof U)for (var e = c.Lc; e.next();) {
var g = e.value;
ef(a, b, g, d)
}
for (g = c.ie; g.next();)if (e = g.value, !b.contains(e)) {
var h = e.ca, k = e.ga;
null !== h && b.contains(h) && null !== k && b.contains(k) && ef(a, b, e, d)
}
if (a.qD)for (c = c.uD(); c.next();)g = c.value, ef(a, b, g, d)
} else if (c instanceof X)for (e = c, b.add(e, ff()), g = e.Wj; g.next();)ef(a, b, g.value, d); else c instanceof Ce || b.add(c, ff(c.location))
}
Ze.prototype.doDeactivate = function () {
this.na = !1;
var a = this.h;
null !== a && gf(a);
hf(this);
sf(this, this.rc);
this.rc = null;
this.hq = this.Yv = !1;
if (0 < tf.count) {
for (var b = tf.length, c = 0; c < b; c++) {
var d = tf.p[c];
uf(d);
vf(d);
hf(d);
null !== d.h && gf(d.h)
}
tf.clear()
}
uf(this);
this.Tn.pp(NaN, NaN);
bf = cf = null;
vf(this);
a.sd = !1;
a.Jy = !1;
this.Yj()
};
function hf(a) {
var b = a.h;
if (null !== b) {
var c = b.xb;
b.xb = !0;
for (var d = b.R, e = a.vl; null !== e;) {
var g = e.cA;
if (null !== g && (g(d, e, null), d.ze))break;
e = e.fa
}
b.xb = c
}
a.Ju = null;
a.vl = null
}
Ze.prototype.doCancel = function () {
vf(this);
wf(this);
var a = this.h;
null !== a && this.Tn.P() && (a.position = this.Tn);
this.stopTool()
};
function af(a, b) {
if (null !== b) {
a.Zu = !0;
for (var c = b.l; c.next();) {
var d = c.key;
d instanceof X && (d.up = !0)
}
}
}
function sf(a, b) {
if (null !== b && a.Zu) {
for (var c = b.l; c.next();) {
var d = c.key;
d instanceof X && (d.up = !1, d.Bi ? xf(d) && d.Tb() : d.Y())
}
a.Zu = !1
}
}
Ze.prototype.doKeyDown = function () {
var a = this.h;
null !== a && (a = a.R, null !== a && this.na && ("Esc" === a.key ? this.doCancel() : this.doMouseMove()))
};
Ze.prototype.doKeyUp = function () {
var a = this.h;
null !== a && null !== a.R && this.na && this.doMouseMove()
};
function yf(a, b) {
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.l; h.next();) {
var k = h.value;
if (k.Jd()) {
var l = k.location, k = l.x, l = l.y;
isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > g && (g = l))
}
}
Infinity === c ? b.q(0, 0, 0, 0) : b.q(c, d, e - c, g - d)
}
function zf(a, b) {
if (null === a.fd) {
var c = a.h;
if (null !== c && !c.Ua && !c.Qe && null !== a.rc) {
wf(a);
c.xb = !b;
a.Kp = !b;
a.Ki = c.zc.V;
for (var c = a.XC ? c.copyParts(a.rc.ml(), c, !0) : c.copyParts(c.selection, c, !0), d = c.l; d.next();)d.value.location = d.key.location;
d = t.rf();
yf(c, d);
t.Jc(d);
for (var d = new ia(B, Object), e = a.rc.l; e.next();) {
var g = e.key;
g.Jd() && g.canCopy() && (g = c.wa(g), null !== g && (a.Kp && (g.Md = "Tool"), g.zf(), d.add(g, ff(g.location))))
}
for (c = c.l; c.next();)e = c.value, e instanceof X && e.canCopy() && d.add(e, ff());
a.fd = d;
$e(a,
d.ml());
null !== a.Uc && (c = a.Uc, d = c.aj(), c.bl(a.Ki.x - (d.x + d.width / 2), a.Ki.y - (d.y + d.height / 2)))
}
}
}
function vf(a) {
var b = a.h;
null !== b && (null !== a.fd && (b.wA(a.fd.ml(), !1), a.fd = null), b.xb = !1, a.Kp = !1, a.Ki = b.zc.V)
}
function uf(a) {
if (null !== a.Uc) {
if (a.wi && null !== a.fi) {
var b = a.fi;
b.h.remove(b.Od);
b.h.remove(b.Pd)
}
a.Uc = null;
a.fi = null
}
}
function Af(a, b, c) {
var d = a.h;
if (null !== d) {
var e = a.Ki, g = t.M();
g.assign(d.R.V);
a.moveParts(b, g.it(e), c);
t.B(g)
}
}
Ze.prototype.moveParts = function (a, b, c) {
if (null !== a && (t.j(a, ia, Ze, "moveParts:parts"), 0 !== a.count)) {
var d = t.M(), e = t.M();
e.assign(b);
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
var g = this.Zu;
g || af(this, a);
for (var h = new A, k = new A(Da), l = a.l; l.next();) {
var m = l.key;
if (m.Jd()) {
var n = Bf(this, m, a);
if (null !== n)h.add({Bc: m, info: l.value, CH: n}); else if (!c || m.canMove()) {
n = l.value.point;
d.assign(n);
var p = this.computeMove(m, d.add(e), a);
m.location = p;
l.value.Iy = p.it(n)
}
} else l.key instanceof X && k.add(l.Vd)
}
for (c = h.l; c.next();)h =
c.value, n = h.info.point, d.assign(n), h.Bc.location = d.add(h.CH.Iy);
n = t.M();
c = t.M();
for (k = k.l; k.next();)if (p = k.value, h = p.key, h instanceof X)if (h.up)if (l = h.ca, m = h.ga, null !== this.Uc && this.wi)p = p.value.point, a.add(h, ff(e)), l = b.x - p.x, m = b.y - p.y, h.bl(l, m); else {
if (null !== l) {
n.assign(l.location);
var q = a.wa(l);
null !== q && n.it(q.point)
}
null !== m && (c.assign(m.location), q = a.wa(m), null !== q && c.it(q.point));
null !== l && null !== m ? n.xi(c) ? (p = p.value.point, l = d, l.assign(n), l.it(p), a.add(h, ff(n)), h.bl(l.x, l.y)) : (h.up = !1, h.Tb()) :
(p = p.value.point, a.add(h, ff(null !== l ? n : null !== m ? c : b)), l = e.x - p.x, m = e.y - p.y, h.bl(l, m))
} else if (null === h.ca || null === h.ga)p = p.value.point, a.add(h, ff(b)), l = e.x - p.x, m = e.y - p.y, h.bl(l, m);
t.B(d);
t.B(e);
t.B(n);
t.B(c);
g || sf(this, a)
}
};
function Bf(a, b, c) {
b = b.ib;
if (null !== b) {
a = Bf(a, b, c);
if (null !== a)return a;
a = c.wa(b);
if (null !== a)return a
}
return null
}
function wf(a) {
if (null !== a.rc) {
for (var b = a.h, c = a.rc.l; c.next();) {
var d = c.key;
d.Jd() && (d.location = c.value.point)
}
for (c = a.rc.l; c.next();)if (d = c.key, d instanceof X && d.up) {
var e = c.value.point;
a.rc.add(d, ff());
d.bl(-e.x, -e.y)
}
b.vc()
}
}
Ze.prototype.computeMove = function (a, b, c, d) {
void 0 === d && (d = new v);
d.assign(b);
if (null === a)return d;
void 0 === c && (c = null);
var e = b;
if (this.Mo && (this.XD || null === c || this.h.R.Mi) && (e = t.M(), c = e, c.assign(b), null !== a)) {
var g = this.h;
if (null !== g) {
var h = g.Io, k = this.Lz, g = k.width, k = k.height, l = this.GD, m = l.x, l = l.y, n = this.FD;
if (null !== h) {
var p = h.xs;
isNaN(g) && (g = p.width);
isNaN(k) && (k = p.height);
h = h.Kz;
isNaN(m) && (m = h.x);
isNaN(l) && (l = h.y)
}
h = t.cc(0, 0);
h.ft(0, 0, g, k, n);
D.rs(b.x, b.y, m + h.x, l + h.y, g, k, c);
t.B(h)
}
}
c = null !== a.Bz ?
a.Bz(a, b, e) : e;
k = a.rE;
g = k.x;
isNaN(g) && (g = a.location.x);
k = k.y;
isNaN(k) && (k = a.location.y);
h = a.lE;
m = h.x;
isNaN(m) && (m = a.location.x);
h = h.y;
isNaN(h) && (h = a.location.y);
d.q(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h)));
e !== b && t.B(e);
return d
};
function Cf(a, b) {
if (null === b)return!0;
var c = b.S;
return null === c || c instanceof Ce || c.layer.kc || a.rc && a.rc.contains(c) || a.fd && a.fd.contains(c) ? !0 : !1
}
function Df(a, b, c, d) {
var e = a.h;
if (null !== e) {
a.wi && (null !== a.Uc && (a.Uc.ca = null, a.Uc.ga = null), Ef(a, !1));
var g = !1;
!1 === a.Uu && (g = e.xb, e.xb = !0);
var h = !1, k = Ff(e, b, null, function (b) {
return!Cf(a, b)
}), l = e.R;
l.Nd = k;
var m = e.xb;
e.xb = !0;
if (k !== a.vl) {
var n = a.vl;
a.Ju = n;
for (a.vl = k; null !== n;) {
var p = n.cA;
if (null !== p) {
if (k === n)break;
if (null !== k && k.Ci(n))break;
p(l, n, k);
h = !0;
if (l.ze)break
}
n = n.fa
}
for (n = a.Ju; null !== k;) {
p = k.sE;
if (null !== p) {
if (n === k)break;
if (null !== n && n.Ci(k))break;
p(l, k, n);
h = !0;
if (l.ze)break
}
k = k.fa
}
k = a.vl
}
null ===
k && (p = e.tE, null !== p && (p(l), h = !0));
a.doDragOver(b, k);
e.xb = m;
h && e.Hi();
!1 === a.Uu && (e.xb = g);
(e.bf || e.cf) && (c || d) && Gf(e, b)
}
}
function Sf(a, b, c) {
var d = a.fi;
if (null === d)return null;
var e = a.h.um(b, d.lA, function (a) {
return d.findValidLinkablePort(a, c)
});
a = t.M();
for (var g = Infinity, h = null, e = e.l; e.next();) {
var k = e.value;
if (null !== k.S) {
var l = k.$a(Hb, a), l = b.Nj(l);
l < g && (h = k, g = l)
}
}
t.B(a);
return h
}
function Ef(a, b) {
var c = a.Uc;
if (null !== c && !(2 > c.ka)) {
var d = a.h;
if (null !== d && !d.Ua && (d = a.fi, null !== d)) {
var e = null, g = null;
null === c.ca && (e = Sf(a, c.n(0), !1), null !== e && (g = e.S));
var h = null, k = null;
null === c.ga && (h = Sf(a, c.n(c.ka - 1), !0), null !== h && (k = h.S));
if ((null === g || g instanceof S) && (null === k || k instanceof S)) {
var l = d.isValidLink(g, e, k, h);
b ? (c.cn = c.n(0).copy(), c.gn = c.n(c.ka - 1).copy(), c.up = !1, c.ca = g, null !== e && (c.Bf = e.ld), c.ga = k, null !== h && (c.ng = h.ld)) : l ? Tf(d, g, e, k, h) : Tf(d, null, null, null, null)
}
}
}
}
Ze.prototype.doDragOver = function () {
};
function Uf(a, b) {
var c = a.h;
if (null !== c && null !== c.da) {
a.wi && Ef(a, !0);
hf(a);
var d = Ff(c, b, null, function (b) {
return!Cf(a, b)
}), e = c.R;
e.Nd = d;
if (null !== d)for (var g = d; null !== g;) {
var h = g.Ls;
if (null !== h && (h(e, g), e.ze))break;
g = g.fa
} else h = c.Ls, null !== h && h(e);
a.doDropOnto(b, d);
for (d = c.selection.l; d.next();)e = d.value, e instanceof S && Vf(c, e.ua)
}
}
Ze.prototype.doDropOnto = function () {
};
Ze.prototype.doMouseMove = function () {
if (this.na) {
var a = this.h;
if (null !== a && null !== this.to && null !== this.rc) {
var b = !1, c = !1;
this.mayCopy() ? (b = !0, zf(this, !1), Af(this, this.fd, !0)) : this.mayMove() ? (c = !0, vf(this), Af(this, this.rc, !0)) : vf(this);
Df(this, a.R.V, c, b)
}
}
};
Ze.prototype.doMouseUp = function () {
if (this.na) {
this.hq = !0;
var a = this.h;
if (null !== a) {
var b = !1, c = this.mayCopy();
c && null !== this.fd ? (wf(this), vf(this), zf(this, !0), Af(this, this.fd, !0), null !== this.fd && a.YE(this.fd.ml())) : (b = !0, vf(this), this.mayMove() && (Af(this, this.rc, !0), this.Uu = !1, Df(this, a.R.V, !0, !1), this.Uu = !0));
Uf(this, a.R.V);
if (this.na) {
this.fd = null;
if (b && null !== this.rc)for (b = this.rc.l; b.next();) {
var d = b.key;
d instanceof S && (d = d.ib, null === d || null === d.placeholder || this.rc.contains(d) || d.vz && d.Y())
}
a.vc();
sf(this, this.rc);
this.We = c ? "Copy" : "Move";
a.Ea(c ? "SelectionCopied" : "SelectionMoved", a.selection)
}
this.stopTool()
}
}
};
Ze.prototype.mayCopy = function () {
var a = this.h;
if (null === a || a.Ua || a.Qe || !a.em || !a.Ej || (a.Dl ? !a.R.Em : !a.R.control))return!1;
for (a = a.selection.l; a.next();) {
var b = a.value;
if (b.Jd() && b.canCopy())return!0
}
return null !== this.Uc && this.wi && this.Uc.canCopy() ? !0 : !1
};
Ze.prototype.mayMove = function () {
var a = this.h;
if (null === a || a.Ua || !a.Ok)return!1;
for (a = a.selection.l; a.next();) {
var b = a.value;
if (b.Jd() && b.canMove())return!0
}
return null !== this.Uc && this.wi && this.Uc.canMove() ? !0 : !1
};
var tf = new A(Ze), bf = null, cf = null;
Ze.prototype.mayCopyExternal = function () {
var a = this.h;
return null === a || !a.kz || a.Ua || a.Qe || !a.em || null === a.da ? !1 : !0
};
Ze.prototype.doSimulatedDragEnter = function () {
if (this.mayCopyExternal()) {
var a = bf;
if (null !== a) {
vf(a);
wf(a);
var b = a.h;
null !== b && a.Tn.P() && (b.position = a.Tn);
null !== b && gf(b)
}
tf.contains(this) || tf.add(this)
}
};
Ze.prototype.doSimulatedDragLeave = function () {
bf.Yv = !1;
this.doCancel()
};
Ze.prototype.doSimulatedDragOver = function () {
if (this.mayCopyExternal()) {
var a = this.h;
if (null !== a) {
var b = bf;
null !== b && null !== b.rc && (Wf(this, b.rc.ml(), !1), Af(this, this.fd, !1), Df(this, a.R.V, !1, !0))
}
}
};
Ze.prototype.doSimulatedDrop = function () {
var a = bf;
if (null !== a && (a.hq = !0, vf(this), this.mayCopyExternal())) {
var b = this.h;
null !== b && (this.mc("Drop"), Wf(this, a.rc.ml(), !0), Af(this, this.fd, !0), null !== this.fd && b.YE(this.fd.ml()), this.We = "ExternalCopy", Uf(this, b.R.V), this.fd = null, b.Ea("ExternalObjectsDropped", b.selection), this.Yj(), b.vc())
}
};
function Wf(a, b, c) {
if (null === a.fd) {
var d = a.h;
if (null !== d && !d.Ua && !d.Qe && null !== d.da) {
d.xb = !c;
a.Kp = !c;
a.Ki = d.R.V;
d = d.copyParts(b, d, !0);
c = t.rf();
yf(b, c);
var e = c.x + c.width / 2, g = c.y + c.height / 2;
t.Jc(c);
var h = a.Wu;
c = new ia(B, Object);
var k = t.M();
for (b = b.l; b.next();) {
var l = b.value;
if (l.Jd() && l.canCopy()) {
var m = l.location, l = d.wa(l);
k.q(h.x - (e - m.x), h.y - (g - m.y));
l.location = k;
a.Kp && (l.Md = "Tool");
l.zf();
c.add(l, ff(k))
}
}
t.B(k);
for (d = d.l; d.next();)e = d.value, e instanceof X && e.canCopy() && c.add(e, ff());
a.fd = c;
$e(a,
c.ml());
null !== a.Uc && (c = a.Uc, d = c.aj(), c.bl(a.Ki.x - (d.x + d.width / 2), a.Ki.y - (d.y + d.height / 2)))
}
}
}
function Xf() {
0 < arguments.length && t.m("LinkingBaseTool constructor cannot take any arguments.");
Td.call(this);
this.Cy = 100;
this.iy = !1;
var a = new X, b = new Y;
b.Di = !0;
b.stroke = "blue";
a.add(b);
b = new Y;
b.Nm = "Standard";
b.fill = "blue";
b.stroke = "blue";
a.add(b);
a.Md = "Tool";
this.Xy = a;
a = new S;
b = new Y;
b.ld = "";
b.Db = "Rectangle";
b.fill = null;
b.stroke = "magenta";
b.bb = 2;
b.ya = D.Vw;
a.add(b);
a.fl = !1;
a.Md = "Tool";
this.Vy = a;
this.Wy = b;
a = new S;
b = new Y;
b.ld = "";
b.Db = "Rectangle";
b.fill = null;
b.stroke = "magenta";
b.bb = 2;
b.ya = D.Vw;
a.add(b);
a.fl = !1;
a.Md = "Tool";
this.Yy = a;
this.Zy = b;
this.By = this.Ay = this.vy = this.uy = this.wy = null;
this.JB = !0;
this.oG = new ia(Q, "boolean");
this.fC = this.Ak = this.Sy = null
}
t.ea("LinkingBaseTool", Xf);
t.Ja(Xf, Td);
Xf.prototype.doStop = function () {
var a = this.h;
null !== a && gf(a);
this.ig = this.hg = this.gg = this.fg = this.$b = null;
this.Cw.clear();
this.qf = null
};
t.g(Xf, "portGravity", Xf.prototype.lA);
t.defineProperty(Xf, {lA: "portGravity"}, function () {
return this.Cy
}, function (a) {
this.Cy !== a && (f && t.k(a, "number", Xf, "portGravity"), 0 <= a && (this.Cy = a))
});
t.g(Xf, "isUnconnectedLinkValid", Xf.prototype.zm);
t.defineProperty(Xf, {zm: "isUnconnectedLinkValid"}, function () {
return this.iy
}, function (a) {
this.iy !== a && (f && t.k(a, "boolean", Xf, "isUnconnectedLinkValid"), this.iy = a)
});
t.g(Xf, "temporaryLink", Xf.prototype.Jf);
t.defineProperty(Xf, {Jf: "temporaryLink"}, function () {
return this.Xy
}, function (a) {
this.Xy !== a && (f && t.j(a, X, Xf, "temporaryLink"), this.Xy = a)
});
t.g(Xf, "temporaryFromNode", Xf.prototype.Od);
t.defineProperty(Xf, {Od: "temporaryFromNode"}, function () {
return this.Vy
}, function (a) {
this.Vy !== a && (f && t.j(a, S, Xf, "temporaryFromNode"), this.Vy = a)
});
t.g(Xf, "temporaryFromPort", Xf.prototype.kl);
t.defineProperty(Xf, {kl: "temporaryFromPort"}, function () {
return this.Wy
}, function (a) {
this.Wy !== a && (f && t.j(a, Q, Xf, "temporaryFromPort"), this.Wy = a)
});
t.g(Xf, "temporaryToNode", Xf.prototype.Pd);
t.defineProperty(Xf, {Pd: "temporaryToNode"}, function () {
return this.Yy
}, function (a) {
this.Yy !== a && (f && t.j(a, S, Xf, "temporaryToNode"), this.Yy = a)
});
t.g(Xf, "temporaryToPort", Xf.prototype.ll);
t.defineProperty(Xf, {ll: "temporaryToPort"}, function () {
return this.Zy
}, function (a) {
this.Zy !== a && (f && t.j(a, Q, Xf, "temporaryToPort"), this.Zy = a)
});
t.g(Xf, "originalLink", Xf.prototype.$b);
t.defineProperty(Xf, {$b: "originalLink"}, function () {
return this.wy
}, function (a) {
this.wy !== a && (f && null !== a && t.j(a, X, Xf, "originalLink"), this.wy = a)
});
t.g(Xf, "originalFromNode", Xf.prototype.fg);
t.defineProperty(Xf, {fg: "originalFromNode"}, function () {
return this.uy
}, function (a) {
this.uy !== a && (f && null !== a && t.j(a, S, Xf, "originalFromNode"), this.uy = a)
});
t.g(Xf, "originalFromPort", Xf.prototype.gg);
t.defineProperty(Xf, {gg: "originalFromPort"}, function () {
return this.vy
}, function (a) {
this.vy !== a && (f && null !== a && t.j(a, Q, Xf, "originalFromPort"), this.vy = a)
});
t.g(Xf, "originalToNode", Xf.prototype.hg);
t.defineProperty(Xf, {hg: "originalToNode"}, function () {
return this.Ay
}, function (a) {
this.Ay !== a && (f && null !== a && t.j(a, S, Xf, "originalToNode"), this.Ay = a)
});
t.g(Xf, "originalToPort", Xf.prototype.ig);
t.defineProperty(Xf, {ig: "originalToPort"}, function () {
return this.By
}, function (a) {
this.By !== a && (f && null !== a && t.j(a, Q, Xf, "originalToPort"), this.By = a)
});
t.defineProperty(Xf, {Hd: "isForwards"}, function () {
return this.JB
}, function (a) {
this.JB = a
});
t.A(Xf, {Cw: "validPortsCache"}, function () {
return this.oG
});
t.g(Xf, "targetPort", Xf.prototype.qf);
t.defineProperty(Xf, {qf: "targetPort"}, function () {
return this.Sy
}, function (a) {
this.Sy !== a && (f && null !== a && t.j(a, Q, Xf, "targetPort"), this.Sy = a)
});
Xf.prototype.copyPortProperties = function (a, b, c, d, e) {
if (null !== a && null !== b && null !== c && null !== d) {
d.ya = b.ua.size;
e ? (d.gb = b.gb, d.$j = b.$j) : (d.fb = b.fb, d.Sj = b.Sj);
c.Re = Hb;
var g = t.M();
c.location = b.$a(Hb, g);
t.B(g);
d.angle = b.Wk();
null !== this.Ws && this.Ws(a, b, c, d, e)
}
};
Xf.prototype.setNoTargetPortProperties = function (a, b, c) {
null !== b && (b.ya = D.Vw, b.fb = wb, b.gb = wb);
null !== a && (a.location = this.h.R.V);
null !== this.Ws && this.Ws(null, null, a, b, c)
};
Xf.prototype.doMouseDown = function () {
this.na && this.doMouseMove()
};
Xf.prototype.doMouseMove = function () {
if (this.na) {
var a = this.h;
if (null !== a) {
this.qf = this.findTargetPort(this.Hd);
if (null !== this.qf) {
var b = this.qf.S;
if (b instanceof S) {
this.Hd ? this.copyPortProperties(b, this.qf, this.Pd, this.ll, !0) : this.copyPortProperties(b, this.qf, this.Od, this.kl, !1);
return
}
}
this.Hd ? this.setNoTargetPortProperties(this.Pd, this.ll, !0) : this.setNoTargetPortProperties(this.Od, this.kl, !1);
(a.bf || a.cf) && Gf(a, a.R.V)
}
}
};
Xf.prototype.findValidLinkablePort = function (a, b) {
if (null === a)return null;
var c = a.S;
if (!(c instanceof S))return null;
for (; null !== a;) {
var d = b ? a.NA : a.Hz;
if (!0 === d && (null !== a.ld || a instanceof S) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a)))return a;
if (!1 === d)break;
a = a.fa
}
return null
};
Xf.prototype.findTargetPort = function (a) {
var b = this.h, c = b.R.V, d = this.lA;
0 >= d && (d = 0.1);
for (var e = this, g = b.um(c, d, function (b) {
return e.findValidLinkablePort(b, a)
}, null, !0), d = Infinity, b = null, g = g.l; g.next();) {
var h = g.value, k = h.S;
if (k instanceof S) {
var l = h.$a(Hb, t.M()), m = c.x - l.x, n = c.y - l.y;
t.B(l);
l = m * m + n * n;
l < d && (m = this.Cw.wa(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.fg, this.gg, k, h) || !a && this.isValidLink(k, h, this.hg, this.ig) ? (this.Cw.add(h, !0), b = h, d = l) : this.Cw.add(h, !1))
}
}
return null !== b && (c = b.S,
c instanceof S && (null === c.layer || c.layer.fm)) ? b : null
};
Xf.prototype.isValidFrom = function (a, b) {
if (null === a || null === b)return this.zm;
if (this.h.Na === this && (null !== a.layer && !a.layer.fm || !0 !== b.Hz))return!1;
var c = b.AD;
if (Infinity > c) {
if (null !== this.$b && a === this.fg && b === this.gg)return!0;
var d = b.ld;
null === d && (d = "");
if (a.Mv(d).count >= c)return!1
}
return!0
};
Xf.prototype.isValidTo = function (a, b) {
if (null === a || null === b)return this.zm;
if (this.h.Na === this && (null !== a.layer && !a.layer.fm || !0 !== b.NA))return!1;
var c = b.tF;
if (Infinity > c) {
if (null !== this.$b && a === this.hg && b === this.ig)return!0;
var d = b.ld;
null === d && (d = "");
if (a.Zf(d).count >= c)return!1
}
return!0
};
Xf.prototype.isInSameNode = function (a, b) {
if (null === a || null === b)return!1;
if (a === b)return!0;
var c = a.S, d = b.S;
return null !== c && c === d
};
Xf.prototype.isLinked = function (a, b) {
if (null === a || null === b)return!1;
var c = a.S;
if (!(c instanceof S))return!1;
var d = a.ld;
null === d && (d = "");
var e = b.S;
if (!(e instanceof S))return!1;
var g = b.ld;
null === g && (g = "");
for (e = e.Zf(g); e.next();)if (g = e.value, g.ca === c && g.Bf === d)return!0;
return!1
};
Xf.prototype.isValidLink = function (a, b, c, d) {
if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.zD && d.sF || !this.isInSameNode(b, d)) && (b.yD && d.rF || !this.isLinked(b, d))) || null !== this.$b && (null !== a && Yf(this, a, this.$b) || null !== c && Yf(this, c, this.$b)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !Zf(this, a, c, this.$b))return!1;
if (null !== a) {
var e = a.Yo;
if (null !== e && !e(a, b, c, d, this.$b))return!1
}
if (null !== c && (e = c.Yo, null !== e && !e(a, b, c, d, this.$b)))return!1;
e = this.Yo;
return null !== e ? e(a, b, c, d, this.$b) : !0
};
function Yf(a, b, c) {
if (null === b)return!1;
var d = b.kd;
if (null === d)return!1;
if (d === c)return!0;
var e = new ka(S);
e.add(b);
return $f(a, d, c, e)
}
function $f(a, b, c, d) {
if (b === c)return!0;
var e = b.ca;
if (null !== e && e.vh && (d.add(e), $f(a, e.kd, c, d)))return!0;
b = b.ga;
return null !== b && b.vh && (d.add(b), $f(a, b.kd, c, d)) ? !0 : !1
}
function Zf(a, b, c, d) {
if (null === b || null === c)return a.zm;
var e = a.h.HF;
if (e !== ag) {
if (e === bg) {
if (null !== d && !d.sc)return!0;
for (e = c.ie; e.next();) {
var g = e.value;
if (g !== d && g.sc && g.ga === c)return!1
}
return!cg(a, b, c, d, !0)
}
if (e === mg) {
if (null !== d && !d.sc)return!0;
for (e = b.ie; e.next();)if (g = e.value, g !== d && g.sc && g.ca === b)return!1;
return!cg(a, b, c, d, !0)
}
if (e === ng)return b === c ? a = !0 : (e = new ka(S), e.add(c), a = og(a, e, b, c, d)), !a;
if (e === pg)return!cg(a, b, c, d, !1);
if (e === qg)return b === c ? a = !0 : (e = new ka(S), e.add(c), a = rg(a, e, b, c,
d)), !a
}
return!0
}
function cg(a, b, c, d, e) {
if (b === c)return!0;
if (null === b || null === c)return!1;
for (var g = b.ie; g.next();) {
var h = g.value;
if (h !== d && (!e || h.sc) && h.ga === b && (h = h.ca, h !== b && cg(a, h, c, d, e)))return!0
}
return!1
}
function og(a, b, c, d, e) {
if (c === d)return!0;
if (null === c || null === d || b.contains(c))return!1;
b.add(c);
for (var g = c.ie; g.next();) {
var h = g.value;
if (h !== e && h.ga === c && (h = h.ca, h !== c && og(a, b, h, d, e)))return!0
}
return!1
}
function rg(a, b, c, d, e) {
if (c === d)return!0;
if (null === c || null === d || b.contains(c))return!1;
b.add(c);
for (var g = c.ie; g.next();) {
var h = g.value;
if (h !== e) {
var k = h.ca, h = h.ga, k = k === c ? h : k;
if (k !== c && rg(a, b, k, d, e))return!0
}
}
return!1
}
t.g(Xf, "linkValidation", Xf.prototype.Yo);
t.defineProperty(Xf, {Yo: "linkValidation"}, function () {
return this.Ak
}, function (a) {
null !== a && t.k(a, "function", Xf, "linkValidation");
this.Ak = a
});
t.g(Xf, "portTargeted", Xf.prototype.Ws);
t.defineProperty(Xf, {Ws: "portTargeted"}, function () {
return this.fC
}, function (a) {
null !== a && t.k(a, "function", Xf, "portTargeted");
this.fC = a
});
function pa() {
0 < arguments.length && t.m("LinkingTool constructor cannot take any arguments.");
Xf.call(this);
this.name = "Linking";
this.Ct = {};
this.Bt = null;
this.oa = sg;
this.Ny = this.My = null
}
t.ea("LinkingTool", pa);
t.Ja(pa, Xf);
var sg;
pa.Either = sg = t.w(pa, "Either", 0);
var tg;
pa.ForwardsOnly = tg = t.w(pa, "ForwardsOnly", 0);
var ug;
pa.BackwardsOnly = ug = t.w(pa, "BackwardsOnly", 0);
t.g(pa, "archetypeLinkData", pa.prototype.GC);
t.defineProperty(pa, {GC: "archetypeLinkData"}, function () {
return this.Ct
}, function (a) {
this.Ct !== a && (null !== a && t.j(a, Object, pa, "archetypeLinkData"), a instanceof Q && t.j(a, X, pa, "archetypeLinkData"), this.Ct = a)
});
t.g(pa, "archetypeLabelNodeData", pa.prototype.oz);
t.defineProperty(pa, {oz: "archetypeLabelNodeData"}, function () {
return this.Bt
}, function (a) {
this.Bt !== a && (null !== a && t.j(a, Object, pa, "archetypeLabelNodeData"), a instanceof Q && t.j(a, S, pa, "archetypeLabelNodeData"), this.Bt = a)
});
t.g(pa, "direction", pa.prototype.direction);
t.defineProperty(pa, {direction: "direction"}, function () {
return this.oa
}, function (a) {
this.oa !== a && (f && t.nb(a, pa, pa, "direction"), this.oa = a)
});
t.g(pa, "startObject", pa.prototype.JA);
t.defineProperty(pa, {JA: "startObject"}, function () {
return this.My
}, function (a) {
this.My !== a && (f && null !== a && t.j(a, Q, pa, "startObject"), this.My = a)
});
t.A(pa, {yw: "startPort"}, function () {
return this.Ny
});
pa.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ua || a.Qe || !a.fm)return!1;
var b = a.da;
return null !== b && (b instanceof P || b instanceof Dd) && a.R.left && (a.Na === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1
};
pa.prototype.findLinkablePort = function () {
var a = this.h;
if (null === a)return null;
var b = this.JA;
null === b && (b = a.fe(a.zc.V, null, null));
if (null === b || !(b.S instanceof S))return null;
var c = this.direction;
if (c === sg || c === tg)if (a = this.findValidLinkablePort(b, !1), null !== a)return this.Hd = !0, a;
if (c === sg || c === ug)if (a = this.findValidLinkablePort(b, !0), null !== a)return this.Hd = !1, a;
return null
};
pa.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (null === this.yw && (this.Ny = this.findLinkablePort()), null !== this.yw)) {
this.mc(this.name);
a.sd = !0;
a.Tc = "pointer";
if (this.Hd) {
this.gg = this.yw;
var b = this.gg.S;
b instanceof S && (this.fg = b);
this.copyPortProperties(this.fg, this.gg, this.Od, this.kl, !1)
} else this.ig = this.yw, b = this.ig.S, b instanceof S && (this.hg = b), this.copyPortProperties(this.hg, this.ig, this.Pd, this.ll, !0);
a.add(this.Od);
a.add(this.Pd);
null !== this.Jf && (null !== this.Od && (this.Jf.ca = this.Od),
null !== this.Pd && (this.Jf.ga = this.Pd), this.Jf.Tb(), a.add(this.Jf));
this.na = !0
}
};
pa.prototype.doDeactivate = function () {
this.na = !1;
var a = this.h;
null !== a && (a.remove(this.Jf), a.remove(this.Od), a.remove(this.Pd), a.sd = !1, a.Tc = "", this.Yj())
};
pa.prototype.doStop = function () {
Xf.prototype.doStop.call(this);
this.JA = this.Ny = null
};
pa.prototype.doMouseUp = function () {
if (this.na) {
var a = this.h;
if (null === a)return;
var b = this.We = null, c = null, d = null, e = null, g = this.qf = this.findTargetPort(this.Hd), h = null;
null !== g ? (h = g.S, h instanceof S && (this.Hd ? (null !== this.fg && (b = this.fg, c = this.gg), d = h, e = g) : (b = h, c = g, null !== this.hg && (d = this.hg, e = this.ig)))) : this.Hd ? null !== this.fg && this.zm && (b = this.fg, c = this.gg) : null !== this.hg && this.zm && (d = this.hg, e = this.ig);
if (null !== b || null !== d)b = this.insertLink(b, c, d, e), null !== b ? (null === g && (this.Hd ? b.gn = a.R.V.copy() :
b.cn = a.R.V.copy()), a.Ie && a.select(b), this.We = this.name, a.Ea("LinkDrawn", b)) : a.da.OC()
}
this.stopTool()
};
pa.prototype.insertLink = function (a, b, c, d) {
var e = this.h;
if (null === e)return null;
var g = e.da;
if (null === g)return null;
if (g instanceof Dd) {
var h = a;
b = c;
e.Xc || (h = c, b = a);
if (null !== h && null !== b)return g.Ah(b.data, g.Ib(h.data)), b.us()
} else if (g instanceof P)if (h = "", null !== a && (null === b && (b = a), h = b.ld, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.ld, null === b && (b = "")), d = this.GC, d instanceof X) {
if (Ee(d), g = d.copy(), g instanceof X)return g.ca = a, g.Bf = h, g.ga = c, g.ng = b, e.add(g), a = this.oz, a instanceof S && (Ee(a),
a = a.copy(), a instanceof S && (a.kd = g, e.add(a))), g
} else if (null !== d && (d = g.ZC(d), t.jb(d)))return null !== a && g.BA(d, g.Ib(a.data)), g.CA(d, h), null !== c && g.GA(d, g.Ib(c.data)), g.HA(d, b), g.kv(d), a = this.oz, null === a || a instanceof S || (a = g.Kj(a), t.jb(a) && (g.dm(a), a = g.Ib(a), void 0 !== a && g.DC(d, a))), g = e.Af(d);
return null
};
function df() {
0 < arguments.length && t.m("RelinkingTool constructor cannot take any arguments.");
Xf.call(this);
this.name = "Relinking";
var a = new Y;
a.Db = "Diamond";
a.ya = D.Ow;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.cursor = "pointer";
a.of = 0;
this.BB = a;
a = new Y;
a.Db = "Diamond";
a.ya = D.Ow;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.cursor = "pointer";
a.of = -1;
this.sC = a;
this.Qb = null;
this.cC = new w
}
t.ea("RelinkingTool", df);
t.Ja(df, Xf);
df.prototype.updateAdornments = function (a) {
if (null !== a && a instanceof X) {
var b = "RelinkFrom", c = null;
if (a.Za && !this.h.Ua) {
var d = a.dt;
null !== d && a.canRelinkFrom() && a.ua.P() && a.ub() && d.ua.P() && d.al() && (c = a.xo(b), null === c && (c = this.makeAdornment(d, !1), c.Ic = b, c.$k = !0), null !== c && (c.Y(), a.Kk(b, c)))
}
null === c && a.el(b);
b = "RelinkTo";
c = null;
a.Za && !this.h.Ua && (d = a.dt, null !== d && a.canRelinkTo() && a.ua.P() && a.ub() && d.ua.P() && d.al() && (c = a.xo(b), null === c && (c = this.makeAdornment(d, !0), c.Ic = b, c.$k = !0), null !== c && (c.Y(), a.Kk(b,
c))));
null === c && a.el(b)
}
};
df.prototype.makeAdornment = function (a, b) {
var c = new Ce;
c.type = vg;
var d = b ? this.JI : this.xH;
null !== d && c.add(d.copy());
c.Hc = a;
return c
};
t.defineProperty(df, {xH: "fromHandleArchetype"}, function () {
return this.BB
}, function (a) {
a && t.j(a, Q, df, "fromHandleArchetype");
this.BB = a
});
t.defineProperty(df, {JI: "toHandleArchetype"}, function () {
return this.sC
}, function (a) {
a && t.j(a, Q, df, "toHandleArchetype");
this.sC = a
});
t.A(df, {handle: "handle"}, function () {
return this.Qb
});
df.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ua || a.Qe || !a.Fj)return!1;
var b = a.da;
if (null === b || !(b instanceof P || b instanceof Dd) || !a.R.left)return!1;
b = this.findToolHandleAt(a.zc.V, "RelinkFrom");
null === b && (b = this.findToolHandleAt(a.zc.V, "RelinkTo"));
return null !== b
};
df.prototype.doActivate = function () {
var a = this.h;
if (null !== a) {
if (null === this.$b) {
var b = this.findToolHandleAt(a.zc.V, "RelinkFrom");
null === b && (b = this.findToolHandleAt(a.zc.V, "RelinkTo"));
if (null === b)return;
var c = b.S;
if (!(c instanceof Ce && c.Cj instanceof X))return;
this.Qb = b;
this.Hd = null === c || "RelinkTo" === c.Ic;
this.$b = c.Cj
}
this.mc(this.name);
a.sd = !0;
a.Tc = "pointer";
this.gg = this.$b.Vc;
this.fg = this.$b.ca;
this.ig = this.$b.Qd;
this.hg = this.$b.ga;
this.cC.set(this.$b.ua);
null !== this.$b && 0 < this.$b.ka && (null === this.$b.ca &&
(null !== this.kl && (this.kl.ya = D.Qm), null !== this.Od && (this.Od.location = this.$b.n(0))), null === this.$b.ga && (null !== this.ll && (this.ll.ya = D.Qm), null !== this.Pd && (this.Pd.location = this.$b.n(this.$b.ka - 1))));
this.copyPortProperties(this.fg, this.gg, this.Od, this.kl, !1);
this.copyPortProperties(this.hg, this.ig, this.Pd, this.ll, !0);
a.add(this.Od);
a.add(this.Pd);
null !== this.Jf && (null !== this.Od && (this.Jf.ca = this.Od), null !== this.Pd && (this.Jf.ga = this.Pd), this.copyLinkProperties(this.$b, this.Jf), this.Jf.Tb(), a.add(this.Jf));
this.na = !0
}
};
df.prototype.copyLinkProperties = function (a, b) {
if (null !== a && null !== b) {
b.eo = a.eo;
b.Cv = a.Cv;
var c = a.ye;
if (c === wg || c === xg)c = yg;
b.ye = c;
b.ns = a.ns;
b.at = a.at;
b.Lm = a.Lm;
b.fb = a.fb;
b.Sj = a.Sj;
b.Co = a.Co;
b.Do = a.Do;
b.gb = a.gb;
b.$j = a.$j;
b.vp = a.vp;
b.wp = a.wp
}
};
df.prototype.doDeactivate = function () {
this.na = !1;
var a = this.h;
null !== a && (a.remove(this.Jf), a.remove(this.Od), a.remove(this.Pd), a.sd = !1, a.Tc = "", this.Yj())
};
df.prototype.doStop = function () {
Xf.prototype.doStop.call(this);
this.Qb = null
};
df.prototype.doMouseUp = function () {
if (this.na) {
var a = this.h;
if (null === a)return;
this.We = null;
var b = this.fg, c = this.gg, d = this.hg, e = this.ig, g = this.$b;
this.qf = this.findTargetPort(this.Hd);
if (null !== this.qf) {
var h = this.qf.S;
h instanceof S && (this.Hd ? (d = h, e = this.qf) : (b = h, c = this.qf))
} else this.zm ? this.Hd ? e = d = null : c = b = null : g = null;
null !== g && (this.reconnectLink(g, this.Hd ? d : b, this.Hd ? e : c, this.Hd), null === this.qf && (this.Hd ? g.gn = a.R.V.copy() : g.cn = a.R.V.copy(), g.Tb()), a.Ie && (g.Za = !0), this.We = this.name, a.Ea("LinkRelinked",
g, this.Hd ? this.ig : this.gg));
zg(this.$b, this.cC)
}
this.stopTool()
};
df.prototype.reconnectLink = function (a, b, c, d) {
if (null === this.h)return!1;
c = null !== c && null !== c.ld ? c.ld : "";
d ? (a.ga = b, a.ng = c) : (a.ca = b, a.Bf = c);
return!0
};
function Tf(a, b, c, d, e) {
null !== b ? (a.copyPortProperties(b, c, a.Od, a.kl, !1), a.h.add(a.Od)) : a.h.remove(a.Od);
null !== d ? (a.copyPortProperties(d, e, a.Pd, a.ll, !0), a.h.add(a.Pd)) : a.h.remove(a.Pd)
}
function Ag() {
0 < arguments.length && t.m("LinkReshapingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "LinkReshaping";
var a = new Y;
a.Db = "Rectangle";
a.ya = D.Dp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
this.uk = a;
a = new Y;
a.Db = "Diamond";
a.ya = D.Dp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
this.SB = a;
this.hC = 3;
this.jx = this.Qb = null;
this.dC = new v;
this.yy = null
}
t.ea("LinkReshapingTool", Ag);
t.Ja(Ag, Td);
var Bg;
Ag.None = Bg = t.w(Ag, "None", 0);
var Fg;
Ag.Horizontal = Fg = t.w(Ag, "Horizontal", 1);
var Gg;
Ag.Vertical = Gg = t.w(Ag, "Vertical", 2);
var Hg;
Ag.All = Hg = t.w(Ag, "All", 3);
function Ig(a, b) {
t.j(a, Q, Ag, "setReshapingBehavior:obj");
t.nb(b, Ag, Ag, "setReshapingBehavior:behavior");
a.Ku = b
}
Ag.prototype.updateAdornments = function (a) {
if (null !== a && a instanceof X) {
if (a.Za && !this.h.Ua) {
var b = a.path;
if (null !== b && a.canReshape() && a.ua.P() && a.ub() && b.ua.P() && b.al()) {
var c = a.xo(this.name);
if (null === c || c.hG !== a.ka || c.qG !== a.ip)c = this.makeAdornment(b), c.$k = !0, c.hG = a.ka, c.qG = a.ip;
if (null !== c) {
c.location = a.position;
c.Y();
a.Kk(this.name, c);
return
}
}
}
a.el(this.name)
}
};
Ag.prototype.makeAdornment = function (a) {
var b = a.S, c = b.ka, d = b.Ub, e = null;
if (null !== b.points && 1 < c) {
e = new Ce;
e.type = vg;
var c = b.vs, g = b.bw, h = d ? 1 : 0;
if (b.ip && b.ye !== Jg)for (var k = c + h; k < g - h; k++) {
var l = this.makeResegmentHandle(a, k);
null !== l && (l.of = k, l.bt = 0.5, e.add(l))
}
for (k = c + 1; k < g; k++)if (l = this.makeHandle(a, k), null !== l) {
l.of = k;
if (k !== c)if (k === c + 1 && d) {
var h = b.n(c), m = b.n(c + 1);
D.I(h.x, m.x) && D.I(h.y, m.y) && (m = b.n(c - 1));
D.I(h.x, m.x) ? (Ig(l, Gg), l.cursor = "n-resize") : D.I(h.y, m.y) && (Ig(l, Fg), l.cursor = "w-resize")
} else k ===
g - 1 && d ? (h = b.n(g - 1), m = b.n(g), D.I(h.x, m.x) && D.I(h.y, m.y) && (h = b.n(g + 1)), D.I(h.x, m.x) ? (Ig(l, Gg), l.cursor = "n-resize") : D.I(h.y, m.y) && (Ig(l, Fg), l.cursor = "w-resize")) : k !== g && (Ig(l, Hg), l.cursor = "move");
e.add(l)
}
e.Ic = this.name;
e.Hc = a
}
return e
};
Ag.prototype.makeHandle = function () {
var a = this.ys;
return null === a ? null : a.copy()
};
t.defineProperty(Ag, {ys: "handleArchetype"}, function () {
return this.uk
}, function (a) {
a && t.j(a, Q, Ag, "handleArchetype");
this.uk = a
});
Ag.prototype.makeResegmentHandle = function () {
var a = this.cI;
return null === a ? null : a.copy()
};
t.defineProperty(Ag, {cI: "midHandleArchetype"}, function () {
return this.SB
}, function (a) {
a && t.j(a, Q, Ag, "midHandleArchetype");
this.SB = a
});
t.A(Ag, {handle: "handle"}, function () {
return this.Qb
});
t.A(Ag, {es: "adornedLink"}, function () {
return this.jx
});
Ag.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ua && a.ho && a.R.left ? null !== this.findToolHandleAt(a.zc.V, this.name) : !1
};
Ag.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (this.Qb = this.findToolHandleAt(a.zc.V, this.name), null !== this.Qb)) {
var b = this.Qb.S.Cj;
if (b instanceof X) {
this.jx = b;
a.sd = !0;
this.mc(this.name);
if (b.ip && 0.5 === this.Qb.bt) {
var c = b.points.copy(), d = this.Qb.$a(Hb);
c.Fd(this.Qb.of + 1, d);
b.Ub && c.Fd(this.Qb.of + 1, d);
b.points = c;
b.ue();
b.updateAdornments();
this.Qb = this.findToolHandleAt(a.zc.V, this.name)
}
this.dC = b.n(this.Qb.of);
this.yy = b.points.copy();
this.na = !0
}
}
};
Ag.prototype.doDeactivate = function () {
this.Yj();
this.jx = this.Qb = null;
var a = this.h;
null !== a && (a.sd = !1);
this.na = !1
};
Ag.prototype.doCancel = function () {
var a = this.es;
null !== a && (a.points = this.yy);
this.stopTool()
};
Ag.prototype.doMouseMove = function () {
var a = this.h;
this.na && null !== a && (a = this.computeReshape(a.R.V), this.reshape(a))
};
Ag.prototype.doMouseUp = function () {
var a = this.h;
if (this.na && null !== a) {
var b = this.computeReshape(a.R.V);
this.reshape(b);
b = this.es;
if (null !== b && b.ip) {
var c = this.handle.of, d = b.n(c - 1), e = b.n(c), g = b.n(c + 1);
if (b.Ub) {
if (c > b.vs + 1 && c < b.bw - 1) {
var h = b.n(c - 2);
if (Math.abs(d.x - e.x) < this.zh && Math.abs(d.y - e.y) < this.zh && (Kg(this, h, d, e, g, !0) || Kg(this, h, d, e, g, !1))) {
var k = b.points.copy();
Kg(this, h, d, e, g, !0) ? (k.jg(c - 2, new v(h.x, (g.y + h.y) / 2)), k.jg(c + 1, new v(g.x, (g.y + h.y) / 2))) : (k.jg(c - 2, new v((g.x + h.x) / 2, h.y)), k.jg(c + 1, new v((g.x +
h.x) / 2, g.y)));
k.ud(c);
k.ud(c - 1);
b.points = k;
b.ue();
b.updateAdornments()
} else h = b.n(c + 2), Math.abs(e.x - g.x) < this.zh && Math.abs(e.y - g.y) < this.zh && (Kg(this, d, e, g, h, !0) || Kg(this, d, e, g, h, !1)) && (k = b.points.copy(), Kg(this, d, e, g, h, !0) ? (k.jg(c - 1, new v(d.x, (d.y + h.y) / 2)), k.jg(c + 2, new v(h.x, (d.y + h.y) / 2))) : (k.jg(c - 1, new v((d.x + h.x) / 2, d.y)), k.jg(c + 2, new v((d.x + h.x) / 2, h.y))), k.ud(c + 1), k.ud(c), b.points = k, b.ue(), b.updateAdornments())
}
} else h = t.M(), D.Gm(d.x, d.y, g.x, g.y, e.x, e.y, h) && 9 > h.Nj(e) && (k = b.points.copy(), k.ud(c),
b.points = k, b.ue(), b.updateAdornments()), t.B(h)
}
a.vc();
this.We = this.name;
a.Ea("LinkReshaped", this.es)
}
this.stopTool()
};
function Kg(a, b, c, d, e, g) {
return g ? Math.abs(b.y - c.y) < a.zh && Math.abs(c.y - d.y) < a.zh && Math.abs(d.y - e.y) < a.zh : Math.abs(b.x - c.x) < a.zh && Math.abs(c.x - d.x) < a.zh && Math.abs(d.x - e.x) < a.zh
}
t.g(Ag, "resegmentingDistance", Ag.prototype.zh);
t.defineProperty(Ag, {zh: "resegmentingDistance"}, function () {
return this.hC
}, function (a) {
this.hC = a
});
Ag.prototype.reshape = function (a) {
var b = this.es;
b.il();
var c = this.handle.of, d = this.handle && this.handle.Ku ? this.handle.Ku : Bg;
if (b.Ub)if (c === b.vs + 1)c = b.vs + 1, d === Gg ? (b.U(c, b.n(c - 1).x, a.y), b.U(c + 1, b.n(c + 2).x, a.y)) : d === Fg && (b.U(c, a.x, b.n(c - 1).y), b.U(c + 1, a.x, b.n(c + 2).y)); else if (c === b.bw - 1)c = b.bw - 1, d === Gg ? (b.U(c - 1, b.n(c - 2).x, a.y), b.U(c, b.n(c + 1).x, a.y)) : d === Fg && (b.U(c - 1, a.x, b.n(c - 2).y), b.U(c, a.x, b.n(c + 1).y)); else {
var d = c, e = b.n(d), g = b.n(d - 1), h = b.n(d + 1);
D.I(g.x, e.x) && D.I(e.y, h.y) ? (D.I(g.x, b.n(d - 2).x) && !D.I(g.y,
b.n(d - 2).y) ? (b.C(d, a.x, g.y), c++, d++) : b.U(d - 1, a.x, g.y), D.I(h.y, b.n(d + 2).y) && !D.I(h.x, b.n(d + 2).x) ? b.C(d + 1, h.x, a.y) : b.U(d + 1, h.x, a.y)) : D.I(g.y, e.y) && D.I(e.x, h.x) ? (D.I(g.y, b.n(d - 2).y) && !D.I(g.x, b.n(d - 2).x) ? (b.C(d, g.x, a.y), c++, d++) : b.U(d - 1, g.x, a.y), D.I(h.x, b.n(d + 2).x) && !D.I(h.y, b.n(d + 2).y) ? b.C(d + 1, a.x, h.y) : b.U(d + 1, a.x, h.y)) : D.I(g.x, e.x) && D.I(e.x, h.x) ? (D.I(g.x, b.n(d - 2).x) && !D.I(g.y, b.n(d - 2).y) ? (b.C(d, a.x, g.y), c++, d++) : b.U(d - 1, a.x, g.y), D.I(h.x, b.n(d + 2).x) && !D.I(h.y, b.n(d + 2).y) ? b.C(d + 1, a.x, h.y) : b.U(d + 1, a.x,
h.y)) : D.I(g.y, e.y) && D.I(e.y, h.y) && (D.I(g.y, b.n(d - 2).y) && !D.I(g.x, b.n(d - 2).x) ? (b.C(d, g.x, a.y), c++, d++) : b.U(d - 1, g.x, a.y), D.I(h.y, b.n(d + 2).y) && !D.I(h.x, b.n(d + 2).x) ? b.C(d + 1, h.x, a.y) : b.U(d + 1, h.x, a.y));
b.U(c, a.x, a.y)
} else b.U(c, a.x, a.y), 1 === c && b.computeSpot(!0).hd() && (e = b.ca, g = b.Vc, d = g.$a(Hb, t.M()), e = b.getLinkPointFromPoint(e, g, d, a, !0, t.M()), b.U(0, e.x, e.y), t.B(d), t.B(e)), c === b.ka - 2 && b.computeSpot(!1).hd() && (c = b.ga, e = b.Qd, d = e.$a(Hb, t.M()), e = b.getLinkPointFromPoint(c, e, d, a, !1, t.M()), b.U(b.ka - 1, e.x, e.y), t.B(d),
t.B(e));
b.ri()
};
Ag.prototype.computeReshape = function (a) {
var b = this.es, c = this.handle.of;
switch (this.handle && this.handle.Ku ? this.handle.Ku : Bg) {
case Hg:
return a;
case Gg:
return b = b.n(c), new v(b.x, a.y);
case Fg:
return b = b.n(c), new v(a.x, b.y);
default:
case Bg:
return b.n(c)
}
};
t.g(Ag, "originalPoint", Ag.prototype.mI);
t.A(Ag, {mI: "originalPoint"}, function () {
return this.dC
});
t.g(Ag, "originalPoints", Ag.prototype.nI);
t.A(Ag, {nI: "originalPoints"}, function () {
return this.yy
});
function Lg() {
0 < arguments.length && t.m("ResizingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "Resizing";
this.Wd = (new da(1, 1)).freeze();
this.lj = (new da(9999, 9999)).freeze();
this.Qi = (new da(NaN, NaN)).freeze();
this.Cl = !1;
this.Ga = null;
var a = new Y;
a.Dj = Hb;
a.Db = "Rectangle";
a.ya = D.Dp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.bb = 1;
a.cursor = "pointer";
this.uk = a;
this.Qb = null;
this.Ln = 0;
this.iG = new w;
this.Fu = new da;
this.xy = new v;
this.Nx = new da(0, 0);
this.Mx = new da(Infinity, Infinity);
this.Lx =
new da(1, 1)
}
t.ea("ResizingTool", Lg);
t.Ja(Lg, Td);
Lg.prototype.updateAdornments = function (a) {
if (!(null === a || a instanceof X)) {
if (a.Za && !this.h.Ua) {
var b = a.NE;
if (null !== b && a.canResize() && a.ua.P() && a.ub() && b.ua.P() && b.al()) {
var c = a.xo(this.name);
null === c && (c = this.makeAdornment(b), c.$k = !0);
if (null !== c) {
var d = b.Wk();
c.angle = d;
var e = b.$a(c.Re, t.M()), g = b.Tj();
c.location = e;
t.B(e);
e = c.placeholder;
if (null !== e) {
var b = b.Oa, h = t.jl();
h.q(b.width * g, b.height * g);
e.ya = h;
t.Rj(h)
}
Mg(this, c, d);
a.Kk(this.name, c);
return
}
}
}
a.el(this.name)
}
};
Lg.prototype.makeAdornment = function (a) {
var b = null, b = a.S.LE;
if (null === b) {
b = new Ce;
b.type = Ng;
b.Re = Hb;
var c = new Og;
c.Di = !0;
b.add(c);
b.add(this.makeHandle(a, yb));
b.add(this.makeHandle(a, Gb));
b.add(this.makeHandle(a, Pb));
b.add(this.makeHandle(a, Jb));
b.add(this.makeHandle(a, Qb));
b.add(this.makeHandle(a, Tb));
b.add(this.makeHandle(a, Ub));
b.add(this.makeHandle(a, Sb))
} else if (Ee(b), b = b.copy(), !(b instanceof Ce))return null;
b.Ic = this.name;
b.Hc = a;
return b
};
Lg.prototype.makeHandle = function (a, b) {
var c = this.ys;
if (null === c)return null;
c = c.copy();
c.alignment = b;
return c
};
function Mg(a, b, c) {
if (null !== b)if (!b.alignment.Ac() && "" !== b.cursor)a:{
a = b.alignment;
a.hd() && (a = Hb);
if (0 >= a.x)c = 0 >= a.y ? c + 225 : 1 <= a.y ? c + 135 : c + 180; else if (1 <= a.x)0 >= a.y ? c += 315 : 1 <= a.y && (c += 45); else if (0 >= a.y)c += 270; else if (1 <= a.y)c += 90; else break a;
0 > c ? c += 360 : 360 <= c && (c -= 360);
b.cursor = 22.5 > c ? "e-resize" : 67.5 > c ? "se-resize" : 112.5 > c ? "s-resize" : 157.5 > c ? "sw-resize" : 202.5 > c ? "w-resize" : 247.5 > c ? "nw-resize" : 292.5 > c ? "n-resize" : 337.5 > c ? "ne-resize" : "e-resize"
} else if (b instanceof y)for (b = b.elements; b.next();)Mg(a,
b.value, c)
}
t.defineProperty(Lg, {ys: "handleArchetype"}, function () {
return this.uk
}, function (a) {
a && t.j(a, Q, Lg, "handleArchetype");
this.uk = a
});
t.A(Lg, {handle: "handle"}, function () {
return this.Qb
});
t.defineProperty(Lg, {Hc: "adornedObject"}, function () {
return this.Ga
}, function (a) {
a && t.j(a, Q, Lg, "adornedObject");
this.Ga = a
});
Lg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ua && a.io && a.R.left ? null !== this.findToolHandleAt(a.zc.V, this.name) ? !0 : !1 : !1
};
Lg.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.Qb = this.findToolHandleAt(a.zc.V, this.name), null !== this.Qb && (this.Ga = this.Qb.S.Hc, this.Ln = this.Ga.angle, this.iG.set(this.Ga.Oa), this.xy.set(this.Ga.S.location), this.Fu.set(this.Ga.ya), this.Lx = this.computeCellSize(), this.Nx = this.computeMinSize(), this.Mx = this.computeMaxSize(), a.sd = !0, this.mc(this.name), this.na = !0))
};
Lg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (this.Yj(), this.Ga = this.Qb = null, this.na = a.sd = !1)
};
Lg.prototype.doCancel = function () {
this.Ga.ya = this.Fu;
this.Ga.S.location = this.xy;
this.stopTool()
};
Lg.prototype.doMouseMove = function () {
var a = this.h;
if (this.na && null !== a) {
var b = this.Nx, c = this.Mx, d = this.Lx, e = this.Ga.DD(a.R.V, t.M()), g = Pg;
this.Ga instanceof Y && (g = this.Ga.Rv, g === Qg && (g = this.Ga.La.fc));
b = this.computeResize(e, this.Qb.alignment, b, c, d, !(g === Rg || g === Sg || a.R.shift));
this.resize(b);
a.Hi();
t.B(e)
}
};
Lg.prototype.doMouseUp = function () {
var a = this.h;
if (this.na && null !== a) {
var b = this.Nx, c = this.Mx, d = this.Lx, e = this.Ga.DD(a.R.V, t.M()), g = Pg;
this.Ga instanceof Y && (g = this.Ga.Rv, g === Qg && (g = this.Ga.La.fc));
b = this.computeResize(e, this.Qb.alignment, b, c, d, !(g === Rg || g === Sg || a.R.shift));
this.resize(b);
t.B(e);
a.vc();
this.We = this.name;
a.Ea("PartResized", this.Ga, this.Fu)
}
this.stopTool()
};
Lg.prototype.resize = function (a) {
if (null !== this.h) {
var b = this.Ga.S, c = b.position.copy(), d = this.Ga.Oa.copy(), e = this.Ga.Wk(), g = this.Ga.Tj();
360 <= e ? e -= 360 : 0 > e && (e += 360);
var h = Math.PI * e / 180, k = Math.cos(h), h = Math.sin(h), l = a.width - d.width, d = a.height - d.height, m = 90 < e && 270 > e ? 1 : 0;
c.x += g * ((a.x + l * m) * k - (a.y + d * (0 < e && 180 > e ? 1 : 0)) * h);
c.y += g * ((a.x + l * (180 < e && 360 > e ? 1 : 0)) * h + (a.y + d * m) * k);
this.Ga.ya = a.size;
b.zf();
b.move(c)
}
};
Lg.prototype.computeResize = function (a, b, c, d, e, g) {
b.hd() && (b = Hb);
var h = this.Ga.Oa, k = h.x, l = h.y, m = h.x + h.width, n = h.y + h.height, p = 1;
if (!g) {
var p = h.width, q = h.height;
0 >= p && (p = 1);
0 >= q && (q = 1);
p = q / p
}
q = t.M();
D.rs(a.x, a.y, k, l, e.width, e.height, q);
a = h.copy();
0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) :
(a.width = a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, g || (a.height = p * a.width, a.y = l + 0.5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y,
n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), g || (a.height = p * a.width, a.y = l + 0.5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, g || (a.width =
a.height / p, a.x = k + 0.5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (a.width = a.height / p, a.x = k + 0.5 * (m - k - a.width)));
t.B(q);
return a
};
Lg.prototype.computeMinSize = function () {
var a = this.Ga.Te.copy(), b = this.Te;
!isNaN(b.width) && b.width > a.width && (a.width = b.width);
!isNaN(b.height) && b.height > a.height && (a.height = b.height);
return a
};
Lg.prototype.computeMaxSize = function () {
var a = this.Ga.Be.copy(), b = this.Be;
!isNaN(b.width) && b.width < a.width && (a.width = b.width);
!isNaN(b.height) && b.height < a.height && (a.height = b.height);
return a
};
Lg.prototype.computeCellSize = function () {
var a = new da(NaN, NaN), b = this.Ga.S;
if (b) {
var c = b.ME;
!isNaN(c.width) && 0 < c.width && (a.width = c.width);
!isNaN(c.height) && 0 < c.height && (a.height = c.height)
}
c = this.Pk;
isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width);
isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height);
b = this.h;
(isNaN(a.width) || isNaN(a.height)) && b && (c = b.zb.de, null !== c && c.Mo && (c = c.Lz, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) &&
0 < c.height && (a.height = c.height)), b = b.Io, null !== b && b.visible && this.Mo && (c = b.xs, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height)));
if (isNaN(a.width) || 0 === a.width || Infinity === a.width)a.width = 1;
if (isNaN(a.height) || 0 === a.height || Infinity === a.height)a.height = 1;
return a
};
t.g(Lg, "minSize", Lg.prototype.Te);
t.defineProperty(Lg, {Te: "minSize"}, function () {
return this.Wd
}, function (a) {
this.Wd.K(a) || (f && t.j(a, da, Lg, "minSize"), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), this.Wd.assign(a))
});
t.g(Lg, "maxSize", Lg.prototype.Be);
t.defineProperty(Lg, {Be: "maxSize"}, function () {
return this.lj
}, function (a) {
this.lj.K(a) || (f && t.j(a, da, Lg, "maxSize"), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), this.lj.assign(a))
});
t.g(Lg, "cellSize", Lg.prototype.Pk);
t.defineProperty(Lg, {Pk: "cellSize"}, function () {
return this.Qi
}, function (a) {
this.Qi.K(a) || (f && t.j(a, da, Lg, "cellSize"), this.Qi.assign(a))
});
t.g(Lg, "isGridSnapEnabled", Lg.prototype.Mo);
t.defineProperty(Lg, {Mo: "isGridSnapEnabled"}, function () {
return this.Cl
}, function (a) {
this.Cl !== a && (t.k(a, "boolean", Lg, "isGridSnapEnabled"), this.Cl = a)
});
t.g(Lg, "originalDesiredSize", Lg.prototype.kI);
t.A(Lg, {kI: "originalDesiredSize"}, function () {
return this.Fu
});
t.g(Lg, "originalLocation", Lg.prototype.lI);
t.A(Lg, {lI: "originalLocation"}, function () {
return this.xy
});
function Tg() {
0 < arguments.length && t.m("RotatingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "Rotating";
this.Ly = 45;
this.Ky = 2;
this.Ga = null;
var a = new Y;
a.Db = "Ellipse";
a.ya = D.Ow;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.bb = 1;
a.cursor = "pointer";
this.uk = a;
this.Qb = null;
this.Ln = 0;
this.iC = new v
}
t.ea("RotatingTool", Tg);
t.Ja(Tg, Td);
Tg.prototype.updateAdornments = function (a) {
if (!(null === a || a instanceof X)) {
if (a.Za && !this.h.Ua) {
var b = a.SE;
if (null !== b && a.canRotate() && a.ua.P() && a.ub() && b.ua.P() && b.al()) {
var c = a.xo(this.name);
null === c && (c = this.makeAdornment(b), c.$k = !0);
if (null !== c) {
c.angle = b.Wk();
var d = null, e = null;
b === a || b === a.Zb ? (d = a.Zb, e = a.Re) : (d = b, e = Hb);
for (var g = d.Oa, e = t.cc(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;)d.transform.Ra(e), d = d.fa;
var d = e.y, g = Math.max(e.x - b.Oa.width, 0), h = t.M();
c.location = b.$a(new H(1,
0, 50 + g, d), h);
t.B(h);
t.B(e);
a.Kk(this.name, c);
return
}
}
}
a.el(this.name)
}
};
Tg.prototype.makeAdornment = function (a) {
var b = null, b = a.S.RE;
if (null === b) {
b = new Ce;
b.type = Ug;
b.Re = Hb;
var c = this.ys;
null !== c && b.add(c.copy())
} else if (Ee(b), b = b.copy(), !(b instanceof Ce))return null;
b.Ic = this.name;
b.Hc = a;
return b
};
t.defineProperty(Tg, {ys: "handleArchetype"}, function () {
return this.uk
}, function (a) {
a && t.j(a, Q, Tg, "handleArchetype");
this.uk = a
});
t.A(Tg, {handle: "handle"}, function () {
return this.Qb
});
t.defineProperty(Tg, {Hc: "adornedObject"}, function () {
return this.Ga
}, function (a) {
a && t.j(a, Q, Tg, "adornedObject");
this.Ga = a
});
Tg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ua && a.jo && a.R.left ? null !== this.findToolHandleAt(a.zc.V, this.name) ? !0 : !1 : !1
};
Tg.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (this.Qb = this.findToolHandleAt(a.zc.V, this.name), null !== this.Qb)) {
this.Ga = this.Qb.S.Hc;
var b = this.Ga.S, c = b.Zb;
this.iC = this.Ga === b || this.Ga === c ? c.$a(b.Re) : this.Ga.$a(Hb);
this.Ln = this.Ga.angle;
a.sd = !0;
this.mc(this.name);
this.na = !0
}
};
Tg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (this.Yj(), this.Ga = this.Qb = null, this.na = a.sd = !1)
};
Tg.prototype.doCancel = function () {
this.rotate(this.Ln);
this.stopTool()
};
Tg.prototype.doMouseMove = function () {
var a = this.h;
this.na && null !== a && (a = this.computeRotate(a.R.V), this.rotate(a))
};
Tg.prototype.doMouseUp = function () {
var a = this.h;
if (this.na && null !== a) {
var b = this.computeRotate(a.R.V);
this.rotate(b);
a.vc();
this.We = this.name;
a.Ea("PartRotated", this.Ga, this.Ln)
}
this.stopTool()
};
Tg.prototype.rotate = function (a) {
t.o(a, Tg, "rotate:newangle");
null !== this.Ga && (this.Ga.angle = a)
};
Tg.prototype.computeRotate = function (a) {
a = this.iC.ui(a);
var b = this.Ga.fa;
b && (a -= b.Wk(), 360 <= a ? a -= 360 : 0 > a && (a += 360));
var b = Math.min(Math.abs(this.kF), 180), c = Math.min(Math.abs(this.jF), b / 2);
!this.h.R.shift && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b));
360 <= a ? a -= 360 : 0 > a && (a += 360);
return a
};
t.g(Tg, "snapAngleMultiple", Tg.prototype.kF);
t.defineProperty(Tg, {kF: "snapAngleMultiple"}, function () {
return this.Ly
}, function (a) {
this.Ly !== a && (f && t.k(a, "number", Tg, "snapAngleMultiple"), this.Ly = a)
});
t.g(Tg, "snapAngleEpsilon", Tg.prototype.jF);
t.defineProperty(Tg, {jF: "snapAngleEpsilon"}, function () {
return this.Ky
}, function (a) {
this.Ky !== a && (f && t.k(a, "number", Tg, "snapAngleEpsilon"), this.Ky = a)
});
t.g(Tg, "originalAngle", Tg.prototype.jI);
t.A(Tg, {jI: "originalAngle"}, function () {
return this.Ln
});
function Vg() {
0 < arguments.length && t.m("ClickSelectingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "ClickSelecting"
}
t.ea("ClickSelectingTool", Vg);
t.Ja(Vg, Td);
Vg.prototype.canStart = function () {
return!this.isEnabled || null === this.h || this.isBeyondDragSize() ? !1 : !0
};
Vg.prototype.doMouseUp = function () {
this.na && (this.standardMouseSelect(), this.standardMouseClick());
this.stopTool()
};
function Wg() {
0 < arguments.length && t.m("ActionTool constructor cannot take any arguments.");
Td.call(this);
this.name = "Action";
this.Tm = null
}
t.ea("ActionTool", Wg);
t.Ja(Wg, Td);
Wg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a)return!1;
var b = a.R, c = a.fe(b.V, function (a) {
for (; null !== a.fa && !a.Wv;)a = a.fa;
return a
}, function (a) {
return a.Wv
});
return null !== c ? (this.Tm = c, a.so = a.fe(b.V, null, null), !0) : !1
};
Wg.prototype.doMouseDown = function () {
if (this.na) {
var a = this.h.R, b = this.Tm;
null !== b && (a.Nd = b, null !== b.fz && b.fz(a, b))
} else this.canStart() && this.doActivate()
};
Wg.prototype.doMouseMove = function () {
if (this.na) {
var a = this.h.R, b = this.Tm;
null !== b && (a.Nd = b, null !== b.gz && b.gz(a, b))
}
};
Wg.prototype.doMouseUp = function () {
if (this.na) {
var a = this.h, b = a.R, c = this.Tm;
if (null === c)return;
b.Nd = c;
null !== c.hz && c.hz(b, c);
this.isBeyondDragSize() || We(c, b, a)
}
this.stopTool()
};
Wg.prototype.doCancel = function () {
var a = this.h;
if (null !== a) {
var a = a.R, b = this.Tm;
if (null === b)return;
a.Nd = b;
null !== b.ez && b.ez(a, b)
}
this.stopTool()
};
Wg.prototype.doStop = function () {
this.Tm = null
};
function qa() {
0 < arguments.length && t.m("ClickCreatingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "ClickCreating";
this.Ni = null;
this.Zx = !0;
this.AB = new v(0, 0)
}
t.ea("ClickCreatingTool", qa);
t.Ja(qa, Td);
qa.prototype.canStart = function () {
if (!this.isEnabled || null === this.fs)return!1;
var a = this.h;
if (null === a || a.Ua || a.Qe || !a.em || !a.R.left || this.isBeyondDragSize())return!1;
if (this.WD) {
if (1 === a.R.ve && (this.AB = a.R.Zc.copy()), 2 !== a.R.ve || this.isBeyondDragSize(this.AB))return!1
} else if (1 !== a.R.ve)return!1;
return a.Na !== this && null !== a.ss(a.R.V, !0) ? !1 : !0
};
qa.prototype.doMouseUp = function () {
var a = this.h;
this.na && null !== a && this.insertPart(a.R.V);
this.stopTool()
};
qa.prototype.insertPart = function (a) {
var b = this.h;
if (null === b)return null;
var c = this.fs;
if (null === c)return null;
this.mc(this.name);
var d = null;
c instanceof B ? c.Jd() && (Ee(c), d = c.copy(), d instanceof B && b.add(d)) : null !== c && (c = b.da.Kj(c), t.jb(c) && (b.da.dm(c), d = b.yi(c)));
d instanceof B && (d.location = a, b.Ie && b.select(d));
b.vc();
this.We = this.name;
b.Ea("PartCreated", d);
this.Yj();
return d instanceof B ? d : null
};
t.g(qa, "archetypeNodeData", qa.prototype.fs);
t.defineProperty(qa, {fs: "archetypeNodeData"}, function () {
return this.Ni
}, function (a) {
this.Ni !== a && (null !== a && t.j(a, Object, qa, "archetypeNodeData"), this.Ni = a)
});
t.g(qa, "isDoubleClick", qa.prototype.WD);
t.defineProperty(qa, {WD: "isDoubleClick"}, function () {
return this.Zx
}, function (a) {
this.Zx !== a && (t.k(a, "boolean", qa, "isDoubleClick"), this.Zx = a)
});
function Xg() {
0 < arguments.length && t.m("ContextMenuTool constructor cannot take any arguments.");
Td.call(this);
this.name = "ContextMenu";
this.lB = null;
this.VB = new v;
this.hn = null;
if (!0 === t.KA) {
this.hn = new Ce;
this.Cx = null;
var a = this;
this.tC = function () {
a.stopTool()
};
if (!1 === t.eD) {
var b = document.createElement("div"), c = document.createElement("div");
b.style.cssText = "top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";
c.style.cssText = "z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);";
var d = document.createElement("style");
document.getElementsByTagName("head")[0].appendChild(d);
d.sheet.insertRule(".defaultCXul { list-style: none; }", 0);
d.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0);
d.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",
0);
b.addEventListener("contextmenu", function (a) {
a.preventDefault();
return!1
}, !1);
b.addEventListener("selectstart", function (a) {
a.preventDefault();
return!1
}, !1);
c.addEventListener("contextmenu", function (a) {
a.preventDefault();
return!1
}, !1);
document.body && (document.body.appendChild(b), document.body.appendChild(c));
t.ls = b;
t.ks = c;
t.eD = !0
}
}
}
t.ea("ContextMenuTool", Xg);
t.Ja(Xg, Td);
Xg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null === a || this.isBeyondDragSize() || !a.R.right ? !1 : (null === this.hn || a.R.event instanceof MouseEvent) && null === this.findObjectWithContextMenu() ? !1 : !0
};
Xg.prototype.doStart = function () {
var a = this.h;
null !== a && this.VB.set(a.zc.V)
};
Xg.prototype.doStop = function () {
this.hideDefaultContextMenu();
this.hideContextMenu()
};
Xg.prototype.findObjectWithContextMenu = function (a) {
var b = this.h;
if (null === b)return null;
var c = b.R, d = null, d = void 0 !== a ? a : b.fe(c.V, null, function (a) {
return!a.layer.kc
});
if (null !== d) {
for (a = d; null !== a;) {
c = a.contextMenu;
if (null !== c)return a;
a = a.fa
}
if (null !== this.hn && !(b.R.event instanceof MouseEvent))return d.S
} else if (c = b.contextMenu, null !== c)return b;
return null
};
Xg.prototype.doActivate = function () {
};
Xg.prototype.doMouseDown = function () {
if (this.na) {
var a = this.h;
if (null !== a && null !== this.ef) {
var b = a.fe(a.R.V, null, null);
null !== b && b.Ci(this.ef) ? (this.standardMouseClick(null, null), this.stopTool()) : (this.stopTool(), a.Na.doMouseDown())
}
}
};
Xg.prototype.doMouseUp = function () {
this.na || this.canStart() && Ve(this, !0)
};
function Ve(a, b, c) {
a.na = !0;
b && a.standardMouseSelect();
a.standardMouseClick();
void 0 === c && (c = a.findObjectWithContextMenu());
null !== c ? (b = c.contextMenu, null !== b ? a.showContextMenu(b, c instanceof Q ? c : null) : a.showDefaultContextMenu()) : a.showDefaultContextMenu()
}
Xg.prototype.doMouseMove = function () {
this.na && this.standardMouseOver()
};
Xg.prototype.showContextMenu = function (a, b) {
t.j(a, Ce, Xg, "showContextMenu:contextmenu");
null !== b && t.j(b, Q, Xg, "showContextMenu:obj");
var c = this.h;
if (null !== c) {
a !== this.ef && this.hideContextMenu();
a.Md = "Tool";
a.fl = !1;
a.scale = 1 / c.scale;
a.Ic = this.name;
c.add(a);
if (null !== b) {
var c = null, d = b.Bo();
null !== d && (c = d.data);
a.Hc = b;
a.data = c
} else a.data = c.da;
a.zf();
this.positionContextMenu(a, b);
this.ef = a
}
};
Xg.prototype.positionContextMenu = function (a) {
var b = this.h;
if (null !== b) {
var c = b.R.V.copy(), d = a.Ba, e = b.lb;
b.R.aw && (c.x -= d.width);
c.x + d.width > e.right && (c.x -= d.width + 5);
c.x < e.x && (c.x = e.x);
c.y + d.height > e.bottom && (c.y -= d.height + 5);
c.y < e.y && (c.y = e.y);
a.position = c
}
};
Xg.prototype.hideContextMenu = function () {
var a = this.h;
null !== a && null !== this.ef && (this.ef.data = null, this.ef.Hc = null, a.remove(this.ef), this.ef = null, this.standardMouseOver())
};
Xg.prototype.initializeDefaultButtons = function () {
if (null === this.h)return null;
var a = new A, b = this.h.Le;
a.add({text: "Copy", yf: function () {
b.copySelection()
}, visible: function () {
return b.canCopySelection()
}});
a.add({text: "Cut", yf: function () {
b.cutSelection()
}, visible: function () {
return b.canCutSelection()
}});
a.add({text: "Delete", yf: function () {
b.deleteSelection()
}, visible: function () {
return b.canDeleteSelection()
}});
a.add({text: "Paste", yf: function (a) {
b.pasteSelection(a.R.V)
}, visible: function () {
return b.canPasteSelection()
}});
a.add({text: "Select All", yf: function () {
b.selectAll()
}, visible: function () {
return b.canSelectAll()
}});
a.add({text: "Undo", yf: function () {
b.undo()
}, visible: function () {
return b.canUndo()
}});
a.add({text: "Redo", yf: function () {
b.redo()
}, visible: function () {
return b.canRedo()
}});
a.add({text: "Zoom Out", yf: function () {
b.decreaseZoom()
}, visible: function () {
return b.canDecreaseZoom()
}});
a.add({text: "Zoom In", yf: function () {
b.increaseZoom()
}, visible: function () {
return b.canIncreaseZoom()
}});
a.add({text: "Zoom To Fit",
yf: function () {
b.zoomToFit()
}, visible: function () {
return b.canZoomToFit()
}});
a.add({text: "Reset Zoom", yf: function () {
b.resetZoom()
}, visible: function () {
return b.canResetZoom()
}});
a.add({text: "Group Selection", yf: function () {
b.groupSelection()
}, visible: function () {
return b.canGroupSelection()
}});
a.add({text: "Ungroup Selection", yf: function () {
b.ungroupSelection()
}, visible: function () {
return b.canUngroupSelection()
}});
a.add({text: "Edit Text", yf: function () {
b.editTextBlock()
}, visible: function () {
return b.canEditTextBlock()
}});
return a
};
Xg.prototype.showDefaultContextMenu = function () {
var a = this.h;
if (null !== a) {
null === this.Cx && (this.Cx = this.initializeDefaultButtons());
this.hn !== this.ef && this.hideContextMenu();
t.ls.innerHTML = "";
t.ks.addEventListener("click", this.tC, !1);
var b = this, c = document.createElement("ul");
c.className = "defaultCXul";
t.ls.appendChild(c);
c.innerHTML = "";
for (var d = this.Cx.l; d.next();) {
var e = d.value, g = e.text, h = e.visible;
if ("function" !== typeof h || h()) {
h = document.createElement("li");
h.className = "defaultCXli";
var k = document.createElement("a");
k.className = "defaultCXa";
k.href = "#";
k.cG = e.yf;
k.addEventListener("click", function (c) {
this.cG(a);
b.stopTool();
c.preventDefault();
return!1
}, !1);
k.textContent = g;
h.appendChild(k);
c.appendChild(h)
}
}
t.ls.style.display = "block";
t.ks.style.display = "block";
this.ef = this.hn
}
};
Xg.prototype.hideDefaultContextMenu = function () {
null !== this.ef && this.ef === this.hn && (t.ls.style.display = "none", t.ks.style.display = "none", t.ks.removeEventListener("click", this.tC, !1), this.ef = null)
};
t.g(Xg, "currentContextMenu", Xg.prototype.ef);
t.defineProperty(Xg, {ef: "currentContextMenu"}, function () {
return this.lB
}, function (a) {
this.lB = a
});
t.A(Xg, {nJ: "mouseDownPoint"}, function () {
return this.VB
});
function Yg() {
0 < arguments.length && t.m("DragSelectingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "DragSelecting";
this.jn = 175;
this.MB = !1;
var a = new B;
a.Md = "Tool";
a.fl = !1;
var b = new Y;
b.name = "SHAPE";
b.Db = "Rectangle";
b.fill = null;
b.stroke = "magenta";
a.add(b);
this.Wm = a
}
t.ea("DragSelectingTool", Yg);
t.Ja(Yg, Td);
Yg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || !a.Ie)return!1;
var b = a.R;
return!b.left || a.Na !== this && (!this.isBeyondDragSize() || b.timestamp - a.zc.timestamp < this.Fv || null !== a.ss(b.V, !0)) ? !1 : !0
};
Yg.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.na = !0, a.sd = !0, a.xb = !0, a.add(this.Yf), this.doMouseMove())
};
Yg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (a.remove(this.Yf), a.xb = !1, this.na = a.sd = !1)
};
Yg.prototype.doMouseMove = function () {
if (null !== this.h && this.na && null !== this.Yf) {
var a = this.computeBoxBounds(), b = this.Yf.ee("SHAPE");
null === b && (b = this.Yf.Nv());
b.ya = a.size;
this.Yf.position = a.position
}
};
Yg.prototype.doMouseUp = function () {
if (this.na) {
var a = this.h;
a.remove(this.Yf);
try {
a.Tc = "wait", this.selectInRect(this.computeBoxBounds())
} finally {
a.Tc = ""
}
}
this.stopTool()
};
Yg.prototype.computeBoxBounds = function () {
var a = this.h;
return null === a ? new w(0, 0, 0, 0) : new w(a.zc.V, a.R.V)
};
Yg.prototype.selectInRect = function (a) {
var b = this.h;
if (null !== b) {
var c = b.R;
b.Ea("ChangingSelection");
a = b.Qj(a, null, function (a) {
return a instanceof B && a.canSelect()
}, this.aE);
if (b.Dl ? c.Em : c.control)if (c.shift)for (a = a.l; a.next();)c = a.value, c.Za && (c.Za = !1); else for (a = a.l; a.next();)c = a.value, c.Za = !c.Za; else {
if (!c.shift) {
for (var d = new A(B), e = b.selection.l; e.next();)c = e.value, a.contains(c) || d.add(c);
for (d = d.l; d.next();)c = d.value, c.Za = !1
}
for (a = a.l; a.next();)c = a.value, c.Za || (c.Za = !0)
}
b.Ea("ChangedSelection")
}
};
t.g(Yg, "delay", Yg.prototype.Fv);
t.defineProperty(Yg, {Fv: "delay"}, function () {
return this.jn
}, function (a) {
this.jn = a
});
t.g(Yg, "isPartialInclusion", Yg.prototype.aE);
t.defineProperty(Yg, {aE: "isPartialInclusion"}, function () {
return this.MB
}, function (a) {
this.MB = a
});
t.g(Yg, "box", Yg.prototype.Yf);
t.defineProperty(Yg, {Yf: "box"}, function () {
return this.Wm
}, function (a) {
this.Wm = a
});
function Zg() {
0 < arguments.length && t.m("PanningTool constructor cannot take any arguments.");
Td.call(this);
this.name = "Panning";
this.zy = new v;
this.Pi = !1;
var a = this;
this.nC = function () {
document.removeEventListener("scroll", a.nC, !1);
a.stopTool()
}
}
t.ea("PanningTool", Zg);
t.Ja(Zg, Td);
Zg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null === a || !a.bf && !a.cf || !a.R.left || a.Na !== this && !this.isBeyondDragSize() ? !1 : !0
};
Zg.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.Pi ? (a.R.bubbles = !0, document.addEventListener("scroll", this.nC, !1)) : (a.Tc = "move", a.sd = !0, this.zy = a.position.copy()), this.na = !0)
};
Zg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (a.Tc = "", this.na = a.sd = !1, a.ra())
};
Zg.prototype.doCancel = function () {
var a = this.h;
null !== a && (a.position = this.zy, a.sd = !1);
this.stopTool()
};
Zg.prototype.doMouseMove = function () {
this.move()
};
Zg.prototype.doMouseUp = function () {
this.move();
this.stopTool()
};
Zg.prototype.move = function () {
var a = this.h;
if (this.na && a)if (this.Pi)a.R.bubbles = !0; else {
var b = a.position, c = a.zc.V, d = a.R.V, e = b.x + c.x - d.x, c = b.y + c.y - d.y;
a.bf || (e = b.x);
a.cf || (c = b.y);
a.position = new v(e, c)
}
};
t.g(Zg, "bubbles", Zg.prototype.bubbles);
t.defineProperty(Zg, {bubbles: "bubbles"}, function () {
return this.Pi
}, function (a) {
this.Pi = a
});
t.g(Zg, "originalPosition", Zg.prototype.oI);
t.A(Zg, {oI: "originalPosition"}, function () {
return this.zy
});
function $g() {
0 < arguments.length && t.m("TextEditingTool constructor cannot take any arguments.");
Td.call(this);
this.name = "TextEditing";
this.Dx = this.nB = this.$y = this.qC = null;
this.Oy = ah;
this.xj = null;
this.eb = bh;
this.Ek = null
}
t.ea("TextEditingTool", $g);
t.Ja($g, Td);
var ch;
$g.LostFocus = ch = t.w($g, "LostFocus", 0);
var dh;
$g.MouseDown = dh = t.w($g, "MouseDown", 1);
var eh;
$g.Tab = eh = t.w($g, "Tab", 2);
var fh;
$g.Enter = fh = t.w($g, "Enter", 3);
$g.SingleClick = t.w($g, "SingleClick", 0);
var ah;
$g.SingleClickSelected = ah = t.w($g, "SingleClickSelected", 1);
var bh = t.w($g, "StateNone", 0), gh = t.w($g, "StateActive", 1), hh = t.w($g, "StateEditing", 2), ih = t.w($g, "StateEditing2", 3), jh = t.w($g, "StateValidating", 4), kh = t.w($g, "StateValidated", 5);
t.g($g, "textBlock", $g.prototype.mg);
t.defineProperty($g, {mg: "textBlock"}, function () {
return this.$y
}, function (a) {
this.$y = a
});
t.g($g, "currentTextEditor", $g.prototype.Eg);
t.defineProperty($g, {Eg: "currentTextEditor"}, function () {
return this.nB
}, function (a) {
this.nB = a
});
t.g($g, "defaultTextEditor", $g.prototype.hD);
t.defineProperty($g, {hD: "defaultTextEditor"}, function () {
return this.Dx
}, function (a) {
this.Dx = a
});
t.g($g, "starting", $g.prototype.lF);
t.defineProperty($g, {lF: "starting"}, function () {
return this.Oy
}, function (a) {
this.Oy !== a && (f && t.nb(a, $g, $g, "starting"), this.Oy = a)
});
$g.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ua || !a.R.left || this.isBeyondDragSize())return!1;
a = a.fe(a.R.V, null, function (a) {
return a instanceof la
});
if (!(a instanceof la && a.Hv))return!1;
a = a.S;
return null === a || this.lF === ah && !a.Za ? !1 : !0
};
$g.prototype.doStart = function () {
this.na || null === this.mg || this.doActivate()
};
$g.prototype.doActivate = function () {
if (!this.na) {
var a = this.h;
if (null !== a) {
var b = this.mg;
null === b && (b = a.fe(a.R.V, function (a) {
return a instanceof la ? a : null
}), b = b instanceof la ? b : null);
if (null !== b && (this.mg = b, null !== b.S)) {
this.na = !0;
this.eb = gh;
this.mc(this.name);
var c = this.hD, d = !1;
null !== b.LA && (c = b.LA);
null === c || c.eB || (d = !0);
this.qC = this.mg.copy();
null === c && (c = document.createElement("textarea"), c.eB = !0, this.Dx = c, c.addEventListener("input", function () {
var a = this.textEditingTool.qC;
a.text = this.value;
lh(a,
Infinity, Infinity);
this.style.width = 20 + a.Ba.width * this.II + "px";
this.rows = a.fE
}, !1), c.addEventListener("keydown", function (a) {
var b = a.which, c = this.textEditingTool;
if (null !== c)if (13 === b)c.acceptText(fh); else {
if (9 === b)return c.acceptText(eh), a.preventDefault(), !1;
27 === b && (c.doCancel(), c.h && c.h.focus())
}
}, !1), c.addEventListener("focus", function () {
var a = this.textEditingTool;
a.eb === gh ? a.eb = hh : a.eb === kh ? a.eb = ih : a.eb === ih && (a.eb = hh);
this.select()
}, !1), c.addEventListener("blur", function () {
this.focus();
this.select()
},
!1));
if (c.eB) {
var e = b.$a(Hb), g = a.position, h = a.scale, k = b.Tj() * h, l = b.Oa.width * k;
mh(b);
var m = (e.x - g.x) * h, e = (e.y - g.y) * h;
c.value = b.text;
a.vi.style.font = b.font;
c.style.font = "inherit";
c.style.fontSize = 100 * k + "%";
c.style.lineHeight = "normal";
l = 20 + l;
c.style.width = l + "px";
c.style.height = "";
c.rows = b.fE;
a.vi.appendChild(c);
c.style.left = (m - l / 2 | 0) + "px";
c.style.top = (e - c.clientHeight / 2 | 0) + "px";
c.style.textAlign = b.textAlign
} else a.vi.appendChild(c);
c.style.position = "absolute";
c.style.zIndex = 100;
c.className = "start";
c.textEditingTool =
this;
c.II = k;
if (d && void 0 !== c.onActivate)c.onActivate();
this.Eg = c;
c.focus()
}
}
}
};
$g.prototype.doCancel = function () {
null !== this.Ek && (this.Eg.style.border = this.Ek, this.Ek = null);
this.stopTool()
};
$g.prototype.doMouseUp = function () {
!this.na && this.canStart() && this.doActivate()
};
$g.prototype.doMouseDown = function () {
this.na && this.acceptText(dh)
};
$g.prototype.acceptText = function (a) {
switch (a) {
case dh:
if (this.eb === kh || this.eb === ih)this.Eg.focus(); else if (this.eb === gh || this.eb === hh)this.eb = jh, yh(this);
break;
case ch:
case fh:
case eh:
if (fh === a && !0 === this.$y.$v)break;
if (this.eb === gh || this.eb === hh)this.eb = jh, yh(this)
}
};
function yh(a) {
if (null !== a.mg && null !== a.Eg) {
var b = a.mg, c = a.mg.text, d = a.Eg.value, e = "", e = "function" === typeof d ? d() : d;
if (!a.isValidText(a.mg, c, e)) {
a.eb = hh;
null !== b.ps && b.ps(a, c, e);
null === a.Ek && (a.Ek = a.Eg.style.border, a.Eg.style.border = "3px solid red");
a.Eg.focus();
return
}
a.eb = kh;
c !== e && (a.mg.text = e);
a.We = a.name;
b = a.h;
null !== b && b.Ea("TextEdited", a.mg, c);
a.stopTool();
null !== b && b.focus()
}
null !== a.Ek && (a.Eg.style.border = a.Ek, a.Ek = null)
}
$g.prototype.doDeactivate = function () {
var a = this.h;
if (null !== a) {
this.na && this.Yj();
this.eb = bh;
this.mg = null;
if (null !== this.Eg) {
var b = this.Eg;
if (void 0 !== b.onDeactivate)b.onDeactivate();
null !== b && a.vi.removeChild(b)
}
this.na = !1
}
};
$g.prototype.isValidText = function (a, b, c) {
t.j(a, la, $g, "isValidText:textblock");
var d = this.lt;
if (null !== d && !d(a, b, c))return!1;
d = a.lt;
return null === d || d(a, b, c) ? !0 : !1
};
t.g($g, "textValidation", $g.prototype.lt);
t.defineProperty($g, {lt: "textValidation"}, function () {
return this.xj
}, function (a) {
this.xj !== a && (this.xj = a)
});
function Ae() {
Td.call(this);
this.name = "ToolManager";
this.WB = new A(Td);
this.XB = new A(Td);
this.YB = new A(Td);
this.DB = this.EB = 1E3;
this.tB = (new da(2, 2)).Ia();
this.Ot = this.Ax = null;
this.ZB = Ye
}
t.ea("ToolManager", Ae);
t.Ja(Ae, Td);
var Ye;
Ae.WheelScroll = Ye = t.w(Ae, "WheelScroll", 0);
var Xe;
Ae.WheelZoom = Xe = t.w(Ae, "WheelZoom", 1);
Ae.WheelNone = t.w(Ae, "WheelNone", 2);
t.g(Ae, "mouseWheelBehavior", Ae.prototype.Fm);
t.defineProperty(Ae, {Fm: "mouseWheelBehavior"}, function () {
return this.ZB
}, function (a) {
this.ZB = a
});
Ae.prototype.initializeStandardTools = function () {
this.BC = new Wg;
this.tA = new df;
this.iE = new Ag;
this.PE = new Lg;
this.UE = new Tg;
this.Zz = new pa;
this.de = new Ze;
this.oD = new Yg;
this.BE = new Zg;
this.Bv = new Xg;
this.Bw = new $g;
this.PC = new qa;
this.QC = new Vg
};
Ae.prototype.doMouseDown = function () {
var a = this.h;
if (null !== a) {
var b = a.va;
b.tz && 0 !== b.nl && t.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");
for (var b = this.mf.length, c = 0; c < b; c++) {
var d = this.mf.ta(c);
null === d.h && d.Ce(this.h);
if (d.canStart()) {
a.Na = d;
a.Na === d && (d.na || d.doActivate(), d.doMouseDown());
return
}
}
1 === a.R.button && (this.Fm === Ye ? this.Fm = Xe : this.Fm === Xe && (this.Fm = Ye));
this.doActivate();
this.standardWaitAfter(this.Mz)
}
};
Ae.prototype.doMouseMove = function () {
var a = this.h;
if (null !== a) {
if (this.na)for (var b = this.Ig.length, c = 0; c < b; c++) {
var d = this.Ig.ta(c);
null === d.h && d.Ce(this.h);
if (d.canStart()) {
a.Na = d;
a.Na === d && (d.na || d.doActivate(), d.doMouseMove());
return
}
}
this.standardMouseOver();
this.isBeyondDragSize() && this.standardWaitAfter(this.na ? this.Mz : this.OD)
}
};
Ae.prototype.doCurrentObjectChanged = function (a, b) {
var c = this.Tk;
null === c || null !== b && (b === c || b.Ci(c)) || this.hideToolTip()
};
Ae.prototype.doWaitAfter = function () {
this.h && this.h.Ta && (this.doMouseHover(), this.na || this.doToolTip())
};
Ae.prototype.doMouseHover = function () {
var a = this.h;
if (null !== a) {
var b = a.R;
null === b.Nd && (b.Nd = a.fe(b.V, null, null));
var c = b.Nd;
if (null !== c)for (; null !== c;) {
a = this.na ? c.Ms : c.Ns;
if (null !== a && (a(b, c), b.ze))break;
c = c.fa
} else a = this.na ? a.Ms : a.Ns, null !== a && a(b)
}
};
Ae.prototype.doToolTip = function () {
var a = this.h;
if (null !== a) {
var b = a.R;
null === b.Nd && (b.Nd = a.fe(b.V, null, null));
b = b.Nd;
if (null !== b) {
if (b !== this.Tk && !b.Ci(this.Tk)) {
for (; null !== b;) {
a = b.mt;
if (null !== a) {
this.showToolTip(a, b);
return
}
b = b.fa
}
this.hideToolTip()
}
} else a = a.mt, null !== a ? this.showToolTip(a, null) : this.hideToolTip()
}
};
Ae.prototype.showToolTip = function (a, b) {
t.j(a, Ce, Ae, "showToolTip:tooltip");
null !== b && t.j(b, Q, Ae, "showToolTip:obj");
var c = this.h;
if (null !== c) {
a !== this.Tk && this.hideToolTip();
a.Md = "Tool";
a.fl = !1;
a.scale = 1 / c.scale;
c.add(a);
if (null !== b && b !== this.Ot) {
var c = null, d = b.Bo();
null !== d && (c = d.data);
a.Hc = b;
a.data = c
} else null === b && (a.data = c.da);
if (null === b || b !== this.Ot)a.zf(), this.positionToolTip(a, b);
this.Ax = a;
this.Ot = b
}
};
Ae.prototype.positionToolTip = function (a) {
var b = this.h;
if (null !== b) {
var c = b.R.V.copy(), d = a.Ba, e = b.lb;
b.R.aw && (c.x -= d.width);
c.x + d.width > e.right && (c.x -= d.width + 5);
c.x < e.x && (c.x = e.x);
c.y = c.y + 20 + d.height > e.bottom ? c.y - (d.height + 5) : c.y + 20;
c.y < e.y && (c.y = e.y);
a.position = c
}
};
Ae.prototype.hideToolTip = function () {
if (null !== this.Tk) {
var a = this.h;
null !== a && (this.Tk.data = null, this.Tk.Hc = null, a.remove(this.Tk), this.Ot = this.Ax = null)
}
};
t.A(Ae, {Tk: "currentToolTip"}, function () {
return this.Ax
});
Ae.prototype.doMouseUp = function () {
this.cancelWaitAfter();
if (this.na) {
var a = this.h;
if (null === a)return;
for (var b = this.Jg.length, c = 0; c < b; c++) {
var d = this.Jg.ta(c);
null === d.h && d.Ce(this.h);
if (d.canStart()) {
a.Na = d;
a.Na === d && (d.na || d.doActivate(), d.doMouseUp());
return
}
}
}
this.doDeactivate()
};
Ae.prototype.doMouseWheel = function () {
this.standardMouseWheel()
};
Ae.prototype.doKeyDown = function () {
var a = this.h;
null !== a && a.Le.doKeyDown()
};
Ae.prototype.doKeyUp = function () {
var a = this.h;
null !== a && a.Le.doKeyUp()
};
Ae.prototype.doCancel = function () {
null !== bf && bf.doCancel();
Td.prototype.doCancel.call(this)
};
Ae.prototype.findTool = function (a) {
t.k(a, "string", Ae, "findTool:name");
for (var b = this.mf.length, c = 0; c < b; c++) {
var d = this.mf.ta(c);
if (d.name === a)return d
}
b = this.Ig.length;
for (c = 0; c < b; c++)if (d = this.Ig.ta(c), d.name === a)return d;
b = this.Jg.length;
for (c = 0; c < b; c++)if (d = this.Jg.ta(c), d.name === a)return d;
return null
};
Ae.prototype.replaceTool = function (a, b) {
t.k(a, "string", Ae, "replaceTool:name");
null !== b && (t.j(b, Td, Ae, "replaceTool:newtool"), b.h && b.h !== this.h && t.m("Cannot share tools between Diagrams: " + b.toString()), b.Ce(this.h));
for (var c = this.mf.length, d = 0; d < c; d++) {
var e = this.mf.ta(d);
if (e.name === a)return null !== b ? this.mf.jg(d, b) : this.mf.ud(d), e
}
c = this.Ig.length;
for (d = 0; d < c; d++)if (e = this.Ig.ta(d), e.name === a)return null !== b ? this.Ig.jg(d, b) : this.Ig.ud(d), e;
c = this.Jg.length;
for (d = 0; d < c; d++)if (e = this.Jg.ta(d), e.name ===
a)return null !== b ? this.Jg.jg(d, b) : this.Jg.ud(d), e;
return null
};
function zh(a, b, c, d) {
t.k(b, "string", Ae, "replaceStandardTool:name");
t.j(d, A, Ae, "replaceStandardTool:list");
null !== c && (t.j(c, Td, Ae, "replaceStandardTool:newtool"), c.h && c.h !== a.h && t.m("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.Ce(a.h));
a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c)
}
t.A(Ae, {mf: "mouseDownTools"}, function () {
return this.WB
});
t.A(Ae, {Ig: "mouseMoveTools"}, function () {
return this.XB
});
t.A(Ae, {Jg: "mouseUpTools"}, function () {
return this.YB
});
t.g(Ae, "hoverDelay", Ae.prototype.OD);
t.defineProperty(Ae, {OD: "hoverDelay"}, function () {
return this.EB
}, function (a) {
this.EB = a
});
t.g(Ae, "holdDelay", Ae.prototype.Mz);
t.defineProperty(Ae, {Mz: "holdDelay"}, function () {
return this.DB
}, function (a) {
this.DB = a
});
t.g(Ae, "dragSize", Ae.prototype.pD);
t.defineProperty(Ae, {pD: "dragSize"}, function () {
return this.tB
}, function (a) {
this.tB = a
});
t.g(Ae, "actionTool", Ae.prototype.BC);
t.defineProperty(Ae, {BC: "actionTool"}, function () {
return this.findTool("Action")
}, function (a) {
zh(this, "Action", a, this.mf)
});
t.g(Ae, "relinkingTool", Ae.prototype.tA);
t.defineProperty(Ae, {tA: "relinkingTool"}, function () {
return this.findTool("Relinking")
}, function (a) {
zh(this, "Relinking", a, this.mf)
});
t.g(Ae, "linkReshapingTool", Ae.prototype.iE);
t.defineProperty(Ae, {iE: "linkReshapingTool"}, function () {
return this.findTool("LinkReshaping")
}, function (a) {
zh(this, "LinkReshaping", a, this.mf)
});
t.g(Ae, "resizingTool", Ae.prototype.PE);
t.defineProperty(Ae, {PE: "resizingTool"}, function () {
return this.findTool("Resizing")
}, function (a) {
zh(this, "Resizing", a, this.mf)
});
t.g(Ae, "rotatingTool", Ae.prototype.UE);
t.defineProperty(Ae, {UE: "rotatingTool"}, function () {
return this.findTool("Rotating")
}, function (a) {
zh(this, "Rotating", a, this.mf)
});
t.g(Ae, "linkingTool", Ae.prototype.Zz);
t.defineProperty(Ae, {Zz: "linkingTool"}, function () {
return this.findTool("Linking")
}, function (a) {
zh(this, "Linking", a, this.Ig)
});
t.g(Ae, "draggingTool", Ae.prototype.de);
t.defineProperty(Ae, {de: "draggingTool"}, function () {
return this.findTool("Dragging")
}, function (a) {
zh(this, "Dragging", a, this.Ig)
});
t.g(Ae, "dragSelectingTool", Ae.prototype.oD);
t.defineProperty(Ae, {oD: "dragSelectingTool"}, function () {
return this.findTool("DragSelecting")
}, function (a) {
zh(this, "DragSelecting", a, this.Ig)
});
t.g(Ae, "panningTool", Ae.prototype.BE);
t.defineProperty(Ae, {BE: "panningTool"}, function () {
return this.findTool("Panning")
}, function (a) {
zh(this, "Panning", a, this.Ig)
});
t.g(Ae, "contextMenuTool", Ae.prototype.Bv);
t.defineProperty(Ae, {Bv: "contextMenuTool"}, function () {
return this.findTool("ContextMenu")
}, function (a) {
zh(this, "ContextMenu", a, this.Jg)
});
t.g(Ae, "textEditingTool", Ae.prototype.Bw);
t.defineProperty(Ae, {Bw: "textEditingTool"}, function () {
return this.findTool("TextEditing")
}, function (a) {
zh(this, "TextEditing", a, this.Jg)
});
t.g(Ae, "clickCreatingTool", Ae.prototype.PC);
t.defineProperty(Ae, {PC: "clickCreatingTool"}, function () {
return this.findTool("ClickCreating")
}, function (a) {
zh(this, "ClickCreating", a, this.Jg)
});
t.g(Ae, "clickSelectingTool", Ae.prototype.QC);
t.defineProperty(Ae, {QC: "clickSelectingTool"}, function () {
return this.findTool("ClickSelecting")
}, function (a) {
zh(this, "ClickSelecting", a, this.Jg)
});
function Sd() {
1 < arguments.length && t.m("Layer constructor cannot take any arguments.");
t.uc(this);
this.ba = null;
this.qb = new A(B);
this.Mb = "";
this.wf = 1;
this.hy = !1;
this.Fk = this.dz = this.lk = this.kk = this.jk = this.ik = this.gk = this.hk = this.fk = this.nk = this.ek = this.mk = this.dk = this.ck = !0;
this.Gu = []
}
t.ea("Layer", Sd);
Sd.prototype.Ce = function (a) {
this.ba = a
};
Sd.prototype.toString = function (a) {
void 0 === a && (a = 0);
var b = 'Layer "' + this.name + '"';
if (0 >= a)return b;
for (var c = 0, d = 0, e = 0, g = 0, h = 0, k = this.qb.l; k.next();) {
var l = k.value;
l instanceof U ? e++ : l instanceof S ? d++ : l instanceof X ? g++ : l instanceof Ce ? h++ : c++
}
k = "";
0 < c && (k += c + " Parts ");
0 < d && (k += d + " Nodes ");
0 < e && (k += e + " Groups ");
0 < g && (k += g + " Links ");
0 < h && (k += h + " Adornments ");
if (1 < a)for (c = this.qb.l; c.next();)d = c.value, k += "\n " + d.toString(a - 1), (e = d.data) && t.jc(e) && (k += " #" + t.jc(e)), d instanceof S ? k += " " + td(e) :
d instanceof X && (k += " " + td(d.ca) + " " + td(d.ga));
return b + " " + this.qb.count + ": " + k
};
Sd.prototype.findObjectAt = Sd.prototype.fe = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
if (!1 === this.Fk)return null;
f && !a.P() && t.m("findObjectAt: Point must have a real value.");
var d = this.qb, e = !1;
this.h.lb.Da(a) && (e = !0);
for (var g = t.M(), h = d.length; h--;) {
var k = d.ta(h);
if ((!0 !== e || !1 !== Ah(k)) && k.ub() && (g.assign(a), Oa(g, k.ae), k = k.fe(g, b, c), null !== k && (null !== b && (k = b(k)), k && (null === c || c(k)))))return t.B(g), k
}
t.B(g);
return null
};
Sd.prototype.findObjectsAt = Sd.prototype.zo = function (a, b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof A || d instanceof ka || (d = new ka(Q));
if (!1 === this.Fk)return d;
f && !a.P() && t.m("findObjectsAt: Point must have a real value.");
var e = this.qb, g = !1;
this.h.lb.Da(a) && (g = !0);
for (var h = t.M(), k = e.length; k--;) {
var l = e.ta(k);
!0 === g && !1 === Ah(l) || !l.ub() || (h.assign(a), Oa(h, l.ae), l.zo(h, b, c, d) && (null !== b && (l = b(l)), l && (null === c || c(l)) && d.add(l)))
}
t.B(h);
return d
};
Sd.prototype.findObjectsIn = Sd.prototype.Qj = function (a, b, c, d, e) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = !1);
e instanceof A || e instanceof ka || (e = new ka(Q));
if (!1 === this.Fk)return e;
f && !a.P() && t.m("findObjectsIn: Rect must have a real value.");
var g = this.qb, h = !1;
this.h.lb.Jj(a) && (h = !0);
for (var k = g.length, g = g.p; k--;) {
var l = g[k];
(!0 !== h || !1 !== Ah(l)) && l.ub() && l.Qj(a, b, c, d, e) && (null !== b && (l = b(l)), l && (null === c || c(l)) && e.add(l))
}
return e
};
Sd.prototype.Dz = function (a, b, c, d, e, g, h) {
if (!1 === this.Fk)return e;
for (var k = this.qb, l = k.length, k = k.p; l--;) {
var m = k[l];
(!0 !== h || !1 !== Ah(m)) && g(m) && m.ub() && m.Qj(a, b, c, d, e) && (null !== b && (m = b(m)), m && (null === c || c(m)) && e.add(m))
}
return e
};
Sd.prototype.findObjectsNear = Sd.prototype.um = function (a, b, c, d, e, g) {
void 0 === c && (c = null);
void 0 === d && (d = null);
void 0 === e && (e = !0);
if (!1 !== e && !0 !== e) {
if (e instanceof A || e instanceof ka)g = e;
e = !0
}
g instanceof A || g instanceof ka || (g = new ka(Q));
if (!1 === this.Fk)return g;
f && !a.P() && t.m("findObjectsNear: Point must have a real value.");
var h = this.qb, k = !1;
this.h.lb.Da(a) && (k = !0);
for (var l = t.M(), m = t.M(), n = h.length; n--;) {
var p = h.p[n];
!0 === k && !1 === Ah(p) || !p.ub() || (l.assign(a), Oa(l, p.ae), m.q(a.x + b, a.y), Oa(m, p.ae),
p.um(l, m, c, d, e, g) && (null !== c && (p = c(p)), p && (null === d || d(p)) && g.add(p)))
}
t.B(l);
t.B(m);
return g
};
aa = Sd.prototype;
aa.If = function (a, b) {
if (this.visible && a.yk) {
var c = this.qb, d;
d = b ? b : a.lb;
for (var e = c.length, g = 0; g < e; g++) {
var h = c.p[g];
h.gG = g;
if (!(h instanceof X && !1 === h.Dg || h instanceof Ce && null !== h.Cj))if (ab(h.ua, d))for (h.If(!0), Bh(h), h = h.mv; h.next();) {
var k = h.value;
lh(k, Infinity, Infinity);
k.yc();
k.If(!0)
} else h.If(!1), null !== h.mv && 0 < h.mv.count && Bh(h)
}
}
};
aa.Ne = function (a, b, c, d) {
if (this.visible && (void 0 === d && (d = !0), d || !this.kc)) {
1 !== this.wf && (a.globalAlpha = this.wf);
c = this.qb;
d = this.Gu;
d.length = 0;
for (var e = b.scale, g = c.length, h = 0; h < g; h++) {
var k = c.p[h];
if (Ah(k)) {
if (k instanceof X && (k.Ub && d.push(k), !1 === k.Dg))continue;
var l = k.ua;
1 < l.width * e || 1 < l.height * e ? k.Ne(a, b) : Ch(k, a)
}
}
a.globalAlpha = 1
}
};
function Dh(a, b, c, d) {
if (a.visible) {
b.globalAlpha = a.wf;
var e = a.qb;
a = a.Gu;
a.length = 0;
for (var g = c.scale, h = e.length, k = d.length, l = 0; l < h; l++) {
var m = e.p[l];
if (Ah(m)) {
if (m instanceof X && (m.Ub && a.push(m), !1 === m.Dg))continue;
var n = Eh(m, m.ua), p;
a:{
p = n;
for (var q = d, r = k, s = 2 / g, u = 4 / g, x = 0; x < r; x++) {
var E = q[x];
if (0 !== E[2] && 0 !== E[3] && p.VD(E[0] - s, E[1] - s, E[2] + u, E[3] + u)) {
p = !0;
break a
}
}
p = !1
}
p && (1 < n.width * g || 1 < n.height * g ? m.Ne(b, c) : Ch(m, b))
}
}
b.globalAlpha = 1
}
}
aa.i = function (a, b, c, d, e) {
var g = this.h;
null !== g && g.Yc(qd, a, this, b, c, d, e)
};
aa.ym = function (a, b, c) {
var d = this.qb;
b.Bn = this;
if (a >= d.count)a = d.count; else if (d.ta(a) === b)return-1;
d.Fd(a, b);
b.As();
d = this.h;
null !== d && (c ? d.ra() : d.ym(b));
b instanceof U && this.xw(b);
return a
};
aa.Pe = function (a, b, c) {
var d = this.qb;
if (0 > a || a >= d.length) {
if (a = d.indexOf(b), 0 > a)return-1
} else if (d.ta(a) !== b && (a = d.indexOf(b), 0 > a))return-1;
b.Bs();
d.ud(a);
d = this.h;
null !== d && (c ? d.ra() : d.Pe(b));
b.Bn = null;
return a
};
aa.xw = function (a) {
for (; null !== a;) {
if (a.layer === this) {
var b = a;
if (b.Lc.next()) {
for (var c = -1, d = -1, e = this.qb.p, g = e.length, h = 0; h < g; h++) {
var k = e[h];
if (k === b && (c = h, 0 <= d))break;
if (0 > d && k.ib === b && (d = h, 0 <= c))break
}
!(0 > d) && d < c && (e = this.qb, e.ud(c), e.Fd(d, b))
}
}
a = a.ib
}
};
aa.clear = function () {
for (var a = this.qb.Ve(), b = a.length, c = 0; c < b; c++)a[c].If(!1), this.Pe(-1, a[c])
};
t.A(Sd, {gp: "parts"}, function () {
return this.qb.l
});
t.A(Sd, {rJ: "partsBackwards"}, function () {
return this.qb.Am
});
t.A(Sd, {h: "diagram"}, function () {
return this.ba
});
t.g(Sd, "name", Sd.prototype.name);
t.defineProperty(Sd, {name: "name"}, function () {
return this.Mb
}, function (a) {
t.k(a, "string", Sd, "name");
var b = this.Mb;
if (b !== a) {
var c = this.h;
if (null !== c)for ("" === b && t.m("Cannot rename default Layer to: " + a), c = c.cw; c.next();)c.value.name === a && t.m("Layer.name is already present in this diagram: " + a);
this.Mb = a;
this.i("name", b, a);
for (a = this.qb.l; a.next();)a.value.Md = this.Mb
}
});
t.g(Sd, "opacity", Sd.prototype.opacity);
t.defineProperty(Sd, {opacity: "opacity"}, function () {
return this.wf
}, function (a) {
var b = this.wf;
b !== a && (t.k(a, "number", Sd, "opacity"), (0 > a || 1 < a) && t.ia(a, "0 <= val <= 1", Sd, "opacity"), this.wf = a, this.i("opacity", b, a), a = this.h, null !== a && a.ra())
});
t.g(Sd, "isTemporary", Sd.prototype.kc);
t.defineProperty(Sd, {kc: "isTemporary"}, function () {
return this.hy
}, function (a) {
var b = this.hy;
b !== a && (t.k(a, "boolean", Sd, "isTemporary"), this.hy = a, this.i("isTemporary", b, a))
});
t.g(Sd, "visible", Sd.prototype.visible);
t.defineProperty(Sd, {visible: "visible"}, function () {
return this.dz
}, function (a) {
var b = this.dz;
if (b !== a) {
t.k(a, "boolean", Sd, "visible");
this.dz = a;
this.i("visible", b, a);
for (b = this.qb.l; b.next();) {
var c = b.value;
a ? (c.J(Fh), c.updateAdornments()) : (c.J(Gh), c.ue())
}
a = this.h;
null !== a && a.ra()
}
});
t.g(Sd, "pickable", Sd.prototype.nf);
t.defineProperty(Sd, {nf: "pickable"}, function () {
return this.Fk
}, function (a) {
var b = this.Fk;
b !== a && (t.k(a, "boolean", Sd, "pickable"), this.Fk = a, this.i("pickable", b, a))
});
t.g(Sd, "allowCopy", Sd.prototype.Ej);
t.defineProperty(Sd, {Ej: "allowCopy"}, function () {
return this.ck
}, function (a) {
var b = this.ck;
b !== a && (t.k(a, "boolean", Sd, "allowCopy"), this.ck = a, this.i("allowCopy", b, a))
});
t.g(Sd, "allowDelete", Sd.prototype.Nk);
t.defineProperty(Sd, {Nk: "allowDelete"}, function () {
return this.dk
}, function (a) {
var b = this.dk;
b !== a && (t.k(a, "boolean", Sd, "allowDelete"), this.dk = a, this.i("allowDelete", b, a))
});
t.g(Sd, "allowTextEdit", Sd.prototype.lo);
t.defineProperty(Sd, {lo: "allowTextEdit"}, function () {
return this.mk
}, function (a) {
var b = this.mk;
b !== a && (t.k(a, "boolean", Sd, "allowTextEdit"), this.mk = a, this.i("allowTextEdit", b, a))
});
t.g(Sd, "allowGroup", Sd.prototype.fo);
t.defineProperty(Sd, {fo: "allowGroup"}, function () {
return this.ek
}, function (a) {
var b = this.ek;
b !== a && (t.k(a, "boolean", Sd, "allowGroup"), this.ek = a, this.i("allowGroup", b, a))
});
t.g(Sd, "allowUngroup", Sd.prototype.mo);
t.defineProperty(Sd, {mo: "allowUngroup"}, function () {
return this.nk
}, function (a) {
var b = this.nk;
b !== a && (t.k(a, "boolean", Sd, "allowUngroup"), this.nk = a, this.i("allowUngroup", b, a))
});
t.g(Sd, "allowLink", Sd.prototype.fm);
t.defineProperty(Sd, {fm: "allowLink"}, function () {
return this.fk
}, function (a) {
var b = this.fk;
b !== a && (t.k(a, "boolean", Sd, "allowLink"), this.fk = a, this.i("allowLink", b, a))
});
t.g(Sd, "allowRelink", Sd.prototype.Fj);
t.defineProperty(Sd, {Fj: "allowRelink"}, function () {
return this.hk
}, function (a) {
var b = this.hk;
b !== a && (t.k(a, "boolean", Sd, "allowRelink"), this.hk = a, this.i("allowRelink", b, a))
});
t.g(Sd, "allowMove", Sd.prototype.Ok);
t.defineProperty(Sd, {Ok: "allowMove"}, function () {
return this.gk
}, function (a) {
var b = this.gk;
b !== a && (t.k(a, "boolean", Sd, "allowMove"), this.gk = a, this.i("allowMove", b, a))
});
t.g(Sd, "allowReshape", Sd.prototype.ho);
t.defineProperty(Sd, {ho: "allowReshape"}, function () {
return this.ik
}, function (a) {
var b = this.ik;
b !== a && (t.k(a, "boolean", Sd, "allowReshape"), this.ik = a, this.i("allowReshape", b, a))
});
t.g(Sd, "allowResize", Sd.prototype.io);
t.defineProperty(Sd, {io: "allowResize"}, function () {
return this.jk
}, function (a) {
var b = this.jk;
b !== a && (t.k(a, "boolean", Sd, "allowResize"), this.jk = a, this.i("allowResize", b, a))
});
t.g(Sd, "allowRotate", Sd.prototype.jo);
t.defineProperty(Sd, {jo: "allowRotate"}, function () {
return this.kk
}, function (a) {
var b = this.kk;
b !== a && (t.k(a, "boolean", Sd, "allowRotate"), this.kk = a, this.i("allowRotate", b, a))
});
t.g(Sd, "allowSelect", Sd.prototype.Ie);
t.defineProperty(Sd, {Ie: "allowSelect"}, function () {
return this.lk
}, function (a) {
var b = this.lk;
b !== a && (t.k(a, "boolean", Sd, "allowSelect"), this.lk = a, this.i("allowSelect", b, a))
});
function z(a) {
function b() {
document.removeEventListener("DOMContentLoaded", b, !1);
Hh(c)
}
1 < arguments.length && t.m("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");
t.uc(this);
t.nD = [];
this.gc = !0;
this.af = 17;
var c = this;
null !== document.body ? Hh(this) : document.addEventListener("DOMContentLoaded", b, !1);
this.Fb = new A(Sd);
this.nc = this.oc = 0;
this.gC = this.vb = this.Ti = this.Ta = null;
this.sb = (new v(NaN, NaN)).freeze();
this.Xb = 1;
this.Xx = (new v(NaN, NaN)).freeze();
this.Yx = NaN;
this.su =
1E-4;
this.pu = 100;
this.qd = new ga;
this.jv = (new v(NaN, NaN)).freeze();
this.Xt = (new w(NaN, NaN, NaN, NaN)).freeze();
this.ql = Ge;
this.tl = xb;
this.xk = Ge;
this.tn = xb;
this.du = this.cu = yb;
this.Of = new ka(Q);
this.Ee = !0;
this.kn = new ia(X, w);
this.ln = !0;
this.aG = 250;
this.$F = 1E3;
this.Qg = null;
this.Dt = (new Wa(16, 16, 16, 16)).freeze();
this.Rt = this.Vf = !1;
this.mq = !0;
this.sg = new md;
this.Qc = new md;
this.hc = new md;
this.Ri = null;
this.$u = -1;
this.Qy = !1;
this.Gx = new ia("string", A);
this.Fx = new ia("string", "string");
Ih(this);
this.Cu = new ka(S);
this.Ik = new ka(U);
this.lu = new ka(X);
this.qb = new ka(B);
this.hu = !0;
this.GB = !1;
this.gv = ag;
this.gj = 10;
this.zx = this.Ex = this.ev = null;
this.Nt = "";
this.fq = "auto";
this.Nh = this.ji = this.Xh = this.vu = this.Yh = this.Zh = this.$h = this.Mh = this.Qh = this.Kh = null;
this.Sh = !0;
this.sy = !1;
this.px = null;
this.Jy = this.gi = !1;
this.NB = !0;
this.yd = !1;
this.Xd = null;
var d = this;
this.TB = function (a) {
if (a.da === d.da && d.Sa) {
d.Sa = !1;
try {
var b = a.ed;
"" === a.lf && b === qd && Jh(d, a.object, a.propertyName)
} finally {
d.Sa = !0
}
}
};
this.UB = function (a) {
Kh(d, a)
};
this.yC = !0;
this.Oh = new ia(Object, B);
this.qk = new ia(Object, X);
this.Hl = new ia(Object, Array);
this.zk = !1;
this.dk = this.ck = this.st = this.Th = !0;
this.ut = this.tt = !1;
this.zt = this.xt = this.lk = this.kk = this.jk = this.ik = this.gk = this.hk = this.fk = this.wt = this.nk = this.ek = this.mk = !0;
this.wn = this.LB = !1;
this.yt = this.vt = this.bu = this.au = !0;
this.Qu = this.Pu = 16;
this.Fy = this.Ou = !1;
this.Hy = this.Gy = this.uj = this.tj = null;
this.Ge = (new Wa(5)).freeze();
this.Tu = (new ka(B)).freeze();
this.qu = 999999999;
this.yk = this.dj = this.cj = !0;
this.Al = this.zl = !1;
this.Wx = this.Vx = 0;
this.Ad = null;
this.At = !0;
this.Nf = !1;
this.Cd = null;
this.Pl = 1;
this.Px = !1;
this.mC = 0;
this.xC = (new w(NaN, NaN, NaN, NaN)).freeze();
this.St = (new w(NaN, NaN, NaN, NaN)).freeze();
this.Nn = new ka;
Lh(this);
this.ku = this.Zt = this.Bu = this.pB = this.oB = this.qB = this.hj = this.tk = this.ai = null;
Mh(this);
this.Pc = null;
this.Yt = !1;
this.so = this.nA = null;
this.zb = new Ae;
this.zb.initializeStandardTools();
this.Na = this.Ev = this.zb;
this.Le = new oa;
this.da = new P;
this.gi = !0;
this.Vb = new fe;
this.gi = !1;
void 0 === a && (a = document.createElement("div"));
this.yB = this.Ix = null;
this.cz = !0;
this.Ey = !1;
this.Vi = null;
this.vk = new Nh;
Oh(this, a);
this.Jl = 1;
this.ju = 0;
this.QB = new v;
this.vC = 500;
this.Ir = null;
this.vn = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android") && (this.vn = !0);
this.ay = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0") && (this.ay = !0);
this.KB = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7") && (this.KB = !0);
this.Dl = 0 <= navigator.platform.toUpperCase().indexOf("MAC");
this.gc = !1
}
t.ea("Diagram", z);
function Mh(a) {
a.ai = new ia("string", B);
var b = new S, c = new la;
c.bind(new we("text", "", td));
b.add(c);
a.qB = b;
a.ai.add("", b);
b = new S;
c = new la;
c.stroke = "brown";
c.bind(new we("text", "", td));
b.add(c);
a.ai.add("Comment", b);
b = new S;
b.fl = !1;
b.qz = !1;
c = new Y;
c.Db = "Ellipse";
c.fill = "black";
c.stroke = null;
c.ya = (new da(3, 3)).Ia();
b.add(c);
a.ai.add("LinkLabel", b);
a.tk = new ia("string", U);
b = new U;
b.tw = "GROUPPANEL";
b.type = Ph;
c = new la;
c.font = "bold 12pt sans-serif";
c.bind(new we("text", "", td));
b.add(c);
c = new y(Qh);
c.name =
"GROUPPANEL";
var d = new Y;
d.Db = "Rectangle";
d.fill = "rgba(128,128,128,0.2)";
d.stroke = "black";
c.add(d);
d = new Og;
d.padding = (new Wa(5, 5, 5, 5)).Ia();
c.add(d);
b.add(c);
a.oB = b;
a.tk.add("", b);
a.hj = new ia("string", X);
b = new X;
c = new Y;
c.Di = !0;
b.add(c);
c = new Y;
c.Nm = "Standard";
c.fill = "black";
c.stroke = null;
c.bb = 0;
b.add(c);
a.pB = b;
a.hj.add("", b);
b = new X;
c = new Y;
c.Di = !0;
c.stroke = "brown";
b.add(c);
a.hj.add("Comment", b);
b = new Ce;
b.type = Qh;
c = new Y;
c.fill = null;
c.stroke = "dodgerblue";
c.bb = 3;
b.add(c);
c = new Og;
c.margin = (new Wa(1.5,
1.5, 1.5, 1.5)).Ia();
b.add(c);
a.Bu = b;
a.Zt = b;
b = new Ce;
b.type = vg;
c = new Y;
c.Di = !0;
c.fill = null;
c.stroke = "dodgerblue";
c.bb = 3;
b.add(c);
a.ku = b
}
function Hh(a) {
var b = document.createElement("p");
b.style.width = "100%";
b.style.height = "200px";
var c = document.createElement("div");
c.style.position = "absolute";
c.style.visibility = "hidden";
c.style.width = "200px";
c.style.height = "150px";
c.style.overflow = "hidden";
c.appendChild(b);
document.body.appendChild(c);
var d = b.offsetWidth;
c.style.overflow = "scroll";
b = b.offsetWidth;
d === b && (b = c.clientWidth);
document.body.removeChild(c);
a.af = d - b
}
z.prototype.toString = function (a) {
void 0 === a && (a = 0);
var b = "";
this.id && (b = this.id);
this.vi && this.vi.id && (b = this.vi.id);
b = 'Diagram "' + b + '"';
if (0 >= a)return b;
for (var c = this.Fb.l; c.next();)b += "\n " + c.value.toString(a - 1);
return b
};
z.prototype.checkProperties = function () {
return t.TG(this)
};
z.fromDiv = function (a) {
var b = a;
"string" === typeof a && (b = document.getElementById(a));
return b instanceof HTMLDivElement && b.ba instanceof z ? b.ba : null
};
t.g(z, "div", z.prototype.vi);
t.defineProperty(z, {vi: "div"}, function () {
return this.vb
}, function (a) {
null !== a && t.j(a, HTMLDivElement, z, "div");
if (this.vb !== a) {
var b = this.vb;
if (null !== b) {
delete b.ba;
b.innerHTML = "";
null !== this.Ta && (this.Ta.ba = null, this.Ta.removeEventListener("touchstart", this.wF, !1), this.Ta.removeEventListener("touchmove", this.vF, !1), this.Ta.removeEventListener("touchend", this.uF, !1));
b = this.ev;
if (null !== b) {
for (var c = b.WB.p, d = c.length, e = 0; e < d; e++)c[e].cancelWaitAfter();
c = b.XB.p;
d = c.length;
for (e = 0; e < d; e++)c[e].cancelWaitAfter();
c = b.YB.p;
d = c.length;
for (e = 0; e < d; e++)c[e].cancelWaitAfter()
}
b.cancelWaitAfter();
this.Ti = this.Ta = null;
window.removeEventListener("resize", this.aA, !1);
window.removeEventListener("mousemove", this.$o, !0);
window.removeEventListener("mousedown", this.Zo, !0);
window.removeEventListener("mouseup", this.bp, !0);
window.removeEventListener("mousewheel", this.Kg, !0);
window.removeEventListener("DOMMouseScroll", this.Kg, !0);
window.removeEventListener("mouseout", this.ap, !0)
} else this.Nf = !1;
this.vb = null;
if (null !== a) {
if (b =
a.ba)b.vi = null;
Oh(this, a);
this.sA()
}
}
});
function Nh() {
this.nG = "63ad05bbe23a1786468a4c741b6d2";
if (this.nG === this._tk)this.Wi = !0; else {
var a = "p", b = window[t.Ka("76a715b2f73f148a")][t.Ka("72ba13b5")];
if (t.Ka("77bb5bb2f32603de") === window[t.Ka("76a715b2f73f148a")][t.Ka("6aba19a7ec351488")])try {
this.Wi = !window[t.Ka("4da118b7ec2108")]([t.Ka("5bb806bfea351a904a84515e1b6d38b6")])([t.Ka("49bc19a1e6")])([t.Ka("59bd04a1e6380fa5539b")])([t.Ka("7bb8069ae7")] === t.Ka(t.nv));
if (!1 === this.Wi)return;
this.Wi = !window[t.Ka("4da118b7ec2108")]([t.Ka("5bb806bfea351a904a84515e1b6d38b6")])([t.Ka("49bc19a1e6")])([t.Ka("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([t.Ka("7bb8069ae7")] === t.Ka(t.nv));
if (!1 === this.Wi)return
} catch (c) {
}
for (var d = b[t.Ka("76ad18b4f73e")], e = b[t.Ka("73a612b6fb191d")](t.Ka("35e7")) + 2; e < d; e++)a += b[e];
d = a[t.Ka("73a612b6fb191d")](t.Ka(t.nv));
0 >= d && t.Ka(t.nv) !== t.Ka("7da71ca0ad381e90") && (d = a[t.Ka("73a612b6fb191d")](t.Ka("76a715b2ef3e149757")));
if (this.Wi = !(0 < d && d < a[t.Ka("73a612b6fb191d")](t.Ka("35"))))for (a = document[t.Ka("69bc0fbfe6051381469f4c")], d = a.length, e = 0; e < d; e++) {
b = null;
try {
b = a[e][t.Ka("79bb0581f63a1e97")]
} catch (g) {
}
if (null !== b) {
for (var h = b.length, k = 0; k < h; k++)if (b[k][t.Ka("69ad1ab6e0221496778e4767")] ===
t.Ka("02cncncn")) {
var l = b[k][t.Ka("69bc0fbfe6")][t.Ka("78a704b7e6242f8b53a8507f1b7b")];
if (!l)return;
if (-1 !== l.indexOf(t.Ka(t.UG)) && -1 !== l.indexOf(t.Ka(t.VG))) {
this.Wi = !1;
break
}
}
if (!1 === this.Wi)break
}
}
}
}
Nh.prototype.ol = function (a) {
a.ZF();
return 0 < this.Wi && this !== this.lG ? !0 : !1
};
Nh.prototype.t = function () {
this.lG = null
};
function Oh(a, b) {
void 0 !== b && null !== b || t.m("Diagram setup requires an argument DIV.");
null !== a.vb && t.m("Diagram has already completed setup.");
"string" === typeof b ? a.vb = document.getElementById(b) : b instanceof HTMLDivElement ? a.vb = b : t.m("No DIV or DIV id supplied: " + b);
null === a.vb && t.m("Invalid DIV id; could not get element with id: " + b);
void 0 !== a.vb.ba && t.m("Invalid div id; div already has a Diagram associated with it.");
"static" === window.getComputedStyle(a.vb, null).position && (a.vb.style.position =
"relative");
a.vb.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)";
a.vb.style["-ms-touch-action"] = "none";
a.vb.innerHTML = "";
a.vb.ba = a;
var c = document.createElement("canvas");
if (c.getContext && c.getContext("2d")) {
c.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element.";
void 0 !== c.style && (c.style.position = "absolute", c.style.top = "0px", c.style.left = "0px", c.style.zIndex = "2", c.style.vJ = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect = "none");
a.oc =
a.vb.clientWidth || 1;
a.nc = a.vb.clientHeight || 1;
c.width = a.oc;
c.height = a.nc;
var d = document.createElement("canvas"), e = d.getContext("2d");
d.width = 1;
d.height = 1;
a.Ix = d;
a.yB = e;
a.Wx = 0;
a.Vx = 0;
document.body ? (d = document.body.parentNode, a.Wx = d.offsetTop || 0, a.Vx = d.offsetLeft || 0) : document.addEventListener("load", function () {
if (document.body) {
var b = document.body.parentNode;
a.Wx = b.offsetTop || 0;
a.Vx = b.offsetLeft || 0
}
}, !1);
c.ba = a;
a.Ta = c;
a.Ti = c.getContext("2d");
e = a.Ti;
a.ZF = e[t.Ka("69ad0287f137159745844d7e")][t.Ka("78a118b7")](e,
1, 0, 0, 1, 0, 0);
a.ix = e[t.Ka("7eba17a4ca3b1a8346")][t.Ka("78a118b7")](e, t.ol, 4, 4);
a.vb.insertBefore(c, a.vb.firstChild);
var d = document.createElement("div"), e = document.createElement("div"), g = document.createElement("div"), h = document.createElement("div");
d.style.position = "absolute";
d.style.overflow = "auto";
d.style.width = a.Ta.width + "px";
d.style.height = a.Ta.height + "px";
d.style.zIndex = "1";
e.style.position = "absolute";
e.style.overflow = "auto";
e.style.width = a.Ta.width + "px";
e.style.height = a.Ta.height + "px";
e.style.zIndex =
"1";
g.style.position = "absolute";
g.style.width = "1px";
g.style.height = "1px";
h.style.position = "absolute";
h.style.width = "1px";
h.style.height = "1px";
a.vb.appendChild(d);
a.vb.appendChild(e);
d.appendChild(g);
e.appendChild(h);
d.onscroll = a.aC;
d.onmousedown = a.bC;
d.ba = a;
d.jC = !0;
e.onscroll = a.aC;
e.onmousedown = a.bC;
e.ba = a;
e.kC = !0;
a.tj = d;
a.uj = e;
a.Gy = g;
a.Hy = h;
a.preventDefault = function (a) {
a.preventDefault();
return!1
};
a.$o = function (b) {
if (a.isEnabled) {
a.wn = !0;
var c = a.Qc;
a.vn && c.aw ? (b.preventDefault(), b.simulated = !0, a.Ir =
b) : (a.Qc = a.hc, a.hc = c, Rh(a, a, b, c, !0), a.gF(b, new v, b.target.ba) || (a.Na.doMouseMove(), a.Na.isBeyondDragSize() && (Sh(a), a.Jl = 0)))
}
};
a.Zo = function (b) {
if (a.isEnabled) {
a.wn = !0;
var c = a.Qc;
if (a.vn && null !== a.Ir)a.Ir = b, b.preventDefault(); else if (a.Qc = a.hc, a.hc = c, Rh(a, a, b, c, !0), c.Oj = !0, c.ve = b.detail, a.sg = c.copy(), !0 === c.lq.simulated)b.preventDefault(), b.simulated = !0; else if (f && f.xE && (window.xE = a.zo(c.V)), bf = null, a.Na.doMouseDown(), 1 === b.button)return b.preventDefault(), !1
}
};
a.bp = function (b) {
if (a.isEnabled) {
a.wn = !0;
var c = a.Qc;
if (a.vn && null !== a.Ir)a.Ir = null, b.preventDefault(); else {
a.Qc = a.hc;
a.hc = c;
Rh(a, a, b, c, !0);
c.Mi = !0;
c.ve = b.detail;
if (a.ay || a.KB)b.timeStamp - a.ju < a.vC && !a.Na.isBeyondDragSize() ? a.Jl++ : a.Jl = 1, a.ju = b.timeStamp, c.ve = a.Jl;
c.bubbles = b.bubbles;
b.target.ba && (c.lg = b.target.ba);
a.hF(b, null, new v, c.lg) || (a.Na.doMouseUp(), gf(a), Th(a, c, b))
}
}
};
a.Kg = function (b) {
if (a.isEnabled) {
var c = a.Qc;
a.Qc = a.hc;
a.hc = c;
Rh(a, a, b, c, !0);
c.bubbles = !0;
c.Mj = void 0 !== b.wheelDelta ? b.wheelDelta : -40 * b.detail;
a.Na.doMouseWheel();
Th(a, c, b)
}
};
a.ap = function () {
if (a.isEnabled) {
a.wn = !1;
var b = a.Na;
b.cancelWaitAfter();
b instanceof Ae && b.hideToolTip()
}
};
a.aA = function () {
if (null !== a.Ta) {
var b = a.vb, c = 0;
a.Al && (c = a.af);
var d = 0;
a.zl && (d = a.af);
0 === b.clientWidth || 0 === b.clientHeight || b.clientWidth === a.oc + c && b.clientHeight === a.nc + d || (a.dj = !0, a.Ee = !0, b = a.Vb, null !== b && b.Hs && b.J(), a.yd || a.Hf())
}
};
a.wF = function (b) {
if (a.isEnabled) {
a.Qy = !1;
if (1 < b.touches.length && (a.Na.doCancel(), !a.Sh || !t.pF)) {
if (a.Sh) {
a.Px = !0;
a.Pl = a.scale;
var c = a.Ta, d = c.getBoundingClientRect(),
e = b.targetTouches[0], g = e.clientX - c.width / d.width * d.left, h = e.clientY - c.height / d.height * d.top, e = b.targetTouches[1], g = e.clientX - c.width / d.width * d.left - g, c = e.clientY - c.height / d.height * d.top - h, c = Math.sqrt(g * g + c * c);
a.mC = c;
b.preventDefault();
b.cancelBubble = !0;
return!1
}
Sh(a);
b.cancelBubble = !1;
return!0
}
c = a.Qc;
a.Qc = a.hc;
a.hc = c;
c.h = a;
d = a.ah(b.targetTouches[0]);
c.Zc = a.xp(d);
c.V = d;
c.Mc = 0;
c.button = 0;
c.Oj = !0;
c.Mi = !1;
c.ve = 1;
c.Mj = 0;
c.ze = !1;
c.bubbles = !1;
c.event = b;
c.timestamp = Date.now();
c.lg = b.target.ba ? b.target.ba :
null;
c.Nd = null;
a.sg = c.copy();
bf = null;
a.Na.doMouseDown();
Uh(a, c);
Th(a, c, b)
}
};
a.vF = function (b) {
if (a.isEnabled) {
if (1 < b.touches.length && (a.Na.doCancel(), Sh(a), !a.Sh || !t.pF)) {
if (a.Sh && a.Px && 1 < b.targetTouches.length) {
var c = a.Ta, d = c.getBoundingClientRect(), e = b.targetTouches[0], g = e.clientX - c.width / d.width * d.left, h = e.clientY - c.height / d.height * d.top, e = b.targetTouches[1], r = e.clientX - c.width / d.width * d.left, e = e.clientY - c.height / d.height * d.top, c = r - g, d = e - h, c = Math.sqrt(c * c + d * d) / a.mC, e = new v(Math.min(r, g) + Math.max(r,
g) / 2, Math.min(e, h) + Math.max(e, h) / 2), g = a.Pl * c, h = a.Le;
if (g > a.scale && h.canIncreaseZoom() || g < a.scale && h.canDecreaseZoom())h = a.Gh, a.Gh = e, a.scale = g, a.Gh = h;
b.preventDefault();
b.cancelBubble = !0;
return!1
}
b.cancelBubble = !1;
return!0
}
g = a.Qc;
a.Qc = a.hc;
a.hc = g;
e = h = null;
0 < b.changedTouches.length ? e = b.changedTouches[0] : 0 < b.targetTouches.length && (e = b.targetTouches[0]);
g.h = a;
e ? ((h = document.elementFromPoint(e.clientX, e.clientY)) && h.ba ? (r = h.ba.ah(e), c = h.ba) : (r = a.ah(b.changedTouches[0]), c = a), g.V = r, g.Zc = c.xp(r)) : null !==
a.Qc ? (g.V = a.Qc.V, g.Zc = a.Qc.Zc, h = a.Qc.lg) : null !== a.sg && (g.V = a.sg.V, g.Zc = a.sg.Zc, h = a.sg.lg);
g.Mc = 0;
g.button = 0;
g.Oj = !1;
g.Mi = !1;
g.ve = 1;
g.Mj = 0;
g.ze = !1;
g.bubbles = !1;
g.event = b;
g.timestamp = Date.now();
g.lg = null === h ? b.target.ba : h.ba ? h.ba : null;
g.Nd = null;
a.Na.isBeyondDragSize() && Sh(a);
a.gF(e ? e : b, new v, g.lg) || (a.Na.doMouseMove(), Th(a, g, b))
}
};
a.uF = function (b) {
if (a.isEnabled) {
Sh(a);
if (a.Qy)return b.preventDefault(), !1;
var c = a.Qc;
a.Qc = a.hc;
a.hc = c;
if (1 < b.touches.length)a.Sh && (a.Px = !1); else {
var d = null, e, g = null;
0 < b.changedTouches.length ?
g = b.changedTouches[0] : 0 < b.targetTouches.length && (g = b.targetTouches[0]);
c.h = a;
c.ve = 1;
if (g) {
var d = document.elementFromPoint(g.clientX, g.clientY), h;
d && d.ba ? (e = d.ba.ah(g), h = d.ba) : (e = a.ah(b.changedTouches[0]), h = a);
c.V = e;
c.Zc = h.xp(e);
e = new v(g.screenX, g.screenY);
h = a.QB;
b.timeStamp - a.ju < a.vC && !(25 < Math.abs(h.x - e.x) || 25 < Math.abs(h.y - e.y)) ? a.Jl++ : a.Jl = 1;
c.ve = a.Jl;
a.ju = b.timeStamp;
a.QB = e
} else null !== a.Qc ? (c.V = a.Qc.V, c.Zc = a.Qc.Zc, d = a.Qc.lg) : null !== a.sg && (c.V = a.sg.V, c.Zc = a.sg.Zc, d = a.sg.lg);
c.Mc = 0;
c.button = 0;
c.Oj = !1;
c.Mi = !0;
c.Mj = 0;
c.ze = !1;
c.bubbles = !1;
c.event = b;
c.timestamp = Date.now();
c.lg = null === d ? b.target.ba : d.ba ? d.ba : null;
c.Nd = null;
a.hF(g ? g : b, null, new v, c.lg) || (a.Na.doMouseUp(), Th(a, c, b))
}
}
};
c.addEventListener("touchstart", a.wF, !1);
c.addEventListener("touchmove", a.vF, !1);
c.addEventListener("touchend", a.uF, !1);
c.addEventListener("gesturestart", function () {
!1 !== a.Sh && (a.Pl = a.scale, a.Na.doCancel(), a.CB = 0)
}, !1);
c.addEventListener("gesturechange", function (b) {
if (!1 !== a.Sh) {
var c = b.scale;
a.CB++;
if (1 === a.CB)if (1.02 <
c || 0.98 > c)b.preventDefault(); else {
a.Pl = null;
return
}
if (null !== a.Pl) {
var d = a.Ta, e = d.getBoundingClientRect();
b = new v(b.pageX - window.scrollX - d.width / e.width * e.left, b.pageY - window.scrollY - d.height / e.height * e.top);
d = a.Gh;
c *= a.Pl;
e = a.Le;
if (c > a.scale && e.canIncreaseZoom() || c < a.scale && e.canDecreaseZoom())a.Gh = b, a.scale = c, a.Gh = d
}
}
}, !1);
c.addEventListener("gestureend", function () {
a.Pl = 1
}, !1);
c.addEventListener("mousemove", a.$o, !1);
c.addEventListener("mousedown", a.Zo, !1);
c.addEventListener("mouseup", a.bp, !1);
c.addEventListener("mousewheel",
a.Kg, !1);
c.addEventListener("DOMMouseScroll", a.Kg, !1);
c.addEventListener("mouseout", a.ap, !1);
c.addEventListener("keydown", a.WH, !1);
c.addEventListener("keyup", a.XH, !1);
c.addEventListener("selectstart", function (a) {
a.preventDefault();
return!1
}, !1);
c.addEventListener("contextmenu", function (a) {
a.preventDefault();
return!1
}, !1);
window.addEventListener("resize", a.aA, !1);
c.tabIndex = 0;
Vh(a)
} else a.vb.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element."
}
z.prototype.focus = z.prototype.focus = function () {
this.Ta && this.Ta.focus()
};
function Vh(a, b, c) {
void 0 === b && (b = a.Ti);
void 0 === c && (c = !0);
c && (b.rt = "");
b.Sm = "";
b.Rm = ""
}
function Lh(a) {
var b = new Sd;
b.name = "Background";
a.cs(b);
b = new Sd;
b.name = "";
a.cs(b);
b = new Sd;
b.name = "Foreground";
a.cs(b);
b = new Sd;
b.name = "Adornment";
b.kc = !0;
a.cs(b);
b = new Sd;
b.name = "Tool";
b.kc = !0;
a.cs(b);
b = new Sd;
b.name = "Grid";
b.Ie = !1;
b.nf = !1;
b.kc = !0;
a.uG(b, a.qs("Background"))
}
function Wh(a) {
a.Pc = new y(Xh);
a.Pc.name = "GRID";
var b = new Y;
b.Db = "LineH";
b.stroke = "lightgray";
b.bb = 0.5;
b.interval = 1;
a.Pc.add(b);
b = new Y;
b.Db = "LineH";
b.stroke = "gray";
b.bb = 0.5;
b.interval = 5;
a.Pc.add(b);
b = new Y;
b.Db = "LineH";
b.stroke = "gray";
b.bb = 1;
b.interval = 10;
a.Pc.add(b);
b = new Y;
b.Db = "LineV";
b.stroke = "lightgray";
b.bb = 0.5;
b.interval = 1;
a.Pc.add(b);
b = new Y;
b.Db = "LineV";
b.stroke = "gray";
b.bb = 0.5;
b.interval = 5;
a.Pc.add(b);
b = new Y;
b.Db = "LineV";
b.stroke = "gray";
b.bb = 1;
b.interval = 10;
a.Pc.add(b);
b = new B;
b.add(a.Pc);
b.Md = "Grid";
b.Tz = !1;
b.nf = !1;
b.fw = "GRID";
a.add(b);
a.qb.remove(b);
a.Pc.visible = !1
}
z.prototype.aC = function () {
if (this.ba.isEnabled) {
var a = this.ba;
if (a.Fy && null !== a.Ta) {
a.Ou = !0;
var b = a.gd, c = a.lb, d = b.width, e = c.width, g = b.height, h = c.height, k = b.right, l = c.right, m = b.bottom, n = c.bottom, p = b.x, q = c.x, b = b.y, c = c.y, r = a.scale;
if (e < d || h < g) {
var s = t.M();
this.jC && a.bf ? (s.q(this.scrollLeft / r + p, a.position.y), a.position = s) : this.kC && a.cf && (s.q(a.position.x, this.scrollTop / r + b), a.position = s);
t.B(s);
a.Ou = !1;
a.dj = !1
} else s = t.M(), this.jC && a.bf && (p < q && (a.position = new v(this.scrollLeft + p, a.position.y)), k > l && (a.position =
new v(-(a.tj.scrollWidth - a.oc) + this.scrollLeft - a.oc / r + a.gd.right, a.position.y))), this.kC && a.cf && (b < c && (a.position = new v(a.position.x, this.scrollTop + b)), m > n && (a.position = new v(a.position.x, -(a.uj.scrollHeight - a.nc) + this.scrollTop - a.nc / r + a.gd.bottom))), t.B(s), Yh(a), a.Ou = !1, a.dj = !1, b = a.gd, c = a.lb, k = b.right, l = c.right, m = b.bottom, n = c.bottom, p = b.x, q = c.x, b = b.y, c = c.y, e >= d && p >= q && k <= l && (a.Gy.style.width = "1px"), h >= g && b >= c && m <= n && (a.Hy.style.height = "1px")
}
} else Zh(this.ba)
};
z.prototype.bC = function () {
this.ba.isEnabled ? this.ba.Fy = !0 : Zh(this.ba)
};
z.prototype.computeBounds = z.prototype.df = function () {
0 < this.Of.count && $h(this);
return ai(this)
};
function ai(a) {
if (a.Ez.P()) {
var b = a.Ez.copy();
b.lv(a.padding);
return b
}
for (var c = !0, d = a.Fb.p, e = d.length, g = 0; g < e; g++) {
var h = d[g];
if (h.visible && !h.kc)for (var h = h.qb.p, k = h.length, l = 0; l < k; l++) {
var m = h[l];
m.Tz && m.ub() && (m = m.ua, m.P() && (c ? (c = !1, b = m.copy()) : b.ak(m)))
}
}
c && (b = new w(0, 0, 0, 0));
b.lv(a.padding);
return b
}
z.prototype.computePartsBounds = function (a) {
var b = null;
for (a = a.l; a.next();) {
var c = a.value;
c instanceof X || (c.zf(), null === b ? b = c.ua.copy() : b.ak(c.ua))
}
return null === b ? new w(NaN, NaN, 0, 0) : b
};
function bi(a, b) {
if ((b || a.Nf) && !a.gc && a.gd.P() && null !== a.Ta) {
a.gc = !0;
var c = a.ql;
b && a.xk !== Ge && (c = a.xk);
var d = c !== Ge ? ci(a, c) : a.scale, c = a.lb.copy(), e = a.oc / d, g = a.nc / d;
a.position.Qa();
var h = a.tl;
b && a.tn.jd() && (h = a.tn);
di(a, a.sb, a.gd, e, g, h);
a.position.freeze();
a.scale = d;
a.gc = !1;
d = a.lb;
d.xi(c) || a.Us(c, d)
}
}
function ci(a, b) {
if (null !== a.Ta) {
a.cj && ei(a, a.df());
var c = a.gd;
if (!c.P())return 1;
var d = c.width, c = c.height, e = a.oc, g = a.nc, h = e / d, k = g / c, l = 1;
return b === fi ? (l = Math.min(k, h), 1 < l && (l = 1), l < a.cg && (l = a.cg), l > a.bg && (l = a.bg), l) : b === gi ? (l = k > h ? (g - a.af) / c : (e - a.af) / d, 1 < l && (l = 1), l < a.cg && (l = a.cg), l > a.bg && (l = a.bg), l) : a.scale
}
}
z.prototype.zoomToFit = z.prototype.zoomToFit = function () {
this.scale = ci(this, fi)
};
z.prototype.zoomToRect = function (a, b) {
void 0 === b && (b = fi);
var c = a.width, d = a.height;
if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) {
var e = 1;
if (b === fi || b === gi)if (isNaN(c))e = this.lb.height * this.scale / d; else if (isNaN(d))e = this.lb.width * this.scale / c; else var e = this.oc, g = this.nc, e = b === gi ? g / d > e / c ? (g - (this.zl ? this.af : 0)) / d : (e - (this.Al ? this.af : 0)) / c : Math.min(g / d, e / c);
this.scale = e;
this.position = new v(a.x, a.y)
}
};
z.prototype.alignDocument = function (a, b) {
this.cj && ei(this, this.df());
var c = this.gd, d = this.lb, e = this.gc;
this.gc = !0;
this.position = new v(c.x + (a.x * c.width + a.offsetX) - (b.x * d.width - b.offsetX), c.y + (a.y * c.height + a.offsetY) - (b.y * d.height - b.offsetY));
this.gc = e;
this.ra()
};
function di(a, b, c, d, e, g) {
g.jd() && (d > c.width && (b.x = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (b.y = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY)));
d < c.width ? (g = b.x + d / 2, g = Math.min(g, c.right - d / 2), g = Math.max(g, c.left + d / 2), b.x = g - d / 2) : b.x > c.left ? b.x = c.left : b.x < c.right - d && (b.x = c.right - d);
e < c.height ? (d = b.y + e / 2, d = Math.min(d, c.bottom - e / 2), d = Math.max(d, c.top + e / 2), b.y = d - e / 2) : b.y > c.top ? b.y = c.top : b.y < c.bottom - e && (b.y = c.bottom - e);
isFinite(b.x) || (b.x = -a.padding.left);
isFinite(b.y) || (b.y = -a.padding.top)
}
z.prototype.findPartAt = z.prototype.ss = function (a, b) {
var c = b ? Ff(this, a, function (a) {
return a.S
}, function (a) {
return a.canSelect()
}) : Ff(this, a, function (a) {
return a.S
});
return c instanceof B ? c : null
};
z.prototype.findObjectAt = z.prototype.fe = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
var d = this.Fb.Am;
for ($h(this); d.next();) {
var e = d.value;
if (e.visible && (e = e.fe(a, b, c), null !== e))return e
}
return null
};
function Ff(a, b, c, d) {
void 0 === c && (c = null);
void 0 === d && (d = null);
var e = a.Fb.Am;
for ($h(a); e.next();)if (a = e.value, a.visible && !a.kc && (a = a.fe(b, c, d), null !== a))return a;
return null
}
z.prototype.findObjectsAt = z.prototype.zo = function (a, b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof A || d instanceof ka || (d = new ka(Q));
$h(this);
for (var e = this.Fb.Am; e.next();) {
var g = e.value;
g.visible && g.zo(a, b, c, d)
}
return d
};
z.prototype.findObjectsIn = z.prototype.Qj = function (a, b, c, d, e) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = !1);
e instanceof A || e instanceof ka || (e = new ka(Q));
$h(this);
for (var g = this.Fb.Am; g.next();) {
var h = g.value;
h.visible && h.Qj(a, b, c, d, e)
}
return e
};
z.prototype.Dz = function (a, b, c, d, e, g) {
var h = new ka(Q);
$h(this);
for (var k = this.Fb.Am; k.next();) {
var l = k.value;
l.visible && l.Dz(a, b, c, d, h, e, g)
}
return h
};
z.prototype.findObjectsNear = z.prototype.um = function (a, b, c, d, e, g) {
void 0 === c && (c = null);
void 0 === d && (d = null);
void 0 === e && (e = !0);
if (!1 !== e && !0 !== e) {
if (e instanceof A || e instanceof ka)g = e;
e = !0
}
g instanceof A || g instanceof ka || (g = new ka(Q));
$h(this);
for (var h = this.Fb.Am; h.next();) {
var k = h.value;
k.visible && k.um(a, b, c, d, e, g)
}
return g
};
function Sh(a) {
-1 !== a.$u && (clearTimeout(a.$u), a.$u = -1)
}
function Uh(a, b) {
var c = b.copy();
a.$u = setTimeout(function () {
c.button = 2;
a.R = c;
a.Qy = !0;
a.Na.doMouseUp()
}, 850)
}
function Rh(a, b, c, d, e) {
d.h = b;
e ? (e = b.ah(c), d.Zc = b.xp(e), d.V = e) : (d.Zc = b.hc.Zc, d.V = b.hc.V);
b = 0;
c.ctrlKey && (b += 1);
c.altKey && (b += 2);
c.shiftKey && (b += 4);
c.metaKey && (b += 8);
d.Mc = b;
d.button = c.button;
a.Dl && 0 === c.button && c.ctrlKey && (d.button = 2);
d.Oj = !1;
d.Mi = !1;
d.ve = 1;
d.Mj = 0;
d.ze = !1;
d.bubbles = !1;
d.event = c;
d.timestamp = Date.now();
d.lg = c.target.ba ? c.target.ba : null;
d.Nd = null
}
function Th(a, b, c) {
if (b.bubbles)return f && f.LD && t.trace("NOT handled " + c.type + " " + b.toString()), !0;
f && f.LD && t.trace("handled " + c.type + " " + a.Na.name + " " + b.toString());
void 0 !== c.stopPropagation && c.stopPropagation();
(void 0 === c.touches || 2 > c.touches.length) && c.preventDefault();
c.cancelBubble = !0;
return!1
}
z.prototype.WH = function (a) {
if (this.ba.isEnabled) {
var b = this.ba.hc;
Rh(this.ba, this.ba, a, b, !1);
b.key = String.fromCharCode(a.which);
b.Oj = !0;
switch (a.which) {
case 33:
b.key = "PageUp";
break;
case 34:
b.key = "PageDown";
break;
case 35:
b.key = "End";
break;
case 36:
b.key = "Home";
break;
case 37:
b.key = "Left";
break;
case 38:
b.key = "Up";
break;
case 39:
b.key = "Right";
break;
case 40:
b.key = "Down";
break;
case 45:
b.key = "Insert";
break;
case 46:
b.key = "Del";
break;
case 48:
b.key = "0";
break;
case 187:
b.key = "Add";
break;
case 189:
b.key = "Subtract";
break;
case 107:
b.key = "Add";
break;
case 109:
b.key = "Subtract";
break;
case 27:
b.key = "Esc"
}
this.ba.Na.doKeyDown();
return 187 !== a.which && 189 !== a.which && 48 !== a.which && 107 !== a.which && 109 !== a.which || !0 !== a.ctrlKey ? Th(this.ba, b, a) : (a.cancelBubble = !0, void 0 !== a.preventDefault ? a.preventDefault() : a.returnValue = !1, Event.stop && (t.m("Event.stop can fire for this browser"), Event.stop(a)), void 0 !== a.stopPropagation && a.stopPropagation(), !1)
}
};
z.prototype.XH = function (a) {
if (this.ba.isEnabled) {
var b = this.ba.hc;
Rh(this.ba, this.ba, a, b, !1);
b.key = String.fromCharCode(a.which);
b.Mi = !0;
switch (a.which) {
case 33:
b.key = "PageUp";
break;
case 34:
b.key = "PageDown";
break;
case 35:
b.key = "End";
break;
case 36:
b.key = "Home";
break;
case 37:
b.key = "Left";
break;
case 38:
b.key = "Up";
break;
case 39:
b.key = "Right";
break;
case 40:
b.key = "Down";
break;
case 45:
b.key = "Insert";
break;
case 46:
b.key = "Del"
}
this.ba.Na.doKeyUp();
return Th(this.ba, b, a)
}
};
z.prototype.ah = function (a) {
var b = this.Ta;
if (null === b)return new v(0, 0);
var c = b.getBoundingClientRect(), d = a.clientX - b.width / c.width * c.left;
a = a.clientY - b.height / c.height * c.top;
return null !== this.qd ? (d = new v(d, a), Oa(d, this.qd), d) : new v(d, a)
};
t.g(z, "renderingHints", z.prototype.IE);
t.defineProperty(z, {IE: "renderingHints"}, function () {
return this.gC
}, function (a) {
this.gC = a;
this.sA()
});
z.prototype.invalidateDocumentBounds = z.prototype.vc = function () {
this.cj = !0;
this.Hf()
};
function hi(a) {
a.yd || $h(a);
a.cj && ei(a, a.df());
bi(a);
for (a = a.Nn.l; a.next();)hi(a.value)
}
z.prototype.redraw = z.prototype.sA = function () {
this.gc || this.yd || (this.ra(), ii(this), Yh(this), this.vc(), this.Hi())
};
z.prototype.isUpdateRequested = function () {
return this.Vf
};
z.prototype.delayInitialization = function (a) {
ji(this);
this.Nf = !1;
a && setTimeout(a, 1)
};
z.prototype.requestUpdate = z.prototype.Hf = function (a) {
void 0 === a && (a = !1);
if (!0 !== this.Vf && !(this.gc || !1 === a && this.yd)) {
this.Vf = !0;
var b = this;
requestAnimationFrame(function () {
b.Vf && b.Hi()
})
}
};
z.prototype.maybeUpdate = z.prototype.Hi = function () {
if (!this.mq || this.Vf)this.mq && (this.mq = !1), ji(this)
};
function ji(a) {
if (!a.yd && (a.Vf = !1, null !== a.vb)) {
a.yd = !0;
a.aA();
!a.gc && a.dj && (Zh(a) || Zh(a));
null !== a.Pc && (a.Pc.visible && !a.Yt && (qi(a), a.Yt = !0), !a.Pc.visible && a.Yt && (a.Yt = !1));
$h(a);
var b = !1;
if (!a.Nf || a.At)a.Nf ? ri(a, !a.Rt) : (a.mc("Initial Layout"), ri(a, !1)), b = !0;
a.Rt = !1;
$h(a);
a.Jy || hi(a);
b && (a.Nf || (si(a), qi(a)), a.Ea("LayoutCompleted"));
ti(a);
$h(a);
a.gc || !a.dj || Zh(a) || (Zh(a), $h(a));
b && !a.Nf && (a.Nf = !0, a.xe("Initial Layout"), a.va.clear(), setTimeout(function () {
a.Vj = !1
}, 1));
a.Ne();
a.yd = !1
}
}
function si(a) {
if (a.xk !== Ge)a.scale = ci(a, a.xk); else if (a.ql !== Ge)a.scale = ci(a, a.ql); else {
var b = a.SD;
isFinite(b) && 0 < b && (a.scale = b)
}
a.cj && ei(a, a.df());
b = a.RD;
if (b.P())a.position = b; else {
b = t.M();
b.et(a.gd, a.QD);
var c = a.lb, c = t.Zj(0, 0, c.width, c.height), d = t.M();
d.et(c, a.TD);
a.position = new v(b.x - d.x, b.y - d.y);
t.Jc(c);
t.B(d);
t.B(b);
bi(a, !0)
}
a.Ea("InitialLayoutCompleted")
}
function $h(a) {
if (0 !== a.Of.count)for (var b = 0; 23 > b; b++) {
var c = a.Of.l;
if (null === c || 0 === a.Of.count)break;
a.Of = new ka(Q);
var d = a, e = a.Of;
for (c.reset(); c.next();) {
var g = c.value;
!g.Jd() || g instanceof U || (g.Zk() ? (lh(g, Infinity, Infinity), g.yc()) : e.add(g))
}
for (c.reset(); c.next();)g = c.value, g instanceof U && ui(d, g);
for (c.reset(); c.next();)d = c.value, d instanceof X && (d.Zk() ? (lh(d, Infinity, Infinity), d.yc(), d.gw()) : e.add(d));
for (c.reset(); c.next();)d = c.value, d instanceof Ce && (d.Zk() ? (lh(d, Infinity, Infinity), d.yc()) :
e.add(d))
}
}
function ui(a, b) {
for (var c = b.Lc, d = t.yb(); c.next();) {
var e = c.value;
e instanceof U ? (vi(e) || wi(e) || xi(e)) && ui(a, e) : e instanceof X ? d.push(e) : (lh(e, Infinity, Infinity), e.yc())
}
c = d.length;
for (e = 0; e < c; e++) {
var g = d[e];
lh(g, Infinity, Infinity);
g.yc()
}
t.xa(d);
lh(b, Infinity, Infinity);
b.yc()
}
z.prototype.If = function (a, b, c, d) {
for (var e = 0; e < b; e++)a[e].If(c, d)
};
z.prototype.Ne = function (a, b) {
null === this.vb && t.m("No div specified");
var c = this.Ta;
null === c && t.m("No canvas specified");
a || (a = this.Ti);
var d = a !== this.Ti, e = this.Fb.p, g = e.length, h = this;
this.If(e, g, h);
if (d)Vh(this, a), Yh(this); else if (!this.Ee && void 0 === b)return;
var g = this.sb, k = this.Xb, l = Math.round(g.x * k) / k, m = Math.round(g.y * k) / k, n = this.qd;
n.reset();
1 !== k && n.scale(k);
0 === g.x && 0 === g.y || n.translate(-l, -m);
var p = this.Vi;
if (k = null !== p && 0 < p.length && !0 === this.Ey) {
m = this.ay;
a.save();
a.beginPath();
g = p.length;
for (l = 0; l < g; l++) {
var q = p[l];
if (0 !== q[2] || 0 !== q[3])q = yi(this, q), a.rect(Math.floor(q[0]) - 1, Math.floor(q[1]) - 1, Math.ceil(q[2]) + 2, Math.ceil(q[3]) + 2), m && a.clearRect(Math.floor(q[0]) - 1, Math.floor(q[1]) - 1, Math.ceil(q[2]) + 2, Math.ceil(q[3]) + 2)
}
a.clip()
}
this.vn ? (c.width = c.width, k = !1, Vh(this, a)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.clearRect(0, 0, this.oc, this.nc));
a.miterLimit = 9;
a.setTransform(n.m11, n.m12, n.m21, n.m22, n.dx, n.dy);
f && f.rz && f.pH(this, a);
c = b ? function (c) {
var d = a;
if (c.visible) {
d.globalAlpha = c.wf;
var e = c.qb;
c = c.Gu;
c.length = 0;
for (var g = h.scale, k = e.length, l = 0; l < k; l++) {
var m = e.p[l];
if (Ah(m) && !b.contains(m)) {
if (m instanceof X && (m.Ub && c.push(m), !1 === m.Dg))continue;
var n = m.ua;
1 < n.width * g || 1 < n.height * g ? m.Ne(d, h) : Ch(m, d)
}
}
d.globalAlpha = 1
}
} : k ? function (b) {
Dh(b, a, h, p)
} : function (b) {
b.Ne(a, h)
};
zi(this, a);
g = e.length;
for (l = 0; l < g; l++)c(e[l]);
this.Vi = [];
//debugger;
this.vk.Wi=false;
this.vk ? this.vk.ol(this) && this.ix() : this.ah = function () {
};
k && (a.restore(), Vh(this, a), f && f.eJ && f.dJ(p, a, this));
d ? (Vh(this), Yh(this)) : this.Ee = this.yk = !1
};
function Ai(a, b, c, d, e) {
null === a.vb && t.m("No div specified");
var g = a.Ta;
null === g && t.m("No canvas specified");
var h = a.Ti;
if (a.Ee) {
a.vn ? (g.width = g.width, Vh(a, h)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.oc, a.nc));
h.OF = !1;
h.PD = !1;
h.drawImage(a.Ix, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e));
e = a.sb;
var g = a.Xb, k = Math.round(e.x * g) / g, l = Math.round(e.y * g) / g;
d = a.qd;
d.reset();
1 !== g && d.scale(g);
0 === e.x && 0 === e.y || d.translate(-k, -l);
h.save();
h.beginPath();
e = c.length;
for (g = 0; g < e; g++)k = c[g], 0 !== k[2] && 0 !== k[3] &&
h.rect(Math.floor(k[0]), Math.floor(k[1]), Math.ceil(k[2]), Math.ceil(k[3]));
h.clip();
h.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
f && f.rz && f.pH(a, h);
c = a.Fb.p;
e = c.length;
a.If(c, e, a);
zi(a, h);
for (g = 0; g < e; g++)Dh(c[g], h, a, b);
h.restore();
Vh(a);
a.vk ? a.vk.ol(a) && a.ix() : a.ah = function () {
};
a.yk = !1;
a.Ee = !1
}
}
function Bi(a, b, c, d, e, g, h, k, l, m) {
null === a.vb && t.m("No div specified");
null === a.Ta && t.m("No canvas specified");
Vh(a);
Yh(a);
var n = void 0;
g && d && e && (n = new w(g.x, g.y, d.width / e, d.height / e));
var p = n.copy();
p.lv(c);
qi(a, p);
$h(a);
var p = a.Fb.p, q = p.length;
a.If(p, q, a, n);
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, d.width, d.height);
k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height));
d = t.Ng();
d.reset();
d.translate(c.left, c.top);
d.scale(e);
0 === g.x && 0 === g.y || d.translate(-g.x, -g.y);
b.setTransform(d.m11, d.m12, d.m21,
d.m22, d.dx, d.dy);
t.Oe(d);
zi(a, b);
if (h) {
var r = new ka;
c = h.l;
for (c.reset(); c.next();)e = c.value.S, !1 === m && "Grid" === e.layer.name || null === e || r.add(e);
c = function (c) {
var d = l;
if (c.visible && (void 0 === d && (d = !0), d || !c.kc)) {
b.globalAlpha = c.wf;
d = c.qb;
c = c.Gu;
c.length = 0;
for (var e = a.scale, g = d.length, h = 0; h < g; h++) {
var k = d.p[h];
if (Ah(k) && r.contains(k)) {
if (k instanceof X && (k.Ub && c.push(k), !1 === k.Dg))continue;
var m = k.ua;
1 < m.width * e || 1 < m.height * e ? k.Ne(b, a) : Ch(k, b)
}
}
b.globalAlpha = 1
}
}
} else if (!l && m) {
var s = a.Io.S, u = s.layer;
c = function (c) {
c === u ? s.Ne(b, a) : c.Ne(b, a, n, l, m)
}
} else c = function (c) {
c.Ne(b, a, n, l, m)
};
for (e = 0; e < q; e++)c(p[e]);
a.vk ? a.vk.ol(a) && a.ix() : a.ah = function () {
};
Vh(a);
Yh(a);
a.If(p, q, a);
qi(a)
}
function zi(a, b) {
var c = a.IE;
if (null !== c) {
if (void 0 !== c.imageSmoothingEnabled) {
var d = !!c.imageSmoothingEnabled;
b.PD = d;
b.OF = d;
b.oJ = d
}
c = c.defaultFont;
void 0 !== c && null !== c && (b.font = c, b.rt = c)
}
}
function ti(a) {
if (0 < a.kn.count) {
for (var b = a.kn.l; b.next();)zg(b.key, b.value);
a.kn.clear()
}
}
z.prototype.ra = function (a, b) {
if (this.Ey && void 0 !== a && null !== this.Vi) {
var c = this.lb;
if (a && c.Cf(a) || b && c.Cf(b))null !== this.Vi && (a && a.P() && Ci(this, a.x - 2, a.y - 2, a.width + 4, a.height + 4), b && b.P() && Ci(this, b.x - 2, b.y - 2, b.width + 4, b.height + 4)), this.Ee = !0, this.Hf()
} else this.Vi = null, this.Ee = !0, this.Hf();
for (c = this.Nn.l; c.next();)c.value.ra(a, b)
};
t.g(z, "viewportOptimizations", z.prototype.MI);
t.defineProperty(z, {MI: null}, function () {
return this.cz
}, function (a) {
t.k(a, "boolean", z, "viewportOptimizations");
this.Vi = null;
this.cz = a
});
function Ci(a, b, c, d, e) {
b = Math.floor(b);
c = Math.floor(c);
d = Math.ceil(d);
e = Math.ceil(e);
for (var g = a.Vi, h = g.length, k = 0; k < h; k++) {
var l = g[k];
if (b >= l[0] && c >= l[1] && b + d <= l[0] + l[2] && c + e <= l[1] + l[3])return!1;
b <= l[0] && c <= l[1] && b + d >= l[0] + l[2] && c + e >= l[1] + l[3] ? (g[k][2] = 0, g[k][3] = 0) : b >= l[0] && b < l[0] + l[2] && c >= l[1] && c + e <= l[1] + l[3] ? (d = b + d - (l[0] + l[2]), b = l[0] + l[2], k = -1) : b + d > l[0] && b + d <= l[0] + l[2] && c >= l[1] && c + e <= l[1] + l[3] ? (d = l[0] - b, k = -1) : b >= l[0] && b + d <= l[0] + l[2] && c >= l[1] && c < l[1] + l[3] ? (e = c + e - (l[1] + l[3]), c = l[1] + l[3], k = -1) : b >=
l[0] && b + d <= l[0] + l[2] && c + e > l[1] && c + e <= l[1] + l[3] ? (e = l[1] - c, k = -1) : g[k][0] >= b && g[k][0] < b + d && g[k][1] >= c && g[k][1] + g[k][3] <= c + e ? (g[k][2] -= b + d - g[k][0], g[k][0] = b + d, k = -1) : g[k][0] + g[k][2] > b && g[k][0] + g[k][2] <= b + d && g[k][1] >= c && g[k][1] + g[k][3] <= c + e ? (g[k][2] = b - g[k][0], k = -1) : g[k][0] >= b && g[k][0] + g[k][2] <= b + d && g[k][1] >= c && g[k][1] < c + e ? (g[k][3] -= c + e - g[k][1], g[k][1] = c + e, k = -1) : g[k][0] >= b && g[k][0] + g[k][2] <= b + d && g[k][1] + g[k][3] > c && g[k][1] + g[k][3] <= c + e && (g[k][3] = c - g[k][1], k = -1)
}
for (k = 0; k < h; k++)if (l = g[k], 0 < d && 0 < e && 0 < l[2] &&
0 < l[3] && (Math.max(b + d, l[0] + l[2]) - Math.min(b, l[0])) * (Math.max(c + e, l[1] + l[3]) - Math.min(c, l[1])) < d * e + l[2] * l[3] + 50) {
var h = Math.min(l[0], b), m = Math.min(l[1], c);
b = Math.max(b + d, l[0] + l[2]) - Math.min(l[0], b);
c = Math.max(c + e, l[1] + l[3]) - Math.min(l[1], c);
g[k][2] = 0;
g[k][3] = 0;
return Ci(a, h, m, b, c)
}
g.push([b, c, d, e]);
return!0
}
function Di(a, b, c) {
if (!0 !== a.Ee) {
a.Ee = !0;
if (a instanceof Ei)Fi(a); else if (!0 === a.cz && c.width === b.width && c.height === b.height) {
var d = a.scale, e = t.rf(), g = Math.max(b.x, c.x), h = Math.max(b.y, c.y), k = Math.min(b.x + b.width, c.x + c.width), l = Math.min(b.y + b.height, c.y + c.height);
e.x = g;
e.y = h;
e.width = Math.max(0, k - g) * d;
e.height = Math.max(0, l - h) * d;
if (0 < e.width && 0 < e.height) {
if (!a.yd && (a.Vf = !1, null !== a.vb && (a.yd = !0, ti(a), $h(a), a.gd.P() || ei(a, a.df()), k = a.Ta, null !== k))) {
g = a.oc;
h = a.nc;
l = a.scale;
d = Math.round(Math.round(c.x * l) -
Math.round(b.x * l));
b = Math.round(Math.round(c.y * l) - Math.round(b.y * l));
c = a.Ix;
l = a.yB;
c.width = g;
c.height = h;
var m = Math.max(d, 0);
c = Math.max(b, 0);
var n = g - m, p = h - c;
l.OF = !1;
l.PD = !1;
l.drawImage(k, m, c, n, p, 0, 0, n, p);
a.vk.ol(a) && l.clearRect(0, 0, 190, 70);
var k = t.yb(), l = t.yb(), p = Math.abs(d), n = Math.abs(b), q = 0 === m ? 0 : g - p, m = t.cc(q, 0), p = t.cc(p + q, h);
l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
var r = a.qd;
r.reset();
1 !== a.Xb && r.scale(a.Xb);
q = a.sb;
(0 !== q.x || 0 !== q.y) && isFinite(q.x) && isFinite(q.y) &&
r.translate(-q.x, -q.y);
Oa(m, r);
Oa(p, r);
k.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
q = 0 === c ? 0 : h - n;
m.q(0, q);
p.q(g, n + q);
l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
Oa(m, r);
Oa(p, r);
k.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
a.vk.ol(a) && (g = 0 < d ? 0 : -d, h = 0 < b ? 0 : -b, m.q(g, h), p.q(190 + g, 70 + h), l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]), Oa(m, r), Oa(p, r), k.push([Math.min(m.x,
p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]));
t.B(m);
t.B(p);
!a.gc && a.dj && (Zh(a) || Zh(a));
Ai(a, k, l, d, b);
t.xa(k);
t.xa(l);
a.yd = !1
}
} else a.Hf();
t.Jc(e)
} else a.Hi();
for (a = a.Nn.l; a.next();)Di(a.value)
}
}
function ii(a) {
!1 === a.dj && (a.dj = !0)
}
function Yh(a) {
!1 === a.yk && (a.yk = !0)
}
function Zh(a) {
var b = a.Ta;
if (null !== b) {
var c = a.vb, d = a.oc, e = a.nc, g = a.xC.copy(), h = !1, k = a.Al ? a.af : 0, l = a.zl ? a.af : 0, m = c.clientWidth || d + k, c = c.clientHeight || e + l;
if (m !== d + k || c !== e + l)a.Al = !1, a.zl = !1, a.oc = m, a.nc = c, b.width = m, b.height = c, h = !0;
a.dj = !1;
if (a.Ou)d === a.oc && e === a.nc || a.Hi(); else {
var n = a.lb, p = a.gd, k = p.width, l = p.height, q = n.width, r = n.height, s = p.x, u = n.x, x = p.right, E = n.right, F = p.y, G = n.y, L = p.bottom, N = n.bottom, p = n = "1px", V = a.scale;
m / V > k && c / V > l || (a.MD && a.bf && (q + 1 < k ? (n = (k - q) * V + a.oc + "px", a.tj.scrollLeft = (a.position.x -
s) * V) : s + 1 < u ? (n = (u - s) * V + a.oc + "px", a.tj.scrollLeft = a.tj.scrollWidth - a.tj.clientWidth) : x > E + 1 && (n = (x - E) * V + a.oc + "px", a.tj.scrollLeft = a.position.x * V)), a.ND && a.cf && (r + 1 < l ? (p = (l - r) * V + a.nc + "px", a.uj.scrollTop = (a.position.y - F) * V) : F + 1 < G ? (p = (G - F) * V + a.nc + "px", a.uj.scrollTop = a.uj.scrollHeight - a.uj.clientHeight) : L > N + 1 && (p = (L - N) * V + a.nc + "px", a.uj.scrollTop = a.position.y * V)));
m = "1px" !== n;
c = "1px" !== p;
m !== a.zl && (a.nc = "1px" === n ? a.nc + a.af : Math.max(a.nc - a.af, 1), b.height = a.nc, h = !0);
a.zl = m;
a.Gy.style.width = n;
c !== a.Al && (a.oc =
"1px" === p ? a.oc + a.af : Math.max(a.oc - a.af, 1), b.width = a.oc, h = !0);
a.Al = c;
a.Hy.style.height = p;
h && Vh(a);
m = a.oc;
c = a.nc;
a.uj.style.height = c + "px";
a.uj.style.width = m + (a.Al ? a.af : 0) + "px";
a.tj.style.width = m + "px";
a.tj.style.height = c + (a.zl ? a.af : 0) + "px";
a.Fy = !1;
return d !== m || e !== c ? (n = a.lb, a.Us(g, n, h ? !0 : void 0), !1) : !0
}
}
}
function Gi(a, b) {
for (var c = a.Fb, d = c.count, e = 0; e < d; e++)c.ta(e).name === b && t.m("Cannot add layer with the name '" + b + "', a layer of the same name is already present in this diagram.")
}
z.prototype.add = z.prototype.add = function (a) {
t.j(a, B, z, "add:part");
var b = a.h;
if (b !== this) {
null !== b && t.m("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString());
var c = a.Md, b = this.qs(c);
null === b && (b = this.qs(""));
null === b && t.m('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer');
a.layer !== b && (c = a.h === this ? b.ym(99999999, a, !0) : b.ym(99999999, a), 0 <= c && this.Yc(rd, "parts", b, null, a, null, c), b.kc || this.vc(), a.J(Hi), c = a.Po, null !== c &&
c(a, null, b))
}
};
z.prototype.ym = function (a) {
if (a instanceof S) {
if (this.Cu.add(a), a instanceof U) {
var b = a.ib;
null === b ? this.Ik.add(a) : b.In.add(a);
b = a.Vb;
null !== b && (b.h = this)
}
} else a instanceof X ? this.lu.add(a) : a instanceof Ce || this.qb.add(a);
a.rb && a.Y();
if (b = a.data) {
a instanceof Ce || (a instanceof X ? this.qk.add(b, a) : this.Oh.add(b, a));
var c = this;
Ii(a, function (a) {
Ji(c, a)
})
}
!0 !== wi(a) && !0 !== xi(a) || this.Of.add(a);
Ki(a, !0, this);
a.ub() && (a.ua.P() && this.ra(Eh(a, a.ua)), this.vc())
};
z.prototype.Pe = function (a) {
a.ue();
if (a instanceof S) {
if (this.Cu.remove(a), a instanceof U) {
var b = a.ib;
null === b ? this.Ik.remove(a) : b.In.remove(a);
b = a.Vb;
null !== b && (b.h = null)
}
} else a instanceof X ? this.lu.remove(a) : a instanceof Ce || this.qb.remove(a);
if (b = a.data) {
a instanceof Ce || (a instanceof X ? this.qk.remove(b) : this.Oh.remove(b));
var c = this;
Ii(a, function (a) {
Li(c, a)
})
}
this.Of.remove(a);
a.ub() && (a.ua.P() && this.ra(Eh(a, a.ua)), this.vc())
};
z.prototype.remove = z.prototype.remove = function (a) {
t.j(a, B, z, "remove:part");
a.Za = !1;
var b = a.layer;
if (null !== b && b.h === this) {
a.J(Mi);
a.rm();
var c = b.Pe(-1, a);
0 <= c && this.Yc(sd, "parts", b, a, null, c, null);
c = a.Po;
null !== c && c(a, b, null);
b.kc || this.vc()
}
};
z.prototype.removeParts = z.prototype.wA = function (a, b) {
if (a === this.selection) {
var c = new ka;
c.He(a);
a = c
}
for (c = a.l; c.next();) {
var d = c.value;
d.h === this && (b && !d.canDelete() || this.remove(d))
}
};
z.prototype.copyParts = z.prototype.copyParts = function (a, b, c) {
return this.Le.copyParts(a, b, c)
};
z.prototype.moveParts = z.prototype.moveParts = function (a, b, c) {
t.j(b, v, z, "moveParts:offset");
var d = this.zb;
if (null !== d) {
d = d.de;
null === d && (d = new Ze, d.h = this);
var e = new ia(B, Object);
if (a)a = a.l; else {
for (a = this.gp; a.next();)ef(d, e, a.value, c);
for (a = this.Ji; a.next();)ef(d, e, a.value, c);
a = this.links
}
for (; a.next();)ef(d, e, a.value, c);
d.moveParts(e, b, c)
}
};
z.prototype.addLayer = z.prototype.cs = function (a) {
t.j(a, Sd, z, "addLayer:layer");
Gi(this, a.name);
a.Ce(this);
var b = this.Fb, c = b.count - 1;
if (!a.kc)for (; 0 <= c && b.ta(c).kc;)c--;
b.Fd(c + 1, a);
null !== this.Xd && this.Yc(rd, "layers", this, null, a, null, c + 1);
this.vc()
};
z.prototype.addLayerBefore = z.prototype.uG = function (a, b) {
t.j(a, Sd, z, "addLayer:layer");
t.j(b, Sd, z, "addLayerBefore:existingLayer");
Gi(this, a.name);
a.Ce(this);
for (var c = !1, d = this.Fb.count, e = 0; e < d; e++)if (this.Fb.ta(e) === b) {
this.Fb.Fd(e, a);
c = !0;
break
}
c || t.m("addLayerBefore: Existing layer " + b.toString() + " not found.");
null !== this.Xd && this.Yc(rd, "layers", this, null, a, null, e);
this.vc()
};
z.prototype.addLayerAfter = function (a, b) {
t.j(a, Sd, z, "addLayer:layer");
t.j(b, Sd, z, "addLayerAfter:existingLayer");
Gi(this, a.name);
a.Ce(this);
for (var c = !1, d = this.Fb.count, e = 0; e < d; e++)if (this.Fb.ta(e) === b) {
this.Fb.Fd(e + 1, a);
c = !0;
break
}
c || t.m("addLayerAfter: Existing layer " + b.toString() + " not found.");
null !== this.Xd && this.Yc(rd, "layers", this, null, a, null, e + 1);
this.vc()
};
function Ni(a, b, c) {
t.j(b, Sd, z, "addLayer:layer");
Gi(a, b.name);
b.Ce(a);
a.Fb.Fd(c, b);
null !== a.Xd && a.Yc(rd, "layers", a, null, b, null, c);
a.vc()
}
z.prototype.removeLayer = z.prototype.GE = function (a) {
if ("" !== a.name) {
var b = this.Fb.indexOf(a);
if (this.Fb.remove(a)) {
for (var c = a.qb.copy().l; c.next();) {
var d = c.value, e = d.Md;
d.Md = "";
e !== a.name && (d.Md = e)
}
null !== this.Xd && this.Yc(sd, "layers", this, a, null, b, null);
this.vc()
}
}
};
z.prototype.findLayer = z.prototype.qs = function (a) {
for (var b = this.cw; b.next();) {
var c = b.value;
if (c.name === a)return c
}
return null
};
z.prototype.addChangedListener = z.prototype.iz = function (a) {
t.k(a, "function", z, "addChangedListener:listener");
null === this.Ri && (this.Ri = new A("function"));
this.Ri.add(a)
};
z.prototype.removeChangedListener = z.prototype.uA = function (a) {
t.k(a, "function", z, "removeChangedListener:listener");
null !== this.Ri && (this.Ri.remove(a), 0 === this.Ri.count && (this.Ri = null))
};
z.prototype.uv = function (a) {
this.xb || this.va.KD(a);
a.ed !== pd && (this.Vj = !0);
if (null !== this.Ri) {
var b = this.Ri, c = b.length;
if (1 === c)b = b.ta(0), b(a); else if (0 !== c)for (var d = b.Ve(), e = 0; e < c; e++)b = d[e], b(a)
}
};
z.prototype.raiseChangedEvent = z.prototype.Yc = function (a, b, c, d, e, g, h) {
void 0 === g && (g = null);
void 0 === h && (h = null);
var k = new od;
k.h = this;
k.ed = a;
k.propertyName = b;
k.object = c;
k.oldValue = d;
k.Gf = g;
k.newValue = e;
k.Ef = h;
this.uv(k)
};
z.prototype.raiseChanged = z.prototype.i = function (a, b, c, d, e) {
this.Yc(qd, a, this, b, c, d, e)
};
t.A(z, {va: "undoManager"}, function () {
return this.Xd.va
});
t.g(z, "skipsUndoManager", z.prototype.xb);
t.defineProperty(z, {xb: "skipsUndoManager"}, function () {
return this.gi
}, function (a) {
t.k(a, "boolean", z, "skipsUndoManager");
this.gi = a;
this.Xd.gi = a
});
z.prototype.changeState = function (a, b) {
if (null !== a && a.h === this) {
var c = a.ed;
if (c === qd) {
var c = a.object, d = a.propertyName, e = a.wa(b);
t.Pa(c, d, e);
c instanceof Q && (c = c.S, null !== c && c.ue())
} else if (c === rd)if (e = a.object, d = a.Ef, c = a.newValue, e instanceof y) {
if ("number" === typeof d && c instanceof Q) {
var g = e;
b ? g.Pe(d) : g.Fd(d, c);
c = e.S;
null !== c && c.ue()
}
} else e instanceof Sd ? (g = !0 === a.Gf, "number" === typeof d && c instanceof B && (b ? (c.ue(), g ? e.Pe(d, c, g) : this.remove(c)) : e.ym(d, c, g))) : e instanceof z ? "number" === typeof d && c instanceof
Sd && (b ? this.GE(c) : Ni(this, c, d)) : t.m("unknown ChangedEvent.Insert object: " + a.toString()); else c === sd ? (e = a.object, d = a.Gf, c = a.oldValue, e instanceof y ? "number" === typeof d && c instanceof Q && (g = e, b ? g.Fd(d, c) : g.Pe(d)) : e instanceof Sd ? (g = !0 === a.Ef, "number" === typeof d && c instanceof B && (b ? e.ym(d, c, g) : (c.ue(), g ? e.Pe(d, c, g) : this.remove(c)))) : e instanceof z ? "number" === typeof d && c instanceof Sd && (b ? Ni(this, c, d) : this.GE(c)) : t.m("unknown ChangedEvent.Remove object: " + a.toString())) : c !== pd && t.m("unknown ChangedEvent: " +
a.toString())
}
};
z.prototype.startTransaction = z.prototype.mc = function (a) {
return this.va.mc(a)
};
z.prototype.commitTransaction = z.prototype.xe = function (a) {
return this.va.xe(a)
};
z.prototype.rollbackTransaction = z.prototype.$s = function () {
return this.va.$s()
};
z.prototype.updateAllTargetBindings = function () {
for (var a = this.gp; a.next();)a.value.Eb();
for (a = this.Ji; a.next();)a.value.Eb();
for (a = this.links; a.next();)a.value.Eb()
};
z.prototype.Us = function (a, b, c) {
ii(this);
Yh(this);
var d = this.Vb;
null !== d && d.Hs && !c && (a.width !== b.width || a.height !== b.height || isNaN(a.x) && !isNaN(b.x) || isNaN(a.y && !isNaN(b.y))) && d.J();
this.gc || bi(this);
qi(this);
d = this.Na;
!0 === this.wn && d instanceof Ae && (this.R.V = this.AF(this.R.Zc), d.doMouseMove());
Di(this, a, b);
this.Ea("ViewportBoundsChanged", c ? {} : null, a)
};
function qi(a, b) {
var c = a.Pc;
if (null !== c && c.visible) {
for (var d = t.jl(), e = 1, g = 1, h = c.za.length, k = 0; k < h; k++) {
var l = c.za.p[k], m = l.interval;
2 > m || ("LineV" === l.Db ? g = g * m / D.BD(g, m) : e = e * m / D.BD(e, m))
}
h = c.xs;
d.q(g * h.width, e * h.height);
if (b)k = b.width, l = b.height, g = b.x, h = b.y; else {
e = t.rf();
g = a.lb;
e.q(g.x, g.y, g.width, g.height);
for (h = a.Nn.l; h.next();)g = h.value.lb, db(e, g.x, g.y, g.width, g.height);
k = e.width;
l = e.height;
g = e.x;
h = e.y;
if (!e.P())return
}
c.width = k + 2 * d.width;
c.height = l + 2 * d.height;
e = t.M();
D.rs(g, h, 0, 0, d.width, d.height,
e);
e.offset(-d.width, -d.height);
t.Rj(d);
c.S.location = e;
t.B(e)
}
}
z.prototype.clearSelection = z.prototype.uz = function () {
var a = 0 < this.selection.count;
a && this.Ea("ChangingSelection");
Fe(this);
a && this.Ea("ChangedSelection")
};
function Fe(a) {
a = a.selection;
if (0 < a.count) {
for (var b = a.Ve(), c = b.length, d = 0; d < c; d++)b[d].Za = !1;
a.Qa();
a.clear();
a.freeze()
}
}
z.prototype.select = z.prototype.select = function (a) {
null !== a && a.layer.h === this && (!a.Za || 1 < this.selection.count) && (this.Ea("ChangingSelection"), Fe(this), a.Za = !0, this.Ea("ChangedSelection"))
};
z.prototype.selectCollection = z.prototype.YE = function (a) {
this.Ea("ChangingSelection");
Fe(this);
for (a = a.l; a.next();)a.value.Za = !0;
this.Ea("ChangedSelection")
};
z.prototype.scroll = function (a, b, c) {
void 0 === c && (c = 1);
var d = "up" === b || "down" === b, e;
"pixel" === a ? e = c : "line" === a ? e = c * (d ? this.op : this.np) : "page" === a ? (a = d ? this.lb.height : this.lb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.op : this.np), 0), e *= c)) : t.m("scrolling unit must be 'pixel', 'line', or 'page', not: " + a);
e /= this.scale;
c = this.position.copy();
"up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : t.m("scrolling direction must be 'up', 'down', 'left', or 'right', not: " +
b);
this.position = c
};
z.prototype.scrollToRect = function (a) {
var b = this.lb;
b.Jj(a) || (a = a.sz, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a)
};
z.prototype.centerRect = function (a) {
var b = this.lb;
a = a.sz;
a.x -= b.width / 2;
a.y -= b.height / 2;
this.position = a
};
z.prototype.transformDocToView = z.prototype.xp = function (a) {
var b = this.qd;
b.reset();
1 !== this.Xb && b.scale(this.Xb);
var c = this.sb;
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
return a.copy().transform(this.qd)
};
function yi(a, b) {
var c = a.qd, d = b[0], e = b[1], g = d + b[2], h = e + b[3], k = c.m11, l = c.m12, m = c.m21, n = c.m22, p = c.dx, q = c.dy, r = d * k + e * m + p, s = d * l + e * n + q, c = g * k + e * m + p, e = g * l + e * n + q, u = d * k + h * m + p, d = d * l + h * n + q, k = g * k + h * m + p, g = g * l + h * n + q, h = r, l = s, r = Math.min(r, c), h = Math.max(h, c), l = Math.min(l, e), s = Math.max(s, e), r = Math.min(r, u), h = Math.max(h, u), l = Math.min(l, d), s = Math.max(s, d), r = Math.min(r, k), h = Math.max(h, k), l = Math.min(l, g), s = Math.max(s, g);
return[r, l, h - r, s - l]
}
z.prototype.transformViewToDoc = z.prototype.AF = function (a) {
var b = this.qd;
b.reset();
1 !== this.Xb && b.scale(this.Xb);
var c = this.sb;
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
return Oa(a.copy(), this.qd)
};
var Ge;
z.None = Ge = t.w(z, "None", 0);
var fi;
z.Uniform = fi = t.w(z, "Uniform", 1);
var gi;
z.UniformToFill = gi = t.w(z, "UniformToFill", 2);
var ag;
z.CycleAll = ag = t.w(z, "CycleAll", 10);
var ng;
z.CycleNotDirected = ng = t.w(z, "CycleNotDirected", 11);
var pg;
z.CycleNotDirectedFast = pg = t.w(z, "CycleNotDirectedFast", 12);
var qg;
z.CycleNotUndirected = qg = t.w(z, "CycleNotUndirected", 13);
var bg;
z.CycleDestinationTree = bg = t.w(z, "CycleDestinationTree", 14);
var mg;
z.CycleSourceTree = mg = t.w(z, "CycleSourceTree", 15);
t.g(z, "validCycle", z.prototype.HF);
t.defineProperty(z, {HF: "validCycle"}, function () {
return this.gv
}, function (a) {
var b = this.gv;
b !== a && (t.nb(a, z, z, "validCycle"), this.gv = a, this.i("validCycle", b, a))
});
t.g(z, "linkSpacing", z.prototype.Vo);
t.defineProperty(z, {Vo: "linkSpacing"}, function () {
return this.gj
}, function (a) {
var b = this.gj;
b !== a && (t.o(a, z, "linkSpacing"), 0 > a && t.ia(a, ">= zero", z, "linkSpacing"), this.gj = a, this.i("linkSpacing", b, a))
});
t.A(z, {cw: "layers"}, function () {
return this.Fb.l
});
t.g(z, "isModelReadOnly", z.prototype.Qe);
t.defineProperty(z, {Qe: "isModelReadOnly"}, function () {
var a = this.Xd;
return null === a ? !1 : a.Ua
}, function (a) {
var b = this.Xd;
null !== b && (b.Ua = a)
});
t.g(z, "isReadOnly", z.prototype.Ua);
t.defineProperty(z, {Ua: "isReadOnly"}, function () {
return this.zk
}, function (a) {
var b = this.zk;
b !== a && (t.k(a, "boolean", z, "isReadOnly"), this.zk = a, this.i("isReadOnly", b, a))
});
t.g(z, "isEnabled", z.prototype.isEnabled);
t.defineProperty(z, {isEnabled: "isEnabled"}, function () {
return this.Th
}, function (a) {
var b = this.Th;
b !== a && (t.k(a, "boolean", z, "isEnabled"), this.Th = a, this.i("isEnabled", b, a))
});
t.g(z, "allowClipboard", z.prototype.ov);
t.defineProperty(z, {ov: "allowClipboard"}, function () {
return this.st
}, function (a) {
var b = this.st;
b !== a && (t.k(a, "boolean", z, "allowClipboard"), this.st = a, this.i("allowClipboard", b, a))
});
t.g(z, "allowCopy", z.prototype.Ej);
t.defineProperty(z, {Ej: "allowCopy"}, function () {
return this.ck
}, function (a) {
var b = this.ck;
b !== a && (t.k(a, "boolean", z, "allowCopy"), this.ck = a, this.i("allowCopy", b, a))
});
t.g(z, "allowDelete", z.prototype.Nk);
t.defineProperty(z, {Nk: "allowDelete"}, function () {
return this.dk
}, function (a) {
var b = this.dk;
b !== a && (t.k(a, "boolean", z, "allowDelete"), this.dk = a, this.i("allowDelete", b, a))
});
t.g(z, "allowDragOut", z.prototype.pv);
t.defineProperty(z, {pv: "allowDragOut"}, function () {
return this.tt
}, function (a) {
var b = this.tt;
b !== a && (t.k(a, "boolean", z, "allowDragOut"), this.tt = a, this.i("allowDragOut", b, a))
});
t.g(z, "allowDrop", z.prototype.kz);
t.defineProperty(z, {kz: "allowDrop"}, function () {
return this.ut
}, function (a) {
var b = this.ut;
b !== a && (t.k(a, "boolean", z, "allowDrop"), this.ut = a, this.i("allowDrop", b, a))
});
t.g(z, "allowTextEdit", z.prototype.lo);
t.defineProperty(z, {lo: "allowTextEdit"}, function () {
return this.mk
}, function (a) {
var b = this.mk;
b !== a && (t.k(a, "boolean", z, "allowTextEdit"), this.mk = a, this.i("allowTextEdit", b, a))
});
t.g(z, "allowGroup", z.prototype.fo);
t.defineProperty(z, {fo: "allowGroup"}, function () {
return this.ek
}, function (a) {
var b = this.ek;
b !== a && (t.k(a, "boolean", z, "allowGroup"), this.ek = a, this.i("allowGroup", b, a))
});
t.g(z, "allowUngroup", z.prototype.mo);
t.defineProperty(z, {mo: "allowUngroup"}, function () {
return this.nk
}, function (a) {
var b = this.nk;
b !== a && (t.k(a, "boolean", z, "allowUngroup"), this.nk = a, this.i("allowUngroup", b, a))
});
t.g(z, "allowInsert", z.prototype.em);
t.defineProperty(z, {em: "allowInsert"}, function () {
return this.wt
}, function (a) {
var b = this.wt;
b !== a && (t.k(a, "boolean", z, "allowInsert"), this.wt = a, this.i("allowInsert", b, a))
});
t.g(z, "allowLink", z.prototype.fm);
t.defineProperty(z, {fm: "allowLink"}, function () {
return this.fk
}, function (a) {
var b = this.fk;
b !== a && (t.k(a, "boolean", z, "allowLink"), this.fk = a, this.i("allowLink", b, a))
});
t.g(z, "allowRelink", z.prototype.Fj);
t.defineProperty(z, {Fj: "allowRelink"}, function () {
return this.hk
}, function (a) {
var b = this.hk;
b !== a && (t.k(a, "boolean", z, "allowRelink"), this.hk = a, this.i("allowRelink", b, a))
});
t.g(z, "allowMove", z.prototype.Ok);
t.defineProperty(z, {Ok: "allowMove"}, function () {
return this.gk
}, function (a) {
var b = this.gk;
b !== a && (t.k(a, "boolean", z, "allowMove"), this.gk = a, this.i("allowMove", b, a))
});
t.g(z, "allowReshape", z.prototype.ho);
t.defineProperty(z, {ho: "allowReshape"}, function () {
return this.ik
}, function (a) {
var b = this.ik;
b !== a && (t.k(a, "boolean", z, "allowReshape"), this.ik = a, this.i("allowReshape", b, a))
});
t.g(z, "allowResize", z.prototype.io);
t.defineProperty(z, {io: "allowResize"}, function () {
return this.jk
}, function (a) {
var b = this.jk;
b !== a && (t.k(a, "boolean", z, "allowResize"), this.jk = a, this.i("allowResize", b, a))
});
t.g(z, "allowRotate", z.prototype.jo);
t.defineProperty(z, {jo: "allowRotate"}, function () {
return this.kk
}, function (a) {
var b = this.kk;
b !== a && (t.k(a, "boolean", z, "allowRotate"), this.kk = a, this.i("allowRotate", b, a))
});
t.g(z, "allowSelect", z.prototype.Ie);
t.defineProperty(z, {Ie: "allowSelect"}, function () {
return this.lk
}, function (a) {
var b = this.lk;
b !== a && (t.k(a, "boolean", z, "allowSelect"), this.lk = a, this.i("allowSelect", b, a))
});
t.g(z, "allowUndo", z.prototype.lz);
t.defineProperty(z, {lz: "allowUndo"}, function () {
return this.xt
}, function (a) {
var b = this.xt;
b !== a && (t.k(a, "boolean", z, "allowUndo"), this.xt = a, this.i("allowUndo", b, a))
});
t.g(z, "allowZoom", z.prototype.no);
t.defineProperty(z, {no: "allowZoom"}, function () {
return this.zt
}, function (a) {
var b = this.zt;
b !== a && (t.k(a, "boolean", z, "allowZoom"), this.zt = a, this.i("allowZoom", b, a))
});
t.g(z, "hasVerticalScrollbar", z.prototype.ND);
t.defineProperty(z, {ND: "hasVerticalScrollbar"}, function () {
return this.bu
}, function (a) {
var b = this.bu;
b !== a && (t.k(a, "boolean", z, "hasVerticalScrollbar"), this.bu = a, ii(this), this.ra(), this.i("hasVerticalScrollbar", b, a), bi(this))
});
t.g(z, "hasHorizontalScrollbar", z.prototype.MD);
t.defineProperty(z, {MD: "hasHorizontalScrollbar"}, function () {
return this.au
}, function (a) {
var b = this.au;
b !== a && (t.k(a, "boolean", z, "hasHorizontalScrollbar"), this.au = a, ii(this), this.ra(), this.i("hasHorizontalScrollbar", b, a), bi(this))
});
t.g(z, "allowHorizontalScroll", z.prototype.bf);
t.defineProperty(z, {bf: "allowHorizontalScroll"}, function () {
return this.vt
}, function (a) {
var b = this.vt;
b !== a && (t.k(a, "boolean", z, "allowHorizontalScroll"), this.vt = a, this.i("allowHorizontalScroll", b, a), bi(this))
});
t.g(z, "allowVerticalScroll", z.prototype.cf);
t.defineProperty(z, {cf: "allowVerticalScroll"}, function () {
return this.yt
}, function (a) {
var b = this.yt;
b !== a && (t.k(a, "boolean", z, "allowVerticalScroll"), this.yt = a, this.i("allowVerticalScroll", b, a), bi(this))
});
t.g(z, "scrollHorizontalLineChange", z.prototype.np);
t.defineProperty(z, {np: "scrollHorizontalLineChange"}, function () {
return this.Pu
}, function (a) {
var b = this.Pu;
b !== a && (t.k(a, "number", z, "scrollHorizontalLineChange"), 0 > a && t.ia(a, ">= 0", z, "scrollHorizontalLineChange"), this.Pu = a, this.i("scrollHorizontalLineChange", b, a))
});
t.g(z, "scrollVerticalLineChange", z.prototype.op);
t.defineProperty(z, {op: "scrollVerticalLineChange"}, function () {
return this.Qu
}, function (a) {
var b = this.Qu;
b !== a && (t.k(a, "number", z, "scrollVerticalLineChange"), 0 > a && t.ia(a, ">= 0", z, "scrollVerticalLineChange"), this.Qu = a, this.i("scrollVerticalLineChange", b, a))
});
t.g(z, "lastInput", z.prototype.R);
t.defineProperty(z, {R: "lastInput"}, function () {
return this.hc
}, function (a) {
f && t.j(a, md, z, "lastInput");
this.hc = a
});
t.g(z, "firstInput", z.prototype.zc);
t.defineProperty(z, {zc: "firstInput"}, function () {
return this.sg
}, function (a) {
f && t.j(a, md, z, "firstInput");
this.sg = a
});
t.g(z, "currentCursor", z.prototype.Tc);
t.defineProperty(z, {Tc: "currentCursor"}, function () {
return this.Nt
}, function (a) {
t.k(a, "string", z, "currentCursor");
null === this.Ta || this.Nt === a || "" === a && this.Nt === this.fq || (this.Nt = a, "" !== a ? (this.Ta.style.cursor = a, this.vb.style.cursor = a) : (this.Ta.style.cursor = this.zz, this.vb.style.cursor = this.zz))
});
t.g(z, "defaultCursor", z.prototype.zz);
t.defineProperty(z, {zz: "defaultCursor"}, function () {
return this.fq
}, function (a) {
t.k(a, "string", z, "defaultCursor");
var b = this.fq;
b !== a && (this.fq = a, this.i("defaultCursor", b, a))
});
t.g(z, "hasGestureZoom", z.prototype.EH);
t.defineProperty(z, {EH: "hasGestureZoom"}, function () {
return this.Sh
}, function (a) {
var b = this.Sh;
b !== a && (t.k(a, "boolean", z, "hasGestureZoom"), this.Sh = a, this.i("hasGestureZoom", b, a))
});
t.g(z, "click", z.prototype.click);
t.defineProperty(z, {click: "click"}, function () {
return this.Kh
}, function (a) {
var b = this.Kh;
b !== a && (null !== a && t.k(a, "function", z, "click"), this.Kh = a, this.i("click", b, a))
});
t.g(z, "doubleClick", z.prototype.sm);
t.defineProperty(z, {sm: "doubleClick"}, function () {
return this.Qh
}, function (a) {
var b = this.Qh;
b !== a && (null !== a && t.k(a, "function", z, "doubleClick"), this.Qh = a, this.i("doubleClick", b, a))
});
t.g(z, "contextClick", z.prototype.ms);
t.defineProperty(z, {ms: "contextClick"}, function () {
return this.Mh
}, function (a) {
var b = this.Mh;
b !== a && (null !== a && t.k(a, "function", z, "contextClick"), this.Mh = a, this.i("contextClick", b, a))
});
t.g(z, "mouseOver", z.prototype.Os);
t.defineProperty(z, {Os: "mouseOver"}, function () {
return this.$h
}, function (a) {
var b = this.$h;
b !== a && (null !== a && t.k(a, "function", z, "mouseOver"), this.$h = a, this.i("mouseOver", b, a))
});
t.g(z, "mouseHover", z.prototype.Ns);
t.defineProperty(z, {Ns: "mouseHover"}, function () {
return this.Zh
}, function (a) {
var b = this.Zh;
b !== a && (null !== a && t.k(a, "function", z, "mouseHover"), this.Zh = a, this.i("mouseHover", b, a))
});
t.g(z, "mouseHold", z.prototype.Ms);
t.defineProperty(z, {Ms: "mouseHold"}, function () {
return this.Yh
}, function (a) {
var b = this.Yh;
b !== a && (null !== a && t.k(a, "function", z, "mouseHold"), this.Yh = a, this.i("mouseHold", b, a))
});
t.g(z, "mouseDragOver", z.prototype.tE);
t.defineProperty(z, {tE: "mouseDragOver"}, function () {
return this.vu
}, function (a) {
var b = this.vu;
b !== a && (null !== a && t.k(a, "function", z, "mouseDragOver"), this.vu = a, this.i("mouseDragOver", b, a))
});
t.g(z, "mouseDrop", z.prototype.Ls);
t.defineProperty(z, {Ls: "mouseDrop"}, function () {
return this.Xh
}, function (a) {
var b = this.Xh;
b !== a && (null !== a && t.k(a, "function", z, "mouseDrop"), this.Xh = a, this.i("mouseDrop", b, a))
});
t.g(z, "toolTip", z.prototype.mt);
t.defineProperty(z, {mt: "toolTip"}, function () {
return this.ji
}, function (a) {
var b = this.ji;
b !== a && (null !== a && t.j(a, Ce, z, "toolTip"), this.ji = a, this.i("toolTip", b, a))
});
t.g(z, "contextMenu", z.prototype.contextMenu);
t.defineProperty(z, {contextMenu: "contextMenu"}, function () {
return this.Nh
}, function (a) {
var b = this.Nh;
b !== a && (null !== a && t.j(a, Ce, z, "contextMenu"), this.Nh = a, this.i("contextMenu", b, a))
});
t.g(z, "commandHandler", z.prototype.Le);
t.defineProperty(z, {Le: "commandHandler"}, function () {
return this.px
}, function (a) {
var b = this.px;
b !== a && (t.j(a, oa, z, "commandHandler"), null !== a.h && t.m("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.Ce(null), this.px = a, a.Ce(this))
});
t.g(z, "toolManager", z.prototype.zb);
t.defineProperty(z, {zb: "toolManager"}, function () {
return this.ev
}, function (a) {
var b = this.ev;
b !== a && (t.j(a, Ae, z, "toolManager"), null !== a.h && t.m("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.Ce(null), this.ev = a, a.Ce(this))
});
t.g(z, "defaultTool", z.prototype.Ev);
t.defineProperty(z, {Ev: "defaultTool"}, function () {
return this.Ex
}, function (a) {
var b = this.Ex;
b !== a && (t.j(a, Td, z, "defaultTool"), this.Ex = a, this.Na === b && (this.Na = a))
});
t.g(z, "currentTool", z.prototype.Na);
t.defineProperty(z, {Na: "currentTool"}, function () {
return this.zx
}, function (a) {
var b = this.zx;
null !== b && (b.na && b.doDeactivate(), b.cancelWaitAfter(), b.doStop());
null === a && (a = this.Ev);
null !== a && (t.j(a, Td, z, "currentTool"), this.zx = a, a.Ce(this), a.doStart())
});
t.A(z, {selection: "selection"}, function () {
return this.Tu
});
t.g(z, "maxSelectionCount", z.prototype.mE);
t.defineProperty(z, {mE: "maxSelectionCount"}, function () {
return this.qu
}, function (a) {
var b = this.qu;
if (b !== a)if (t.k(a, "number", z, "maxSelectionCount"), 0 <= a && !isNaN(a)) {
if (this.qu = a, this.i("maxSelectionCount", b, a), !this.va.kb && (a = this.selection.count - a, 0 < a)) {
this.Ea("ChangingSelection");
for (var b = this.selection.Ve(), c = 0; c < a; c++)b[c].Za = !1;
this.Ea("ChangedSelection")
}
} else t.ia(a, ">= 0", z, "maxSelectionCount")
});
t.g(z, "nodeSelectionAdornmentTemplate", z.prototype.yE);
t.defineProperty(z, {yE: "nodeSelectionAdornmentTemplate"}, function () {
return this.Bu
}, function (a) {
var b = this.Bu;
b !== a && (t.j(a, Ce, z, "nodeSelectionAdornmentTemplate"), this.Bu = a, this.i("nodeSelectionAdornmentTemplate", b, a))
});
t.g(z, "groupSelectionAdornmentTemplate", z.prototype.HD);
t.defineProperty(z, {HD: "groupSelectionAdornmentTemplate"}, function () {
return this.Zt
}, function (a) {
var b = this.Zt;
b !== a && (t.j(a, Ce, z, "groupSelectionAdornmentTemplate"), this.Zt = a, this.i("groupSelectionAdornmentTemplate", b, a))
});
t.g(z, "linkSelectionAdornmentTemplate", z.prototype.jE);
t.defineProperty(z, {jE: "linkSelectionAdornmentTemplate"}, function () {
return this.ku
}, function (a) {
var b = this.ku;
b !== a && (t.j(a, Ce, z, "linkSelectionAdornmentTemplate"), this.ku = a, this.i("linkSelectionAdornmentTemplate", b, a))
});
t.g(z, "isModified", z.prototype.Vj);
t.defineProperty(z, {Vj: "isModified"}, function () {
var a = this.va;
return null === a ? this.by : null !== a.Uk ? !0 : this.by && this.wk !== a.Uj
}, function (a) {
if (this.by !== a) {
t.k(a, "boolean", z, "isModified");
this.by = a;
var b = this.va;
!a && b && (this.wk = b.Uj);
a || Oi(this)
}
});
function Oi(a) {
var b = a.Vj;
a.yC !== b && (a.yC = b, a.Ea("Modified"))
}
t.g(z, "model", z.prototype.da);
t.defineProperty(z, {da: "model"}, function () {
return this.Xd
}, function (a) {
var b = this.Xd;
if (b !== a) {
t.j(a, C, z, "model");
null !== b && b.va !== a.va && b.va.MH && t.m("Do not replace a Diagram.model while a transaction is in progress.");
this.Nf = !1;
this.mq = !0;
this.Vf = !1;
var c = this.yd;
this.yd = !0;
null !== b && (b.uA(this.UB), b instanceof P && Pi(this, b.Fi), Pi(this, b.eg));
this.Xd = a;
a.iz(this.TB);
Qi(this, a.eg);
a instanceof P && Ri(this, a.Fi);
a.uA(this.TB);
a.iz(this.UB);
this.yd = c;
this.gc || this.ra();
null !== b && (a.va.isEnabled = b.va.isEnabled)
}
});
t.defineProperty(z, {Sa: null}, function () {
return this.NB
}, function (a) {
this.NB = a
});
function Kh(a, b) {
if (b.da === a.da && a.Sa) {
a.Sa = !1;
try {
var c = b.ed, d = b.lf;
if ("" !== d)if (c === qd) {
if ("linkFromKey" === d) {
var e = b.object, g = a.Af(e);
if (null !== g) {
var h = b.newValue, k = a.$f(h);
g.ca = k
}
} else if ("linkToKey" === d)e = b.object, g = a.Af(e), null !== g && (h = b.newValue, k = a.$f(h), g.ga = k); else if ("linkFromPortId" === d) {
if (e = b.object, g = a.Af(e), null !== g) {
var l = b.newValue;
"string" === typeof l && (g.Bf = l)
}
} else if ("linkToPortId" === d)e = b.object, g = a.Af(e), null !== g && (l = b.newValue, "string" === typeof l && (g.ng = l)); else if ("nodeGroupKey" ===
d) {
var e = b.object, m = a.yi(e);
if (null !== m) {
var n = b.newValue;
if (void 0 !== n) {
var p = a.$f(n);
m.ib = p instanceof U ? p : null
} else m.ib = null
}
} else if ("linkLabelKeys" === d) {
if (e = b.object, g = a.Af(e), null !== g) {
var q = b.oldValue, r = b.newValue;
if (t.isArray(q))for (var s = t.wb(q), u = 0; u < s; u++) {
var x = t.mb(q, u), k = a.$f(x);
null !== k && (k.kd = null)
}
if (t.isArray(r))for (s = t.wb(r), u = 0; u < s; u++)x = t.mb(r, u), k = a.$f(x), null !== k && (k.kd = g)
}
} else if ("nodeParentKey" === d) {
var E = b.object, F = a.$f(b.newValue), G = a.Ov(E);
if (null !== G) {
var L = G.us();
null !== L ? null === F ? a.remove(L) : a.Xc ? L.ca = F : L.ga = F : Si(a, F, G)
}
} else if ("parentLinkCategory" === d) {
var E = b.object, G = a.Ov(E), N = b.newValue;
null !== G && "string" === typeof N && (L = G.us(), null !== L && (L.Ic = N))
} else if ("nodeCategory" === d) {
var e = b.object, V = a.yi(e), N = b.newValue;
null !== V && "string" === typeof N && (V.Ic = N)
} else if ("linkCategory" === d) {
var e = b.object, T = a.Af(e), N = b.newValue;
null !== T && "string" === typeof N && (T.Ic = N)
} else if ("nodeDataArray" === d) {
a.ra();
var W = b.oldValue;
Pi(a, W);
var ea = b.newValue;
Qi(a, ea)
} else"linkDataArray" ===
d && (a.ra(), W = b.oldValue, Pi(a, W), ea = b.newValue, Ri(a, ea));
a.Vj = !0
} else if (c === rd)ea = b.newValue, "nodeDataArray" === d && t.jb(ea) ? Ti(a, ea) : "linkDataArray" === d && t.jb(ea) ? Ui(a, ea) : "linkLabelKeys" === d && je(ea) && (g = a.Af(b.object), k = a.$f(ea), null !== g && null !== k && (k.kd = g)), a.Vj = !0; else if (c === sd)W = b.oldValue, "nodeDataArray" === d && t.jb(W) ? Vi(a, W) : "linkDataArray" === d && t.jb(W) ? Vi(a, W) : "linkLabelKeys" === d && je(W) && (k = a.$f(W), null !== k && (k.kd = null)), a.Vj = !0; else {
if (c === pd && "SourceChanged" === d) {
var m = a.yi(b.object), R = b.propertyName;
null !== m && "string" === typeof R && (m.Eb(R), a.da instanceof Dd && (g = a.Af(b.object), null !== g && g.Eb(R)))
}
} else if (c === qd) {
var wa = b.propertyName, e = b.object;
if (e === a.da) {
if ("nodeKeyProperty" === wa || "nodeCategoryProperty" === wa || "linkFromKeyProperty" === wa || "linkToKeyProperty" === wa || "linkFromPortIdProperty" === wa || "linkToPortIdProperty" === wa || "linkLabelKeysProperty" === wa || "nodeIsGroupProperty" === wa || "nodeGroupKeyProperty" === wa || "nodeParentKeyProperty" === wa || "linkCategoryProperty" === wa)a.va.kb || a.Im()
} else Jh(a,
e, wa);
a.Vj = !0
} else if (c === rd || c === sd)Wi(a, b), a.Vj = !0; else if (c === pd) {
var Ja = b.propertyName;
"S" !== Ja[0] ? ("CommittingTransaction" === Ja || "FinishedUndo" !== Ja && "FinishedRedo" !== Ja || (a.va.Uh = !0, $h(a), a.va.Uh = !1), a.Rt = !0, a.Hi(), Oi(a), a.sy || "CommittedTransaction" !== Ja || (a.sy = !0, setTimeout(function () {
a.Na.standardMouseOver();
a.sy = !1
}, 10))) : "StartingFirstTransaction" !== Ja || a.yd || a.Nf || (a.Rt = !0, a.mq && (a.Vf = !0))
}
} finally {
a.Sa = !0
}
}
}
function Jh(a, b, c) {
var d = a.yi(b);
if (null !== d && "string" === typeof c)d.Eb(c), a.da instanceof Dd && (b = a.Af(b), null !== b && b.Eb(c)); else if ("string" === typeof c) {
d = null;
for (a = a.Hl.l; a.next();) {
for (var e = a.value, g = 0; g < e.length; g++) {
var h = e[g];
null !== h.Pf && (h = h.Pf.wa(b), null !== h && (null === d && (d = t.yb()), d.push(h)))
}
if (null !== d)break
}
b = d;
if (null !== b) {
for (d = 0; d < b.length; d++)b[d].Eb(c);
t.xa(b)
}
}
}
function Wi(a, b) {
var c = b.ed === rd, d = c ? b.Ef : b.Gf, e = c ? b.newValue : b.oldValue, g = a.Hl.wa(b.object);
if (Array.isArray(g) && "number" === typeof d)for (var h = 0; h < g.length; h++) {
var k = g[h];
k.type !== Ng && k.type !== Qh || d++;
c ? Xi(k, e, d) : (k.Pe(d), Yi(k, d - 1))
}
}
function Ji(a, b) {
var c = b.ej;
if (t.isArray(c)) {
var d = a.Hl.wa(c);
if (null === d)a.Hl.add(c, [b]); else {
for (c = 0; c < d.length; c++)if (d[c] === b)return;
d.push(b)
}
}
}
function Li(a, b) {
var c = b.ej;
if (t.isArray(c)) {
var d = a.Hl.wa(c);
if (null !== d)for (var e = 0; e < d.length; e++)if (d[e] === b) {
d.splice(e, 1);
0 === d.length && a.Hl.remove(c);
break
}
}
}
z.prototype.clear = z.prototype.clear = function () {
var a = null;
null !== this.Pc && (a = this.Pc.S);
this.da.clear();
for (var b = this.Fb.length, c = 0; c < b; c++)this.Fb.p[c].clear();
this.Of.clear();
this.kn.clear();
this.Cu.clear();
this.Ik.clear();
this.lu.clear();
this.qb.clear();
this.Oh.clear();
this.qk.clear();
this.Hl.clear();
this.Tu.Qa();
this.Tu.clear();
this.Tu.freeze();
this.so = this.nA = null;
t.js = null;
this.St = (new w(NaN, NaN, NaN, NaN)).freeze();
null !== a && (this.add(a), this.qb.remove(a));
this.ra()
};
z.prototype.reset = z.prototype.reset = function () {
this.gc = !0;
this.clear();
this.Fb = new A(Sd);
this.sb = (new v(NaN, NaN)).freeze();
this.Xb = 1;
this.su = 1E-4;
this.pu = 100;
this.jv = (new v(NaN, NaN)).freeze();
this.Xt = (new w(NaN, NaN, NaN, NaN)).freeze();
this.ql = Ge;
this.tl = xb;
this.xk = Ge;
this.tn = xb;
this.du = this.cu = yb;
this.Dt = (new Wa(16, 16, 16, 16)).freeze();
this.hu = !0;
this.gv = ag;
this.fq = "auto";
this.Xd = this.Nh = this.ji = this.Xh = this.vu = this.Yh = this.Zh = this.$h = this.Mh = this.Qh = this.Kh = null;
this.zk = !1;
this.dk = this.ck = this.st =
this.Th = !0;
this.ut = this.tt = !1;
this.yt = this.vt = this.bu = this.au = this.zt = this.xt = this.lk = this.kk = this.jk = this.ik = this.gk = this.hk = this.fk = this.wt = this.nk = this.ek = this.mk = !0;
this.Qu = this.Pu = 16;
this.Ge = (new Wa(5)).freeze();
this.qu = 999999999;
this.Ad = null;
Lh(this);
Mh(this);
this.Pc = null;
this.da = new P;
this.gi = !0;
this.Vb = new fe;
this.gc = this.gi = !1;
this.ra()
};
z.prototype.rebuildParts = z.prototype.Im = function () {
for (var a = this.iw.l; a.next();) {
var b = a.value;
(!b.Jd() || b instanceof U) && t.m('Invalid node template in Diagram.nodeTemplateMap: template for "' + a.key + '" must be a Node or a simple Part, not a Group or Link: ' + b)
}
for (a = this.Sv.l; a.next();)b = a.value, b instanceof U || t.m('Invalid group template in Diagram.groupTemplateMap: template for "' + a.key + '" must be a Group, not a normal Node or Link: ' + b);
for (a = this.ew.l; a.next();)b = a.value, b instanceof X || t.m('Invalid link template in Diagram.linkTemplateMap: template for "' +
a.key + '" must be a Link, not a normal Node or simple Part: ' + b);
a = t.yb();
for (b = this.selection.l; b.next();) {
var c = b.value.data;
c && a.push(c)
}
b = this.da;
b instanceof P && Pi(this, b.Fi);
Pi(this, b.eg);
Qi(this, b.eg);
b instanceof P && Ri(this, b.Fi);
for (b = 0; b < a.length; b++)if (c = this.yi(a[b]))c.Za = !0;
t.xa(a)
};
function Qi(a, b) {
if (null !== b) {
for (var c = a.da, d = t.wb(b), e = 0; e < d; e++) {
var g = t.mb(b, e);
c.be(g) ? Ti(a, g, !1) : c instanceof P && Ui(a, g)
}
if (c instanceof P || c instanceof Dd) {
for (e = 0; e < d; e++)g = t.mb(b, e), c.be(g) && Zi(a, g);
if (c instanceof P)for (c = a.links; c.next();)$i(c.value)
}
aj(a, !1)
}
}
function Ti(a, b, c) {
if (void 0 !== b && null !== b && !a.va.kb && !a.Oh.contains(b)) {
void 0 === c && (c = !0);
var d = a.getCategoryForNodeData(b), e = a.findTemplateForNodeData(b, d);
e instanceof B && (Ee(e), e = e.copy(), e instanceof B && (e.Sg = d, a.add(e), e.data = b, c && Zi(a, b)))
}
}
z.prototype.getCategoryForNodeData = function (a) {
var b = this.da, c = b.getCategoryForNodeData(a), d = !1;
b instanceof P && (d = b.NH(a));
d && "" === c && (c = "LinkLabel");
return c
};
z.prototype.findTemplateForNodeData = function (a, b) {
var c = !1, d = this.da;
d instanceof P && (c = d.Sz(a));
c ? (c = this.Sv.wa(b), null === c && (c = this.Sv.wa(""), null === c && (t.KF || (t.KF = !0, t.trace('No Group template found for category "' + b + '"'), t.trace(" Using default group template")), c = this.oB))) : (c = this.iw.wa(b), null === c && (c = this.iw.wa(""), null === c && (t.NF || (t.NF = !0, t.trace('No Node template found for category "' + b + '"'), t.trace(" Using default node template")), c = this.qB)));
return c instanceof B ? c : null
};
function Zi(a, b) {
var c = a.da;
if (c instanceof P || c instanceof Dd) {
var d = c.Ib(b);
if (void 0 !== d) {
var e = ke(c, d), g = a.yi(b);
if (null !== e && null !== g) {
for (e = e.l; e.next();) {
var h = e.value;
if (c instanceof P)if (c.be(h)) {
if (g instanceof U && c.Fo(h) === d) {
var k = a.yi(h);
null !== k && (k.ib = g)
}
} else {
if (k = a.Af(h), null !== k && g instanceof S && (c.wm(h) === d && (k.ca = g), c.xm(h) === d && (k.ga = g), h = c.Yk(h), t.isArray(h)))for (var l = 0; l < t.wb(h); l++)if (t.mb(h, l) === d) {
g.kd = k;
break
}
} else c instanceof Dd && c.be(h) && g instanceof S && c.Ho(h) === d &&
(k = a.Ov(h), Si(a, g, k))
}
ue(c, d)
}
c instanceof P ? (c = c.Fo(b), void 0 !== c && (c = a.$f(c), c instanceof U && (g.ib = c))) : c instanceof Dd && (c = c.Ho(b), void 0 !== c && g instanceof S && (c = a.$f(c), Si(a, c, g)))
}
}
}
function Si(a, b, c) {
if (null !== b && null !== c) {
var d = a.zb.Zz, e = b, g = c;
if (a.Xc)for (b = g.ie; b.next();) {
var h = b.value;
if (h.ga === g)return
} else for (e = c, g = b, b = e.ie; b.next();)if (h = b.value, h.ca === e)return;
null !== d && cg(d, e, g, null, !0) || (d = a.getCategoryForLinkData(c.data), b = a.findTemplateForLinkData(c.data, d), b instanceof X && (Ee(b), b = b.copy(), b instanceof X && (b.Sg = d, b.ca = e, b.ga = g, a.add(b), b.data = c.data)))
}
}
function Ri(a, b) {
if (null !== b) {
for (var c = t.wb(b), d = 0; d < c; d++) {
var e = t.mb(b, d);
Ui(a, e)
}
aj(a, !1)
}
}
function Ui(a, b) {
if (void 0 !== b && null !== b && !a.va.kb && !a.qk.contains(b)) {
var c = a.getCategoryForLinkData(b), d = a.findTemplateForLinkData(b, c);
if (d instanceof X && (Ee(d), d = d.copy(), d instanceof X)) {
d.Sg = c;
var c = a.da, e = c.yH(b);
"" !== e && (d.Bf = e);
e = c.wm(b);
void 0 !== e && (e = a.$f(e), e instanceof S && (d.ca = e));
e = c.BH(b);
"" !== e && (d.ng = e);
e = c.xm(b);
void 0 !== e && (e = a.$f(e), e instanceof S && (d.ga = e));
c = c.Yk(b);
if (t.isArray(c))for (var e = t.wb(c), g = 0; g < e; g++) {
var h = t.mb(c, g), h = a.$f(h);
null !== h && (h.kd = d)
}
a.add(d);
d.data = b
}
}
}
z.prototype.getCategoryForLinkData = function (a) {
var b = this.da, c = "";
b instanceof P ? c = b.getCategoryForLinkData(a) : b instanceof Dd && (c = b.AH(a));
return c
};
z.prototype.findTemplateForLinkData = function (a, b) {
var c = this.ew.wa(b);
null === c && (c = this.ew.wa(""), null === c && (t.MF || (t.MF = !0, t.trace('No Link template found for category "' + b + '"'), t.trace(" Using default link template")), c = this.pB));
return c instanceof X ? c : null
};
function Pi(a, b) {
for (var c = t.wb(b), d = 0; d < c; d++) {
var e = t.mb(b, d);
Vi(a, e)
}
}
function Vi(a, b) {
if (void 0 !== b && null !== b) {
var c = a.yi(b);
if (c instanceof B) {
c.Za = !1;
var d = c.layer;
if (null !== d && d.h === a) {
var e = a.da;
if (e instanceof P && c instanceof S) {
var g = e.Ib(c.data);
if (void 0 !== g) {
for (var h = c.ie; h.next();) {
var k = h.value.data;
le(e, g, k)
}
c.vh && (h = c.kd, null !== h && (k = h.data, le(e, g, k)));
if (c instanceof U)for (h = c.Lc; h.next();)k = h.value.data, e.be(k) && le(e, g, k)
}
} else if (e instanceof Dd && c instanceof S) {
h = a.Af(c.data);
if (null !== h && (h.Za = !1, k = h.layer, null !== k)) {
var l = k.Pe(-1, h);
0 <= l && a.Yc(sd,
"parts", k, h, null, l, null);
l = h.Po;
null !== l && l(h, k, null)
}
h = a.Xc;
for (k = c.ie; k.next();)l = k.value, l = (h ? l.ga : l.ca).data, e.be(l) && le(e, g, l)
}
e = d.Pe(-1, c);
0 <= e && a.Yc(sd, "parts", d, c, null, e, null);
e = c.Po;
null !== e && e(c, d, null)
}
}
}
}
z.prototype.findPartForKey = function (a) {
if (null === a || void 0 === a)return null;
a = this.da.ff(a);
if (null === a)return null;
a = this.Oh.wa(a);
return a instanceof B ? a : null
};
z.prototype.findNodeForKey = z.prototype.$f = function (a) {
if (null === a || void 0 === a)return null;
a = this.da.ff(a);
if (null === a)return null;
a = this.Oh.wa(a);
return a instanceof S ? a : null
};
z.prototype.findPartForData = z.prototype.yi = function (a) {
if (null === a)return null;
var b = this.Oh.wa(a);
if (b instanceof B)return b;
b = this.qk.wa(a);
return b instanceof B ? b : null
};
z.prototype.findNodeForData = z.prototype.Ov = function (a) {
if (null === a)return null;
a = this.Oh.wa(a);
return a instanceof S ? a : null
};
z.prototype.findLinkForData = z.prototype.Af = function (a) {
if (null === a)return null;
a = this.qk.wa(a);
return a instanceof X ? a : null
};
t.g(z, "nodeTemplate", z.prototype.gI);
t.defineProperty(z, {gI: "nodeTemplate"}, function () {
return this.ai.wa("")
}, function (a) {
var b = this.ai.wa("");
b !== a && (t.j(a, B, z, "nodeTemplate"), this.ai.add("", a), this.i("nodeTemplate", b, a), this.va.kb || this.Im())
});
t.g(z, "nodeTemplateMap", z.prototype.iw);
t.defineProperty(z, {iw: "nodeTemplateMap"}, function () {
return this.ai
}, function (a) {
var b = this.ai;
b !== a && (t.j(a, ia, z, "nodeTemplateMap"), this.ai = a, this.i("nodeTemplateMap", b, a), this.va.kb || this.Im())
});
t.g(z, "groupTemplate", z.prototype.DH);
t.defineProperty(z, {DH: "groupTemplate"}, function () {
return this.tk.wa("")
}, function (a) {
var b = this.tk.wa("");
b !== a && (t.j(a, U, z, "groupTemplate"), this.tk.add("", a), this.i("groupTemplate", b, a), this.va.kb || this.Im())
});
t.g(z, "groupTemplateMap", z.prototype.Sv);
t.defineProperty(z, {Sv: "groupTemplateMap"}, function () {
return this.tk
}, function (a) {
var b = this.tk;
b !== a && (t.j(a, ia, z, "groupTemplateMap"), this.tk = a, this.i("groupTemplateMap", b, a), this.va.kb || this.Im())
});
t.g(z, "linkTemplate", z.prototype.$H);
t.defineProperty(z, {$H: "linkTemplate"}, function () {
return this.hj.wa("")
}, function (a) {
var b = this.hj.wa("");
b !== a && (t.j(a, X, z, "linkTemplate"), this.hj.add("", a), this.i("linkTemplate", b, a), this.va.kb || this.Im())
});
t.g(z, "linkTemplateMap", z.prototype.ew);
t.defineProperty(z, {ew: "linkTemplateMap"}, function () {
return this.hj
}, function (a) {
var b = this.hj;
b !== a && (t.j(a, ia, z, "linkTemplateMap"), this.hj = a, this.i("linkTemplateMap", b, a), this.va.kb || this.Im())
});
t.g(z, "isMouseCaptured", z.prototype.sd);
t.defineProperty(z, {sd: "isMouseCaptured"}, function () {
return this.LB
}, function (a) {
var b = this.Ta;
null !== b && (a ? (this.R.bubbles = !1, b.removeEventListener("mousemove", this.$o, !1), b.removeEventListener("mousedown", this.Zo, !1), b.removeEventListener("mouseup", this.bp, !1), b.removeEventListener("mousewheel", this.Kg, !1), b.removeEventListener("DOMMouseScroll", this.Kg, !1), b.removeEventListener("mouseout", this.ap, !1), window.addEventListener("mousemove", this.$o, !0), window.addEventListener("mousedown", this.Zo, !0),
window.addEventListener("mouseup", this.bp, !0), window.addEventListener("mousewheel", this.Kg, !0), window.addEventListener("DOMMouseScroll", this.Kg, !0), window.addEventListener("mouseout", this.ap, !0), window.addEventListener("selectstart", this.preventDefault, !1)) : (window.removeEventListener("mousemove", this.$o, !0), window.removeEventListener("mousedown", this.Zo, !0), window.removeEventListener("mouseup", this.bp, !0), window.removeEventListener("mousewheel", this.Kg, !0), window.removeEventListener("DOMMouseScroll",
this.Kg, !0), window.removeEventListener("mouseout", this.ap, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("mousemove", this.$o, !1), b.addEventListener("mousedown", this.Zo, !1), b.addEventListener("mouseup", this.bp, !1), b.addEventListener("mousewheel", this.Kg, !1), b.addEventListener("DOMMouseScroll", this.Kg, !1), b.addEventListener("mouseout", this.ap, !1)), this.LB = a)
});
t.g(z, "position", z.prototype.position);
t.defineProperty(z, {position: "position"}, function () {
return this.sb
}, function (a) {
var b = this.sb;
if (!b.K(a)) {
t.j(a, v, z, "position");
var c = this.lb.copy();
c.x = b.x;
c.y = b.y;
a = a.copy();
b.Pj(a) || (this.gc || null === this.Ta || (this.gc = !0, b = this.scale, di(this, a, this.gd, this.oc / b, this.nc / b, this.tl), this.gc = !1), b = a);
this.sb = b.W();
this.gc || this.Us(c, this.lb)
}
});
t.g(z, "initialPosition", z.prototype.RD);
t.defineProperty(z, {RD: "initialPosition"}, function () {
return this.Xx
}, function (a) {
this.Xx.K(a) || (t.j(a, v, z, "initialPosition"), this.Xx = a.W())
});
t.g(z, "initialScale", z.prototype.SD);
t.defineProperty(z, {SD: "initialScale"}, function () {
return this.Yx
}, function (a) {
this.Yx !== a && (t.k(a, "number", z, "initialScale"), this.Yx = a)
});
t.g(z, "grid", z.prototype.Io);
t.defineProperty(z, {Io: "grid"}, function () {
null === this.Pc && Wh(this);
return this.Pc
}, function (a) {
var b = this.Pc;
if (b !== a) {
null === b && (Wh(this), b = this.Pc);
t.j(a, y, z, "grid");
a.type !== Xh && t.m("Diagram.grid must be a Panel of type Panel.Grid");
var c = b.fa;
null !== c && c.remove(b);
this.Pc = a;
a.name = "GRID";
null !== c && c.add(a);
qi(this);
this.ra();
this.i("grid", b, a)
}
});
t.A(z, {lb: "viewportBounds"}, function () {
var a = this.xC;
if (null === this.Ta)return a;
var b = this.sb, c = this.Xb;
a.q(b.x, b.y, Math.max(this.oc, 0) / c, Math.max(this.nc, 0) / c);
return a
});
t.g(z, "fixedBounds", z.prototype.Ez);
t.defineProperty(z, {Ez: "fixedBounds"}, function () {
return this.Xt
}, function (a) {
var b = this.Xt;
b.K(a) || (t.j(a, w, z, "fixedBounds"), this.Xt = a = a.W(), this.vc(), this.i("fixedBounds", b, a))
});
t.A(z, {gd: "documentBounds"}, function () {
return this.St
});
function ei(a, b) {
var c = a.St;
c.K(b) || (b = b.W(), a.St = b, a.cj = !1, a.Vi = null, bi(a), a.Ea("DocumentBoundsChanged", null, c.copy()), ii(a))
}
t.g(z, "scale", z.prototype.scale);
t.defineProperty(z, {scale: "scale"}, function () {
return this.Xb
}, function (a) {
var b = this.Xb;
t.o(a, z, "scale");
a < this.cg && (a = this.cg);
a > this.bg && (a = this.bg);
if (b !== a) {
var c = this.Xb = a;
if (!this.gc && !this.yd && (this.gc = !0, null !== this.Ta)) {
a = this.lb.copy();
var d = this.oc / c, e = this.nc / c;
a.width = this.oc / b;
a.height = this.nc / b;
var g = this.Gh.copy();
if (isNaN(g.x))switch (this.Av) {
case $b:
g.x = 0;
break;
case ac:
g.x = d - 1;
break;
case Hb:
g.x = d / 2;
break;
case xb:
case cc:
g.x = d / 2
}
if (isNaN(g.y))switch (this.Av) {
case Zb:
g.y = 0;
break;
case bc:
g.y =
e - 1;
break;
case Hb:
g.y = e / 2;
break;
case xb:
case cc:
g.y = e / 2
}
var h = this.position, b = new v(h.x + g.x / b - g.x / c, h.y + g.y / b - g.y / c);
di(this, b, this.gd, d, e, this.tl);
this.position = b;
this.gc = !1;
this.Us(a, this.lb)
}
this.ra();
ii(this)
}
});
t.g(z, "autoScale", z.prototype.im);
t.defineProperty(z, {im: "autoScale"}, function () {
return this.ql
}, function (a) {
var b = this.ql;
b !== a && (t.nb(a, z, z, "autoScale"), this.ql = a, this.i("autoScale", b, a), a !== Ge && bi(this))
});
t.g(z, "initialAutoScale", z.prototype.IH);
t.defineProperty(z, {IH: "initialAutoScale"}, function () {
return this.xk
}, function (a) {
var b = this.xk;
b !== a && (t.nb(a, z, z, "initialAutoScale"), this.xk = a, this.i("initialAutoScale", b, a))
});
t.g(z, "initialViewportSpot", z.prototype.TD);
t.defineProperty(z, {TD: "initialViewportSpot"}, function () {
return this.du
}, function (a) {
var b = this.du;
b !== a && (t.j(a, H, z, "initialViewportSpot"), a.jd() || t.m("initialViewportSpot must be a real Spot: " + a), this.du = a, this.i("initialViewportSpot", b, a))
});
t.g(z, "initialDocumentSpot", z.prototype.QD);
t.defineProperty(z, {QD: "initialDocumentSpot"}, function () {
return this.cu
}, function (a) {
var b = this.cu;
b !== a && (t.j(a, H, z, "initialDocumentSpot"), a.jd() || t.m("initialViewportSpot must be a real Spot: " + a), this.cu = a, this.i("initialDocumentSpot", b, a))
});
t.g(z, "minScale", z.prototype.cg);
t.defineProperty(z, {cg: "minScale"}, function () {
return this.su
}, function (a) {
t.o(a, z, "minScale");
var b = this.su;
b !== a && 0 < a ? (this.su = a, this.i("minScale", b, a), a > this.scale && (this.scale = a)) : t.ia(a, "> 0", z, "minScale")
});
t.g(z, "maxScale", z.prototype.bg);
t.defineProperty(z, {bg: "maxScale"}, function () {
return this.pu
}, function (a) {
t.o(a, z, "maxScale");
var b = this.pu;
b !== a && 0 < a ? (this.pu = a, this.i("maxScale", b, a), a < this.scale && (this.scale = a)) : t.ia(a, "> 0", z, "maxScale")
});
t.g(z, "zoomPoint", z.prototype.Gh);
t.defineProperty(z, {Gh: "zoomPoint"}, function () {
return this.jv
}, function (a) {
this.jv.K(a) || (t.j(a, v, z, "zoomPoint"), this.jv = a = a.W())
});
t.g(z, "contentAlignment", z.prototype.Av);
t.defineProperty(z, {Av: "contentAlignment"}, function () {
return this.tl
}, function (a) {
var b = this.tl;
b.K(a) || (t.j(a, H, z, "contentAlignment"), this.tl = a = a.W(), this.i("contentAlignment", b, a), bi(this))
});
t.g(z, "initialContentAlignment", z.prototype.JH);
t.defineProperty(z, {JH: "initialContentAlignment"}, function () {
return this.tn
}, function (a) {
var b = this.tn;
b.K(a) || (t.j(a, H, z, "initialContentAlignment"), this.tn = a = a.W(), this.i("initialContentAlignment", b, a))
});
t.g(z, "padding", z.prototype.padding);
t.defineProperty(z, {padding: "padding"}, function () {
return this.Ge
}, function (a) {
"number" === typeof a ? a = new Wa(a) : t.j(a, Wa, z, "padding");
var b = this.Ge;
b.K(a) || (this.Ge = a = a.W(), this.vc(), this.i("padding", b, a))
});
t.A(z, {Ji: "nodes"}, function () {
return this.Cu.l
});
t.A(z, {links: "links"}, function () {
return this.lu.l
});
t.A(z, {gp: "parts"}, function () {
return this.qb.l
});
z.prototype.findTopLevelGroups = function () {
return this.Ik.l
};
t.g(z, "layout", z.prototype.Vb);
t.defineProperty(z, {Vb: "layout"}, function () {
return this.Ad
}, function (a) {
var b = this.Ad;
b !== a && (t.j(a, fe, z, "layout"), null !== b && (b.h = null, b.group = null), this.Ad = a, a.h = this, a.group = null, this.At = !0, this.i("layout", b, a), this.Hf())
});
z.prototype.layoutDiagram = function (a) {
$h(this);
a && aj(this, !0);
ri(this, !1)
};
function aj(a, b) {
for (var c = a.Ik.l; c.next();)bj(a, c.value, b);
null !== a.Vb && (b ? a.Vb.hf = !1 : a.Vb.J())
}
function bj(a, b, c) {
if (null !== b) {
for (var d = b.In.l; d.next();)bj(a, d.value, c);
null !== b.Vb && (c ? b.Vb.hf = !1 : b.Vb.J())
}
}
function ri(a, b) {
for (var c = a.Ik.l; c.next();)cj(a, c.value, b);
c = a.Vb;
if (null !== c && !c.hf) {
if (b && !c.Wz)return;
c.doLayout(a);
$h(a);
c.hf = !0
}
a.At = !1
}
function cj(a, b, c) {
if (null !== b) {
for (var d = b.In.l; d.next();)cj(a, d.value, c);
d = b.Vb;
null === d || d.hf || c && !d.Wz || (b.$B = !b.location.P(), d.doLayout(b), b.J(dj), d.hf = !0, ui(a, b))
}
}
t.g(z, "isTreePathToChildren", z.prototype.Xc);
t.defineProperty(z, {Xc: "isTreePathToChildren"}, function () {
return this.hu
}, function (a) {
var b = this.hu;
if (b !== a && (t.k(a, "boolean", z, "isTreePathToChildren"), this.hu = a, this.i("isTreePathToChildren", b, a), !this.va.kb))for (a = this.Ji; a.next();)ej(a.value)
});
z.prototype.findTreeRoots = function () {
for (var a = new A(S), b = this.Ji.l; b.next();) {
var c = b.value;
c.Oo && null === c.us() && a.add(c)
}
return a.l
};
t.g(z, "isCollapsingExpanding", z.prototype.Gd);
t.defineProperty(z, {Gd: null}, function () {
return this.GB
}, function (a) {
this.GB = a
});
function Ih(a) {
function b(a) {
var b = a.toLowerCase(), h = new A("function");
c.add(a, h);
c.add(b, h);
d.add(a, a);
d.add(b, a)
}
var c = new ia("string", A), d = new ia("string", "string");
b("BackgroundSingleClicked");
b("BackgroundDoubleClicked");
b("BackgroundContextClicked");
b("ClipboardChanged");
b("ClipboardPasted");
b("DocumentBoundsChanged");
b("ExternalObjectsDropped");
b("InitialLayoutCompleted");
b("LayoutCompleted");
b("LinkDrawn");
b("LinkRelinked");
b("LinkReshaped");
b("Modified");
b("ObjectSingleClicked");
b("ObjectDoubleClicked");
b("ObjectContextClicked");
b("PartCreated");
b("PartResized");
b("PartRotated");
b("SelectionMoved");
b("SelectionCopied");
b("SelectionDeleting");
b("SelectionDeleted");
b("SelectionGrouped");
b("SelectionUngrouped");
b("ChangingSelection");
b("ChangedSelection");
b("SubGraphCollapsed");
b("SubGraphExpanded");
b("TextEdited");
b("TreeCollapsed");
b("TreeExpanded");
b("ViewportBoundsChanged");
a.Gx = c;
a.Fx = d
}
function ja(a, b) {
var c = a.Fx.wa(b);
return null !== c ? c : a.Fx.wa(b.toLowerCase())
}
function fj(a, b) {
var c = a.Gx.wa(b);
if (null !== c)return c;
c = a.Gx.wa(b.toLowerCase());
if (null !== c)return c;
t.m("Unknown DiagramEvent name: " + b);
return null
}
z.prototype.addDiagramListener = z.prototype.jz = function (a, b) {
t.k(a, "string", z, "addDiagramListener:name");
t.k(b, "function", z, "addDiagramListener:listener");
var c = fj(this, a);
null !== c && c.add(b)
};
z.prototype.removeDiagramListener = z.prototype.FE = function (a, b) {
t.k(a, "string", z, "removeDiagramListener:name");
t.k(b, "function", z, "addDiagramListener:listener");
var c = fj(this, a);
null !== c && c.remove(b)
};
z.prototype.raiseDiagramEvent = z.prototype.Ea = function (a, b, c) {
f && t.k(a, "string", z, "raiseDiagramEvent:name");
var d = fj(this, a), e = new nd;
e.h = this;
e.name = ja(this, a);
void 0 !== b && (e.Aw = b);
void 0 !== c && (e.mw = c);
a = d.length;
if (1 === a)d = d.ta(0), d(e); else if (0 !== a)for (b = d.Ve(), c = 0; c < a; c++)d = b[c], d(e);
return e.cancel
};
function Vf(a, b) {
var c = !1;
a.lb.Jj(b) && (c = !0);
c = a.Dz(b, function (a) {
return a.S
}, function (a) {
return a instanceof X
}, !0, function (a) {
return a instanceof X
}, c);
if (0 !== c.count)for (c = c.l; c.next();) {
var d = c.value;
d.Bi && d.Tb()
}
}
function gj(a, b) {
null === a.Cd && (a.Cd = new hj);
var c = null !== b ? b.ib : null;
if (a.Cd.Cs || a.Cd.group !== c) {
if (null === c) {
var d;
d = a.cj ? ai(a) : a.gd.copy();
d.Gg(100, 100);
a.Cd.initialize(d);
d = t.rf();
for (var e = a.Ji; e.next();) {
var g = e.value, h = g.layer;
null !== h && h.visible && !h.kc && ij(a, g, null, d)
}
} else for (d = c.ua.copy(), d.Gg(20, 20), a.Cd.initialize(d), d = t.rf(), e = c.Lc; e.next();)g = e.value, g instanceof S && ij(a, g, null, d);
t.Jc(d);
a.Cd.group = c;
a.Cd.Cs = !1
} else jj(a.Cd);
return a.Cd
}
function ij(a, b, c, d) {
if (b !== c)if (b.canAvoid()) {
c = b.getAvoidableRect(d);
d = a.Cd.km;
b = a.Cd.jm;
for (var e = c.x + c.width, g = c.y + c.height, h = c.x; h < e; h += d) {
for (var k = c.y; k < g; k += b)kj(a.Cd, h, k);
kj(a.Cd, h, g)
}
for (k = c.y; k < g; k += b)kj(a.Cd, e, k);
kj(a.Cd, e, g)
} else if (b instanceof U)for (b = b.Lc; b.next();)e = b.value, e instanceof S && ij(a, e, c, d)
}
function nj(a, b) {
null === a.Cd || a.Cd.Cs || null !== b && !b.canAvoid() || (a.Cd.Cs = !0)
}
z.prototype.simulatedMouseMove = z.prototype.gF = function (a, b, c) {
if (null !== bf) {
c instanceof z || (c = null);
var d = cf, e = bf.h;
cf = c;
if (c !== d) {
if (null !== d && d !== e && null !== d.zb.de)return d.zb.de.doSimulatedDragLeave(), !1;
null !== c && null !== c.zb.de && c.zb.de.doSimulatedDragEnter()
}
if (null === c || !c.kz || !c.em || c.Ua || c === e)return!1;
d = c.zb.de;
null !== d && (null !== a && (b = c.ah(a)), c.hc.V = b, c.hc.Oj = !1, c.hc.Mi = !1, d.doSimulatedDragOver());
return!0
}
return!1
};
z.prototype.simulatedMouseUp = z.prototype.hF = function (a, b, c, d) {
if (null !== bf) {
null === d && (d = b);
b = cf;
var e = bf.h;
if (d !== b) {
if (null !== b && b !== e && null !== b.zb.de)return b.zb.de.doSimulatedDragLeave(), !1;
null !== d && null !== d.zb.de && d.zb.de.doSimulatedDragEnter()
}
cf = d;
if (null === d)return bf.doCancel(), !0;
if (d !== this)return null !== a && (c = d.ah(a)), d.hc.V = c, d.hc.Oj = !1, d.hc.Mi = !0, a = d.zb.de, null !== a && a.doSimulatedDrop(), a = bf, null !== a && (d = a.mayCopy(), a.We = d ? "Copy" : "Move", a.stopTool()), !0
}
return!1
};
t.g(z, "autoScrollRegion", z.prototype.KC);
t.defineProperty(z, {KC: "autoScrollRegion"}, function () {
return this.Dt
}, function (a) {
"number" === typeof a ? a = new Wa(a) : t.j(a, Wa, z, "autoScrollRegion");
var b = this.Dt;
b.K(a) || (this.Dt = a = a.W(), this.vc(), this.i("autoScrollRegion", b, a))
});
function Gf(a, b) {
a.lx = a.xp(b);
zj(a, a.lx).xi(a.position) ? gf(a) : Aj(a)
}
function Aj(a) {
if (null === a.Qg) {
a.Qg = {};
var b;
b = a.Na !== a.zb.de ? a.$F : a.aG;
a.Qg.isEnabled = !0;
var c = setInterval(function () {
var b = c;
null !== a.Qg && a.Qg.isEnabled && (a.Qg = null, clearInterval(b), b = zj(a, a.lx), b.xi(a.position) || (a.position = b, a.R.V = a.AF(a.lx), a.Na.doMouseMove(), a.cj = !0, ei(a, a.df()), a.Ee = !0, a.Hi(), Aj(a)))
}, b);
a.Qg.id = c
}
}
function gf(a) {
null !== a.Qg && (a.Qg.isEnabled && clearInterval(a.Qg.id), a.Qg = null)
}
function zj(a, b) {
var c = a.position, d = a.KC;
if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom)return c;
var e = a.lb, g = a.scale, e = t.Zj(0, 0, e.width * g, e.height * g), h = t.cc(0, 0);
if (b.x >= e.x && b.x < e.x + d.left) {
var k = Math.max(a.np, 1), k = k | 0;
h.x -= k;
b.x < e.x + d.left / 2 && (h.x -= k);
b.x < e.x + d.left / 4 && (h.x -= 4 * k)
} else b.x <= e.x + e.width && b.x > e.x + e.width - d.right && (k = Math.max(a.np, 1), k |= 0, h.x += k, b.x > e.x + e.width - d.right / 2 && (h.x += k), b.x > e.x + e.width - d.right / 4 && (h.x += 4 * k));
b.y >= e.y && b.y < e.y + d.top ? (k = Math.max(a.op, 1), k |= 0, h.y -= k, b.y < e.y +
d.top / 2 && (h.y -= k), b.y < e.y + d.top / 4 && (h.y -= 4 * k)) : b.y <= e.y + e.height && b.y > e.y + e.height - d.bottom && (k = Math.max(a.op, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k));
h.xi(D.bk) || (c = new v(c.x + h.x / g, c.y + h.y / g));
t.Jc(e);
t.B(h);
return c
}
z.prototype.makeSVG = function (a) {
void 0 === a && (a = {});
a.context = "svg";
a = Bj(this, a);
return null !== a ? a.jt : null
};
z.prototype.makeImage = function (a) {
var b = document.createElement("img");
b.src = this.aI(a);
return b instanceof HTMLImageElement ? b : null
};
z.prototype.makeImageData = z.prototype.aI = function (a) {
void 0 === a && (a = {});
var b = Bj(this, a);
return null !== b ? b.toDataURL(a.type, a.details) : ""
};
function Bj(a, b) {
a.Hi();
if (null === a.Ta)return null;
"object" !== typeof b && t.m("properties argument must be an Object.");
var c = !1, d = b.size || null, e = b.scale || null;
void 0 !== b.scale && isNaN(b.scale) && (e = "NaN");
var g = b.maxSize || new da(2E3, 2E3);
void 0 === b.maxSize && (c = !0);
var h = b.position || null, k = b.parts || null, l = void 0 === b.padding ? 1 : b.padding, m = b.background || null, n = b.omitTemporary;
void 0 === n && (n = !0);
var p = b.showTemporary;
void 0 === p && (p = !n);
n = b.showGrid;
void 0 === n && (n = p);
null !== d && isNaN(d.width) && isNaN(d.height) &&
(d = null);
l && "number" === typeof l && (l = new Wa(l));
l || (l = new Wa(0));
l.left = Math.max(l.left, 0);
l.right = Math.max(l.right, 0);
l.top = Math.max(l.top, 0);
l.bottom = Math.max(l.bottom, 0);
a.ln = !1;
Vh(a);
var q = document.createElement("canvas"), r = q.getContext("2d"), s = q;
if (!(d || e || k || h))return q.width = a.Ta.width + Math.ceil(l.left + l.right), q.height = a.Ta.height + Math.ceil(l.top + l.bottom), "svg" === b.context && (r = s = new nc(q), r instanceof nc && (a.ln = !0)), Bi(a, r, l, new da(q.width, q.height), a.Xb, a.sb, k, m, p, n), a.ln = !0, s;
var u, x = new v(0,
0);
u = a.gd.copy();
u.FI(a.padding);
null !== h && h.P() ? (x = h, e || (e = 1)) : (x.x = u.x, x.y = u.y);
if (k) {
var E, h = !0, k = k.l;
for (k.reset(); k.next();) {
var F = k.value;
if (F instanceof B) {
var G = F.layer;
G && !G.visible || G && G.kc || !F.ub() || (F = F.ua, F.P() && (h ? (h = !1, E = F.copy()) : E.ak(F)))
}
}
h && (E = new w(0, 0, 0, 0));
u.width = E.width;
u.height = E.height;
x.x = E.x;
x.y = E.y
}
h = E = 0;
l && (E = l.left + l.right, h = l.top + l.bottom);
F = G = 0;
d && (G = d.width, F = d.height, isFinite(G) && (G = Math.max(0, G - E)), isFinite(F) && (F = Math.max(0, F - h)));
d && e ? ("NaN" === e && (e = 1), d.P() ?
(d = G, u = F) : isNaN(F) ? (d = G, u = u.height * e) : (d = u.width * e, u = F)) : d ? d.P() ? (e = Math.min(G / u.width, F / u.height), d = G, u = F) : isNaN(F) ? (e = G / u.width, d = G, u = u.height * e) : (e = F / u.height, d = u.width * e, u = F) : e ? "NaN" === e && g.P() ? (e = Math.min((g.width - E) / u.width, (g.height - h) / u.height), 1 < e ? (e = 1, d = u.width, u = u.height) : (d = g.width, u = g.height)) : (d = u.width * e, u = u.height * e) : (e = 1, d = u.width, u = u.height);
l ? (d += E, u += h) : l = new Wa(0);
g && (E = g.width, g = g.height, "svg" !== b.context && c && !t.JF && (d > E || u > g) && (t.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" +
Math.ceil(d) + "x" + Math.ceil(u) + " vs 2000x2000) Consider increasing the max size."), t.JF = !0), isNaN(E) && (E = 2E3), isNaN(g) && (g = 2E3), isFinite(E) && (d = Math.min(d, E)), isFinite(g) && (u = Math.min(u, g)));
q.width = Math.ceil(d);
q.height = Math.ceil(u);
"svg" === b.context && (r = s = new nc(q), r instanceof nc && (a.ln = !0));
Bi(a, r, l, new da(Math.ceil(d), Math.ceil(u)), e, x, k, m, p, n);
a.ln = !0;
return s
}
z.inherit = function (a, b) {
t.k(a, "function", z, "inherit");
t.k(b, "function", z, "inherit");
b.kG && t.m("Cannot inherit from " + t.Fg(b));
t.Ja(a, b)
};
function Cj(a) {
1 < arguments.length && t.m("Palette constructor can only take one optional argument, the DIV HTML element or its id.");
z.call(this, a);
this.pv = !0;
this.Ok = !1;
this.Ua = !0;
this.Av = Eb;
this.Vb = new Dj
}
t.ea("Palette", Cj);
t.Ja(Cj, z);
function Ei(a) {
1 < arguments.length && t.m("Overview constructor can only take one optional argument, the DIV HTML element or its id.");
z.call(this, a);
this.gc = !0;
this.bi = null;
this.Ut = !0;
var b = new B, c = new Y;
c.stroke = "magenta";
c.bb = 2;
c.fill = null;
c.name = "BOXSHAPE";
b.tw = "BOXSHAPE";
b.fw = "BOXSHAPE";
b.add(c);
this.Wm = b;
this.Ty = document.createElement("canvas");
this.mG = this.Ty.getContext("2d");
b = new Ej;
b.Ce(this);
this.zb.mf.Fd(0, b);
var d = this;
this.AE = function () {
Fj(d)
};
this.zE = function () {
null !== d.bi && (d.vc(), d.ra())
};
this.Ua = !0;
this.Ie = !1;
this.im = fi;
this.zb.Fm = Xe;
this.gc = !1
}
t.ea("Overview", Ei);
t.Ja(Ei, z);
function Fi(a) {
a.gc || a.yd || !1 !== a.Vf || (a.Vf = !0, requestAnimationFrame(function () {
if (a.Vf && !a.yd && (a.Vf = !1, null !== a.vb)) {
a.yd = !0;
$h(a);
a.gd.P() || ei(a, a.df());
null === a.vb && t.m("No div specified");
null === a.Ta && t.m("No canvas specified");
if (a.Ee && null !== a.bi) {
var b = a.Ti, c = a.Ty;
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, a.Ta.width, a.Ta.height);
b.drawImage(c, 0, 0);
c = a.qd;
c.reset();
1 !== a.Xb && c.scale(a.scale);
0 === a.position.x && 0 === a.position.y || c.translate(-a.sb.x, -a.sb.y);
b.setTransform(c.m11, c.m12, c.m21,
c.m22, c.dx, c.dy);
for (var c = a.Fb.length, d = 0; d < c; d++)a.Fb.p[d].Ne(b, a);
a.yk = !1;
a.Ee = !1
}
a.yd = !1
}
}))
}
Ei.prototype.Ne = function () {
null === this.vb && t.m("No div specified");
null === this.Ta && t.m("No canvas specified");
if (this.Ee) {
var a = this.bi;
if (null !== a) {
var b = a.Io;
(b && b.visible && isNaN(b.width) || isNaN(b.height)) && qi(a);
var c = this.Ta, b = this.Ti, d = this.Ty, e = this.mG;
d.width = c.width;
d.height = c.height;
b.rt = "";
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, this.Ta.width, this.Ta.height);
var g = this.qd;
g.reset();
1 !== this.Xb && g.scale(this.scale);
0 === this.position.x && 0 === this.position.y || g.translate(-this.sb.x, -this.sb.y);
b.setTransform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
for (var h = this.Ut, k = this.lb, l = a.Fb.length, g = 0; g < l; g++) {
var m = a.Fb.p[g], n = b, p = k, q = h;
void 0 === q && (q = !0);
if (q || !m.kc)for (var m = m.qb, q = this.scale, r = m.length, s = 0; s < r; s++) {
var u = m.p[s], x = u.ua;
x.Cf(p) && (1 < x.width * q || 1 < x.height * q ? u.Ne(n, this) : Ch(u, n))
}
}
e.drawImage(c, 0, 0);
f && f.rz && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4));
a = this.Fb.length;
for (g = 0; g < a; g++)this.Fb.p[g].Ne(b, this);
this.Ee = this.yk = !1
}
}
};
t.g(Ei, "observed", Ei.prototype.iI);
t.defineProperty(Ei, {iI: "observed"}, function () {
return this.bi
}, function (a) {
var b = this.bi;
null !== a && t.j(a, z, Ei, "observed");
b === a || a instanceof Ei || (null !== b && (this.remove(this.Yf), b.FE("ViewportBoundsChanged", this.AE), b.FE("DocumentBoundsChanged", this.zE), b.Nn.remove(this)), this.bi = a, null !== a && (a.jz("ViewportBoundsChanged", this.AE), a.jz("DocumentBoundsChanged", this.zE), a.Nn.add(this), this.add(this.Yf), Fj(this)), this.vc(), this.i("observed", b, a))
});
t.g(Ei, "box", Ei.prototype.Yf);
t.defineProperty(Ei, {Yf: "box"}, function () {
return this.Wm
}, function (a) {
var b = this.Wm;
b !== a && (this.Wm = a, this.i("box", b, a))
});
t.g(Ei, "drawsTemporaryLayers", Ei.prototype.rH);
t.defineProperty(Ei, {rH: "drawsTemporaryLayers"}, function () {
return this.Ut
}, function (a) {
this.Ut !== a && (this.Ut = a, this.sA())
});
function Fj(a) {
var b = a.Yf;
if (null !== b) {
var c = a.bi;
if (null !== c) {
a.Ee = !0;
var c = c.lb, d = b.dt, e = t.jl();
e.q(c.width, c.height);
d.ya = e;
t.Rj(e);
a = 2 / a.scale;
d instanceof Y && (d.bb = a);
b.location = new v(c.x - a / 2, c.y - a / 2)
}
}
}
Ei.prototype.df = function () {
var a = this.bi;
return null === a ? D.YF : a.gd
};
Ei.prototype.Us = function (a) {
this.gc || (Yh(this), this.ra(), ii(this), this.vc(), Fj(this), this.Ea("ViewportBoundsChanged", a))
};
function Ej() {
Td.call(this);
this.name = "MoveBox"
}
t.Ja(Ej, Td);
Ej.prototype.doStart = function () {
this.na = this.h.sd = !0
};
Ej.prototype.doMouseMove = function () {
if (this.na) {
var a = this.h;
if (null !== a && null !== a.bi) {
var b = a.bi, c = b.lb, d = a.R.V;
b.position = new v(d.x - c.width / 2, d.y - c.height / 2);
a.Hf()
}
}
};
Ej.prototype.doMouseUp = function () {
this.na && this.doMouseMove();
this.stopTool()
};
Ej.prototype.doStop = function () {
this.na = !1;
var a = this.h;
a.sd = !1;
Fj(a)
};
function Nd(a) {
1 < arguments.length && t.m("Brush constructor can take at most one optional argument, the Brush type.");
t.uc(this);
this.cb = !1;
void 0 === a ? (this.Z = Pd, this.$m = "black") : "string" === typeof a ? (this.Z = Pd, this.$m = a) : (f && t.nb(a, Nd, Nd, "constructor:type"), this.Z = a, this.$m = "black");
var b = this.Z;
b === Qd ? (this.Sn = Eb, this.nn = Kb) : this.nn = b === Rd ? this.Sn = Hb : this.Sn = wb;
this.Xu = 0;
this.Vt = NaN;
this.qg = this.Iu = this.pg = null;
this.sx = this.tx = 0
}
t.ea("Brush", Nd);
var Pd;
Nd.Solid = Pd = t.w(Nd, "Solid", 0);
var Qd;
Nd.Linear = Qd = t.w(Nd, "Linear", 1);
var Rd;
Nd.Radial = Rd = t.w(Nd, "Radial", 2);
var Gj;
Nd.Pattern = Gj = t.w(Nd, "Pattern", 2);
Nd.prototype.copy = function () {
var a = new Nd;
a.Z = this.Z;
a.$m = this.$m;
a.Sn = this.Sn;
a.nn = this.nn;
a.Xu = this.Xu;
a.Vt = this.Vt;
null !== this.pg && (a.pg = this.pg.copy());
a.Iu = this.Iu;
return a
};
Nd.prototype.Ia = function () {
this.freeze();
Object.freeze(this);
return this
};
Nd.prototype.freeze = function () {
this.cb = !0;
null !== this.pg && this.pg.freeze();
return this
};
Nd.prototype.Qa = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.cb = !1;
null !== this.pg && this.pg.Qa();
return this
};
Nd.prototype.toString = function () {
var a = "Brush(";
if (this.type === Pd)a += this.color; else if (a = this.type === Qd ? a + "Linear " : this.type === Rd ? a + "Radial " : this.type === Gj ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.qo)for (var b = this.qo.l; b.next();)a += " " + b.key + ":" + b.value;
return a + ")"
};
Nd.prototype.addColorStop = Nd.prototype.addColorStop = function (a, b) {
t.L(this);
("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && t.ia(a, "0 <= loc <= 1", Nd, "addColorStop:loc");
t.k(b, "string", Nd, "addColorStop:color");
null === this.pg && (this.pg = new ia("number", "string"));
this.pg.add(a, b);
this.Z === Pd && (this.type = Qd);
this.qg = null
};
t.g(Nd, "type", Nd.prototype.type);
t.defineProperty(Nd, {type: "type"}, function () {
return this.Z
}, function (a) {
t.L(this, a);
t.nb(a, Nd, Nd, "type");
this.Z = a;
this.start.hd() && (a === Qd ? this.start = Eb : a === Rd && (this.start = Hb));
this.end.hd() && (a === Qd ? this.end = Kb : a === Rd && (this.end = Hb));
this.qg = null
});
t.g(Nd, "color", Nd.prototype.color);
t.defineProperty(Nd, {color: "color"}, function () {
return this.$m
}, function (a) {
t.L(this, a);
t.k(a, "string", Nd, "color");
this.$m = a;
this.qg = null
});
t.g(Nd, "start", Nd.prototype.start);
t.defineProperty(Nd, {start: "start"}, function () {
return this.Sn
}, function (a) {
t.L(this, a);
a instanceof H || t.Nb(a, "Spot", Nd, "start");
this.Sn = a.W();
this.qg = null
});
t.g(Nd, "end", Nd.prototype.end);
t.defineProperty(Nd, {end: "end"}, function () {
return this.nn
}, function (a) {
t.L(this, a);
a instanceof H || t.Nb(a, "Spot", Nd, "end");
this.nn = a.W();
this.qg = null
});
t.g(Nd, "startRadius", Nd.prototype.tp);
t.defineProperty(Nd, {tp: "startRadius"}, function () {
return this.Xu
}, function (a) {
t.L(this, a);
t.o(a, Nd, "startRadius");
0 > a && t.ia(a, ">= zero", Nd, "startRadius");
this.Xu = a;
this.qg = null
});
t.g(Nd, "endRadius", Nd.prototype.wo);
t.defineProperty(Nd, {wo: "endRadius"}, function () {
return this.Vt
}, function (a) {
t.L(this, a);
t.o(a, Nd, "endRadius");
0 > a && t.ia(a, ">= zero", Nd, "endRadius");
this.Vt = a;
this.qg = null
});
t.g(Nd, "colorStops", Nd.prototype.qo);
t.defineProperty(Nd, {qo: "colorStops"}, function () {
return this.pg
}, function (a) {
t.L(this, a);
f && t.j(a, ia, Nd, "colorStops");
this.pg = a;
this.qg = null
});
t.g(Nd, "pattern", Nd.prototype.pattern);
t.defineProperty(Nd, {pattern: "pattern"}, function () {
return this.Iu
}, function (a) {
t.L(this, a);
this.Iu = a;
this.qg = null
});
Nd.randomColor = function (a, b) {
void 0 === a && (a = 128);
f && (t.o(a, Nd, "randomColor:min"), (0 > a || 255 < a) && t.ia(a, "0 <= min <= 255", Nd, "randomColor:min"));
void 0 === b && (b = Math.max(a, 255));
f && (t.o(b, Nd, "randomColor:max"), (b < a || 255 < b) && t.ia(b, "min <= max <= 255", Nd, "randomColor:max"));
var c = Math.abs(b - a), d = Math.floor(a + Math.random() * c).toString(16), e = Math.floor(a + Math.random() * c).toString(16), c = Math.floor(a + Math.random() * c).toString(16);
2 > d.length && (d = "0" + d);
2 > e.length && (e = "0" + e);
2 > c.length && (c = "0" + c);
return"#" +
d + e + c
};
function Q() {
t.uc(this);
this.ha = 30723;
this.di = null;
this.Mb = "";
this.dc = this.Bb = null;
this.sb = (new v(NaN, NaN)).freeze();
this.Ye = (new da(NaN, NaN)).freeze();
this.Wd = D.Qm;
this.lj = D.XF;
this.qd = new ga;
this.pl = new ga;
this.Bk = new ga;
this.Xb = 1;
this.Vm = 0;
this.nh = Qg;
this.Rq = D.Fp;
this.Dc = (new w(NaN, NaN, NaN, NaN)).freeze();
this.Ob = (new w(NaN, NaN, NaN, NaN)).freeze();
this.Ec = (new w(0, 0, NaN, NaN)).freeze();
this.Sr = this.nq = this.T = this.lr = this.Yd = null;
this.Tr = this.oq = Infinity;
this.Mp = this.le = xb;
this.wr = 0;
this.sj = 1;
this.Tp =
0;
this.Si = 1;
this.zr = -Infinity;
this.yr = 0;
this.Ar = D.bk;
this.Br = yg;
this.$p = "";
this.Rl = this.Lh = this.ul = this.wc = this.O = null
}
t.ea("GraphObject", Q);
t.sh(Q);
Q.prototype.cloneProtected = function (a) {
a.ha = this.ha | 6144;
a.Mb = this.Mb;
a.Bb = this.Bb;
a.dc = this.dc;
a.sb.assign(this.sb);
a.Ye.assign(this.Ye);
a.Wd = this.Wd.W();
a.lj = this.lj.W();
a.Bk = this.Bk.copy();
a.Xb = this.Xb;
a.Vm = this.Vm;
a.nh = this.nh;
a.Rq = this.Rq.W();
a.Dc.assign(this.Dc);
a.Ob.assign(this.Ob);
a.Ec.assign(this.Ec);
a.lr = this.lr;
a.le = this.le.W();
a.Mp = this.Mp.W();
a.wr = this.wr;
a.sj = this.sj;
a.Tp = this.Tp;
a.Si = this.Si;
a.zr = this.zr;
a.yr = this.yr;
a.Ar = this.Ar.W();
a.Br = this.Br;
a.$p = this.$p;
if (null !== this.O) {
var b =
this.O;
a.O = {Kh: b.Kh, Qh: b.Qh, Mh: b.Mh, br: b.br, cr: b.cr, $h: b.$h, Zh: b.Zh, Yh: b.Yh, $q: b.$q, ar: b.ar, Xh: b.Xh, Hp: b.Hp, Ip: b.Ip, Jp: b.Jp, Gp: b.Gp, ji: b.ji, Nh: b.Nh}
}
null !== this.T && (b = this.T, a.T = {$i: b.$i.W(), Bj: b.Bj.W(), Yi: b.Yi, zj: b.zj, Xi: b.Xi, yj: b.yj, Zi: b.Zi, Aj: b.Aj});
a.nq = this.nq;
a.oq = this.oq;
a.Sr = this.Sr;
a.Tr = this.Tr;
a.wc = this.wc;
if (Array.isArray(this.ul))for (a.ul = this.ul.slice(0), b = 0; b < this.ul.length; b++) {
var c = this.ul[b];
a[c] = this[c]
}
null !== this.Lh && (a.Lh = this.Lh.copy())
};
Q.prototype.th = function (a) {
a.Yd = null;
a.Rl = null;
a.Y()
};
Q.prototype.copy = function () {
var a = new this.constructor;
this.cloneProtected(a);
return a
};
Q.prototype.toString = function () {
return t.Fg(Object.getPrototypeOf(this)) + "#" + t.jc(this)
};
var Pg;
Q.None = Pg = t.w(Q, "None", 0);
var Qg;
Q.Default = Qg = t.w(Q, "Default", 0);
var Hj;
Q.Vertical = Hj = t.w(Q, "Vertical", 4);
var Ij;
Q.Horizontal = Ij = t.w(Q, "Horizontal", 5);
var Fc;
Q.Fill = Fc = t.w(Q, "Fill", 3);
var Rg;
Q.Uniform = Rg = t.w(Q, "Uniform", 1);
var Sg;
Q.UniformToFill = Sg = t.w(Q, "UniformToFill", 2);
function Jj(a) {
a.O = {Kh: null, Qh: null, Mh: null, br: null, cr: null, $h: null, Zh: null, Yh: null, $q: null, ar: null, Xh: null, Hp: null, Ip: null, Jp: null, Gp: null, ji: null, Nh: null}
}
aa = Q.prototype;
aa.Ae = function () {
this.T = {$i: wb, Bj: wb, Yi: 10, zj: 10, Xi: Kj, yj: Kj, Zi: 0, Aj: 0}
};
function Lj(a, b, c, d, e, g, h) {
var k = 0.001, l = g.length;
a.moveTo(b, c);
d -= b;
k = e - c;
0 === d && (d = 0.001);
e = k / d;
for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; 0.1 <= m;) {
if (q) {
k = g[n++ % l];
for (k -= h; 0 > k;)k += g[n++ % l], p = !p;
q = !1
} else k = g[n++ % l];
k > m && (k = m);
var r = Math.sqrt(k * k / (1 + e * e));
0 > d && (r = -r);
b += r;
c += e * r;
p ? a.lineTo(b, c) : a.moveTo(b, c);
m -= k;
p = !p
}
}
aa.Yc = function (a, b, c, d, e, g, h) {
var k = this.S;
null !== k && (k.Hm(a, b, c, d, e, g, h), 0 !== (this.ha & 1024) && c === this && a === qd && Mj(this, k, b))
};
function Mj(a, b, c) {
var d = a.Bo();
if (null !== d)for (var e = a.wc.l; e.next();) {
var g = e.value, h = d.data, k = g.ht;
null !== k && (h = d.ee(k));
if (null !== h && (g.FF(a, h, c, null !== k ? null : b.h), null !== k && (h = d, "" !== k && (h = d.ee(k)), null !== h))) {
var k = g.Mm, l = d;
"" !== k && (l = d.ee(k));
null !== l && g.GF(l, h, c)
}
}
}
aa.i = function (a, b, c) {
this.Yc(qd, a, this, b, c)
};
function Nj(a, b, c, d, e) {
var g = a.Dc, h = a.Bk;
h.reset();
Oj(a, h, b, c, d, e);
a.Bk = h;
g.x = b;
g.y = c;
g.width = d;
g.height = e;
h.Es() || h.zF(g)
}
function Pj(a, b, c, d) {
if (!1 === a.nf)return!1;
d.multiply(a.transform);
return c ? a.Cf(b, d) : a.nm(b, d)
}
aa.tD = function (a, b, c) {
if (!1 === this.nf)return!1;
var d = this.Oa;
b = a.Nj(b);
var e = !1;
c && (e = Pa(a.x, a.y, 0, 0, 0, d.height) < b || Pa(a.x, a.y, 0, d.height, d.width, d.height) < b || Pa(a.x, a.y, d.width, d.height, d.width, 0) < b || Pa(a.x, a.y, d.width, 0, 0, 0) < b);
c || (e = Pa(a.x, a.y, 0, 0, 0, d.height) < b && Pa(a.x, a.y, 0, d.height, d.width, d.height) < b && Pa(a.x, a.y, d.width, d.height, d.width, 0) < b && Pa(a.x, a.y, d.width, 0, 0, 0) < b);
return e
};
aa.Og = function () {
return!0
};
Q.prototype.containsPoint = Q.prototype.Da = function (a) {
f && t.j(a, v, Q, "containsPoint:p");
var b = t.M();
b.assign(a);
this.transform.Ra(b);
var c = this.ua;
if (!c.P())return!1;
if (t.KA) {
var d = this.Oa, e = this.Tj() * (null !== this.h ? this.h.scale : 1), g = 1 / e;
if (10 > d.width * e && 10 > d.height * e)return a = eb(c.x - 5 * g, c.y - 5 * g, c.width + 10 * g, c.height + 10 * g, b.x, b.y), t.B(b), a
}
if (void 0 !== this.Hc || this instanceof Y ? eb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Da(b)) {
if (this.Lh && !this.Lh.Da(b))return!1;
if (null !== this.dc && c.Da(b) || null !==
this.Bb && this.Ec.Da(a))return!0;
t.B(b);
return this.Ij(a)
}
t.B(b);
return!1
};
Q.prototype.Ij = function (a) {
var b = this.Oa;
return eb(0, 0, b.width, b.height, a.x, a.y)
};
Q.prototype.containsRect = Q.prototype.Jj = function (a) {
f && t.j(a, w, Q, "containsRect:r");
if (0 === this.angle)return this.ua.Jj(a);
var b = this.Oa, b = t.Zj(0, 0, b.width, b.height), c = this.transform, d = !1, e = t.cc(a.x, a.y);
b.Da(c.Ai(e)) && (e.q(a.x, a.bottom), b.Da(c.Ai(e)) && (e.q(a.right, a.bottom), b.Da(c.Ai(e)) && (e.q(a.right, a.y), b.Da(c.Ai(e)) && (d = !0))));
t.B(e);
t.Jc(b);
return d
};
Q.prototype.containedInRect = Q.prototype.nm = function (a, b) {
f && t.j(a, w, Q, "containedInRect:r");
if (void 0 === b)return a.Jj(this.ua);
var c = this.Oa, d = !1, e = t.cc(0, 0);
a.Da(b.Ra(e)) && (e.q(0, c.height), a.Da(b.Ra(e)) && (e.q(c.width, c.height), a.Da(b.Ra(e)) && (e.q(c.width, 0), a.Da(b.Ra(e)) && (d = !0))));
return d
};
Q.prototype.intersectsRect = Q.prototype.Cf = function (a, b) {
f && t.j(a, w, Q, "intersectsRect:r");
if (void 0 === b && (b = this.transform, 0 === this.angle))return a.Cf(this.ua);
var c = this.Oa, d = b, e = t.cc(0, 0), g = t.cc(0, c.height), h = t.cc(c.width, c.height), k = t.cc(c.width, 0), l = !1;
if (a.Da(d.Ra(e)) || a.Da(d.Ra(g)) || a.Da(d.Ra(h)) || a.Da(d.Ra(k)))l = !0; else {
var c = t.Zj(0, 0, c.width, c.height), m = t.cc(a.x, a.y);
c.Da(d.Ai(m)) ? l = !0 : (m.q(a.x, a.bottom), c.Da(d.Ai(m)) ? l = !0 : (m.q(a.right, a.bottom), c.Da(d.Ai(m)) ? l = !0 : (m.q(a.right, a.y), c.Da(d.Ai(m)) &&
(l = !0))));
t.B(m);
t.Jc(c);
!l && (D.Vv(a, e, g) || D.Vv(a, g, h) || D.Vv(a, h, k) || D.Vv(a, k, e)) && (l = !0)
}
t.B(e);
t.B(g);
t.B(h);
t.B(k);
return l
};
Q.prototype.getDocumentPoint = Q.prototype.$a = function (a, b) {
void 0 === b && (b = new v);
a.hd() && t.m("Spot must be real");
var c = this.Oa;
b.q(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY);
this.ae.Ra(b);
return b
};
Q.prototype.getDocumentAngle = Q.prototype.Wk = function () {
var a = this.ae, a = 180 / Math.PI * Math.atan2(a.m12, a.m11);
0 > a && (a += 360);
return a
};
Q.prototype.getDocumentScale = Q.prototype.Tj = function () {
var a = this.Xb;
return null !== this.fa ? a * this.fa.Tj() : a
};
Q.prototype.getLocalPoint = Q.prototype.DD = function (a, b) {
void 0 === b && (b = new v);
b.assign(a);
this.ae.Ai(b);
return b
};
Q.prototype.getNearestIntersectionPoint = Q.prototype.Go = function (a, b, c) {
return this.ws(a.x, a.y, b.x, b.y, c)
};
aa = Q.prototype;
aa.ws = function (a, b, c, d, e) {
var g = this.transform, h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), k = g.m22 * h, l = -g.m12 * h, m = -g.m21 * h, n = g.m11 * h, p = h * (g.m21 * g.dy - g.m22 * g.dx), q = h * (g.m12 * g.dx - g.m11 * g.dy);
if (null !== this.Gj)return g = this.ua, D.Go(g.left, g.top, g.right, g.bottom, a, b, c, d, e);
if (!(this instanceof y) || this instanceof y && null !== this.background)return h = a * k + b * m + p, a = a * l + b * n + q, k = c * k + d * m + p, c = c * l + d * n + q, e.q(0, 0), d = this.Oa, c = D.Go(0, 0, d.width, d.height, h, a, k, c, e), e.transform(g), c;
if (this instanceof y && (null === this.Gj || void 0 ===
this.Gj)) {
h = a * k + b * m + p;
a = a * l + b * n + q;
k = c * k + d * m + p;
d = c * l + d * n + q;
e.q(k, d);
l = (k - h) * (k - h) + (d - a) * (d - a);
c = !1;
n = this.za.p;
q = n.length;
m = t.M();
for (p = 0; p < q; p++)b = n[p], b.visible && b.ws(h, a, k, d, m) && (c = !0, b = (h - m.x) * (h - m.x) + (a - m.y) * (a - m.y), b < l && (l = b, e.set(m)));
t.B(m);
e.transform(g);
return c
}
t.m("Unknown GraphObject case");
return!1
};
function lh(a, b, c, d, e) {
if (!1 !== vi(a)) {
var g = a.margin, h = g.top + g.bottom;
b = Math.max(b - (g.right + g.left), 0);
c = Math.max(c - h, 0);
g = a.ya;
h = 0;
a.bb && (h = a.bb);
b = isFinite(g.width) ? g.width + h : b;
c = isFinite(g.height) ? g.height + h : c;
var g = d || 0, h = e || 0, k = a instanceof y;
switch (Qj(a)) {
case Pg:
h = g = 0;
k && (c = b = Infinity);
break;
case Fc:
isFinite(b) && b > d && (g = b);
isFinite(c) && c > e && (h = c);
break;
case Ij:
isFinite(b) && b > d && (g = b);
h = 0;
k && (c = Infinity);
break;
case Hj:
isFinite(c) && c > e && (h = c), g = 0, k && (b = Infinity)
}
var k = a.Be, l = a.Te;
g > k.width &&
l.width < k.width && (g = k.width);
h > k.height && l.height < k.height && (h = k.height);
d = Math.max(g / a.scale, l.width);
e = Math.max(h / a.scale, l.height);
k.width < d && (d = Math.min(l.width, d));
k.height < e && (e = Math.min(l.height, e));
b = Math.min(k.width, b);
c = Math.min(k.height, c);
b = Math.max(d, b);
c = Math.max(e, c);
g = a.angle;
if (90 === g || 270 === g)g = b, b = c, c = g, g = d, d = e, e = g;
a.Dc.Qa();
a.Js(b, c, d, e);
a.Dc.freeze();
a.Dc.P() || t.m("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Dc.toString());
Rj(a, !1)
}
}
aa.yc = function (a, b, c, d, e) {
Sj(this);
var g = t.rf();
g.assign(this.Ob);
this.Ob.Qa();
if (!1 === wi(this)) {
var h = this.Ob;
h.x = a;
h.y = b;
h.width = c;
h.height = d
} else this.Hj(a, b, c, d);
this.Ob.freeze();
this.Lh = void 0 === e ? null : e;
c = !1;
void 0 !== e ? c = !0 : this.fa && (e = this.fa.Ec, d = this.Ba, null !== this.Gj && (d = this.Ob), c = b + d.height, d = a + d.width, c = !(0 <= a && d <= e.width && 0 <= b && c <= e.height), this instanceof la && (a = this.Ec, this.ou > a.height || this.Fn.Gi > a.width)) && (c = !0);
this.ha = c ? this.ha | 256 : this.ha & -257;
this.Ob.P() || t.m("Non-real actualBounds has been set. Object " +
this + ", actualBounds: " + this.Ob.toString());
Tj(this, g, this.Ob);
t.Jc(g)
};
aa.Hj = function () {
};
function Uj(a, b, c, d, e) {
var g = a.ua;
g.x = b;
g.y = c;
g.width = d;
g.height = e;
if (!a.ya.P()) {
g = a.Dc;
c = a.margin;
b = c.right + c.left;
var h = c.top + c.bottom;
c = g.width + b;
g = g.height + h;
d += b;
e += h;
b = Qj(a);
c === d && g === e && (b = Pg);
switch (b) {
case Pg:
if (c > d || g > e)Rj(a, !0), lh(a, c > d ? d : c, g > e ? e : g);
break;
case Fc:
Rj(a, !0);
lh(a, d, e, 0, 0);
break;
case Ij:
Rj(a, !0);
lh(a, d, g, 0, 0);
break;
case Hj:
Rj(a, !0), lh(a, c, e, 0, 0)
}
}
}
function Tj(a, b, c) {
Vj(a, !1);
var d = a.S;
if (null !== d) {
var e = d.h;
if (null !== e)if (Wj(d), a instanceof B) {
var g = !1, d = b.P();
if (!1 === e.cj) {
var h = e.gd, k = e.padding, l = h.x + k.left, m = h.y + k.top, n = h.width - 2 * k.right, h = h.height - 2 * k.bottom;
d && b.x > l && b.y > m && b.right < n && b.bottom < h && c.x > l && c.y > m && c.right < n && c.bottom < h && (g = !0)
}
0 !== (a.aa & 65536) !== !0 && b.K(c) || Ki(a, g, e);
e.Ey && null !== e.Vi ? (g = null, d && (g = t.rf(), Eh(a, b, g)), e.ra(c.P() ? Eh(a, c) : null, g), null !== g && t.Jc(g)) : e.ra()
} else Xj(a, d), a.ra(), b = a.S, null !== b && (b.dt !== a && b.NE !==
a && b.SE !== a || Yj(b, !0))
}
}
function Xj(a, b) {
null !== a.ld && Yj(b, !0);
if (a instanceof y)for (var c = a.za, d = c.length, e = 0; e < d; e++)Xj(c.p[e], b)
}
aa.Ne = function (a, b) {
if (this.visible)if (a instanceof nc)a:{
if (this.visible)if (this instanceof y && (this.type === Zj || this.type === ak))bk(this, a, b); else {
var c = this.Ob;
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
var d = this.transform, e = this.fa, g = this.pl;
g.reset();
null !== e && (e.Og() ? g.multiply(e.ae) : null !== e.fa && g.multiply(e.fa.ae));
g.multiply(this.qd);
var g = 0 !== (this.ha & 256), h = !1;
this instanceof la && ck(this, a);
if (g) {
h = e.Og() ? e.Oa : e.ua;
if (this.Lh)var k = this.Lh, l = k.x, m = k.y, n = k.width, k = k.height; else l =
Math.max(c.x, h.x), m = Math.max(c.y, h.y), n = Math.min(c.right, h.right) - l, k = Math.min(c.bottom, h.bottom) - m;
if (l > c.width + c.x || c.x > h.width + h.x || m > c.height + c.y || c.y > h.height + h.y)break a;
h = !0;
zc(a, 1, 0, 0, 1, 0, 0);
a.save();
a.beginPath();
a.rect(l, m, n, k);
a.clip()
}
l = !1;
if (this instanceof B && (l = !0, !this.ub()))break a;
m = !1;
this.S && (m = this.S.Ei);
a.ti.Se = [1, 0, 0, 1, 0, 0];
null !== this.dc && (dk(this, a, this.dc, !0, !0), this.dc instanceof Nd && this.dc.type === Rd ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), ek(a, this.dc, !0)) : a.fillRect(c.x,
c.y, c.width, c.height));
l && this.Ei && (zc(a, 1, 0, 0, 1, 0, 0), c = this.$l, a.shadowOffsetX = c.x, a.shadowOffsetY = c.y, a.shadowColor = this.Zl, a.shadowBlur = this.Yl / b.scale, a.Xa());
this instanceof y ? zc(a, d.m11, d.m12, d.m21, d.m22, d.dx, d.dy) : a.ti.Se = [d.m11, d.m12, d.m21, d.m22, d.dx, d.dy];
if (null !== this.Bb) {
var k = this.Oa, c = d = 0, n = k.width, k = k.height, p = 0;
this instanceof Y && (k = this.La.Hb, d = k.x, c = k.y, n = k.width, k = k.height, p = this.Cg);
dk(this, a, this.Bb, !0);
this.Bb instanceof Nd && this.Bb.type === Rd ? (a.beginPath(), a.rect(d - p / 2, c - p /
2, n + p, k + p), ek(a, this.Bb, !0)) : a.fillRect(d - p / 2, c - p / 2, n + p, k + p)
}
if (m && (null !== this.Bb || null !== this.dc || null !== e && 0 !== (e.ha & 512) || null !== e && e.type === Qh && e.Nv() !== this)) {
fk(this, !0);
var q = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur];
a.shadowOffsetX = 0;
a.shadowOffsetY = 0;
a.shadowBlur = 0
} else fk(this, !1);
this.Vk(a, b);
m && 0 !== (this.ha & 512) === !0 && (a.shadowOffsetX = q[0], a.shadowOffsetY = q[1], a.shadowBlur = q[2]);
l && m && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0);
g ? (a.restore(), h && a.ag.pop(), Vh(b, a)) : this instanceof
y && a.ag.pop();
l && m && a.ag.pop()
}
}
} else if (this instanceof y && (this.type === Zj || this.type === ak))bk(this, a, b); else if (d = this.Ob, 0 !== d.width && 0 !== d.height && !isNaN(d.x) && !isNaN(d.y)) {
q = this.transform;
g = this.fa;
h = this.pl;
h.reset();
null !== g && (g.Og() ? h.multiply(g.ae) : null !== g.fa && h.multiply(g.fa.ae));
h.multiply(this.qd);
h = 0 !== (this.ha & 256);
this instanceof la && ck(this, a);
if (h) {
f && f.qH && t.trace("clip" + this.toString());
c = g.Og() ? g.Oa : g.ua;
this.Lh ? (k = this.Lh, l = k.x, m = k.y, n = k.width, k = k.height) : (l = Math.max(d.x, c.x),
m = Math.max(d.y, c.y), n = Math.min(d.right, c.right) - l, k = Math.min(d.bottom, c.bottom) - m);
if (l > d.width + d.x || d.x > c.width + c.x || m > d.height + d.y || d.y > c.height + c.y)return;
a.save();
a.beginPath();
a.rect(l, m, n, k);
a.clip()
}
c = !1;
if (this instanceof B) {
c = !0;
if (!this.ub())return;
this.Ei && (l = this.$l, a.shadowOffsetX = l.x * b.scale, a.shadowOffsetY = l.y * b.scale, a.shadowColor = this.Zl, a.shadowBlur = this.Yl)
}
l = !1;
this.S && (l = this.S.Ei);
null !== this.dc && (dk(this, a, this.dc, !0, !0), this.dc instanceof Nd && this.dc.type === Rd ? (a.beginPath(),
a.rect(d.x, d.y, d.width, d.height), ek(a, this.dc, !0)) : a.fillRect(d.x, d.y, d.width, d.height));
q.Es() || a.transform(q.m11, q.m12, q.m21, q.m22, q.dx, q.dy);
null !== this.Bb && (k = this.Oa, m = d = 0, n = k.width, k = k.height, p = 0, this instanceof Y && (k = this.La.Hb, d = k.x, m = k.y, n = k.width, k = k.height, p = this.Cg), dk(this, a, this.Bb, !0), this.Bb instanceof Nd && this.Bb.type === Rd ? (a.beginPath(), a.rect(d - p / 2, m - p / 2, n + p, k + p), ek(a, this.Bb, !0)) : a.fillRect(d - p / 2, m - p / 2, n + p, k + p));
l && (null !== this.Bb || null !== this.dc || null !== g && 0 !== (g.ha & 512) || null !==
g && g.type === Qh && g.Nv() !== this) ? (fk(this, !0), e = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0) : fk(this, !1);
this.Vk(a, b);
l && 0 !== (this.ha & 512) === !0 && (a.shadowOffsetX = e[0], a.shadowOffsetY = e[1], a.shadowBlur = e[2]);
c && l && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0);
h ? (a.restore(), this instanceof y ? Vh(b, a, !0) : Vh(b, a, !1)) : q.Es() || (e = 1 / (q.m11 * q.m22 - q.m12 * q.m21), a.transform(q.m22 * e, -q.m12 * e, -q.m21 * e, q.m11 * e, e * (q.m21 * q.dy - q.m22 * q.dx), e * (q.m12 * q.dx - q.m11 *
q.dy)))
}
};
function bk(a, b, c) {
var d = a.Ob;
0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.dc && (dk(a, b, a.dc, !0, !0), a.dc instanceof Nd && a.dc.type === Rd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), ek(b, a.dc, !0)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Bb && (dk(a, b, a.Bb, !0), a.Bb instanceof Nd && a.Bb.type === Rd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), ek(b, a.Bb, !0)) : b.fillRect(d.x, d.y, d.width, d.height)), a.Vk(b, c))
}
aa.Vk = function () {
};
function ek(a, b, c) {
if (c)if (a instanceof CanvasRenderingContext2D && b instanceof Nd && b.type === Rd) {
var d = b.tx;
b = b.sx;
b > d ? (a.scale(d / b, 1), a.translate((b - d) / 2, 0), c ? a.fill() : a.stroke(), a.translate(-(b - d) / 2, 0), a.scale(1 / (d / b), 1)) : d > b ? (a.scale(1, b / d), a.translate(0, (d - b) / 2), c ? a.fill() : a.stroke(), a.translate(0, -(d - b) / 2), a.scale(1, 1 / (b / d))) : c ? a.fill() : a.stroke()
} else c ? a.fill() : a.stroke(); else a.stroke()
}
function dk(a, b, c, d, e) {
if (null !== c) {
var g = 1, h = 1;
if ("string" === typeof c)d ? b.Rm !== c && (b.fillStyle = c, b.Rm = c) : b.Sm !== c && (b.strokeStyle = c, b.Sm = c); else if (c.type === Pd)c = c.color, d ? b.Rm !== c && (b.fillStyle = c, b.Rm = c) : b.Sm !== c && (b.strokeStyle = c, b.Sm = c); else {
var k, h = a.Oa, g = h.width, h = h.height;
if (e)var l = a.ua, g = l.width, h = l.height;
var m = b instanceof CanvasRenderingContext2D;
if (m && (c.qg && c.type === Gj || c.tx === g && c.sx === h))k = c.qg; else {
var n, p, q = p = 0;
e && (l = a.ua, g = l.width, h = l.height, p = l.x, q = l.y);
c.start instanceof v ? (a =
c.start.x, e = c.start.y) : c.start instanceof H ? (a = c.start.x * g, e = c.start.y * h) : (a = Hb.x * g, e = Hb.y * h);
c.end instanceof v ? (l = c.end.x, n = c.end.y) : c.end instanceof H ? (l = c.end.x * g, n = c.end.y * h) : c.type === Qd ? (l = Kb.x * g, n = Kb.y * h) : (l = Hb.x * g, n = Hb.y * h);
a += p;
l += p;
e += q;
n += q;
c.type === Qd ? k = b.createLinearGradient(a, e, l, n) : c.type === Rd ? (p = isNaN(c.wo) ? Math.max(g, h) / 2 : c.wo, isNaN(c.tp) ? (k = 0, p = Math.max(g, h) / 2) : k = c.tp, k = b.createRadialGradient(a, e, k, l, n, p)) : c.type === Gj ? k = b.createPattern(c.pattern, "repeat") : t.Nb(c.type, "Brush type");
if (c.type !== Gj && (p = c.qo))for (p = p.l; p.next();)k.addColorStop(p.key, p.value);
m && (c.qg = k, c.tx = g, c.sx = h)
}
d ? b.Rm !== k && (b.fillStyle = k, b.Rm = k) : b.Sm !== k && (b.strokeStyle = k, b.Sm = k)
}
}
}
Q.prototype.isContainedBy = Q.prototype.Ci = function (a) {
if (a instanceof y)a:{
if (this !== a && null !== a)for (var b = this.fa; null !== b;) {
if (b === a) {
a = !0;
break a
}
b = b.fa
}
a = !1
} else a = !1;
return a
};
Q.prototype.isVisibleObject = Q.prototype.al = function () {
if (!this.visible)return!1;
var a = this.fa;
return null !== a ? a.al() : !0
};
function gk(a) {
if (0 !== (a.ha & 2048) === !0) {
var b = a.qd;
b.reset();
if (!a.Ob.P() || !a.Dc.P()) {
hk(a, !1);
return
}
b.translate(a.Ob.x, a.Ob.y);
b.translate(-a.Ba.x, -a.Ba.y);
var c = a.Oa;
Oj(a, b, c.x, c.y, c.width, c.height);
hk(a, !1);
ik(a, !0)
}
0 !== (a.ha & 4096) === !0 && (null === a.fa ? (a.pl.set(a.qd), ik(a, !1)) : null !== a.fa.ae && (b = a.pl, b.reset(), b.multiply(a.fa.pl), b.multiply(a.qd), ik(a, !1)))
}
function Oj(a, b, c, d, e, g) {
1 !== a.scale && b.scale(a.scale);
if (0 !== a.angle) {
var h = Hb;
a.Re && a.Re.jd() && (h = a.Re);
var k = t.M();
if (a instanceof B && a.Zb !== a)for (c = a.Zb, d = c.Oa, k.ft(d.x, d.y, d.width, d.height, h), c.Bk.Ra(k), k.offset(-c.Ba.x, -c.Ba.y), h = c.fa; null !== h && h !== a;)h.Bk.Ra(k), k.offset(-h.Ba.x, -h.Ba.y), h = h.fa; else k.ft(c, d, e, g, h);
b.rotate(a.angle, k.x, k.y);
t.B(k)
}
}
Q.prototype.Y = function (a) {
if (!0 !== vi(this)) {
Rj(this, !0);
Vj(this, !0);
var b = this.fa;
null !== b ? a || b.Y() : (a = this.h, null !== a && (a.Of.add(this), this instanceof S && (a.va.kb || this.Hg(), null !== this.kd && jk(this.kd)), a.Hf()));
if (this instanceof y) {
var c = null;
a = this.za;
b = a.length;
this.Z === Qh && (c = kk(this, a, b)) && c.Y(!0);
a = a.p;
for (c = 0; c < b; c++) {
var d = a[c];
!0 !== vi(d) && (d.ya.P() || (d instanceof Og || d instanceof y || d instanceof la || Qj(d) !== Pg) && d.Y(!0))
}
}
}
};
function lk(a) {
if (!1 === vi(a) && (Rj(a, !0), Vj(a, !0), a instanceof y)) {
a = a.za.p;
for (var b = a.length, c = 0; c < b; c++)lk(a[c])
}
}
function jk(a) {
if (!1 === wi(a)) {
if (null !== a.fa)a.fa.Y(); else {
var b = a.h;
null !== b && (b.Of.add(a), a instanceof S && a.Hg(), b.Hf())
}
Vj(a, !0)
}
}
function Sj(a) {
if (0 !== (a.ha & 2048) === !1 && (hk(a, !0), ik(a, !0), a instanceof y))for (a = a.elements; a.next();)mk(a.value)
}
function mk(a) {
ik(a, !0);
if (a instanceof y)for (a = a.elements; a.next();)mk(a.value)
}
Q.prototype.ra = function () {
if (this instanceof B) {
var a = this.h;
null !== a && !wi(this) && !xi(this) && this.ub() && this.Ob.P() && a.ra(Eh(this, this.Ob))
} else null !== this.S && this.S.ra()
};
function Qj(a) {
var b = a.Ch, c = a.fa;
if (c && c.Z === nk)return ok(a, c.he(a.ac), c.ge(a.column));
if (c && c.Z === Qh && c.Nv() === a)return Fc;
if (b === Qg) {
if (c) {
c.Z === Ng && null === c.Wn && (b = c.za, kk(c, b, b.length));
if (c.Wn === a)return Fc;
a = c.Az;
return a === Qg ? Pg : a
}
return Pg
}
return b
}
function ok(a, b, c) {
var d = a.Ch;
if (d !== Qg)return d;
var e = d = void 0;
switch (b.Ch) {
case Hj:
e = !0;
break;
case Fc:
e = !0
}
switch (c.Ch) {
case Ij:
d = !0;
break;
case Fc:
d = !0
}
a = a.fa.Az;
d = void 0 !== d || a !== Ij && a !== Fc ? !1 : !0;
e = void 0 !== e || a !== Hj && a !== Fc ? !1 : !0;
return!0 === d && !0 === e ? Fc : !0 === d ? Ij : !0 === e ? Hj : Pg
}
t.g(Q, "segmentOrientation", Q.prototype.ct);
t.defineProperty(Q, {ct: "segmentOrientation"}, function () {
return this.Br
}, function (a) {
var b = this.Br;
b !== a && (f && t.nb(a, X, Q, "segmentOrientation"), this.Br = a, this.Y(), this.i("segmentOrientation", b, a))
});
t.g(Q, "segmentIndex", Q.prototype.of);
t.defineProperty(Q, {of: "segmentIndex"}, function () {
return this.zr
}, function (a) {
f && t.k(a, "number", Q, "segmentIndex");
a = Math.round(a);
var b = this.zr;
b !== a && (this.zr = a, this.Y(), this.i("segmentIndex", b, a))
});
t.g(Q, "segmentFraction", Q.prototype.bt);
t.defineProperty(Q, {bt: "segmentFraction"}, function () {
return this.yr
}, function (a) {
f && t.k(a, "number", Q, "segmentFraction");
isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1);
var b = this.yr;
b !== a && (this.yr = a, this.Y(), this.i("segmentFraction", b, a))
});
t.g(Q, "segmentOffset", Q.prototype.zA);
t.defineProperty(Q, {zA: "segmentOffset"}, function () {
return this.Ar
}, function (a) {
var b = this.Ar;
b.K(a) || (f && t.j(a, v, Q, "segmentOffset"), this.Ar = a = a.W(), this.Y(), this.i("segmentOffset", b, a))
});
t.g(Q, "stretch", Q.prototype.Ch);
t.defineProperty(Q, {Ch: "stretch"}, function () {
return this.nh
}, function (a) {
var b = this.nh;
b !== a && (f && t.nb(a, Q, Q, "stretch"), this.nh = a, this.Y(), this.i("stretch", b, a))
});
t.g(Q, "name", Q.prototype.name);
t.defineProperty(Q, {name: "name"}, function () {
return this.Mb
}, function (a) {
var b = this.Mb;
b !== a && (f && t.k(a, "string", Q, "name"), this.Mb = a, this.S && (this.S.mj = null), this.i("name", b, a))
});
t.g(Q, "visible", Q.prototype.visible);
t.defineProperty(Q, {visible: "visible"}, function () {
return 0 !== (this.ha & 1)
}, function (a) {
var b = 0 !== (this.ha & 1);
b !== a && (f && t.k(a, "boolean", Q, "visible"), this.ha ^= 1, this.i("visible", b, a), b = this.fa, null !== b ? b.Y() : this instanceof B && (this.Y(), Wj(this), a ? (this.J(Fh), this.updateAdornments()) : (this.J(Gh), this.ue())), this.ra(), pk(this))
});
t.g(Q, "pickable", Q.prototype.nf);
t.defineProperty(Q, {nf: "pickable"}, function () {
return 0 !== (this.ha & 2)
}, function (a) {
var b = 0 !== (this.ha & 2);
b !== a && (f && t.k(a, "boolean", Q, "pickable"), this.ha ^= 2, this.i("pickable", b, a))
});
t.g(Q, "fromLinkableDuplicates", Q.prototype.yD);
t.defineProperty(Q, {yD: "fromLinkableDuplicates"}, function () {
return 0 !== (this.ha & 4)
}, function (a) {
var b = 0 !== (this.ha & 4);
b !== a && (f && t.k(a, "boolean", Q, "fromLinkableDuplicates"), this.ha ^= 4, this.i("fromLinkableDuplicates", b, a))
});
t.g(Q, "fromLinkableSelfNode", Q.prototype.zD);
t.defineProperty(Q, {zD: "fromLinkableSelfNode"}, function () {
return 0 !== (this.ha & 8)
}, function (a) {
var b = 0 !== (this.ha & 8);
b !== a && (f && t.k(a, "boolean", Q, "fromLinkableSelfNode"), this.ha ^= 8, this.i("fromLinkableSelfNode", b, a))
});
t.g(Q, "toLinkableDuplicates", Q.prototype.rF);
t.defineProperty(Q, {rF: "toLinkableDuplicates"}, function () {
return 0 !== (this.ha & 16)
}, function (a) {
var b = 0 !== (this.ha & 16);
b !== a && (f && t.k(a, "boolean", Q, "toLinkableDuplicates"), this.ha ^= 16, this.i("toLinkableDuplicates", b, a))
});
t.g(Q, "toLinkableSelfNode", Q.prototype.sF);
t.defineProperty(Q, {sF: "toLinkableSelfNode"}, function () {
return 0 !== (this.ha & 32)
}, function (a) {
var b = 0 !== (this.ha & 32);
b !== a && (f && t.k(a, "boolean", Q, "toLinkableSelfNode"), this.ha ^= 32, this.i("toLinkableSelfNode", b, a))
});
t.g(Q, "isPanelMain", Q.prototype.Di);
t.defineProperty(Q, {Di: "isPanelMain"}, function () {
return 0 !== (this.ha & 64)
}, function (a) {
var b = 0 !== (this.ha & 64);
b !== a && (f && t.k(a, "boolean", Q, "isPanelMain"), this.ha ^= 64, this.Y(), this.i("isPanelMain", b, a))
});
t.g(Q, "isActionable", Q.prototype.Wv);
t.defineProperty(Q, {Wv: "isActionable"}, function () {
return 0 !== (this.ha & 128)
}, function (a) {
var b = 0 !== (this.ha & 128);
b !== a && (f && t.k(a, "boolean", Q, "isActionable"), this.ha ^= 128, this.i("isActionable", b, a))
});
t.g(Q, "areaBackground", Q.prototype.Gj);
t.defineProperty(Q, {Gj: "areaBackground"}, function () {
return this.dc
}, function (a) {
var b = this.dc;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.dc = a, this.ra(), this.i("areaBackground", b, a))
});
t.g(Q, "background", Q.prototype.background);
t.defineProperty(Q, {background: "background"}, function () {
return this.Bb
}, function (a) {
var b = this.Bb;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Bb = a, this.ra(), this.i("background", b, a))
});
function fk(a, b) {
a.ha = b ? a.ha | 512 : a.ha & -513
}
function qk(a, b) {
a.ha = b ? a.ha | 1024 : a.ha & -1025
}
function hk(a, b) {
a.ha = b ? a.ha | 2048 : a.ha & -2049
}
function ik(a, b) {
a.ha = b ? a.ha | 4096 : a.ha & -4097
}
function vi(a) {
return 0 !== (a.ha & 8192)
}
function Rj(a, b) {
a.ha = b ? a.ha | 8192 : a.ha & -8193
}
function wi(a) {
return 0 !== (a.ha & 16384)
}
function Vj(a, b) {
a.ha = b ? a.ha | 16384 : a.ha & -16385
}
t.A(Q, {S: "part"}, function () {
if (this instanceof B)return this;
if (this.Rl)return this.Rl;
var a;
for (a = this.fa; a;) {
if (a instanceof B)return this.Rl = a;
a = a.fa
}
return null
});
Q.prototype.gl = function (a) {
this.di = a
};
t.A(Q, {fa: "panel"}, function () {
return this.di
});
t.A(Q, {layer: "layer"}, function () {
var a = this.S;
return null !== a ? a.layer : null
});
t.A(Q, {h: "diagram"}, function () {
var a = this.S;
return null !== a ? a.h : null
}, {configurable: !0});
t.g(Q, "position", Q.prototype.position);
t.defineProperty(Q, {position: "position"}, function () {
return this.sb
}, function (a) {
var b = this.sb;
if (!b.K(a)) {
f && t.j(a, v, Q, "position");
a = a.W();
if (this instanceof B) {
if (this instanceof X || !a.P())return;
var c = this.Wh;
this.sb = a;
if (!1 === wi(this)) {
var d = c.copy();
c.q(d.x + (a.x - b.x), d.y + (a.y - b.y));
rk(this);
Sj(this);
sk(this);
c.K(d) || this.i("location", d, c)
} else c.q(NaN, NaN)
} else this.sb = a, jk(this), Sj(this);
this.i("position", b, a)
}
});
t.A(Q, {ua: "actualBounds"}, function () {
return this.Ob
});
t.g(Q, "scale", Q.prototype.scale);
t.defineProperty(Q, {scale: "scale"}, function () {
return this.Xb
}, function (a) {
var b = this.Xb;
b !== a && (f && t.o(a, Q, "scale"), 0 >= a && t.m("GraphObject.scale must be greater than zero"), this.Xb = a, Sj(this), this.Y(), this.i("scale", b, a))
});
t.g(Q, "angle", Q.prototype.angle);
t.defineProperty(Q, {angle: "angle"}, function () {
return this.Vm
}, function (a) {
var b = this.Vm;
b !== a && (f && t.o(a, Q, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.Vm = a, this.Y(), Sj(this), this.i("angle", b, a)))
});
t.g(Q, "desiredSize", Q.prototype.ya);
t.defineProperty(Q, {ya: "desiredSize"}, function () {
return this.Ye
}, function (a) {
var b = this.Ye;
b.K(a) || (f && t.j(a, da, Q, "desiredSize"), this.Ye = a = a.W(), this.Y(), this instanceof Y && this.Df(), this.i("desiredSize", b, a), a = this.S, null !== a && 0 !== (this.ha & 1024) && (Mj(this, a, "width"), Mj(this, a, "height")))
});
t.g(Q, "width", Q.prototype.width);
t.defineProperty(Q, {width: "width"}, function () {
return this.Ye.width
}, function (a) {
if (this.Ye.width !== a) {
f && t.k(a, "number", Q, "width");
var b = this.Ye;
this.Ye = a = (new da(a, this.Ye.height)).freeze();
this.Y();
this instanceof Y && this.Df();
this.i("desiredSize", b, a);
b = this.S;
null !== b && 0 !== (this.ha & 1024) && Mj(this, b, "width")
}
});
t.g(Q, "height", Q.prototype.height);
t.defineProperty(Q, {height: "height"}, function () {
return this.Ye.height
}, function (a) {
if (this.Ye.height !== a) {
f && t.k(a, "number", Q, "height");
var b = this.Ye;
this.Ye = a = (new da(this.Ye.width, a)).freeze();
this.Y();
this instanceof Y && this.Df();
this.i("desiredSize", b, a);
b = this.S;
null !== b && 0 !== (this.ha & 1024) && Mj(this, b, "height")
}
});
t.g(Q, "minSize", Q.prototype.Te);
t.defineProperty(Q, {Te: "minSize"}, function () {
return this.Wd
}, function (a) {
var b = this.Wd;
b.K(a) || (f && t.j(a, da, Q, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.Wd = a, this.Y(), this.i("minSize", b, a))
});
t.g(Q, "maxSize", Q.prototype.Be);
t.defineProperty(Q, {Be: "maxSize"}, function () {
return this.lj
}, function (a) {
var b = this.lj;
b.K(a) || (f && t.j(a, da, Q, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.lj = a, this.Y(), this.i("maxSize", b, a))
});
t.A(Q, {Ba: "measuredBounds"}, function () {
return this.Dc
});
t.A(Q, {Oa: "naturalBounds"}, function () {
return this.Ec
}, {configurable: !0});
t.g(Q, "margin", Q.prototype.margin);
t.defineProperty(Q, {margin: "margin"}, function () {
return this.Rq
}, function (a) {
"number" === typeof a ? a = new Wa(a) : f && t.j(a, Wa, Q, "margin");
var b = this.Rq;
b.K(a) || (this.Rq = a = a.W(), this.Y(), this.i("margin", b, a))
});
t.A(Q, {transform: null}, function () {
0 !== (this.ha & 2048) === !0 && gk(this);
return this.qd
});
t.A(Q, {ae: null}, function () {
0 !== (this.ha & 4096) === !0 && gk(this);
return this.pl
});
t.g(Q, "alignment", Q.prototype.alignment);
t.defineProperty(Q, {alignment: "alignment"}, function () {
return this.le
}, function (a) {
var b = this.le;
b.K(a) || (f ? t.j(a, H, Q, "alignment") : a.hd() && !a.Ac() && t.m("alignment must be a real Spot or Spot.Default"), this.le = a = a.W(), jk(this), this.i("alignment", b, a))
});
t.g(Q, "column", Q.prototype.column);
t.defineProperty(Q, {column: "column"}, function () {
return this.Tp
}, function (a) {
f && t.o(a, Q, "column");
a = Math.round(a);
var b = this.Tp;
b !== a && (0 > a && t.ia(a, ">= 0", Q, "column"), this.Tp = a, this.Y(), this.i("column", b, a))
});
t.g(Q, "columnSpan", Q.prototype.TC);
t.defineProperty(Q, {TC: "columnSpan"}, function () {
return this.Si
}, function (a) {
f && t.o(a, Q, "columnSpan");
a = Math.round(a);
var b = this.Si;
b !== a && (1 > a && t.ia(a, ">= 1", Q, "columnSpan"), this.Si = a, this.Y(), this.i("columnSpan", b, a))
});
t.g(Q, "row", Q.prototype.ac);
t.defineProperty(Q, {ac: "row"}, function () {
return this.wr
}, function (a) {
f && t.o(a, Q, "row");
a = Math.round(a);
var b = this.wr;
b !== a && (0 > a && t.ia(a, ">= 0", Q, "row"), this.wr = a, this.Y(), this.i("row", b, a))
});
t.g(Q, "rowSpan", Q.prototype.rowSpan);
t.defineProperty(Q, {rowSpan: "rowSpan"}, function () {
return this.sj
}, function (a) {
f && t.o(a, Q, "rowSpan");
a = Math.round(a);
var b = this.sj;
b !== a && (1 > a && t.ia(a, ">= 1", Q, "rowSpan"), this.sj = a, this.Y(), this.i("rowSpan", b, a))
});
t.g(Q, "alignmentFocus", Q.prototype.Dj);
t.defineProperty(Q, {Dj: "alignmentFocus"}, function () {
return this.Mp
}, function (a) {
var b = this.Mp;
b.K(a) || (f ? t.j(a, H, Q, "alignmentFocus") : a.hd() && !a.Ac() && t.m("alignmentFocus must be a real Spot or Spot.Default"), this.Mp = a = a.W(), this.Y(), this.i("alignmentFocus", b, a))
});
t.g(Q, "portId", Q.prototype.ld);
t.defineProperty(Q, {ld: "portId"}, function () {
return this.lr
}, function (a) {
var b = this.lr;
if (b !== a) {
f && null !== a && t.k(a, "string", Q, "portId");
var c = this.S;
null === c || c instanceof S || (t.m("portID being set on a Link: " + a), c = null);
null !== b && c && tk(c, this);
this.lr = a;
if (null !== a && c) {
c.bj = !0;
null === c.Zd && uk(c);
var d = this.ld;
null !== d && c.Zd.add(d, this)
}
this.i("portId", b, a)
}
});
function vk(a) {
var b = {value: null};
wk(a, b);
return b.value
}
function wk(a, b) {
var c = a.fa;
return null === c || !wk(c, b) && a.visible ? (b.value = a, !1) : !0
}
function pk(a) {
var b = a.S;
b instanceof S && (a = a.h) && !a.va.kb && b.Hg()
}
t.g(Q, "toSpot", Q.prototype.gb);
t.defineProperty(Q, {gb: "toSpot"}, function () {
return null !== this.T ? this.T.Bj : wb
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Bj;
b.K(a) || (f && t.j(a, H, Q, "toSpot"), a = a.W(), this.T.Bj = a, this.i("toSpot", b, a), pk(this))
});
t.g(Q, "toEndSegmentLength", Q.prototype.$j);
t.defineProperty(Q, {$j: "toEndSegmentLength"}, function () {
return null !== this.T ? this.T.zj : 10
}, function (a) {
null === this.T && this.Ae();
var b = this.T.zj;
b !== a && (f && t.k(a, "number", Q, "toEndSegmentLength"), 0 > a && t.ia(a, ">= 0", Q, "toEndSegmentLength"), this.T.zj = a, this.i("toEndSegmentLength", b, a), pk(this))
});
t.g(Q, "toEndSegmentDirection", Q.prototype.vp);
t.defineProperty(Q, {vp: "toEndSegmentDirection"}, function () {
return null !== this.T ? this.T.yj : Kj
}, function (a) {
null === this.T && this.Ae();
var b = this.T.yj;
b !== a && (f && t.nb(a, S, Q, "toEndSegmentDirection"), this.T.yj = a, this.i("toEndSegmentDirection", b, a), pk(this))
});
t.g(Q, "toShortLength", Q.prototype.wp);
t.defineProperty(Q, {wp: "toShortLength"}, function () {
return null !== this.T ? this.T.Aj : 0
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Aj;
b !== a && (f && t.k(a, "number", Q, "toShortLength"), this.T.Aj = a, this.i("toShortLength", b, a), pk(this))
});
t.g(Q, "toLinkable", Q.prototype.NA);
t.defineProperty(Q, {NA: "toLinkable"}, function () {
return this.Sr
}, function (a) {
var b = this.Sr;
b !== a && (f && null !== a && t.k(a, "boolean", Q, "toLinkable"), this.Sr = a, this.i("toLinkable", b, a))
});
t.g(Q, "toMaxLinks", Q.prototype.tF);
t.defineProperty(Q, {tF: "toMaxLinks"}, function () {
return this.Tr
}, function (a) {
var b = this.Tr;
b !== a && (f && t.o(a, Q, "toMaxLinks"), 0 > a && t.ia(a, ">= 0", Q, "toMaxLinks"), this.Tr = a, this.i("toMaxLinks", b, a))
});
t.g(Q, "fromSpot", Q.prototype.fb);
t.defineProperty(Q, {fb: "fromSpot"}, function () {
return null !== this.T ? this.T.$i : wb
}, function (a) {
null === this.T && this.Ae();
var b = this.T.$i;
b.K(a) || (f && t.j(a, H, Q, "fromSpot"), a = a.W(), this.T.$i = a, this.i("fromSpot", b, a), pk(this))
});
t.g(Q, "fromEndSegmentLength", Q.prototype.Sj);
t.defineProperty(Q, {Sj: "fromEndSegmentLength"}, function () {
return null !== this.T ? this.T.Yi : 10
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Yi;
b !== a && (f && t.k(a, "number", Q, "fromEndSegmentLength"), 0 > a && t.ia(a, ">= 0", Q, "fromEndSegmentLength"), this.T.Yi = a, this.i("fromEndSegmentLength", b, a), pk(this))
});
t.g(Q, "fromEndSegmentDirection", Q.prototype.Co);
t.defineProperty(Q, {Co: "fromEndSegmentDirection"}, function () {
return null !== this.T ? this.T.Xi : Kj
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Xi;
b !== a && (f && t.nb(a, S, Q, "fromEndSegmentDirection"), this.T.Xi = a, this.i("fromEndSegmentDirection", b, a), pk(this))
});
t.g(Q, "fromShortLength", Q.prototype.Do);
t.defineProperty(Q, {Do: "fromShortLength"}, function () {
return null !== this.T ? this.T.Zi : 0
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Zi;
b !== a && (f && t.k(a, "number", Q, "fromShortLength"), this.T.Zi = a, this.i("fromShortLength", b, a), pk(this))
});
t.g(Q, "fromLinkable", Q.prototype.Hz);
t.defineProperty(Q, {Hz: "fromLinkable"}, function () {
return this.nq
}, function (a) {
var b = this.nq;
b !== a && (f && null !== a && t.k(a, "boolean", Q, "fromLinkable"), this.nq = a, this.i("fromLinkable", b, a))
});
t.g(Q, "fromMaxLinks", Q.prototype.AD);
t.defineProperty(Q, {AD: "fromMaxLinks"}, function () {
return this.oq
}, function (a) {
var b = this.oq;
b !== a && (f && t.o(a, Q, "fromMaxLinks"), 0 > a && t.ia(a, ">= 0", Q, "fromMaxLinks"), this.oq = a, this.i("fromMaxLinks", b, a))
});
t.g(Q, "cursor", Q.prototype.cursor);
t.defineProperty(Q, {cursor: "cursor"}, function () {
return this.$p
}, function (a) {
var b = this.$p;
b !== a && (t.k(a, "string", Q, "cursor"), this.$p = a, this.i("cursor", b, a))
});
t.g(Q, "click", Q.prototype.click);
t.defineProperty(Q, {click: "click"}, function () {
return null !== this.O ? this.O.Kh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Kh;
b !== a && (null !== a && t.k(a, "function", Q, "click"), this.O.Kh = a, this.i("click", b, a))
});
t.g(Q, "doubleClick", Q.prototype.sm);
t.defineProperty(Q, {sm: "doubleClick"}, function () {
return null !== this.O ? this.O.Qh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Qh;
b !== a && (null !== a && t.k(a, "function", Q, "doubleClick"), this.O.Qh = a, this.i("doubleClick", b, a))
});
t.g(Q, "contextClick", Q.prototype.ms);
t.defineProperty(Q, {ms: "contextClick"}, function () {
return null !== this.O ? this.O.Mh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Mh;
b !== a && (null !== a && t.k(a, "function", Q, "contextClick"), this.O.Mh = a, this.i("contextClick", b, a))
});
t.g(Q, "mouseEnter", Q.prototype.dA);
t.defineProperty(Q, {dA: "mouseEnter"}, function () {
return null !== this.O ? this.O.br : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.br;
b !== a && (null !== a && t.k(a, "function", Q, "mouseEnter"), this.O.br = a, this.i("mouseEnter", b, a))
});
t.g(Q, "mouseLeave", Q.prototype.eA);
t.defineProperty(Q, {eA: "mouseLeave"}, function () {
return null !== this.O ? this.O.cr : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.cr;
b !== a && (null !== a && t.k(a, "function", Q, "mouseLeave"), this.O.cr = a, this.i("mouseLeave", b, a))
});
t.g(Q, "mouseOver", Q.prototype.Os);
t.defineProperty(Q, {Os: "mouseOver"}, function () {
return null !== this.O ? this.O.$h : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.$h;
b !== a && (null !== a && t.k(a, "function", Q, "mouseOver"), this.O.$h = a, this.i("mouseOver", b, a))
});
t.g(Q, "mouseHover", Q.prototype.Ns);
t.defineProperty(Q, {Ns: "mouseHover"}, function () {
return null !== this.O ? this.O.Zh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Zh;
b !== a && (null !== a && t.k(a, "function", Q, "mouseHover"), this.O.Zh = a, this.i("mouseHover", b, a))
});
t.g(Q, "mouseHold", Q.prototype.Ms);
t.defineProperty(Q, {Ms: "mouseHold"}, function () {
return null !== this.O ? this.O.Yh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Yh;
b !== a && (null !== a && t.k(a, "function", Q, "mouseHold"), this.O.Yh = a, this.i("mouseHold", b, a))
});
t.g(Q, "mouseDragEnter", Q.prototype.sE);
t.defineProperty(Q, {sE: "mouseDragEnter"}, function () {
return null !== this.O ? this.O.$q : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.$q;
b !== a && (null !== a && t.k(a, "function", Q, "mouseDragEnter"), this.O.$q = a, this.i("mouseDragEnter", b, a))
});
t.g(Q, "mouseDragLeave", Q.prototype.cA);
t.defineProperty(Q, {cA: "mouseDragLeave"}, function () {
return null !== this.O ? this.O.ar : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.ar;
b !== a && (null !== a && t.k(a, "function", Q, "mouseDragLeave"), this.O.ar = a, this.i("mouseDragLeave", b, a))
});
t.g(Q, "mouseDrop", Q.prototype.Ls);
t.defineProperty(Q, {Ls: "mouseDrop"}, function () {
return null !== this.O ? this.O.Xh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Xh;
b !== a && (null !== a && t.k(a, "function", Q, "mouseDrop"), this.O.Xh = a, this.i("mouseDrop", b, a))
});
t.g(Q, "actionDown", Q.prototype.fz);
t.defineProperty(Q, {fz: "actionDown"}, function () {
return null !== this.O ? this.O.Hp : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Hp;
b !== a && (null !== a && t.k(a, "function", Q, "actionDown"), this.O.Hp = a, this.i("actionDown", b, a))
});
t.g(Q, "actionUp", Q.prototype.hz);
t.defineProperty(Q, {hz: "actionUp"}, function () {
return null !== this.O ? this.O.Jp : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Jp;
b !== a && (null !== a && t.k(a, "function", Q, "actionUp"), this.O.Jp = a, this.i("actionUp", b, a))
});
t.g(Q, "actionMove", Q.prototype.gz);
t.defineProperty(Q, {gz: "actionMove"}, function () {
return null !== this.O ? this.O.Ip : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Ip;
b !== a && (null !== a && t.k(a, "function", Q, "actionMove"), this.O.Ip = a, this.i("actionMove", b, a))
});
t.g(Q, "actionCancel", Q.prototype.ez);
t.defineProperty(Q, {ez: "actionCancel"}, function () {
return null !== this.O ? this.O.Gp : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Gp;
b !== a && (null !== a && t.k(a, "function", Q, "actionCancel"), this.O.Gp = a, this.i("actionCancel", b, a))
});
t.g(Q, "toolTip", Q.prototype.mt);
t.defineProperty(Q, {mt: "toolTip"}, function () {
return null !== this.O ? this.O.ji : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.ji;
b !== a && (null !== a && t.j(a, Ce, Q, "toolTip"), this.O.ji = a, this.i("toolTip", b, a))
});
t.g(Q, "contextMenu", Q.prototype.contextMenu);
t.defineProperty(Q, {contextMenu: "contextMenu"}, function () {
return null !== this.O ? this.O.Nh : null
}, function (a) {
null === this.O && Jj(this);
var b = this.O.Nh;
b !== a && (null !== a && t.j(a, Ce, Q, "contextMenu"), this.O.Nh = a, this.i("contextMenu", b, a))
});
Q.prototype.bind = Q.prototype.bind = function (a) {
a.Tf = this;
var b = this.Bo();
null !== b && xk(b) && t.m("Cannot add a Binding to a template that has already been copied: " + a);
null === this.wc && (this.wc = new A(we));
this.wc.add(a)
};
Q.prototype.findTemplateBinder = Q.prototype.Bo = function () {
for (var a = this instanceof y ? this : this.fa; null !== a;) {
if (null !== a.rl && a instanceof y)return a;
a = a.fa
}
return null
};
Q.fromSvg = function (a) {
return yk(a)
};
Q.prototype.setProperties = function (a) {
t.vw(this, a)
};
var zk;
Q.make = zk = function (a, b) {
var c = arguments, d = null, e = null;
if ("function" === typeof a)e = a; else if ("string" === typeof a) {
var g = Ak.wa(a);
"function" === typeof g ? (c = Array.prototype.slice.call(arguments), d = g(c)) : e = ba[a]
}
null === d && (void 0 === e && (d = window.$, void 0 !== d && void 0 !== d.noop && t.m("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"), t.m("GraphObject.make failed to complete, it may be conflicting with another var.")), null !== e && e.constructor || t.m("GraphObject.make requires a class function or class name, not: " +
a), d = new e);
g = 1;
d instanceof z && 1 < c.length && (e = c[1], "string" === typeof e || e instanceof HTMLDivElement) && (d.vi = null, Oh(d, e), g++);
for (; g < c.length; g++)e = c[g], void 0 === e ? t.m("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : Bk(d, e);
return d
};
function Bk(a, b) {
if ("string" === typeof b) {
var c = a;
if (c instanceof la)c.text = b; else if (c instanceof Y)c.Db = b; else if (c instanceof Ck)c.source = b; else if (c instanceof y) {
var d = t.tm(y, b);
null !== d ? c.type = d : t.m("Unknown Panel type as an argument to GraphObject.make: " + b)
} else c instanceof Nd ? (d = t.tm(Nd, b), null !== d ? c.type = d : t.m("Unknown Brush type as an argument to GraphObject.make: " + b)) : c instanceof I ? (d = t.tm(I, b), null !== d ? c.type = d : t.m("Unknown Geometry type as an argument to GraphObject.make: " + b)) : c instanceof
O ? (d = t.tm(O, b), null !== d ? c.type = d : t.m("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : t.m("Unable to use a string as an argument to GraphObject.make: " + b)
} else if (b instanceof Q)a instanceof y || t.m("A GraphObject can only be added to a Panel, not to: " + a), a.add(b); else if (b instanceof Dk)a instanceof y || t.m("A RowColumnDefinition can only be added to a Panel, not to: " + a), c = b.wh ? a.he(b.index) : a.ge(b.index), t.j(b, Dk, Dk, "copyFrom:pd"), b.wh ? c.height = b.height : c.width = b.width, c.yh = b.yh,
c.kf = b.kf, c.alignment = b.alignment, c.gt = b.gt, c.vj = null === b.vj ? null : b.vj.W(), c.Jm = b.Jm, c.Km = b.Km, c.jh = null, b.jh && (c.jh = b.jh.slice(0)), c.background = b.background, c.Dv = b.Dv, c.wc = b.wc; else if (b instanceof ca)c = a, c instanceof X && b.Ke === X ? 2 === (b.value & 2) ? c.at = b : b === Jg || b === xg || b === wg ? c.ye = b : b === Ek || b === Fk || b === Gk ? c.eo = b : b !== Hk && b !== yg && t.m("Unknown Link enum value for a Link property: " + b) : c instanceof y && b.Ke === y ? c.type = b : c instanceof la && b.Ke === la ? c.SA = b : c instanceof Q && b.Ke === X ? 0 === b.name.indexOf("Orient") ?
c.ct = b : t.m("Unknown Link enum value for GraphObject.segmentOrientation property: " + b) : c instanceof Q && b.Ke === Q ? c.Ch = b : c instanceof z && b.Ke === z ? c.im = b : c instanceof Nd && b.Ke === Nd ? c.type = b : c instanceof I && b.Ke === I ? c.type = b : c instanceof O && b.Ke === O ? c.type = b : c instanceof we && b.Ke === we ? c.mode = b : c instanceof od && b.Ke === od ? c.ed = b : c instanceof Z && b.Ke === Z ? 0 === b.name.indexOf("Alignment") ? c.alignment = b : 0 === b.name.indexOf("Arrangement") ? c.Je = b : 0 === b.name.indexOf("Compaction") ? c.compaction = b : 0 === b.name.indexOf("Path") ?
c.path = b : 0 === b.name.indexOf("Sorting") ? c.sorting = b : 0 === b.name.indexOf("Style") ? c.CF = b : t.m("Unknown enum value: " + b) : c instanceof Ik && b.Ke === Ik ? 0 === b.name.indexOf("Aggressive") ? c.FC = b : 0 === b.name.indexOf("Cycle") ? c.bD = b : 0 === b.name.indexOf("Init") ? c.UD = b : 0 === b.name.indexOf("Layer") ? c.dE = b : t.m("Unknown enum value: " + b) : c instanceof Dj && b.Ke === Dj ? b === Jk || b === Kk || b === Lk || b === Mk ? c.sorting = b : b === Nk || b === Ok ? c.Je = b : b === Pk || b === Qk ? c.alignment = b : t.m("Unknown enum value: " + b) : c instanceof Rk && b.Ke === Rk ? b === Sk ||
b === Tk || b === Uk || b === Vk || b === Wk ? c.sorting = b : b === Xk || b === Yk || b === Zk || b === $k ? c.direction = b : b === al || b === bl || b === cl || b === dl ? c.Je = b : b === el || b === fl ? c.Rs = b : t.m("Unknown enum value: " + b) : t.m("No property to set for this enum value: " + b); else if (b instanceof we)if (a instanceof Q || a instanceof Dk) {
var d = b.kt, e = d.indexOf(".");
0 < e && a instanceof y && (c = d.substr(e + 1), d = a.ee(d.substring(0, e)), null !== d && (a = d, b.kt = c));
a.bind(b)
} else t.m("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " +
a); else if (b instanceof Cc)a instanceof I ? a.ob.add(b) : t.m("A PathFigure can only be added to a Geometry, not to: " + a); else if (b instanceof O)a instanceof Cc ? a.Ca.add(b) : t.m("A PathSegment can only be added to a PathFigure, not to: " + a); else if (Array.isArray(b))for (c = 0; c < b.length; c++)Bk(a, b[c]); else if ("object" === typeof b && null !== b)if (c = a, c instanceof Nd) {
d = {};
for (e in b) {
var g = parseFloat(e);
isNaN(g) ? d[e] = b[e] : c.addColorStop(g, b[e])
}
t.vw(c, d)
} else c instanceof Dk ? (void 0 !== b.row ? (d = b.row, (void 0 ===
d || null === d || Infinity === d || isNaN(d) || 0 > d) && t.m("Must specify non-negative integer row for RowColumnDefinition " + b), c.El = !0, c.ne = d) : void 0 !== b.column ? (d = b.column, (void 0 === d || null === d || Infinity === d || isNaN(d) || 0 > d) && t.m("Must specify non-negative integer column for RowColumnDefinition " + b), c.El = !1, c.ne = d) : t.m("Must specify row or column value in a RowColumnDefinition " + b), d = t.YG(b, "row", "column"), t.vw(c, d)) : t.vw(c, b); else t.m('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' +
a)
}
var Ak;
Q.Builders = Ak = new ia("string", "function");
Ak.add("Button", function () {
var a = new Nd(Qd);
a.addColorStop(0, "white");
a.addColorStop(1, "lightgray");
var b = new Nd(Qd);
b.addColorStop(0, "white");
b.addColorStop(1, "dodgerblue");
var c = zk(y, Qh, {Wv: !0}, zk(Y, {name: "ButtonBorder", Db: "RoundedRectangle", fill: a, stroke: "gray"}));
c.dA = function (a, c) {
var g = c.ta(0), h = c._buttonFillOver;
void 0 === h && (h = b);
c._buttonFillNormal = g.fill;
g.fill = h;
h = c._buttonStrokeOver;
void 0 === h && (h = "blue");
c._buttonStrokeNormal = g.stroke;
g.stroke = h
};
c.eA = function (b, c) {
var g = c.ta(0), h = c._buttonFillNormal;
void 0 === h && (h = a);
g.fill = h;
h = c._buttonStrokeNormal;
void 0 === h && (h = "gray");
g.stroke = h
};
return c
});
Ak.add("TreeExpanderButton", function () {
var a = zk("Button", zk(Y, {name: "ButtonIcon", Db: "MinusLine", ya: D.Dp}, (new we("figure", "isTreeExpanded", function (a, c) {
var d = null, e = c.fa;
e && (d = a ? e._treeExpandedFigure : e._treeCollapsedFigure);
d || (d = a ? "MinusLine" : "PlusLine");
return d
})).jA("")), {visible: !1}, (new we("visible", "isTreeLeaf", function (a) {
return!a
})).jA(""));
a.click = function (a, c) {
var d = c.S;
if (d instanceof S) {
var e = d.h;
null === e || e.Ua || (a.ze = !0, d.Kc ? e.Le.collapseTree(d) : e.Le.expandTree(d))
}
};
return a
});
Ak.add("SubGraphExpanderButton", function () {
var a = zk("Button", zk(Y, {name: "ButtonIcon", Db: "MinusLine", ya: D.Dp}, (new we("figure", "isSubGraphExpanded", function (a, c) {
var d = null, e = c.fa;
e && (d = a ? e._subGraphExpandedFigure : e._subGraphCollapsedFigure);
d || (d = a ? "MinusLine" : "PlusLine");
return d
})).jA("")));
a.click = function (a, c) {
var d = c.S;
if (d instanceof U) {
var e = d.h;
null === e || e.Ua || (a.ze = !0, d.gf ? e.Le.collapseSubGraph(d) : e.Le.expandSubGraph(d))
}
};
return a
});
Ak.add("ContextMenuButton", function () {
var a = zk("Button");
a.Ch = Ij;
var b = a.ee("ButtonBorder");
b instanceof Y && (b.Db = "Rectangle", b.G = new H(0, 0, 2, 2), b.H = new H(1, 1, -2, -2));
return a
});
function y(a) {
Q.call(this);
void 0 === a ? 0 === arguments.length ? this.Z = Ug : t.m("invalid argument to Panel constructor: undefined") : (t.nb(a, y, y, "type"), this.Z = a);
this.za = new A(Q);
this.Ge = D.Fp;
this.tg = !1;
this.Z === Xh && (this.tg = !0);
this.wf = 1;
this.cq = xb;
this.fc = Qg;
this.Z === nk && gl(this);
this.$n = Rg;
this.sq = (new da(10, 10)).freeze();
this.tq = D.bk;
this.rl = this.wl = null;
this.jy = "";
this.ug = this.ej = null;
this.zn = "category";
this.Pf = null;
this.li = new w(NaN, NaN, NaN, NaN);
this.Wn = null;
this.bj = !1
}
t.ea("Panel", y);
t.sh(y);
t.Ja(y, Q);
function gl(a) {
a.Ui = D.Fp;
a.Xg = 1;
a.Ph = null;
a.yl = null;
a.Wg = 1;
a.Vg = null;
a.xl = null;
a.Rc = [];
a.Nc = [];
a.Wl = kl;
a.sl = kl;
a.ki = 0;
a.Vh = 0
}
y.prototype.cloneProtected = function (a) {
Q.prototype.cloneProtected.call(this, a);
a.Z = this.Z;
a.Ge = this.Ge.W();
a.tg = this.tg;
a.wf = this.wf;
a.cq = this.cq.W();
a.fc = this.fc;
if (a.Z === nk) {
a.Ui = this.Ui.W();
a.Xg = this.Xg;
a.Ph = this.Ph;
a.yl = this.yl;
a.Wg = this.Wg;
a.Vg = this.Vg;
a.xl = this.xl;
var b = [];
if (0 < this.Rc.length)for (var c = this.Rc, d = c.length, e = 0; e < d; e++)if (void 0 !== c[e]) {
var g = c[e].copy();
g.gl(a);
b[e] = g
}
a.Rc = b;
b = [];
if (0 < this.Nc.length)for (c = this.Nc, d = c.length, e = 0; e < d; e++)void 0 !== c[e] && (g = c[e].copy(), g.gl(a), b[e] =
g);
a.Nc = b;
a.Wl = this.Wl;
a.sl = this.sl;
a.ki = this.ki;
a.Vh = this.Vh
}
a.$n = this.$n;
a.sq.assign(this.sq);
a.tq = this.tq.W();
a.wl = this.wl;
a.rl = this.rl;
a.jy = this.jy;
a.ej = this.ej;
a.ug = this.ug;
a.zn = this.zn;
a.li.assign(this.li);
a.bj = this.bj;
this.Nu && (a.Nu = this.Nu);
this._buttonFillNormal && (a._buttonFillNormal = this._buttonFillNormal);
this._buttonFillOver && (a._buttonFillOver = this._buttonFillOver);
this._buttonStrokeNormal && (a._buttonStrokeNormal = this._buttonStrokeNormal);
this._buttonStrokeOver && (a._buttonStrokeOver =
this._buttonStrokeOver);
this._treeExpandedFigure && (a._treeExpandedFigure = this._treeExpandedFigure);
this._treeCollapsedFigure && (a._treeCollapsedFigure = this._treeCollapsedFigure);
this._subGraphExpandedFigure && (a._subGraphExpandedFigure = this._subGraphExpandedFigure);
this._subGraphCollapsedFigure && (a._subGraphCollapsedFigure = this._subGraphCollapsedFigure)
};
y.prototype.th = function (a) {
Q.prototype.th.call(this, a);
a.za = this.za;
for (var b = a.za.l; b.next();)b.value.di = a
};
y.prototype.copy = function () {
var a = Q.prototype.copy.call(this);
if (a instanceof y) {
var b = this.za;
if (0 < b.length)for (var c = b.length, d = 0; d < c; d++) {
var e = b.p[d].copy(), g = a;
e.gl(g);
e.Rl = null;
var h = g.za, k = h.count;
h.Fd(k, e);
h = g.S;
if (null !== h) {
h.mj = null;
null !== e.ld && h instanceof S && (h.bj = !0);
var l = g.h;
null !== l && l.va.kb || h.Yc(rd, "elements", g, null, e, null, k)
}
}
return a
}
return null
};
y.prototype.toString = function () {
return"Panel(" + this.type + ")#" + t.jc(this)
};
var Ug;
y.Position = Ug = t.w(y, "Position", 0);
y.Horizontal = t.w(y, "Horizontal", 1);
var Ph;
y.Vertical = Ph = t.w(y, "Vertical", 2);
var Ng;
y.Spot = Ng = t.w(y, "Spot", 3);
var Qh;
y.Auto = Qh = t.w(y, "Auto", 4);
var nk;
y.Table = nk = t.w(y, "Table", 5);
y.Viewbox = t.w(y, "Viewbox", 6);
var Zj;
y.TableRow = Zj = t.w(y, "TableRow", 7);
var ak;
y.TableColumn = ak = t.w(y, "TableColumn", 8);
var vg;
y.Link = vg = t.w(y, "Link", 9);
var Xh;
y.Grid = Xh = t.w(y, "Grid", 10);
t.g(y, "type", y.prototype.type);
t.defineProperty(y, {type: "type"}, function () {
return this.Z
}, function (a) {
var b = this.Z;
b !== a && (f && t.nb(a, y, y, "type"), b !== Zj && b !== ak || t.m("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.Z = a, this.Z === Xh ? this.tg = !0 : this.Z === nk && gl(this), this.Y(), this.i("type", b, a))
});
t.A(y, {elements: "elements"}, function () {
return this.za.l
});
t.A(y, {Oa: "naturalBounds"}, function () {
return this.Ec
});
t.g(y, "padding", y.prototype.padding);
t.defineProperty(y, {padding: "padding"}, function () {
return this.Ge
}, function (a) {
"number" === typeof a ? (0 > a && t.ia(a, ">= 0", y, "padding"), a = new Wa(a)) : (t.j(a, Wa, y, "padding"), 0 > a.left && t.ia(a.left, ">= 0", y, "padding:val.left"), 0 > a.right && t.ia(a.right, ">= 0", y, "padding:val.right"), 0 > a.top && t.ia(a.top, ">= 0", y, "padding:val.top"), 0 > a.bottom && t.ia(a.bottom, ">= 0", y, "padding:val.bottom"));
var b = this.Ge;
b.K(a) || (this.Ge = a = a.W(), this.Y(), this.i("padding", b, a))
});
t.g(y, "defaultAlignment", y.prototype.Lj);
t.defineProperty(y, {Lj: "defaultAlignment"}, function () {
return this.cq
}, function (a) {
var b = this.cq;
b.K(a) || (f && t.j(a, H, y, "defaultAlignment"), this.cq = a = a.W(), this.Y(), this.i("defaultAlignment", b, a))
});
t.g(y, "defaultStretch", y.prototype.Az);
t.defineProperty(y, {Az: "defaultStretch"}, function () {
return this.fc
}, function (a) {
var b = this.fc;
b !== a && (t.nb(a, Q, y, "defaultStretch"), this.fc = a, this.Y(), this.i("defaultStretch", b, a))
});
t.g(y, "defaultSeparatorPadding", y.prototype.jH);
t.defineProperty(y, {jH: "defaultSeparatorPadding"}, function () {
return void 0 === this.Ui ? D.Fp : this.Ui
}, function (a) {
if (void 0 !== this.Ui) {
"number" === typeof a ? a = new Wa(a) : f && t.j(a, Wa, y, "defaultSeparatorPadding");
var b = this.Ui;
b.K(a) || (this.Ui = a = a.W(), this.i("defaultSeparatorPadding", b, a))
}
});
t.g(y, "defaultRowSeparatorStroke", y.prototype.hH);
t.defineProperty(y, {hH: "defaultRowSeparatorStroke"}, function () {
return void 0 === this.Ph ? null : this.Ph
}, function (a) {
var b = this.Ph;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Ph = a, this.i("defaultRowSeparatorStroke", b, a))
});
t.g(y, "defaultRowSeparatorStrokeWidth", y.prototype.iH);
t.defineProperty(y, {iH: "defaultRowSeparatorStrokeWidth"}, function () {
return void 0 === this.Xg ? 1 : this.Xg
}, function (a) {
if (void 0 !== this.Xg) {
var b = this.Xg;
b !== a && (this.Xg = a, this.i("defaultRowSeparatorStrokeWidth", b, a))
}
});
t.g(y, "defaultRowSeparatorDashArray", y.prototype.gH);
t.defineProperty(y, {gH: "defaultRowSeparatorDashArray"}, function () {
return void 0 === this.yl ? null : this.yl
}, function (a) {
if (void 0 !== this.yl) {
var b = this.yl;
b !== a && (Array.isArray(a) || t.Nb(a, "Array", y, "defaultRowSeparatorDashArray:val"), this.yl = a, this.i("defaultRowSeparatorDashArray", b, a))
}
});
t.g(y, "defaultColumnSeparatorStroke", y.prototype.cH);
t.defineProperty(y, {cH: "defaultColumnSeparatorStroke"}, function () {
return void 0 === this.Vg ? null : this.Vg
}, function (a) {
if (void 0 !== this.Vg) {
var b = this.Vg;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Vg = a, this.i("defaultColumnSeparatorStroke", b, a))
}
});
t.g(y, "defaultColumnSeparatorStrokeWidth", y.prototype.dH);
t.defineProperty(y, {dH: "defaultColumnSeparatorStrokeWidth"}, function () {
return void 0 === this.Wg ? 1 : this.Wg
}, function (a) {
if (void 0 !== this.Wg) {
var b = this.Wg;
b !== a && (this.Wg = a, this.i("defaultColumnSeparatorStrokeWidth", b, a))
}
});
t.g(y, "defaultColumnSeparatorDashArray", y.prototype.bH);
t.defineProperty(y, {bH: "defaultColumnSeparatorDashArray"}, function () {
return void 0 === this.xl ? null : this.xl
}, function (a) {
if (void 0 !== this.xl) {
var b = this.xl;
b !== a && (Array.isArray(a) || t.Nb(a, "Array", y, "defaultColumnSeparatorDashArray:val"), this.xl = a, this.i("defaultColumnSeparatorDashArray", b, a))
}
});
t.g(y, "viewboxStretch", y.prototype.LI);
t.defineProperty(y, {LI: "viewboxStretch"}, function () {
return this.$n
}, function (a) {
var b = this.$n;
b !== a && (t.nb(a, Q, y, "viewboxStretch"), this.$n = a, this.i("viewboxStretch", b, a))
});
t.g(y, "gridCellSize", y.prototype.xs);
t.defineProperty(y, {xs: "gridCellSize"}, function () {
return this.sq
}, function (a) {
var b = this.sq;
b.K(a) || (t.j(a, da, y, "gridCellSize"), a.P() && 0 !== a.width && 0 !== a.height || t.m("Invalid Panel.gridCellSize: " + a), this.sq = a.W(), null !== this.h && this === this.h.Io && qi(this.h), this.ra(), this.i("gridCellSize", b, a))
});
t.g(y, "gridOrigin", y.prototype.Kz);
t.defineProperty(y, {Kz: "gridOrigin"}, function () {
return this.tq
}, function (a) {
var b = this.tq;
b.K(a) || (t.j(a, v, y, "gridOrigin"), a.P() || t.m("Invalid Panel.gridOrigin: " + a), this.tq = a.W(), this.h && qi(this.h), this.ra(), this.i("gridOrigin", b, a))
});
y.prototype.Vk = function (a, b) {
var c = this.opacity, d = 1;
1 !== c && (d = a.globalAlpha, a.globalAlpha = d * c);
if (this.Z === Xh) {
c = this.Tj() * b.scale;
0 >= c && (c = 1);
var e = this.xs, d = e.width, e = e.height, g = this.Oa, h = g.width, g = g.height, k = Math.ceil(h / d), l = Math.ceil(g / e), m = this.Kz;
a.save();
a.beginPath();
a.rect(0, 0, h, g);
a.clip();
for (var n = [], p = this.za.p, q = this.za.length, r = 0; r < q; r++) {
var s = [];
n.push(s);
var u = p[r];
if (u.visible)for (var u = "LineV" === u.Db, x = r + 1; x < q; x++) {
var E = p[x];
E.visible && "LineV" === E.Db === u && (E = E.interval, 2 <= E &&
s.push(E))
}
}
p = this.za.length;
for (q = 0; q < p; q++)if (r = this.za.p[q], r.visible) {
s = n[q];
u = r.interval;
x = !1;
E = r.zw;
if (null !== E) {
var F = x = !0;
void 0 !== a.setLineDash ? (a.setLineDash(E), a.lineDashOffset = r.Sc) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = E, a.webkitLineDashOffset = r.Sc) : void 0 !== a.mozDash ? (a.mozDash = E, a.mozDashOffset = r.Sc) : F = !1
}
a.lineWidth = r.bb;
dk(this, a, r.stroke, !1);
a.beginPath();
if ("LineV" === r.Db)for (var G = Math.floor(-m.x / d), L = G; L <= G + k; L++) {
var N = L * d + m.x;
if (0 <= N && N < h && ll(L, u, s) && (x && !F ? Lj(a, N, 0, N,
g, E, r.Sc) : (a.moveTo(N, 0), a.lineTo(N, g)), 2 > d * u * c))break
} else for (L = G = Math.floor(-m.y / e); L <= G + l && !(N = L * e + m.y, 0 <= N && N <= g && ll(L, u, s) && (x && !F ? Lj(a, 0, N, h, N, E, r.Sc) : (a.moveTo(0, N), a.lineTo(h, N)), 2 > e * u * c)); L++);
a.stroke();
x && (void 0 !== a.setLineDash ? (a.setLineDash(t.Hh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = t.Hh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0))
}
a.restore();
Vh(b, a, !1)
} else {
this.Z === nk && (a.lineCap = "butt", ml(this, a, !0, this.Rc, !0), ml(this,
a, !1, this.Nc, !0), nl(this, a, !0, this.Rc), nl(this, a, !1, this.Nc), ml(this, a, !0, this.Rc, !1), ml(this, a, !1, this.Nc, !1));
F = this.za.length;
for (e = 0; e < F; e++)this.za.p[e].Ne(a, b);
f && f.bJ && this instanceof X && f.aJ(a, b, this);
1 !== c && (a.globalAlpha = d)
}
};
function nl(a, b, c, d) {
for (var e = d.length, g, h = a.ua, k = c ? a.he(0) : a.ge(0), l = 0; l < e; l++)if (g = d[l], void 0 !== g && g !== k && 0 !== g.Rb) {
var m = g.Km;
isNaN(m) && (m = c ? a.Xg : a.Wg);
var n = g.Jm;
null === n && (n = c ? a.Ph : a.Vg);
if (0 !== m && null !== n) {
dk(a, b, n, !1);
var n = !1, p = g.bF;
if (null !== p) {
var q = n = !0;
void 0 !== b.setLineDash ? (b.setLineDash(p), b.lineDashOffset = a.Sc) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = p, b.webkitLineDashOffset = a.Sc) : void 0 !== b.mozDash ? (b.mozDash = p, b.mozDashOffset = a.Sc) : q = !1
}
b.beginPath();
var r = g.position + m;
c ? r >
h.height && (m -= r - h.height) : r > h.width && (m -= r - h.width);
g = g.position + m / 2;
b.lineWidth = m;
r = a.padding;
c ? (g += r.top, m = r.left, r = h.width - r.right, n && !q ? Lj(b, m, g, r, g, p, 0) : (b.moveTo(m, g), b.lineTo(r, g))) : (g += r.left, m = r.top, r = h.height - r.bottom, n && !q ? Lj(b, g, m, g, r, p, 0) : (b.moveTo(g, m), b.lineTo(g, r)));
b.stroke();
n && (void 0 !== b.setLineDash ? (b.setLineDash(t.Hh), b.lineDashOffset = 0) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = t.Hh, b.webkitLineDashOffset = 0) : void 0 !== b.mozDash && (b.mozDash = null, b.mozDashOffset = 0))
}
}
}
function ml(a, b, c, d, e) {
for (var g = d.length, h, k = a.ua, l = 0; l < g; l++)if (h = d[l], void 0 !== h && null !== h.background && h.Dv !== e && 0 !== h.Rb) {
var m = c ? k.height : k.width;
if (!(h.position > m)) {
var n = ol(h), p = h.Km;
isNaN(p) && (p = c ? a.Xg : a.Wg);
var q = h.Jm;
null === q && (q = c ? a.Ph : a.Vg);
null === q && (p = 0);
n -= p;
p = h.position + p;
n += h.Rb;
p + n > m && (n = m - p);
0 >= n || (m = a.padding, dk(a, b, h.background, !0), c ? b.fillRect(m.left, p + m.top, k.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, k.height - (m.top + m.bottom)))
}
}
}
function ll(a, b, c) {
if (0 !== a % b)return!1;
b = c.length;
for (var d = 0; d < b; d++)if (0 === a % c[d])return!1;
return!0
}
y.prototype.Js = function (a, b, c, d) {
var e = this.li;
e.width = 0;
e.height = 0;
var g = this.ya, h = this.Te;
void 0 === c && (c = h.width, d = h.height);
c = Math.max(c, h.width);
d = Math.max(d, h.height);
var k = this.Be;
isNaN(g.width) || (a = Math.min(g.width, k.width));
isNaN(g.height) || (b = Math.min(g.height, k.height));
a = Math.max(c, a);
b = Math.max(d, b);
var l = this.padding;
a = Math.max(a - l.left - l.right, 0);
b = Math.max(b - l.top - l.bottom, 0);
var m = this.za, n = m.length;
if (0 === n) {
var p = this.Ec;
Ua(p, isNaN(g.width) ? 0 : a, isNaN(g.height) ? 0 : b);
Nj(this, 0, 0, p.width,
p.height)
} else {
var q = this.Z.Mb;
switch (q) {
case "Position":
var r = a, s = b, u = c, x = d;
e.x = 0;
e.y = 0;
e.width = 0;
for (var E = e.height = 0; E < n; E++) {
var F = m.p[E];
if (F.visible || F === this.Zb) {
var G = F.margin, L = G.right + G.left, N = G.top + G.bottom;
lh(F, r, s, u, x);
var V = F.Ba, T = Math.max(V.width + L, 0), W = Math.max(V.height + N, 0), ea = F.position.x, R = F.position.y;
isFinite(ea) || (ea = 0);
isFinite(R) || (R = 0);
if (F instanceof Y && F.Rz)var wa = F.bb / 2, ea = ea - wa, R = R - wa;
db(e, ea, R, T, W)
}
}
break;
case "Vertical":
for (var Ja = a, Ma = c, Na = t.yb(), xa = 0; xa < n; xa++) {
var Ra =
m.p[xa];
if (Ra.visible || Ra === this.Zb) {
var Ba = Qj(Ra);
if (Ba !== Pg && Ba !== Hj)Na.push(Ra); else {
var ob = Ra.margin, jf = ob.right + ob.left, hc = ob.top + ob.bottom;
lh(Ra, Ja, Infinity, Ma, 0);
var kf = Ra.Ba, ic = Math.max(kf.width + jf, 0), hb = Math.max(kf.height + hc, 0);
e.width = Math.max(e.width, ic);
e.height += hb
}
}
}
var ib = Na.length;
if (0 !== ib) {
this.ya.width ? Ja = Math.min(this.ya.width, this.Be.width) : 0 !== e.width && (Ja = Math.min(e.width, this.Be.width));
for (xa = 0; xa < ib; xa++)if (Ra = Na[xa], Ra.visible || Ra === this.Zb)ob = Ra.margin, jf = ob.right + ob.left,
hc = ob.top + ob.bottom, lh(Ra, Ja, Infinity, Ma, 0), kf = Ra.Ba, ic = Math.max(kf.width + jf, 0), hb = Math.max(kf.height + hc, 0), e.width = Math.max(e.width, ic), e.height += hb;
t.xa(Na)
}
break;
case "Horizontal":
for (var Ga = b, Ka = d, bb = t.yb(), tb = 0; tb < n; tb++) {
var Ya = m.p[tb];
if (Ya.visible || Ya === this.Zb) {
var Hf = Qj(Ya);
if (Hf !== Pg && Hf !== Ij)bb.push(Ya); else {
var dd = Ya.margin, vd = dd.right + dd.left, Ed = dd.top + dd.bottom;
lh(Ya, Infinity, Ga, 0, Ka);
var Ud = Ya.Ba, wd = Math.max(Ud.width + vd, 0), Vd = Math.max(Ud.height + Ed, 0);
e.width += wd;
e.height = Math.max(e.height,
Vd)
}
}
}
var Cg = bb.length;
if (0 !== Cg) {
this.ya.height ? Ga = Math.min(this.ya.height, this.Be.height) : 0 !== e.height && (Ga = Math.min(e.height, this.Be.height));
for (tb = 0; tb < Cg; tb++)if (Ya = bb[tb], Ya.visible || Ya === this.Zb)dd = Ya.margin, vd = dd.right + dd.left, Ed = dd.top + dd.bottom, lh(Ya, Infinity, Ga, 0, Ka), Ud = Ya.Ba, wd = Math.max(Ud.width + vd, 0), Vd = Math.max(Ud.height + Ed, 0), e.width += wd, e.height = Math.max(e.height, Vd);
t.xa(bb)
}
break;
case "Spot":
a:{
var Cb = a, lf = b, Ib = c, dc = d, Lb = kk(this, m, n), Sa = Lb.margin, jc, Ie, If = Sa.right + Sa.left, dg = Sa.top +
Sa.bottom;
lh(Lb, Cb, lf, Ib, dc);
var Fb = Lb.Ba, ed = Fb.width, qc = Fb.height, fd = Math.max(ed + If, 0), Za = Math.max(qc + dg, 0);
e.x = -Sa.left;
e.y = -Sa.top;
e.width = fd;
e.height = Za;
for (var fb = 0; fb < n; fb++) {
var Xb = m.p[fb];
if (Xb !== Lb && (Xb.visible || Xb === this.Zb)) {
Sa = Xb.margin;
jc = Sa.right + Sa.left;
Ie = Sa.top + Sa.bottom;
lh(Xb, Cb, lf, 0, 0);
var Fb = Xb.Ba, fd = Math.max(Fb.width + jc, 0), Za = Math.max(Fb.height + Ie, 0), ub = Xb.alignment;
ub.Ac() && (ub = this.Lj);
ub.jd() || (ub = Hb);
var kc = Xb.Dj;
kc.Ac() && (kc = Hb);
db(e, ub.x * ed + ub.offsetX - (kc.x * Fb.width - kc.offsetX) -
Sa.left, ub.y * qc + ub.offsetY - (kc.y * Fb.height - kc.offsetY) - Sa.top, fd, Za)
}
}
var mf = Lb.Ch;
mf === Qg && (mf = Qj(Lb));
switch (mf) {
case Pg:
break a;
case Fc:
if (!isFinite(Cb) && !isFinite(lf))break a;
break;
case Ij:
if (!isFinite(Cb))break a;
break;
case Hj:
if (!isFinite(lf))break a
}
Fb = Lb.Ba;
ed = Fb.width;
qc = Fb.height;
fd = Math.max(ed + If, 0);
Za = Math.max(qc + dg, 0);
Sa = Lb.margin;
e.x = -Sa.left;
e.y = -Sa.top;
e.width = fd;
e.height = Za;
for (fb = 0; fb < n; fb++)Xb = m.p[fb], Xb === Lb || !Xb.visible && Xb !== this.Zb || (Sa = Xb.margin, jc = Sa.right + Sa.left, Ie = Sa.top +
Sa.bottom, Fb = Xb.Ba, fd = Math.max(Fb.width + jc, 0), Za = Math.max(Fb.height + Ie, 0), ub = Xb.alignment, ub.Ac() && (ub = this.Lj), ub.jd() || (ub = Hb), kc = Xb.Dj, kc.Ac() && (kc = Hb), db(e, ub.x * ed + ub.offsetX - (kc.x * Fb.width - kc.offsetX) - Sa.left, ub.y * qc + ub.offsetY - (kc.y * Fb.height - kc.offsetY) - Sa.top, fd, Za))
}
break;
case "Auto":
var rc = a, zb = b, Wd = c, Je = d, Ab = kk(this, m, n), Fd = Ab.margin, Ke = Fd.right + Fd.left, me = Fd.top + Fd.bottom;
lh(Ab, rc, zb, Wd, Je);
var gb = Ab.Ba, nf = Math.max(gb.width + Ke, 0), Bb = Math.max(gb.height + me, 0), $a = pl(Ab), Oc = $a.x * nf + $a.offsetX,
Mb = $a.y * Bb + $a.offsetY, $a = ql(Ab), Gd = $a.x * nf + $a.offsetX, Xd = $a.y * Bb + $a.offsetY, Yd = rc, ne = zb;
isFinite(rc) && (Yd = Math.abs(Oc - Gd));
isFinite(zb) && (ne = Math.abs(Mb - Xd));
var Pc = t.jl();
Pc.q(0, 0);
for (var xd = 0; xd < n; xd++) {
var jb = m.p[xd];
if (jb !== Ab && (jb.visible || jb === this.Zb)) {
var Fd = jb.margin, Le = Fd.right + Fd.left, Me = Fd.top + Fd.bottom;
lh(jb, Yd, ne, 0, 0);
gb = jb.Ba;
nf = Math.max(gb.width + Le, 0);
Bb = Math.max(gb.height + Me, 0);
Pc.q(Math.max(nf, Pc.width), Math.max(Bb, Pc.height))
}
}
if (1 === n)e.width = nf, e.height = Bb, t.Rj(Pc); else {
var mb =
pl(Ab), oe = ql(Ab), Db, lc;
oe.x !== mb.x && oe.y !== mb.y && (Db = Pc.width / Math.abs(oe.x - mb.x), lc = Pc.height / Math.abs(oe.y - mb.y));
t.Rj(Pc);
var yd = 0;
Ab instanceof Y && (yd = Ab.bb * Ab.scale, rl(Ab) === Rg && (Db = Math.max(Db, lc), lc = Math.max(Db, lc)));
Db += Math.abs(mb.offsetX) + Math.abs(oe.offsetX) + yd;
lc += Math.abs(mb.offsetY) + Math.abs(oe.offsetY) + yd;
var sc = Ab.Ch;
sc === Qg && (sc = Qj(Ab));
switch (sc) {
case Pg:
Je = Wd = 0;
break;
case Fc:
isFinite(rc) && (Db = rc);
isFinite(zb) && (lc = zb);
break;
case Ij:
isFinite(rc) && (Db = rc);
Je = 0;
break;
case Hj:
Wd = 0,
isFinite(zb) && (lc = zb)
}
Ab instanceof Y && !Ab.ya.P() && (Ab.Bg ? Ab.ok = null : Ab.La = null);
lk(Ab);
lh(Ab, Db, lc, Wd, Je);
e.width = Ab.Ba.width + Ke;
e.height = Ab.Ba.height + me
}
break;
case "Table":
for (var Nb = a, Ne = b, kb = n, cb = c, Jf = d, Dc = t.yb(), Hd = t.yb(), ma = 0; ma < kb; ma++) {
var na = m.p[ma];
if (na instanceof y && (na.type === Zj || na.type === ak) && na.visible) {
Hd.push(na);
for (var eg = na.za, Dg = eg.length, Qc = 0; Qc < Dg; Qc++) {
var nh = eg.p[Qc];
na.type === Zj ? nh.ac = na.ac : na.type === ak && (nh.column = na.column);
Dc.push(nh)
}
} else Dc.push(na)
}
for (var kb = Dc.length,
ec = [], ma = 0; ma < kb; ma++)na = Dc[ma], Rj(na, !0), Vj(na, !0), ec[na.ac] || (ec[na.ac] = []), ec[na.ac][na.column] || (ec[na.ac][na.column] = []), ec[na.ac][na.column].push(na);
t.xa(Dc);
for (var oh = t.yb(), Rc = t.yb(), Zd = t.yb(), Ec = {count: 0}, gd = {count: 0}, yc = Nb, hd = Ne, Kf = this.Rc, kb = Kf.length, ma = 0; ma < kb; ma++) {
var fa = Kf[ma];
void 0 !== fa && sl(fa, 0)
}
Kf = this.Nc;
kb = Kf.length;
for (ma = 0; ma < kb; ma++)fa = Kf[ma], void 0 !== fa && sl(fa, 0);
for (var Id = ec.length, fg = 0, ma = 0; ma < Id; ma++)ec[ma] && (fg = Math.max(fg, ec[ma].length));
for (var lj = Math.min(this.ki,
Id - 1), gg = Math.min(this.Vh, fg - 1), Sc, Id = ec.length, ma = lj; ma < Id; ma++)if (ec[ma]) {
var fg = ec[ma].length, pb = this.he(ma);
sl(pb, 0);
for (Qc = gg; Qc < fg; Qc++)if (ec[ma][Qc]) {
var lb = this.ge(Qc);
void 0 === oh[Qc] && (sl(lb, 0), oh[Qc] = !0);
for (var mj = ec[ma][Qc], ph = mj.length, hg = 0; hg < ph; hg++)if (na = mj[hg], na.visible || na === this.Zb) {
var ig = 1 < na.sj || 1 < na.Si;
ig && Rc.push(na);
var mc = na.margin, Lf = mc.right + mc.left, Mf = mc.top + mc.bottom, Yb = ok(na, pb, lb), qh = na.ya, Nf = !isNaN(qh.width), pe = !isNaN(qh.height), ki = Nf && pe;
ig || Yb === Pg || ki || (void 0 ===
Ec[Qc] && (Ec[Qc] = -1, Ec.count++), void 0 === gd[ma] && (gd[ma] = -1, gd.count++), Zd.push(na));
lh(na, Infinity, Infinity, 0, 0);
var Oe = na.Ba, Pe = Math.max(Oe.width + Lf, 0), Qe = Math.max(Oe.height + Mf, 0);
1 !== na.sj || !pe && Yb !== Pg && Yb !== Ij || (fa = this.he(ma), Sc = Math.max(Qe - fa.Rb, 0), Sc > hd && (Sc = hd), sl(fa, fa.Rb + Sc), hd = Math.max(hd - Sc, 0));
1 !== na.Si || !Nf && Yb !== Pg && Yb !== Hj || (fa = this.ge(Qc), Sc = Math.max(Pe - fa.Rb, 0), Sc > yc && (Sc = yc), sl(fa, fa.Rb + Sc), yc = Math.max(yc - Sc, 0));
ig && lk(na)
}
}
}
t.xa(oh);
for (var $d = 0, Ob = 0, kb = this.yv, ma = 0; ma < kb; ma++)void 0 !==
this.Nc[ma] && ($d += this.ge(ma).Ab);
kb = this.rw;
for (ma = 0; ma < kb; ma++)void 0 !== this.Rc[ma] && (Ob += this.he(ma).Ab);
for (var yc = Math.max(Nb - $d, 0), rh = hd = Math.max(Ne - Ob, 0), sh = yc, kb = Zd.length, ma = 0; ma < kb; ma++) {
var na = Zd[ma], pb = this.he(na.ac), lb = this.ge(na.column), qe = na.Ba, mc = na.margin, Lf = mc.right + mc.left, Mf = mc.top + mc.bottom;
Ec[na.column] = 0 === lb.Rb ? Math.max(qe.width + Lf, Ec[na.column]) : null;
gd[na.ac] = 0 === pb.Rb ? Math.max(qe.height + Mf, gd[na.ac]) : null
}
var Eg = 0, jg = 0;
for (ma in gd)"count" !== ma && (Eg += gd[ma]);
for (ma in Ec)"count" !==
ma && (jg += Ec[ma]);
for (var vb = t.jl(), ma = 0; ma < kb; ma++)if (na = Zd[ma], na.visible || na === this.Zb) {
var pb = this.he(na.ac), lb = this.ge(na.column), of;
isFinite(lb.width) ? of = lb.width : (of = isFinite(yc) && null !== Ec[na.column] ? 0 === jg ? lb.Rb + yc : Ec[na.column] / jg * sh : null !== Ec[na.column] ? yc : lb.Rb || yc, of = Math.max(0, of - ol(lb)));
var Jd;
isFinite(pb.height) ? Jd = pb.height : (Jd = isFinite(hd) && null !== gd[na.ac] ? 0 === Eg ? pb.Rb + hd : gd[na.ac] / Eg * rh : null !== gd[na.ac] ? hd : pb.Rb || hd, Jd = Math.max(0, Jd - ol(pb)));
vb.q(Math.max(lb.yh, Math.min(of, lb.kf)),
Math.max(pb.yh, Math.min(Jd, pb.kf)));
Yb = ok(na, pb, lb);
switch (Yb) {
case Ij:
vb.height = Infinity;
break;
case Hj:
vb.width = Infinity
}
mc = na.margin;
Lf = mc.right + mc.left;
Mf = mc.top + mc.bottom;
lk(na);
lh(na, vb.width, vb.height, lb.yh, pb.yh);
Oe = na.Ba;
Pe = Math.max(Oe.width + Lf, 0);
Qe = Math.max(Oe.height + Mf, 0);
isFinite(yc) && (Pe = Math.min(Pe, vb.width));
isFinite(hd) && (Qe = Math.min(Qe, vb.height));
var pf;
pf = pb.Rb;
sl(pb, Math.max(pb.Rb, Qe));
Sc = pb.Rb - pf;
hd = Math.max(hd - Sc, 0);
pf = lb.Rb;
sl(lb, Math.max(lb.Rb, Pe));
Sc = lb.Rb - pf;
yc = Math.max(yc -
Sc, 0)
}
t.xa(Zd);
for (var ae = t.jl(), kb = Rc.length, ma = 0; ma < kb; ma++)if (na = Rc[ma], na.visible || na === this.Zb) {
pb = this.he(na.ac);
lb = this.ge(na.column);
vb.q(Math.max(lb.yh, Math.min(Nb, lb.kf)), Math.max(pb.yh, Math.min(Ne, pb.kf)));
Yb = ok(na, pb, lb);
switch (Yb) {
case Fc:
0 !== lb.Rb && (vb.width = Math.min(vb.width, lb.Rb));
0 !== pb.Rb && (vb.height = Math.min(vb.height, pb.Rb));
break;
case Ij:
0 !== lb.Rb && (vb.width = Math.min(vb.width, lb.Rb));
break;
case Hj:
0 !== pb.Rb && (vb.height = Math.min(vb.height, pb.Rb))
}
isFinite(lb.width) && (vb.width =
lb.width);
isFinite(pb.height) && (vb.height = pb.height);
ae.q(0, 0);
for (var tc = 1; tc < na.sj && !(na.ac + tc >= this.rw); tc++)fa = this.he(na.ac + tc), ae.height += Math.max(fa.yh, isNaN(fa.xf) ? fa.kf : Math.min(fa.xf, fa.kf));
for (tc = 1; tc < na.Si && !(na.column + tc >= this.yv); tc++)fa = this.ge(na.column + tc), ae.width += Math.max(fa.yh, isNaN(fa.xf) ? fa.kf : Math.min(fa.xf, fa.kf));
vb.width += ae.width;
vb.height += ae.height;
mc = na.margin;
Lf = mc.right + mc.left;
Mf = mc.top + mc.bottom;
lh(na, vb.width, vb.height, cb, Jf);
for (var Oe = na.Ba, Pe = Math.max(Oe.width +
Lf, 0), Qe = Math.max(Oe.height + Mf, 0), Of = 0, tc = 0; tc < na.sj; tc++)fa = this.he(na.ac + tc), Of += fa.total || 0;
if (Of < Qe)for (var uc = Qe - Of; 0 < uc;) {
var jd = fa.Ab || 0;
isNaN(fa.height) && fa.kf > jd && (sl(fa, Math.min(fa.kf, jd + uc)), fa.Ab !== jd && (uc -= fa.Ab - jd));
if (-1 === fa.index - 1)break;
fa = this.he(fa.index - 1)
}
for (var kg = 0, tc = 0; tc < na.Si; tc++)fa = this.ge(na.column + tc), kg += fa.total || 0;
if (kg < Pe)for (uc = Pe - kg; 0 < uc;) {
jd = fa.Ab || 0;
isNaN(fa.width) && fa.kf > jd && (sl(fa, Math.min(fa.kf, jd + uc)), fa.Ab !== jd && (uc -= fa.Ab - jd));
if (-1 === fa.index - 1)break;
fa = this.ge(fa.index - 1)
}
}
t.xa(Rc);
t.Rj(ae);
t.Rj(vb);
for (var be = 0, Pf = 0, Yb = Qj(this), qf = this.ya, Re = this.Be, ce = Ob = $d = 0, de = 0, kb = this.yv, ma = 0; ma < kb; ma++)void 0 !== this.Nc[ma] && (fa = this.ge(ma), isFinite(fa.width) ? (ce += fa.width, ce += ol(fa)) : tl(fa) === ul ? (ce += fa.Ab, ce += ol(fa)) : 0 !== fa.Ab && ($d += fa.Ab, $d += ol(fa)));
var be = isFinite(qf.width) ? Math.min(qf.width, Re.width) : Yb !== Pg && isFinite(Nb) ? Nb : $d, be = Math.max(be, this.Te.width), be = Math.max(be - ce, 0), Se = Math.max(be / $d, 1);
isFinite(Se) || (Se = 1);
for (ma = 0; ma < kb; ma++)void 0 !==
this.Nc[ma] && (fa = this.ge(ma), isFinite(fa.width) || tl(fa) === ul || sl(fa, fa.Ab * Se), fa.sb = e.width, 0 !== fa.Ab && (e.width += fa.Ab, e.width += ol(fa)));
kb = this.rw;
for (ma = 0; ma < kb; ma++)void 0 !== this.Rc[ma] && (fa = this.he(ma), isFinite(fa.height) ? (de += fa.height, de += ol(fa)) : tl(fa) === ul ? (de += fa.Ab, de += ol(fa)) : 0 !== fa.Ab && (Ob += fa.Ab, Ob += ol(fa)));
var Pf = isFinite(qf.height) ? Math.min(qf.height, Re.height) : Yb !== Pg && isFinite(Ne) ? Ne : Ob, Pf = Math.max(Pf, this.Te.height), Pf = Math.max(Pf - de, 0), th = Math.max(Pf / Ob, 1);
isFinite(th) || (th = 1);
for (ma = 0; ma < kb; ma++)void 0 !== this.Rc[ma] && (fa = this.he(ma), isFinite(fa.height) || tl(fa) === ul || sl(fa, fa.Ab * th), fa.sb = e.height, 0 !== fa.Ab && (e.height += fa.Ab, e.height += ol(fa)));
kb = Hd.length;
for (ma = 0; ma < kb; ma++) {
var Kd = Hd[ma];
Kd.type === Zj ? (of = e.width, fa = this.he(Kd.ac), Jd = fa.Rb) : (fa = this.ge(Kd.column), of = fa.Rb, Jd = e.height);
Kd.Dc.q(0, 0, of, Jd);
Rj(Kd, !1);
ec[Kd.ac] || (ec[Kd.ac] = []);
ec[Kd.ac][Kd.column] || (ec[Kd.ac][Kd.column] = []);
ec[Kd.ac][Kd.column].push(Kd)
}
t.xa(Hd);
this.Nu = ec;
break;
case "Viewbox":
var oj = a, pj =
b, lo = c, mo = d;
1 < n && t.m("Viewbox Panel cannot contain more than one GraphObject.");
var ee = m.p[0];
ee.Xb = 1;
lk(ee);
lh(ee, Infinity, Infinity, lo, mo);
var li = ee.Ba, qj = ee.margin, no = qj.right + qj.left, oo = qj.top + qj.bottom;
if (isFinite(oj) || isFinite(pj)) {
var pq = ee.scale, po = li.width, qo = li.height, ro = Math.max(oj - no, 0), so = Math.max(pj - oo, 0);
ee.Xb = this.$n === Rg ? ee.Xb * Math.min(ro / po, so / qo) : ee.Xb * Math.max(ro / po, so / qo);
pq !== ee.scale && (Rj(ee, !0), lh(ee, Infinity, Infinity, lo, mo))
}
li = ee.Ba;
e.width = isFinite(oj) ? oj : Math.max(li.width +
no, 0);
e.height = isFinite(pj) ? pj : Math.max(li.height + oo, 0);
break;
case "Link":
var rj = this instanceof Ce ? this.Cj : this;
if (0 === n) {
var sj = this.Ec;
Ua(sj, 0, 0);
var Ld = this.Ba;
Ld.q(0, 0, 0, 0)
} else {
var tj = this.rq(), Te = this.aj(), re = this.li;
re.assign(Te);
re.x = 0;
re.y = 0;
var uh, mi = this.Qx();
uh = void 0 !== this.ka ? this.ka : mi.count;
this.Wh.q(Te.x, Te.y);
this.Jh.clear();
null !== tj && (vl(tj, Te.width, Te.height), Ld = tj.Ba, re.ak(Ld), this.Jh.add(Ld));
for (var vh = t.Ng(), lg = t.M(), Qf = t.M(), hl = 0; hl < n; hl++) {
var Rb = m.p[hl];
if (Rb !== tj)if (Rb.Di &&
Rb instanceof Y)vl(Rb, Te.width, Te.height), Ld = Rb.Ba, re.ak(Ld), this.Jh.add(Ld); else if (2 > uh)lh(Rb, Infinity, Infinity), Ld = Rb.Ba, re.ak(Ld), this.Jh.add(Ld); else {
var Rf = Rb.of, uo = Rb.bt, il = Rb.Dj;
il.hd() && (il = Hb);
var uj = Rb.ct, qq = Rb.zA, ni, oi, vj = 0;
if (Rf < -uh || Rf >= uh) {
var vo = rj.qE, wj = rj.pE;
uj !== yg && (vj = rj.computeAngle(Rb, uj, wj), Rb.angle = vj);
ni = vo.x - Te.x;
oi = vo.y - Te.y
} else {
var rf, wh;
if (0 <= Rf)rf = mi.p[Rf], wh = Rf < uh - 1 ? mi.p[Rf + 1] : rf; else {
var jl = uh + Rf;
rf = mi.p[jl];
wh = 0 < jl ? mi.p[jl - 1] : rf
}
wj = 0 <= Rf ? rf.ui(wh) : wh.ui(rf);
uj !==
yg && (vj = rj.computeAngle(Rb, uj, wj), Rb.Vm = vj);
ni = rf.x + (wh.x - rf.x) * uo - Te.x;
oi = rf.y + (wh.y - rf.y) * uo - Te.y
}
lh(Rb, Infinity, Infinity);
var Ld = Rb.Ba, sj = Rb.Oa, pi = 0;
Rb instanceof Y && (pi = Rb.bb);
var wo = sj.width + pi, xo = sj.height + pi;
vh.reset();
vh.translate(-Ld.x, -Ld.y);
vh.scale(Rb.scale, Rb.scale);
vh.rotate(Rb.angle, wo / 2, xo / 2);
var xh = new w(0, 0, wo, xo);
lg.et(xh, il);
vh.Ra(lg);
var rq = -lg.x + pi / 2, sq = -lg.y + pi / 2;
Qf.assign(qq);
isNaN(Qf.x) && (Qf.x = 0 <= Rf ? lg.x + 3 : -(lg.x + 3));
isNaN(Qf.y) && (Qf.y = -(lg.y + 3));
Qf.rotate(wj);
ni += Qf.x;
oi +=
Qf.y;
xh.set(Ld);
xh.x = ni + rq;
xh.y = oi + sq;
this.Jh.add(xh);
re.ak(xh)
}
}
if (this.$e)for (var yo = this.Wj; yo.next();)lh(yo.value, Infinity, Infinity);
this.li = re;
var xj = this.Wh;
xj && xj.q(xj.x + re.x, xj.y + re.y);
Ua(e, re.width || 0, re.height || 0);
t.Oe(vh);
t.B(lg);
t.B(Qf)
}
break;
case "Grid":
break;
case "TableRow":
case "TableColumn":
t.m(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");
break;
default:
t.m("Unknown panel type: " + q)
}
var se = e.width, te =
e.height, yj = this.padding, tq = yj.top + yj.bottom, se = se + (yj.left + yj.right), te = te + tq;
isFinite(g.width) && (se = g.width);
isFinite(g.height) && (te = g.height);
se = Math.min(k.width, se);
te = Math.min(k.height, te);
se = Math.max(h.width, se);
te = Math.max(h.height, te);
se = Math.max(c, se);
te = Math.max(d, te);
e.width = se;
e.height = te;
p = this.Ec;
Ua(p, se, te);
Nj(this, 0, 0, se, te)
}
};
y.prototype.findMainElement = y.prototype.Nv = function () {
null === this.Wn && kk(this, this.za, this.za.length);
return this.Wn
};
function kk(a, b, c) {
for (var d = 0; d < c; d++) {
var e = b.p[d];
if (!0 === e.Di)return a.Wn = e
}
b = b.p[0];
return a.Wn = b
}
y.prototype.Hj = function (a, b, c, d) {
var e = this.li, g = this.za, h = g.length, k = t.Zj(0, 0, 0, 0);
if (0 === h) {
var l = this.ua;
l.x = a;
l.y = b;
l.width = c;
l.height = d
} else {
if (!this.ya.P()) {
var m = Qj(this), n = this.Dc, p = n.width, q = n.height, r = this.margin, s = r.left + r.right, u = r.top + r.bottom;
p === c && q === d && (m = Pg);
switch (m) {
case Pg:
if (p > c || q > d)this.Y(), lh(this, p > c ? c : p, q > d ? d : q);
break;
case Fc:
Rj(this, !0);
lh(this, c + s, d + u, 0, 0);
break;
case Ij:
Rj(this, !0);
lh(this, c + s, q + u, 0, 0);
break;
case Hj:
Rj(this, !0), lh(this, p + s, d + u, 0, 0)
}
}
l = this.ua;
l.x = a;
l.y =
b;
l.width = c;
l.height = d;
var x = this.Z.Mb;
switch (x) {
case "Position":
for (var E = e.x - this.padding.left, F = e.y - this.padding.top, G = 0; G < h; G++) {
var L = g.p[G], N = L.Ba, V = L.margin, T = L.position.x, W = L.position.y;
k.x = isNaN(T) ? -E : T - E;
k.y = isNaN(W) ? -F : W - F;
if (L instanceof Y && L.Rz) {
var ea = L.bb / 2;
k.x -= ea;
k.y -= ea
}
k.x += V.left;
k.y += V.top;
k.width = N.width;
k.height = N.height;
L.visible && L.yc(k.x, k.y, k.width, k.height)
}
break;
case "Vertical":
for (var R = this.padding.left, wa = this.padding.top, Ja = 0; Ja < h; Ja++) {
var Ma = R, Na = g.p[Ja], xa = Na.Ba,
Ra = Na.margin, Ba = Ra.left + Ra.right, ob = R + this.padding.right, jf = xa.width, hc = Qj(Na);
if (isNaN(Na.ya.width) && hc === Fc || hc === Ij)jf = Math.max(e.width - Ba - ob, 0);
var kf = jf + Ba + ob, ic = Na.alignment;
ic.Ac() && (ic = this.Lj);
ic.jd() || (ic = Hb);
k.x = Ma + ic.offsetX + Ra.left + (e.width * ic.x - kf * ic.x);
k.y = wa + ic.offsetY + Ra.top;
k.width = jf;
k.height = xa.height;
Na.visible && (Na.yc(k.x, k.y, k.width, k.height), wa += xa.height + Ra.bottom + Ra.top)
}
break;
case "Horizontal":
for (var hb = this.padding.top, ib = this.padding.left, Ga = 0; Ga < h; Ga++) {
var Ka = hb, bb =
g.p[Ga], tb = bb.Ba, Ya = bb.margin, Hf = Ya.top + Ya.bottom, dd = hb + this.padding.bottom, vd = tb.height, Ed = Qj(bb);
if (isNaN(bb.ya.height) && Ed === Fc || Ed === Hj)vd = Math.max(e.height - Hf - dd, 0);
var Ud = vd + Hf + dd, wd = bb.alignment;
wd.Ac() && (wd = this.Lj);
wd.jd() || (wd = Hb);
k.x = ib + wd.offsetX + Ya.left;
k.y = Ka + wd.offsetY + Ya.top + (e.height * wd.y - Ud * wd.y);
k.width = tb.width;
k.height = vd;
bb.visible && (bb.yc(k.x, k.y, k.width, k.height), ib += tb.width + Ya.left + Ya.right)
}
break;
case "Spot":
var Vd = kk(this, g, h), Cg = Vd.Ba, Cb = Cg.width, lf = Cg.height, Ib = this.padding,
dc = Ib.left, Lb = Ib.top;
k.x = dc - e.x;
k.y = Lb - e.y;
Vd.yc(k.x, k.y, Cb, lf);
for (var Sa = 0; Sa < h; Sa++) {
var jc = g.p[Sa];
if (jc !== Vd) {
var Ie = jc.Ba, If = Ie.width, dg = Ie.height, Fb = jc.alignment;
Fb.Ac() && (Fb = this.Lj);
Fb.jd() || (Fb = Hb);
var ed = jc.Dj;
ed.Ac() && (ed = Hb);
k.x = Fb.x * Cb + Fb.offsetX - (ed.x * If - ed.offsetX);
k.y = Fb.y * lf + Fb.offsetY - (ed.y * dg - ed.offsetY);
k.x -= e.x;
k.y -= e.y;
jc.visible && jc.yc(dc + k.x, Lb + k.y, If, dg)
}
}
break;
case "Auto":
var qc = kk(this, g, h), fd = qc.Ba, Za = t.rf();
Za.q(0, 0, 1, 1);
var fb = qc.margin, Xb = fb.left, ub = fb.top, kc = this.padding,
mf = kc.left, rc = kc.top;
k.x = Xb;
k.y = ub;
k.width = fd.width;
k.height = fd.height;
qc.yc(mf + k.x, rc + k.y, k.width, k.height);
var zb = pl(qc), Wd = ql(qc), Je = 0 + zb.y * fd.height + zb.offsetY, Ab = 0 + Wd.x * fd.width + Wd.offsetX, Fd = 0 + Wd.y * fd.height + Wd.offsetY;
Za.x = 0 + zb.x * fd.width + zb.offsetX;
Za.y = Je;
db(Za, Ab, Fd, 0, 0);
Za.x += Xb + mf;
Za.y += ub + rc;
for (var Ke = 0; Ke < h; Ke++) {
var me = g.p[Ke];
if (me !== qc) {
var gb = me.Ba, fb = me.margin, nf = Math.max(gb.width + fb.right + fb.left, 0), Bb = Math.max(gb.height + fb.top + fb.bottom, 0), $a = me.alignment;
$a.Ac() && ($a = this.Lj);
$a.jd() || ($a = Hb);
k.x = Za.width * $a.x + $a.offsetX - nf * $a.x + fb.left + Za.x;
k.y = Za.height * $a.y + $a.offsetY - Bb * $a.y + fb.top + Za.y;
k.width = Za.width;
k.height = Za.height;
me.visible && (eb(Za.x, Za.y, Za.width, Za.height, k.x, k.y, gb.width, gb.height) ? me.yc(k.x, k.y, gb.width, gb.height) : me.yc(k.x, k.y, gb.width, gb.height, new w(Za.x, Za.y, Za.width, Za.height)))
}
}
t.Jc(Za);
break;
case "Table":
for (var Oc = this.padding, Mb = Oc.left, Gd = Oc.top, Xd = this.Nu, Yd, ne, Pc = Xd.length, xd = 0, jb = 0; jb < Pc; jb++)Xd[jb] && (xd = Math.max(xd, Xd[jb].length));
for (var Le =
Math.min(this.ki, Pc - 1); Le !== Pc && (void 0 === this.Rc[Le] || 0 === this.Rc[Le].Ab);)Le++;
for (var Le = Math.min(Le, Pc - 1), Me = -this.Rc[Le].sb, mb = Math.min(this.Vh, xd - 1); mb !== xd && (void 0 === this.Nc[mb] || 0 === this.Nc[mb].Ab);)mb++;
for (var mb = Math.min(mb, xd - 1), oe = -this.Nc[mb].sb, Db = t.jl(), jb = 0; jb < Pc; jb++)if (Xd[jb]) {
var xd = Xd[jb].length, lc = this.he(jb);
ne = lc.sb + Me + Gd + wl(lc);
for (var yd = 0; yd < xd; yd++)if (Xd[jb][yd]) {
var sc = this.ge(yd);
Yd = sc.sb + oe + Mb + wl(sc);
for (var Nb = Xd[jb][yd], Ne = Nb.length, kb = 0; kb < Ne; kb++) {
var cb = Nb[kb],
Jf = cb.Ba;
if (cb instanceof y && (cb.type === Zj || cb.type === ak)) {
Sj(cb);
cb.Ob.Qa();
var Dc = cb.Ob;
Dc.x = cb.type === Zj ? Mb : Yd;
Dc.y = cb.type === ak ? Gd : ne;
Dc.width = Jf.width;
Dc.height = Jf.height;
cb.Ob.freeze();
Vj(cb, !1)
} else {
Db.q(0, 0);
for (var Hd = 1; Hd < cb.rowSpan && !(jb + Hd >= this.rw); Hd++) {
var ma = this.he(jb + Hd);
Db.height += ma.total
}
for (Hd = 1; Hd < cb.TC && !(yd + Hd >= this.yv); Hd++) {
var na = this.ge(yd + Hd);
Db.width += na.total
}
var eg = sc.Ab + Db.width, Dg = lc.Ab + Db.height;
k.x = Yd;
k.y = ne;
k.width = eg;
k.height = Dg;
ne + Dg > e.height && (Dg = Math.max(e.height -
ne, 0));
Yd + eg > e.width && (eg = Math.max(e.width - Yd, 0));
var Qc = Yd, nh = ne, ec = eg, oh = Dg, Rc = cb.alignment, Zd, Ec, gd, yc;
if (Rc.Ac()) {
Rc = this.Lj;
Rc.jd() || (Rc = Hb);
Zd = Rc.x;
Ec = Rc.y;
gd = Rc.offsetX;
yc = Rc.offsetY;
var hd = sc.alignment, Kf = lc.alignment;
hd.jd() && (Zd = hd.x, gd = hd.offsetX);
Kf.jd() && (Ec = Kf.y, yc = Kf.offsetY)
} else Zd = Rc.x, Ec = Rc.y, gd = Rc.offsetX, yc = Rc.offsetY;
if (isNaN(Zd) || isNaN(Ec))Ec = Zd = 0.5, yc = gd = 0;
var fa = Jf.width, Id = Jf.height, fg = cb.Be, lj = cb.Te, fa = Math.min(fg.width, fa), Id = Math.min(fg.height, Id), fa = Math.max(lj.width,
fa), Id = Math.max(lj.height, Id), gg = cb.margin, Sc = gg.left + gg.right, pb = gg.top + gg.bottom, lb = ok(cb, lc, sc);
if (isNaN(cb.ya.width) && isNaN(sc.width) && lb === Fc || lb === Ij)fa = Math.max(eg - Sc, 0);
if (isNaN(cb.ya.height) && isNaN(lc.height) && lb === Fc || lb === Hj)Id = Math.max(Dg - pb, 0);
var mj = Id + pb;
k.x += k.width * Zd - (fa + Sc) * Zd + gd + gg.left;
k.y += k.height * Ec - mj * Ec + yc + gg.top;
cb.visible && (eb(Qc, nh, ec, oh, k.x, k.y, fa, Id) ? cb.yc(k.x, k.y, fa, Id) : cb.yc(k.x, k.y, fa, Id, new w(Qc, nh, ec, oh)))
}
}
}
}
t.Rj(Db);
for (jb = 0; jb < h; jb++)cb = g.p[jb], cb instanceof
y && (cb.type === Zj || cb.type === ak) && (Dc = cb.Ob, cb.Ec.Qa(), cb.Ec.pp(0, 0, Dc.width, Dc.height), cb.Ec.freeze());
break;
case "Viewbox":
var ph = g.p[0], hg = ph.Ba, ig = ph.margin, mc = ig.top + ig.bottom, Lf = Math.max(hg.width + (ig.right + ig.left), 0), Mf = Math.max(hg.height + mc, 0), Yb = ph.alignment;
Yb.Ac() && (Yb = this.Lj);
Yb.jd() || (Yb = Hb);
k.x = e.width * Yb.x - Lf * Yb.x + Yb.offsetX;
k.y = e.height * Yb.y - Mf * Yb.y + Yb.offsetY;
k.width = hg.width;
k.height = hg.height;
ph.yc(k.x, k.y, k.width, k.height);
break;
case "Link":
var qh = this.rq(), Nf = 0;
if (null !== qh &&
Nf < this.Jh.count) {
var pe = this.Jh.p[Nf];
Nf++;
qh.yc(pe.x - this.li.x, pe.y - this.li.y, pe.width, pe.height)
}
for (var ki = 0; ki < h; ki++) {
var Oe = g.p[ki];
Oe !== qh && Nf < this.Jh.count && (pe = this.Jh.p[Nf], Nf++, Oe.yc(pe.x - this.li.x, pe.y - this.li.y, pe.width, pe.height))
}
var Pe = this.Qx(), Qe = Pe.count;
if (2 <= Qe && this.$e)for (var $d = this.Wj; $d.next();) {
var Ob = $d.value, rh = Qe, sh = Pe, qe = Ob.of, Eg = Ob.bt, jg = Ob.Dj;
jg.hd() && (jg = Hb);
var vb = Ob.ct, of = Ob.zA, Jd = void 0, pf = void 0, ae = 0;
if (qe < -rh || qe >= rh) {
var tc = this.qE, Of = this.pE;
vb !== yg && (ae =
this.computeAngle(Ob, vb, Of), Ob.angle = ae);
Jd = tc.x;
pf = tc.y
} else {
var uc = void 0, jd = void 0;
if (0 <= qe)uc = sh.p[qe], jd = qe < rh - 1 ? sh.p[qe + 1] : uc; else var kg = rh + qe, uc = sh.p[kg], jd = 0 < kg ? sh.p[kg - 1] : uc;
Of = 0 <= qe ? uc.ui(jd) : jd.ui(uc);
vb !== yg && (ae = this.computeAngle(Ob, vb, Of), Ob.angle = ae);
Jd = uc.x + (jd.x - uc.x) * Eg;
pf = uc.y + (jd.y - uc.y) * Eg
}
var be = t.Ng();
be.reset();
be.scale(Ob.scale, Ob.scale);
be.rotate(Ob.angle, 0, 0);
var Pf = Ob.Oa, qf = t.Zj(0, 0, Pf.width, Pf.height), Re = t.M();
Re.et(qf, jg);
be.Ra(Re);
var ce = -Re.x, de = -Re.y, Se = of.copy();
isNaN(Se.x) && (Se.x = 0 <= qe ? Re.x + 3 : -(Re.x + 3));
isNaN(Se.y) && (Se.y = -(Re.y + 3));
Se.rotate(Of);
Jd += Se.x;
pf += Se.y;
be.zF(qf);
var ce = ce + qf.x, de = de + qf.y, th = t.cc(Jd + ce, pf + de);
Ob.move(th);
t.B(th);
t.B(Re);
t.Jc(qf);
t.Oe(be)
}
this.gw();
break;
case "Grid":
break;
case "TableRow":
case "TableColumn":
t.m(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
break;
default:
t.m("Unknown panel type: " + x)
}
t.Jc(k)
}
};
y.prototype.Ij = function (a) {
var b = this.Oa;
if (eb(0, 0, b.width, b.height, a.x, a.y)) {
for (var c = this.za.length, b = t.cc(0, 0); c--;) {
var d = this.za.p[0];
if (d.visible || d === this.Zb)if (Oa(b.set(a), d.transform), d.Da(b))return t.B(b), !0
}
t.B(b);
return null === this.Bb && null === this.dc ? !1 : !0
}
return!1
};
function xl(a, b, c) {
c(a, b);
if (b instanceof y)for (b = b.elements; b.next();)xl(a, b.value, c)
}
function Ii(a, b) {
yl(a, a, b)
}
function yl(a, b, c) {
c(b);
for (b = b.elements; b.next();) {
var d = b.value;
d instanceof y && yl(a, d, c)
}
}
function zl(a, b, c) {
if (c(b))return b;
if (b instanceof y)for (b = b.elements; b.next();) {
var d = zl(a, b.value, c);
if (null !== d)return b.rg(), d
}
return null
}
y.prototype.findObject = y.prototype.ee = function (a) {
if (this.name === a)return this;
for (var b = this.za.p, c = b.length, d = 0; d < c; d++) {
var e = b[d];
if (e.name === a)return e;
if (e instanceof y)if (!e.ZD()) {
if (e = e.ee(a), null !== e)return e
} else if (Al(e) && (e = e.za.Ya(), null !== e && (e = e.ee(a), null !== e)))return e
}
return null
};
function Ue(a, b) {
return b(a) ? a : Bl(a, b)
}
function Bl(a, b) {
for (var c = a.elements; c.next();) {
var d = c.value;
if (b(d))return d;
if (d instanceof y && (d = Bl(d, b), null !== d))return d
}
return null
}
function Cl(a) {
a = a.za.p;
for (var b = a.length, c = 0, d = 0; d < b; d++) {
var e = a[d];
if (e instanceof y)c = Math.max(c, Cl(e)); else if (e instanceof Y) {
a:{
if (!e.Bg)switch (e.on) {
case "None":
case "Square":
case "Ellipse":
case "Circle":
case "LineH":
case "LineV":
case "FramedRectangle":
case "RoundedRectangle":
case "Line1":
case "Line2":
case "Border":
case "Cube1":
case "Cube2":
case "Junction":
case "Cylinder1":
case "Cylinder2":
case "Cylinder3":
case "Cylinder4":
case "PlusLine":
case "XLine":
case "ThinCross":
case "ThickCross":
e = 0;
break a
}
e = e.Cg / 2 * e.bm * e.Tj()
}
c = Math.max(c, e)
}
}
return c
}
aa = y.prototype;
aa.Og = function () {
return!(this.type === Zj || this.type === ak)
};
aa.fe = function (a, b, c) {
if (!1 === this.nf)return null;
void 0 === b && (b = null);
void 0 === c && (c = null);
if (wi(this))return null;
var d = this.Oa, e = 1 / this.Tj(), g = this.Og(), h = g ? a : Oa(t.cc(a.x, a.y), this.transform);
if (eb(-(5 * e), -(5 * e), d.width + 10 * e, d.height + 10 * e, h.x, h.y)) {
if (!this.tg) {
for (var k = this.za.length, e = t.M(); k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Zb) {
l.Og() ? Oa(e.set(a), l.transform) : e.set(a);
var m = null;
l instanceof y ? m = l.fe(e, b, c) : !0 === l.nf && l.Da(e) && (m = l);
if (null !== m && (null !== b && (m = b(m)), m && (null ===
c || c(m))))return t.B(e), g || t.B(h), m
}
}
t.B(e)
}
if (null === this.background && null === this.Gj)return g || t.B(h), null;
a = eb(0, 0, d.width, d.height, h.x, h.y) ? this : null;
g || t.B(h);
return a
}
g || t.B(h);
return null
};
aa.zo = function (a, b, c, d) {
if (!1 === this.nf)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof A || d instanceof ka || (d = new A(Q));
var e = this.Oa, g = this.Og(), h = g ? a : Oa(t.cc(a.x, a.y), this.transform);
if (eb(0, 0, e.width, e.height, h.x, h.y)) {
if (!this.tg) {
for (var k = this.za.length, e = t.M(); k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Zb)l.Og() ? Oa(e.set(a), l.transform) : e.set(a), (l instanceof y ? l.zo(e, b, c, d) : l.Da(e)) && !1 !== l.nf && (null !== b && (l = b(l)), l && (null === c || c(l)) && d.add(l))
}
t.B(e)
}
g || t.B(h);
return null !==
this.background || null !== this.Gj
}
g || t.B(h);
return!1
};
aa.Qj = function (a, b, c, d, e, g) {
if (!1 === this.nf)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
var h = g;
void 0 === g && (h = t.Ng(), h.reset());
h.multiply(this.transform);
if (this.nm(a, h))return Dl(this, b, c, e), void 0 === g && t.Oe(h), !0;
if (this.Cf(a, h)) {
if (!this.tg)for (var k = this.za.length; k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Zb) {
var m = l.ua, n = this.Oa;
if (!(m.x > n.width || m.y > n.height || 0 > m.x + m.width || 0 > m.y + m.height)) {
m = t.Ng();
m.set(h);
if (l instanceof y ? l.Qj(a, b, c, d, e, m) : Pj(l, a, d, m))null !== b && (l = b(l)), l &&
(null === c || c(l)) && e.add(l);
t.Oe(m)
}
}
}
void 0 === g && t.Oe(h);
return d
}
void 0 === g && t.Oe(h);
return!1
};
function Dl(a, b, c, d) {
for (var e = a.za.length; e--;) {
var g = a.za.p[e];
if (g.visible) {
var h = g.ua, k = a.Oa;
h.x > k.width || h.y > k.height || 0 > h.x + h.width || 0 > h.y + h.height || (g instanceof y && Dl(g, b, c, d), null !== b && (g = b(g)), g && (null === c || c(g)) && d.add(g))
}
}
}
aa.um = function (a, b, c, d, e, g) {
if (!1 === this.nf)return!1;
void 0 === c && (c = null);
void 0 === d && (d = null);
var h = this.Oa, k = this.Og(), l = k ? a : Oa(t.cc(a.x, a.y), this.transform), m = k ? b : Oa(t.cc(b.x, b.y), this.transform), n = l.Nj(m), p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || Pa(l.x, l.y, 0, 0, 0, h.height) < n || Pa(l.x, l.y, 0, h.height, h.width, h.height) < n || Pa(l.x, l.y, h.width, h.height, h.width, 0) < n || Pa(l.x, l.y, h.width, 0, 0, 0) < n, h = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height && Pa(l.x, l.y, 0, 0, 0, h.height) < n && Pa(l.x, l.y, 0, h.height, h.width, h.height) <
n && Pa(l.x, l.y, h.width, h.height, h.width, 0) < n && Pa(l.x, l.y, h.width, 0, 0, 0) < n;
k || (t.B(l), t.B(m));
if (p) {
if (!this.tg) {
k = t.M();
l = t.M();
for (m = this.za.length; m--;)if (n = this.za.p[m], n.visible || n === this.Zb) {
var q = n.ua, r = this.Oa;
q.x > r.width || q.y > r.height || 0 > q.x + q.width || 0 > q.y + q.height || (n.Og() ? (q = n.transform, Oa(k.set(a), q), Oa(l.set(b), q)) : (k.set(a), l.set(b)), n instanceof y ? !n.um(k, l, c, d, e, g) : !n.tD(k, l, e)) || (null !== c && (n = c(n)), n && (null === d || d(n)) && g.add(n))
}
t.B(k);
t.B(l)
}
return e ? p : h
}
return!1
};
function pl(a) {
var b = a.G;
if (void 0 === b || b === xb)b = null;
null === b && a instanceof Y && (a = a.La, null !== a && (b = a.G));
null === b && (b = yb);
return b
}
function ql(a) {
var b = a.H;
if (void 0 === b || b === xb)b = null;
null === b && a instanceof Y && (a = a.La, null !== a && (b = a.H));
null === b && (b = Pb);
return b
}
y.prototype.add = y.prototype.add = function (a) {
t.j(a, Q, y, "add:element");
this.Fd(this.za.count, a)
};
y.prototype.elt = y.prototype.ta = function (a) {
return this.za.ta(a)
};
y.prototype.insertAt = y.prototype.Fd = function (a, b) {
b instanceof B && t.m("Cannot add a Part to a Panel: " + b);
if (this === b || this.Ci(b))this === b && t.m("Cannot make a Panel contain itself: " + this.toString()), t.m("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString());
var c = b.fa;
null !== c && c !== this && t.m("Cannot add a GraphObject that already belongs to another Panel to this Panel: " + b.toString() + ", already contained by " + c.toString() + ", cannot be shared by this Panel: " +
this.toString());
this.Z !== Xh || b instanceof Y || t.m("Can only add Shapes to a Grid Panel, not: " + b);
b.gl(this);
b.Rl = null;
if (null !== this.Xz) {
var d = b.data;
null !== d && "object" === typeof d && (null === this.Pf && (this.Pf = new ia(Object, y)), this.Pf.add(d, b))
}
var e = this.za, d = -1;
if (c === this) {
for (var g = -1, h = e.count, k = 0; k < h; k++)if (e.p[k] === b) {
g = k;
break
}
if (-1 !== g) {
if (g === a || g + 1 >= e.count && a >= e.count)return;
e.ud(g);
d = g
} else t.m("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.")
}
if (0 > a ||
a > e.count)a = e.count;
e.Fd(a, b);
this.Y();
b.Y();
null !== b.ld && (this.bj = !0);
b instanceof y && !0 === b.bj && (this.bj = !0);
c = this.S;
null !== c && (c.mj = null, c.kj = NaN, null !== b.ld && c instanceof S && (c.bj = !0), e = this.h, null !== e && e.va.kb || (-1 !== d && c.Yc(sd, "elements", this, b, null, d, null), c.Yc(rd, "elements", this, null, b, null, a)))
};
y.prototype.remove = y.prototype.remove = function (a) {
t.j(a, Q, y, "remove:element");
for (var b = this.za, c = b.count, d = -1, e = 0; e < c; e++)if (b.p[e] === a) {
d = e;
break
}
-1 !== d && this.Pe(d)
};
y.prototype.removeAt = y.prototype.ud = function (a) {
f && t.o(a, y, "removeAt:idx");
0 <= a && this.Pe(a)
};
y.prototype.Pe = function (a) {
var b = this.za, c = b.ta(a);
c.Rl = null;
c.gl(null);
if (null !== this.Pf) {
var d = c.data;
"object" === typeof d && this.Pf.remove(d)
}
b.ud(a);
Rj(this, !1);
this.Y();
b = this.S;
null !== b && (b.mj = null, b.kj = NaN, d = this.h, null !== d && d.va.kb || b.Yc(sd, "elements", this, c, null, a, null))
};
t.A(y, {rw: "rowCount"}, function () {
return void 0 === this.Rc ? 0 : this.Rc.length
});
y.prototype.getRowDefinition = y.prototype.he = function (a) {
if (void 0 === this.Rc)return null;
f && t.o(a, y, "getRowDefinition:idx");
0 > a && t.ia(a, ">= 0", y, "getRowDefinition:idx");
a = Math.round(a);
var b = this.Rc;
if (void 0 === b[a]) {
var c = new Dk;
c.gl(this);
c.El = !0;
c.ne = a;
b[a] = c
}
return b[a]
};
y.prototype.removeRowDefinition = function (a) {
if (void 0 !== this.Rc) {
f && t.o(a, y, "removeRowDefinition:idx");
0 > a && t.ia(a, ">= 0", y, "removeRowDefinition:idx");
a = Math.round(a);
var b = this.Rc;
b[a] && (b[a] = void 0)
}
};
t.A(y, {yv: "columnCount"}, function () {
return void 0 === this.Nc ? 0 : this.Nc.length
});
y.prototype.getColumnDefinition = y.prototype.ge = function (a) {
if (void 0 === this.Nc)return null;
f && t.o(a, y, "getColumnDefinition:idx");
0 > a && t.ia(a, ">= 0", y, "getColumnDefinition:idx");
a = Math.round(a);
var b = this.Nc;
if (void 0 === b[a]) {
var c = new Dk;
c.gl(this);
c.El = !1;
c.ne = a;
b[a] = c
}
return b[a]
};
y.prototype.removeColumnDefinition = function (a) {
if (void 0 !== this.Nc) {
f && t.o(a, y, "removeColumnDefinition:idx");
0 > a && t.ia(a, ">= 0", y, "removeColumnDefinition:idx");
a = Math.round(a);
var b = this.Nc;
b[a] && (b[a] = void 0)
}
};
t.g(y, "rowSizing", y.prototype.VE);
t.defineProperty(y, {VE: "rowSizing"}, function () {
return void 0 === this.Wl ? kl : this.Wl
}, function (a) {
if (void 0 !== this.Wl) {
var b = this.Wl;
b !== a && (a !== kl && a !== ul && t.m("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.Wl = a, this.Y(), this.i("rowSizing", b, a))
}
});
t.g(y, "columnSizing", y.prototype.SC);
t.defineProperty(y, {SC: "columnSizing"}, function () {
return void 0 === this.sl ? kl : this.sl
}, function (a) {
if (void 0 !== this.sl) {
var b = this.sl;
b !== a && (a !== kl && a !== ul && t.m("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.sl = a, this.Y(), this.i("columnSizing", b, a))
}
});
t.g(y, "topIndex", y.prototype.KI);
t.defineProperty(y, {KI: "topIndex"}, function () {
return void 0 === this.ki ? 0 : this.ki
}, function (a) {
if (void 0 !== this.ki) {
var b = this.ki;
b !== a && ((!isFinite(a) || 0 > a) && t.m("topIndex must be greater than zero and a real number. Was " + a), this.ki = a, this.Y(), this.i("topIndex", b, a))
}
});
t.g(y, "leftIndex", y.prototype.ZH);
t.defineProperty(y, {ZH: "leftIndex"}, function () {
return void 0 === this.Vh ? 0 : this.Vh
}, function (a) {
if (void 0 !== this.Vh) {
var b = this.Vh;
b !== a && ((!isFinite(a) || 0 > a) && t.m("leftIndex must be greater than zero and a real number. Was " + a), this.Vh = a, this.Y(), this.i("leftIndex", b, a))
}
});
y.prototype.findRowForLocalY = function (a) {
if (0 > a)return-1;
if (this.type !== nk)return NaN;
for (var b = 0, c = this.Rc, d = c.length, e = this.ki; e < d; e++) {
var g = c[e];
if (void 0 !== g && (b += g.total, a < b))return e
}
return-1
};
y.prototype.findColumnForLocalX = function (a) {
if (0 > a)return-1;
if (this.type !== nk)return NaN;
for (var b = 0, c = this.Nc, d = c.length, e = this.Vh; e < d; e++) {
var g = c[e];
if (void 0 !== g && (b += g.total, a < b))return e
}
return-1
};
t.g(y, "data", y.prototype.data);
t.defineProperty(y, {data: "data"}, function () {
return this.wl
}, function (a) {
var b = this.wl;
if (b !== a) {
var c = this instanceof B && !(this instanceof Ce);
c && t.k(a, "object", y, "data");
Ee(this);
this.wl = a;
var d = this.h;
null !== d && (c ? this instanceof X ? (null !== b && d.qk.remove(b), null !== a && d.qk.add(a, this)) : (null !== b && d.Oh.remove(b), null !== a && d.Oh.add(a, this)) : (c = this.fa, null !== c && null !== c.Pf && (null !== b && c.Pf.remove(b), null !== a && c.Pf.add(a, this))));
this.i("data", b, a);
null !== d && d.va.kb || null !== a && this.Eb()
}
});
function xk(a) {
a = a.rl;
return null !== a && a.cb
}
function Ee(a) {
var b = a.rl;
if (null === b)null !== a.data && t.m("Template cannot have .data be non-null: " + a), a.rl = b = new A(we); else if (b.cb)return;
var c = new A(Q);
xl(a, a, function (a, d) {
var e = d.wc;
if (null !== e) {
qk(d, !1);
for (var g = e.l; g.next();) {
e = g.value;
e.mode === ye && qk(d, !0);
var h = e.ht;
if (null !== h) {
var q = a;
"" !== h && (q = a.ee(h));
null !== q && (c.add(q), void 0 === q.Mr && (q.Mr = new A(we)), q.Mr.add(e))
}
b.add(e)
}
}
if (d instanceof y && d.type === nk) {
if (0 < d.Rc.length)for (g = d.Rc, h = g.length, q = 0; q < h; q++) {
var r = g[q];
if (void 0 !== r &&
null !== r.wc)for (var s = r.wc.l; s.next();)e = s.value, e.Tf = r, e.Ry = 2, e.av = r.index, b.add(e)
}
if (0 < d.Nc.length)for (g = d.Nc, h = g.length, q = 0; q < h; q++)if (r = g[q], void 0 !== r && null !== r.wc)for (s = r.wc.l; s.next();)e = s.value, e.Tf = r, e.Ry = 1, e.av = r.index, b.add(e)
}
});
for (var d = c.l; d.next();) {
var e = d.value;
if (void 0 !== e.Mr) {
qk(e, !0);
for (var g = e.Mr.l; g.next();) {
var h = g.value;
null === e.wc && (e.wc = new A(we));
e.wc.add(h)
}
}
delete e.Mr
}
for (d = b.l; d.next();)e = d.value, g = e.Tf, null !== g && (e.Tf = null, g === a ? e.Mm = "" : (g instanceof Dk && (g = g.fa),
e.Mm = "" !== g.name ? g.name : g.name = "_" + t.jc(g)));
b.freeze();
a instanceof B && a.Jd() && (lh(a, Infinity, Infinity), a.yc())
}
y.prototype.updateTargetBindings = y.prototype.Eb = function (a) {
var b = this.rl;
if (null !== b)for (void 0 === a && (a = ""), b = b.l; b.next();) {
var c = b.value, d = c.IA;
if ("" === a || d === a)if (d = c.kt, null !== c.WC || "" !== d) {
var d = this.data, e = c.ht;
null !== e && (d = this.ee(e));
if (null === d)f && t.trace("Binding error: missing GraphObject named " + e + " in " + this.toString()); else {
var e = this, g = c.Mm;
if ("" !== g) {
if (e = this.ee(g), null === e)continue
} else null !== c.Tf && (e = c.Tf);
g = c.Ry;
if (0 !== g) {
if (!(e instanceof y))continue;
1 === g ? e = e.ge(c.av) : 2 ===
g && (e = e.he(c.av))
}
void 0 !== e && c.GF(e, d)
}
}
}
};
t.g(y, "itemArray", y.prototype.Xz);
t.defineProperty(y, {Xz: "itemArray"}, function () {
return this.ej
}, function (a) {
var b = this.ej;
if (b !== a) {
f && null !== a && !t.isArray(a) && t.m("Panel.itemArray must be an Array-like object or null, not: " + a);
var c = this.h;
null !== c && null !== b && Li(c, this);
this.ej = a;
null !== c && null !== a && Ji(c, this);
this.i("itemArray", b, a);
null !== c && c.va.kb || this.rA()
}
});
function Al(a) {
return a.type === Ng || a.type === Qh || a.type === vg
}
y.prototype.rebuildItemElements = y.prototype.rA = function () {
var a = 0;
for (Al(this) && (a = 1); this.za.length > a;)this.Pe(a);
a = this.Xz;
if (null !== a)for (var b = t.wb(a), c = 0; c < b; c++)Xi(this, t.mb(a, c), c)
};
function Xi(a, b, c) {
if (void 0 !== b && null !== b) {
var d = a.getCategoryForItemData(b, c), e = a.findTemplateForItemData(b, c, d);
e instanceof y && (Ee(e), e = e.copy(), "object" === typeof b && (null === a.Pf && (a.Pf = new ia(Object, y)), a.Pf.add(b, e)), a.type !== Ng && a.type !== Qh || c++, a.Fd(c, e), El(e, c), Yi(a, c), e.jy = d, e.data = b)
}
}
function Yi(a, b) {
for (var c = a.za, d = b + 1; d < c.length;) {
var e = c.ta(d);
e instanceof y && El(e, d);
d++
}
}
function El(a, b) {
a.type === Zj ? a.ac = b : a.type === ak && (a.column = b)
}
y.prototype.isItemPanel = y.prototype.ZD = function () {
return null !== this.ej || null !== this.ug
};
t.g(y, "itemTemplate", y.prototype.UH);
t.defineProperty(y, {UH: "itemTemplate"}, function () {
return null === this.ug ? null : this.ug.wa("")
}, function (a) {
if (null === this.ug) {
if (null === a)return;
this.ug = new ia("string", y)
}
var b = this.ug.wa("");
b !== a && (t.j(a, y, y, "itemTemplate"), a instanceof B && t.m("itemTemplate must not be a Part: " + a), this.ug.add("", a), this.i("itemTemplate", b, a), a = this.h, null !== a && a.va.kb || this.rA())
});
t.g(y, "itemTemplateMap", y.prototype.bE);
t.defineProperty(y, {bE: "itemTemplateMap"}, function () {
return this.ug
}, function (a) {
var b = this.ug;
if (b !== a) {
t.j(a, ia, y, "itemTemplateMap");
for (var c = a.l; c.next();) {
var d = c.value;
d instanceof B && t.m("Template in itemTemplateMap must not be a Part: " + d)
}
this.ug = a;
this.i("itemTemplateMap", b, a);
a = this.h;
null !== a && a.va.kb || this.rA()
}
});
t.g(y, "itemCategoryProperty", y.prototype.TH);
t.defineProperty(y, {TH: "itemCategoryProperty"}, function () {
return this.zn
}, function (a) {
var b = this.zn;
b !== a && ("string" !== typeof a && "function" !== typeof a && t.Nb(a, "string or function", y, "itemCategoryProperty"), this.zn = a, this.i("itemCategoryProperty", b, a))
});
y.prototype.getCategoryForItemData = function (a) {
if (null === a)return"";
var b = this.zn;
if ("function" === typeof b)b = b(a); else if ("string" === typeof b && "object" === typeof a) {
if ("" === b)return"";
b = t.ab(a, b)
} else return"";
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("Panel.getCategoryForItemData found a non-string category for " + a + ": " + b);
return""
};
y.prototype.findTemplateForItemData = function (a, b, c) {
a = this.bE;
b = null;
null !== a && (b = a.wa(c));
null === b && (t.LF || (t.LF = !0, t.trace('No item template Panel found for category "' + c + '" on ' + this), t.trace(" Using default item template."), c = new y, a = new la, a.bind(new we("text", "", td)), c.add(a), t.fD = c), b = t.fD);
return b instanceof y ? b : null
};
t.g(y, "isAtomic", y.prototype.LH);
t.defineProperty(y, {LH: "isAtomic"}, function () {
return this.tg
}, function (a) {
var b = this.tg;
b !== a && (t.k(a, "boolean", y, "isAtomic"), this.tg = a, this.i("isAtomic", b, a))
});
t.g(y, "opacity", y.prototype.opacity);
t.defineProperty(y, {opacity: "opacity"}, function () {
return this.wf
}, function (a) {
var b = this.wf;
b !== a && (t.k(a, "number", y, "opacity"), (0 > a || 1 < a) && t.ia(a, "0 <= val <= 1", y, "opacity"), this.wf = a, this.i("opacity", b, a), a = this.h, b = this.S, null !== a && null !== b && a.ra(Eh(b, b.ua)))
});
function Dk() {
t.uc(this);
this.di = null;
this.El = !0;
this.ne = 0;
this.xf = NaN;
this.Ml = 0;
this.Ll = Infinity;
this.le = xb;
this.sb = this.Ab = 0;
this.wc = null;
this.Jr = Fl;
this.nh = Qg;
this.Gr = this.vj = null;
this.Hr = NaN;
this.Bb = this.jh = null;
this.Zp = !1
}
t.ea("RowColumnDefinition", Dk);
Dk.prototype.copy = function () {
var a = new Dk;
a.El = this.El;
a.ne = this.ne;
a.xf = this.xf;
a.Ml = this.Ml;
a.Ll = this.Ll;
a.le = this.le;
a.Ab = this.Ab;
a.sb = this.sb;
a.nh = this.nh;
a.Jr = this.Jr;
a.vj = null === this.vj ? null : this.vj.W();
a.Gr = this.Gr;
a.Hr = this.Hr;
a.jh = null;
this.jh && (a.jh = this.jh.slice(0));
a.Bb = this.Bb;
a.Zp = this.Zp;
a.wc = this.wc;
return a
};
Dk.prototype.toString = function () {
return"RowColumnDefinition " + (this.wh ? "(Row " : "(Column ") + this.index + ") #" + t.jc(this)
};
var Fl;
Dk.Default = Fl = t.w(Dk, "Default", 0);
var ul;
Dk.None = ul = t.w(Dk, "None", 1);
var kl;
Dk.ProportionalExtra = kl = t.w(Dk, "ProportionalExtra", 2);
Dk.prototype.gl = function (a) {
this.di = a
};
function sl(a, b) {
a.Ab = isNaN(a.xf) ? Math.max(Math.min(a.Ll, b), a.Ml) : Math.max(Math.min(a.Ll, a.xf), a.Ml)
}
function wl(a) {
var b = a.di, c = a.Jm;
null === c && (c = a.wh ? b.Ph : b.Vg);
var d = a.Km;
isNaN(d) && (d = a.wh ? b.Xg : b.Wg);
d = null !== c ? d : 0;
0 === a.index && (d = 0);
c = a.AA;
null === c && (c = b.Ui);
return d + (a.wh ? c.top : c.left)
}
function ol(a) {
var b = a.di, c = a.Jm;
null === c && (c = a.wh ? b.Ph : b.Vg);
var d = a.Km;
isNaN(d) && (d = a.wh ? b.Xg : b.Wg);
d = null !== c ? d : 0;
0 === a.index && (d = 0);
c = a.AA;
null === c && (c = b.Ui);
return d + (a.wh ? c.top + c.bottom : c.left + c.right)
}
Dk.prototype.Fc = function (a, b, c, d, e) {
var g = this.di;
if (null !== g) {
g.Y();
for (var h = this.wh, k = g.za, l = k.length, m = 0; m < l; m++) {
var n = k.p[m];
(h ? n.ac : n.column) === this.index && n.Y()
}
g.Yc(qd, a, this, b, c, d, e);
if (null !== this.wc && (b = g.Bo(), null !== b && (b = b.data, null !== b)))for (c = this.wc.l; c.next();)c.value.FF(this, b, a, null)
}
};
t.A(Dk, {fa: "panel"}, function () {
return this.di
});
t.A(Dk, {wh: "isRow"}, function () {
return this.El
});
t.A(Dk, {index: "index"}, function () {
return this.ne
});
t.g(Dk, "height", Dk.prototype.height);
t.defineProperty(Dk, {height: "height"}, function () {
return this.xf
}, function (a) {
var b = this.xf;
b !== a && (f && t.k(a, "number", Dk, "height"), 0 > a && t.ia(a, ">= 0", Dk, "height"), this.xf = a, sl(this, this.Ab), this.Fc("size", b, a))
});
t.g(Dk, "width", Dk.prototype.width);
t.defineProperty(Dk, {width: "width"}, function () {
return this.xf
}, function (a) {
var b = this.xf;
b !== a && (f && t.k(a, "number", Dk, "width"), 0 > a && t.ia(a, ">= 0", Dk, "width"), this.xf = a, sl(this, this.Ab), this.Fc("size", b, a))
});
t.g(Dk, "minimum", Dk.prototype.yh);
t.defineProperty(Dk, {yh: "minimum"}, function () {
return this.Ml
}, function (a) {
var b = this.Ml;
b !== a && (f && t.k(a, "number", Dk, "minimum"), (0 > a || !isFinite(a)) && t.ia(a, ">= 0", Dk, "minimum"), this.Ml = a, sl(this, this.Ab), this.Fc("minimum", b, a))
});
t.g(Dk, "maximum", Dk.prototype.kf);
t.defineProperty(Dk, {kf: "maximum"}, function () {
return this.Ll
}, function (a) {
var b = this.Ll;
b !== a && (f && t.k(a, "number", Dk, "maximum"), 0 > a && t.ia(a, ">= 0", Dk, "maximum"), this.Ll = a, sl(this, this.Ab), this.Fc("maximum", b, a))
});
t.g(Dk, "alignment", Dk.prototype.alignment);
t.defineProperty(Dk, {alignment: "alignment"}, function () {
return this.le
}, function (a) {
var b = this.le;
b.K(a) || (f && t.j(a, H, Dk, "alignment"), this.le = a.W(), this.Fc("alignment", b, a))
});
t.g(Dk, "stretch", Dk.prototype.Ch);
t.defineProperty(Dk, {Ch: "stretch"}, function () {
return this.nh
}, function (a) {
var b = this.nh;
b !== a && (f && t.nb(a, Q, Dk, "stretch"), this.nh = a, this.Fc("stretch", b, a))
});
t.g(Dk, "separatorPadding", Dk.prototype.AA);
t.defineProperty(Dk, {AA: "separatorPadding"}, function () {
return this.vj
}, function (a) {
"number" === typeof a ? a = new Wa(a) : null !== a && f && t.j(a, Wa, Dk, "separatorPadding");
var b = this.vj;
null !== a && null !== b && b.K(a) || (null !== a && (a = a.W()), this.vj = a, this.Fc("separatorPadding", b, a))
});
t.g(Dk, "separatorStroke", Dk.prototype.Jm);
t.defineProperty(Dk, {Jm: "separatorStroke"}, function () {
return this.Gr
}, function (a) {
var b = this.Gr;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Gr = a, this.fa && this.fa.ra(), this.Fc("separatorStroke", b, a))
});
t.g(Dk, "separatorStrokeWidth", Dk.prototype.Km);
t.defineProperty(Dk, {Km: "separatorStrokeWidth"}, function () {
return this.Hr
}, function (a) {
var b = this.Hr;
b !== a && (this.Hr = a, this.fa && this.fa.ra(), this.Fc("separatorStrokeWidth", b, a))
});
t.g(Dk, "separatorDashArray", Dk.prototype.bF);
t.defineProperty(Dk, {bF: "separatorDashArray"}, function () {
return this.jh
}, function (a) {
var b = this.jh;
b !== a && (Array.isArray(a) || t.Nb(a, "Array", Dk, "separatorDashArray:val"), this.jh = a, this.fa && this.fa.ra(), this.Fc("separatorDashArray", b, a))
});
t.g(Dk, "background", Dk.prototype.background);
t.defineProperty(Dk, {background: "background"}, function () {
return this.Bb
}, function (a) {
var b = this.Bb;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Bb = a, this.fa && this.fa.ra(), this.Fc("background", b, a))
});
t.g(Dk, "coversSeparators", Dk.prototype.Dv);
t.defineProperty(Dk, {Dv: "coversSeparators"}, function () {
return this.Zp
}, function (a) {
var b = this.Zp;
b !== a && (t.k(a, "boolean", Dk, "coversSeparators"), this.Zp = a, this.Fc("coversSeparators", b, a))
});
t.g(Dk, "sizing", Dk.prototype.gt);
t.defineProperty(Dk, {gt: "sizing"}, function () {
return this.Jr
}, function (a) {
var b = this.Jr;
b !== a && (f && t.nb(a, Dk, Dk, "sizing"), this.Jr = a, this.Fc("sizing", b, a))
});
function tl(a) {
if (a.gt === Fl) {
var b = a.di;
return a.wh ? b.VE : b.SC
}
return a.gt
}
t.A(Dk, {Rb: "actual"}, function () {
return this.Ab
});
t.A(Dk, {total: "total"}, function () {
return this.Ab + ol(this)
});
t.A(Dk, {position: "position"}, function () {
return this.sb
});
Dk.prototype.bind = Dk.prototype.bind = function (a) {
a.Tf = this;
var b = this.fa;
null !== b && (b = b.Bo(), null !== b && xk(b) && t.m("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a));
null === this.wc && (this.wc = new A(we));
this.wc.add(a)
};
function Y() {
Q.call(this);
this.La = null;
this.on = "None";
this.Bg = !1;
this.qq = Qg;
this.ok = null;
this.tb = this.Cc = "black";
this.Cg = 1;
this.Un = "butt";
this.Vn = "miter";
this.bm = 10;
this.am = null;
this.Sc = 0;
this.ii = this.hi = xb;
this.ir = this.hr = 0;
this.vq = !1;
this.Aq = !0;
this.kr = null;
this.qn = this.Xn = "None";
this.uq = 1
}
t.ea("Shape", Y);
t.Ja(Y, Q);
Y.prototype.cloneProtected = function (a) {
Q.prototype.cloneProtected.call(this, a);
a.La = this.La;
a.on = this.on;
a.Bg = this.Bg;
a.qq = this.qq;
a.ok = this.ok;
a.Cc = this.Cc;
a.tb = this.tb;
a.Cg = this.Cg;
a.Un = this.Un;
a.Vn = this.Vn;
a.bm = this.bm;
a.am = null;
this.am && (a.am = this.am.slice(0));
a.Sc = this.Sc;
a.hi = this.hi.W();
a.ii = this.ii.W();
a.hr = this.hr;
a.ir = this.ir;
a.vq = this.vq;
a.Aq = this.Aq;
a.kr = this.kr;
a.Xn = this.Xn;
a.qn = this.qn;
a.uq = this.uq
};
Y.prototype.toString = function () {
return"Shape(" + ("None" !== this.Db ? this.Db : "None" !== this.Nm ? this.Nm : this.Qv) + ")#" + t.jc(this)
};
function Gl(a, b, c, d) {
var e = 0.001, g = d.Ba, h = g.width, g = g.height, k, l, m, n = c.length;
if (!(2 > n)) {
k = c[0][0];
l = c[0][1];
for (var p, q, r, s, u = 0, x = t.yb(), E = 1; E < n; E++)p = c[E], e = p[0], m = p[1], p = e - k, k = m - l, 0 === p && (p = 0.001), q = k / p, s = Math.atan2(k, p), k = Math.sqrt(p * p + k * k), x.push([p, s, q, k]), u += k, k = e, l = m;
k = c[0][0];
l = c[0][1];
c = 0;
e = h;
n = h / 2;
E = 0 === n ? !1 : !0;
m = 0;
r = x[m];
p = r[0];
s = r[1];
q = r[2];
r = r[3];
for (var F = 0; 0.1 <= u;) {
0 === F && (E ? (e = h, c++, e -= n, u -= n, E = !1) : (e = h, c++), 0 === e && (e = 1));
if (e > u) {
t.xa(x);
return
}
e > r ? (F = e - r, e = r) : F = 0;
var G = Math.sqrt(e *
e / (1 + q * q));
0 > p && (G = -G);
k += G;
l += q * G;
a.translate(k, l);
a.rotate(s);
a.translate(-(h / 2), -(g / 2));
0 === F && d.Vk(a, b);
a.translate(h / 2, g / 2);
a.rotate(-s);
a.translate(-k, -l);
u -= e;
r -= e;
if (0 !== F) {
m++;
if (m === x.length) {
t.xa(x);
return
}
r = x[m];
p = r[0];
s = r[1];
q = r[2];
r = r[3];
e = F
}
}
t.xa(x)
}
}
Y.prototype.Vk = function (a, b) {
if (null !== this.tb || null !== this.Cc) {
null !== this.Cc && dk(this, a, this.Cc, !0);
null !== this.tb && dk(this, a, this.tb, !1);
var c = this.Cg;
if (0 === c) {
var d = this.S;
d instanceof Ce && d.type === vg && d.Hc instanceof Y && (c = d.Hc.bb)
}
a.lineWidth = c;
a.lineJoin = this.Vn;
a.lineCap = this.Un;
a.miterLimit = this.bm;
var e = !1;
this.S && (e = this.S.Ei);
var g = !0;
null !== this.tb && null === this.Cc && (g = !1);
var d = !1, h = this.zw;
if (null !== h) {
var k = d = !0;
void 0 !== a.setLineDash ? (a.setLineDash(h), a.lineDashOffset = this.Sc) : void 0 !==
a.webkitLineDash ? (a.webkitLineDash = h, a.webkitLineDashOffset = this.Sc) : void 0 !== a.mozDash ? (a.mozDash = h, a.mozDashOffset = this.Sc) : k = !1
}
var l = this.La;
if (null !== l) {
if (l.Z === Gc)a.beginPath(), d && !k ? Lj(a, l.Yb, l.ic, l.cd, l.pd, h, this.Sc) : (a.moveTo(l.Yb, l.ic), a.lineTo(l.cd, l.pd)), null !== this.Cc && ek(a, this.Cc, !0), 0 !== c && null !== this.tb && ek(a, this.tb, !1); else if (l.Z === Hc) {
var m = l.Yb, n = l.ic, p = l.cd, l = l.pd, q = Math.min(m, p), r = Math.min(n, l), m = Math.abs(p - m), n = Math.abs(l - n);
null !== this.Cc && (this.Cc instanceof Nd && this.Cc.type ===
Rd ? (a.beginPath(), a.rect(q, r, m, n), ek(a, this.Cc, !0)) : a.fillRect(q, r, m, n));
if (null !== this.tb) {
if (g && e) {
var s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur];
a.shadowOffsetX = 0;
a.shadowOffsetY = 0;
a.shadowBlur = 0
}
d && !k ? (k = [
[q, r],
[q + m, r],
[q + m, r + n],
[q, r + n],
[q, r]
], a.beginPath(), Hl(a, k, h, this.Sc), ek(a, this.tb, !1)) : 0 !== c && (this.tb instanceof Nd && this.tb.type === Rd ? (a.beginPath(), a.rect(q, r, m, n), ek(a, this.tb, !1)) : a.strokeRect(q, r, m, n));
g && e && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])
}
} else if (l.Z ===
Ic)m = l.Yb, n = l.ic, p = l.cd, l = l.pd, q = Math.abs(p - m) / 2, r = Math.abs(l - n) / 2, m = Math.min(m, p) + q, n = Math.min(n, l) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + D.sa * q, n - r, m + q, n - D.sa * r, m + q, n), a.bezierCurveTo(m + q, n + D.sa * r, m + D.sa * q, n + r, m, n + r), a.bezierCurveTo(m - D.sa * q, n + r, m - q, n + D.sa * r, m - q, n), a.bezierCurveTo(m - q, n - D.sa * r, m - D.sa * q, n - r, m, n - r), a.closePath(), null !== this.Cc && ek(a, this.Cc, !0), d && !k && (k = t.yb(), D.te(m, n - r, m + D.sa * q, n - r, m + q, n - D.sa * r, m + q, n, 0.5, k), D.te(m + q, n, m + q, n + D.sa * r, m + D.sa * q, n + r, m, n + r, 0.5, k), D.te(m, n +
r, m - D.sa * q, n + r, m - q, n + D.sa * r, m - q, n, 0.5, k), D.te(m - q, n, m - q, n - D.sa * r, m - D.sa * q, n - r, m, n - r, 0.5, k), a.beginPath(), Hl(a, k, h, this.Sc), t.xa(k)), 0 !== c && null !== this.tb && (g && e && (s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), ek(a, this.tb, !1), g && e && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])); else if (l.Z === Bc) {
for (var q = l.sk, r = q.length, u = 0; u < r; u++) {
var x = q.p[u];
a.beginPath();
a.moveTo(x.la, x.ma);
for (var E = x.Ca.p, F = E.length, G = null, L = 0; L < F; L++) {
var N =
E[L];
switch (N.Z) {
case Yc:
a.moveTo(N.D, N.F);
break;
case Kc:
a.lineTo(N.D, N.F);
break;
case Zc:
a.bezierCurveTo(N.zg, N.Ag, N.Gk, N.Hk, N.pe, N.qe);
break;
case $c:
a.quadraticCurveTo(N.zg, N.Ag, N.pe, N.qe);
break;
case ad:
if (N.radiusX === N.radiusY)G = Math.PI / 180, a.arc(N.Ym, N.Zm, N.radiusX, N.kg * G, (N.kg + N.Dh) * G, 0 > N.Dh); else for (var G = cd(N, x), V = G.length, T = 0; T < V; T++) {
var W = G[T];
0 === T && a.lineTo(W.x1, W.y1);
a.bezierCurveTo(W.x2, W.y2, W.Rd, W.Sd, W.Jb, W.Kb)
}
break;
case bd:
G && G.type === ad ? (G = cd(G, x), G = G[G.length - 1] || null, null !== G &&
(m = G.Jb, p = G.Kb)) : (m = G ? G.D : x.la, p = G ? G.F : x.ma);
G = id(N, x, m, p);
V = G.length;
for (T = 0; T < V; T++)W = G[T], a.bezierCurveTo(W.x2, W.y2, W.Rd, W.Sd, W.Jb, W.Kb);
break;
default:
t.m("Segment not of valid type")
}
N.dh && a.closePath();
G = N
}
e ? x.xn ? (!0 === x.Bl && null !== this.Cc ? (ek(a, this.Cc, !0), g = !0) : g = !1, 0 !== c && null !== this.tb && (g && (s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !k || ek(a, this.tb, !1), g && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2]))) : (g && (s =
[a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === x.Bl && null !== this.Cc && ek(a, this.Cc, !0), 0 !== c && null !== this.tb && (d && !k || ek(a, this.tb, !1)), g && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])) : (!0 === x.Bl && null !== this.Cc && ek(a, this.Cc, !0), 0 === c || null === this.tb || d && !k || ek(a, this.tb, !1))
}
if (d && !k)for (c = g, s = l.sk, g = s.length, k = 0; k < g; k++) {
l = s.p[k];
a.beginPath();
m = t.yb();
m.push([l.la, l.ma]);
p = l.la;
q = l.ma;
r = p;
u = q;
x = l.Ca.p;
E = x.length;
for (F = 0; F <
E; F++) {
L = x[F];
switch (L.Z) {
case Yc:
Hl(a, m, h, this.Sc);
m.length = 0;
m.push([L.D, L.F]);
p = L.D;
q = L.F;
r = p;
u = q;
break;
case Kc:
m.push([L.D, L.F]);
p = L.D;
q = L.F;
break;
case Zc:
D.te(p, q, L.zg, L.Ag, L.Gk, L.Hk, L.pe, L.qe, 0.5, m);
p = L.D;
q = L.F;
break;
case $c:
D.hp(p, q, L.zg, L.Ag, L.pe, L.qe, 0.5, m);
p = L.D;
q = L.F;
break;
case ad:
N = cd(L, l);
G = N.length;
for (V = 0; V < G; V++)T = N[V], D.te(p, q, T.x2, T.y2, T.Rd, T.Sd, T.Jb, T.Kb, 0.5, m), p = T.Jb, q = T.Kb;
break;
case bd:
N = id(L, l, p, q);
G = N.length;
for (V = 0; V < G; V++)T = N[V], D.te(p, q, T.x2, T.y2, T.Rd, T.Sd, T.Jb, T.Kb, 0.5,
m), p = T.Jb, q = T.Kb;
break;
default:
t.m("Segment not of valid type")
}
L.dh && (m.push([r, u]), Hl(a, m, h, this.Sc))
}
Hl(a, m, h, this.Sc);
t.xa(m);
null !== this.tb && (c && e && (n = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), ek(a, this.tb, !1), c && e && (a.shadowOffsetX = n[0], a.shadowOffsetY = n[1], a.shadowBlur = n[2]))
}
}
d && (void 0 !== a.setLineDash ? (a.setLineDash(t.Hh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = t.Hh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash &&
(a.mozDash = null, a.mozDashOffset = 0));
if (this.kA) {
d = this.kA;
lh(d, Infinity, Infinity);
h = d.Ba;
d.yc(0, 0, h.width, h.height);
a.save();
h = this.Wc.ob.Ya();
a.beginPath();
n = t.yb();
n.push([h.la, h.ma]);
c = h.la;
e = h.ma;
s = c;
g = e;
k = h.Ca.p;
l = k.length;
for (m = 0; m < l; m++) {
p = k[m];
switch (p.Z) {
case Yc:
Gl(a, b, n, d);
n.length = 0;
n.push([p.D, p.F]);
c = p.D;
e = p.F;
s = c;
g = e;
break;
case Kc:
n.push([p.D, p.F]);
c = p.D;
e = p.F;
break;
case Zc:
D.te(c, e, p.zg, p.Ag, p.Gk, p.Hk, p.pe, p.qe, 0.5, n);
c = p.D;
e = p.F;
break;
case $c:
D.hp(c, e, p.zg, p.Ag, p.pe, p.qe, 0.5, n);
c =
p.D;
e = p.F;
break;
case ad:
q = cd(p, h);
r = q.length;
for (u = 0; u < r; u++)x = q[u], D.te(c, e, x.x2, x.y2, x.Rd, x.Sd, x.Jb, x.Kb, 0.5, n), c = x.Jb, e = x.Kb;
break;
case bd:
q = id(p, h, c, e);
r = q.length;
for (u = 0; u < r; u++)x = q[u], D.te(c, e, x.x2, x.y2, x.Rd, x.Sd, x.Jb, x.Kb, 0.5, n), c = x.Jb, e = x.Kb;
break;
default:
t.m("Segment not of valid type")
}
p.dh && (n.push([s, g]), Gl(a, b, n, d))
}
Gl(a, b, n, d);
t.xa(n);
a.restore()
}
}
}
};
function Hl(a, b, c, d) {
var e = 0.001, g = c.length, h, k, l, m = b.length;
if (!(2 > m))if (h = b[0][0], k = b[0][1], 2 === m)Lj(a, h, k, b[1][0], b[1][1], c, d); else {
a.moveTo(h, k);
for (var n, p, q, r = 0, s = t.yb(), u = 1; u < m; u++)n = b[u], e = n[0], l = n[1], n = e - h, h = l - k, 0 === n && (n = 0.001), p = h / n, h = Math.sqrt(n * n + h * h), s.push([n, p, h]), r += h, h = e, k = l;
h = b[0][0];
k = b[0][1];
b = 0;
m = !0;
e = c[b % g];
u = 0 !== d;
l = 0;
q = s[l];
n = q[0];
p = q[1];
q = q[2];
for (var x = 0; 0.1 <= r;) {
0 === x && (e = c[b % g], b++, u && (d %= e, e -= d, u = !1));
e > r && (e = r);
e > q ? (x = e - q, e = q) : x = 0;
var E = Math.sqrt(e * e / (1 + p * p));
0 > n && (E = -E);
h += E;
k += p * E;
m ? a.lineTo(h, k) : a.moveTo(h, k);
r -= e;
q -= e;
if (0 !== x) {
l++;
if (l === s.length) {
t.xa(s);
return
}
q = s[l];
n = q[0];
p = q[1];
q = q[2];
e = x
} else m = !m
}
t.xa(s)
}
}
Y.prototype.getDocumentPoint = Y.prototype.$a = function (a, b) {
void 0 === b && (b = new v);
a.hd() && t.m("Spot must be real");
var c = this.Oa, d = this.bb;
b.q(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY);
this.ae.Ra(b);
return b
};
Y.prototype.Ij = function (a, b) {
var c = this.La;
if (null === c || null === this.fill && null === this.stroke)return!1;
var d = c.Hb, e = this.bb / 2;
c.type !== Gc || b || (e += 2);
var g = t.rf();
g.assign(d);
g.Gg(e + 2, e + 2);
if (!g.Da(a))return t.Jc(g), !1;
d = e + 1E-4;
if (c.type === Gc) {
if (null === this.stroke)return!1;
g = (c.D - c.la) * (a.x - c.la) + (c.F - c.ma) * (a.y - c.ma);
return 0 > (c.la - c.D) * (a.x - c.D) + (c.ma - c.F) * (a.y - c.F) || 0 > g ? !1 : D.td(c.la, c.ma, c.D, c.F, e, a.x, a.y)
}
if (c.type === Hc) {
var h = c.la, k = c.ma, l = c.D, m = c.F, c = Math.min(h, l), n = Math.min(k, m), h = Math.abs(l -
h), k = Math.abs(m - k);
g.x = c;
g.y = n;
g.width = h;
g.height = k;
if (null === this.fill) {
g.Gg(-d, -d);
if (g.Da(a))return!1;
g.Gg(d, d)
}
null !== this.stroke && g.Gg(e, e);
e = g.Da(a);
t.Jc(g);
return e
}
if (c.type === Ic) {
h = c.la;
k = c.ma;
l = c.D;
m = c.F;
c = Math.min(h, l);
n = Math.min(k, m);
h = Math.abs(l - h);
k = Math.abs(m - k);
g = h / 2;
k /= 2;
c = a.x - (c + g);
n = a.y - (n + k);
if (null === this.fill) {
g -= d;
k -= d;
if (0 >= g || 0 >= k || 1 >= c * c / (g * g) + n * n / (k * k))return!1;
g += d;
k += d
}
null !== this.stroke && (g += e, k += e);
return 0 >= g || 0 >= k ? !1 : 1 >= c * c / (g * g) + n * n / (k * k)
}
if (c.type === Bc)return null ===
this.fill ? ld(c, a.x, a.y, e) : c.Da(a, e, 1 < this.bb, b);
t.m("Unknown Geometry type");
return!1
};
Y.prototype.Js = function (a, b, c, d) {
var e = this.ya, g = this.Cg;
a = Math.max(a, 0);
b = Math.max(b, 0);
var h;
if (this.Bg)h = this.La.Hb; else {
var k = this.Db, l = D.mA[k];
if (void 0 === l) {
var m = D.zi[k];
"string" === typeof m && (m = D.zi[m]);
"function" === typeof m ? (l = m(null, 100, 100), D.mA[k] = l) : t.m("Unsupported Figure:" + k)
}
h = l.Hb
}
var k = h.width, l = h.height, m = h.width, n = h.height;
switch (Qj(this)) {
case Pg:
d = c = 0;
break;
case Fc:
m = Math.max(a - g, 0);
n = Math.max(b - g, 0);
break;
case Ij:
m = Math.max(a - g, 0);
d = 0;
break;
case Hj:
c = 0, n = Math.max(b - g, 0)
}
isFinite(e.width) &&
(m = e.width);
isFinite(e.height) && (n = e.height);
e = this.Be;
h = this.Te;
c = Math.max(c, h.width) - g;
d = Math.max(d, h.height) - g;
m = Math.min(e.width, m);
n = Math.min(e.height, n);
m = isFinite(m) ? Math.max(c, m) : Math.max(k, c);
n = isFinite(n) ? Math.max(d, n) : Math.max(l, d);
c = rl(this);
switch (c) {
case Pg:
break;
case Fc:
k = m;
l = n;
break;
case Rg:
c = Math.min(m / k, n / l);
isFinite(c) || (c = 1);
k *= c;
l *= c;
break;
default:
t.m(c + " is not a valid geometryStretch.")
}
if (this.Bg) {
h = this.Wc;
d = k;
e = l;
c = h.copy();
h = h.Hb;
d /= h.width;
e /= h.height;
isFinite(d) || (d = 1);
isFinite(e) || (e = 1);
if (1 !== d || 1 !== e)switch (c.type) {
case Gc:
case Hc:
case Ic:
c.la *= d;
c.ma *= e;
c.D *= d;
c.F *= e;
break;
case Bc:
h = c.ob;
for (var p = h.length, q = 0; q < p; q++) {
var r = h.p[q];
r.la *= d;
r.ma *= e;
for (var r = r.Ca, s = r.length, u = 0; u < s; u++) {
var x = r.p[u];
switch (x.type) {
case Kc:
case Yc:
x.D *= d;
x.F *= e;
break;
case Zc:
x.pb *= d;
x.Gb *= e;
x.je *= d;
x.ke *= e;
x.D *= d;
x.F *= e;
break;
case $c:
x.pb *= d;
x.Gb *= e;
x.D *= d;
x.F *= e;
break;
case ad:
x.Aa *= d;
x.Ma *= e;
x.radiusX *= d;
void 0 !== x.radiusY && (x.radiusY *= e);
break;
case bd:
x.D *= d;
x.F *= e;
x.radiusX *=
d;
x.radiusY *= e;
break;
default:
t.m("Unknown Segment type: " + x.type)
}
}
}
}
this.La = c
} else if (null === this.La || this.La.fu !== a - g || this.La.eu !== b - g)this.La = D.makeGeometry(this, k, l);
h = this.La.Hb;
Infinity === a || Infinity === b ? Nj(this, h.x - g / 2, h.y - g / 2, 0 === a && 0 === k ? 0 : h.width + g, 0 === b && 0 === l ? 0 : h.height + g) : Nj(this, -(g / 2), -(g / 2), m + g, n + g)
};
function vl(a, b, c) {
if (!1 !== vi(a)) {
a.Dc.Qa();
var d = a.Cg;
if (0 === d) {
var e = a.S;
e instanceof Ce && e.type === vg && e.Hc instanceof Y && (d = e.Hc.bb)
}
d *= a.Xb;
Nj(a, -(d / 2), -(d / 2), b + d, c + d);
b = a.Dc;
c = a.Be;
d = a.Te;
b.width = Math.min(c.width, b.width);
b.height = Math.min(c.height, b.height);
b.width = Math.max(d.width, b.width);
b.height = Math.max(d.height, b.height);
a.Dc.freeze();
a.Dc.P() || t.m("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Dc.toString());
Rj(a, !1)
}
}
function rl(a) {
var b = a.Rv;
return a.Bg ? b === Qg ? Fc : b : b === Qg ? D.mA[a.Db].fc : b
}
Y.prototype.Hj = function (a, b, c, d) {
Uj(this, a, b, c, d)
};
Y.prototype.getNearestIntersectionPoint = Y.prototype.Go = function (a, b, c) {
return this.ws(a.x, a.y, b.x, b.y, c)
};
Y.prototype.ws = function (a, b, c, d, e) {
var g = this.transform, h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), k = g.m22 * h, l = -g.m12 * h, m = -g.m21 * h, n = g.m11 * h, p = h * (g.m21 * g.dy - g.m22 * g.dx), q = h * (g.m12 * g.dx - g.m11 * g.dy), g = a * k + b * m + p, h = a * l + b * n + q, k = c * k + d * m + p, l = c * l + d * n + q, m = this.bb / 2, p = this.La;
null === p && (lh(this, Infinity, Infinity), p = this.La);
q = p.Hb;
n = !1;
if (p.type === Gc)if (1.5 >= this.bb)n = D.Lg(p.Yb, p.ic, p.cd, p.pd, g, h, k, l, e); else {
var r, s;
p.Yb === p.cd ? (r = m, s = 0) : (b = (p.pd - p.ic) / (p.cd - p.Yb), s = m / Math.sqrt(1 + b * b), r = s * b);
d = t.yb();
b = new v;
D.Lg(p.Yb +
r, p.ic + s, p.cd + r, p.pd + s, g, h, k, l, b) && d.push(b);
b = new v;
D.Lg(p.Yb - r, p.ic - s, p.cd - r, p.pd - s, g, h, k, l, b) && d.push(b);
b = new v;
D.Lg(p.Yb + r, p.ic + s, p.Yb - r, p.ic - s, g, h, k, l, b) && d.push(b);
b = new v;
D.Lg(p.cd + r, p.pd + s, p.cd - r, p.pd - s, g, h, k, l, b) && d.push(b);
b = d.length;
if (0 === b)return t.xa(d), !1;
n = !0;
s = Infinity;
for (r = 0; r < b; r++) {
var k = d[r], u = (k.x - g) * (k.x - g) + (k.y - h) * (k.y - h);
u < s && (s = u, e.x = k.x, e.y = k.y)
}
t.xa(d)
} else if (p.type === Hc)b = q.x - m, n = D.Go(b, q.y - m, q.x + q.width + m, q.y + q.height + m, g, h, k, l, e); else if (p.type === Ic)a:if (b = q.copy().Gg(m,
m), 0 === b.width)n = D.Lg(b.x, b.y, b.x, b.y + b.height, g, h, k, l, e); else if (0 === b.height)n = D.Lg(b.x, b.y, b.x + b.width, b.y, g, h, k, l, e); else {
a = b.width / 2;
var x = b.height / 2;
d = b.x + a;
b = b.y + x;
c = 9999;
g !== k && (c = (h - l) / (g - k));
if (9999 > Math.abs(c)) {
n = h - b - c * (g - d);
if (0 > a * a * c * c + x * x - n * n) {
e.x = NaN;
e.y = NaN;
n = !1;
break a
}
m = Math.sqrt(a * a * c * c + x * x - n * n);
k = (-(a * a * c * n) + a * x * m) / (x * x + a * a * c * c) + d;
a = (-(a * a * c * n) - a * x * m) / (x * x + a * a * c * c) + d;
l = c * (k - d) + n + b;
b = c * (a - d) + n + b;
d = Math.abs((g - k) * (g - k)) + Math.abs((h - l) * (h - l));
h = Math.abs((g - a) * (g - a)) + Math.abs((h - b) *
(h - b));
d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b)
} else {
k = x * x;
l = g - d;
k -= k / (a * a) * l * l;
if (0 > k) {
e.x = NaN;
e.y = NaN;
n = !1;
break a
}
m = Math.sqrt(k);
l = b + m;
b -= m;
d = Math.abs(l - h);
h = Math.abs(b - h);
d < h ? (e.x = g, e.y = l) : (e.x = g, e.y = b)
}
n = !0
} else if (p.type === Bc) {
var E, F, G, q = t.M();
r = k - g;
s = l - h;
s = r * r + s * s;
e.x = k;
e.y = l;
for (r = 0; r < p.ob.count; r++) {
var L = p.ob.p[r], N = L.Ca;
E = L.la;
F = L.ma;
for (var V = E, T = F, W, ea, R = 0; R < N.count; R++) {
W = N.p[R];
ea = W.type;
u = W.D;
G = W.F;
var wa = !1;
switch (ea) {
case Yc:
V = u;
T = G;
break;
case Kc:
wa = Il(E, F, u, G, g, h, k, l, q);
break;
case Zc:
wa =
W.pb;
ea = W.Gb;
var Ja = W.je, Ma = W.ke, wa = D.gs(E, F, wa, ea, Ja, Ma, u, G, g, h, k, l, 0.5, q);
break;
case $c:
wa = (E + 2 * W.pb) / 3;
ea = (F + 2 * W.Gb) / 3;
Ja = (2 * W.pb + u) / 3;
Ma = (2 * W.pb + u) / 3;
wa = D.gs(E, F, wa, ea, Ja, Ma, u, G, g, h, k, l, 0.5, q);
break;
case ad:
case bd:
G = W.type === ad ? cd(W, L) : id(W, L, E, F);
ea = G.length;
for (Ja = 0; Ja < ea; Ja++)x = G[Ja], 0 === Ja && Il(E, F, x.x1, x.y1, g, h, k, l, q) && (u = Jl(g, h, q, s, e), u < s && (s = u, n = !0)), D.gs(x.x1, x.y1, x.x2, x.y2, x.Rd, x.Sd, x.Jb, x.Kb, g, h, k, l, 0.5, q) && (u = Jl(g, h, q, s, e), u < s && (s = u, n = !0));
u = x.Jb;
G = x.Kb;
break;
default:
t.m("Unknown Segment type: " +
W.type)
}
E = u;
F = G;
wa && (u = Jl(g, h, q, s, e), u < s && (s = u, n = !0));
W.Ds && (u = V, G = T, Il(E, F, u, G, g, h, k, l, q) && (u = Jl(g, h, q, s, e), u < s && (s = u, n = !0)))
}
}
g = c - a;
h = d - b;
b = Math.sqrt(g * g + h * h);
0 !== b && (g /= b, h /= b);
e.x -= g * m;
e.y -= h * m;
t.B(q)
} else t.m("Invalid Geometry type");
if (!n)return!1;
this.transform.Ra(e);
return!0
};
function Jl(a, b, c, d, e) {
a = c.x - a;
b = c.y - b;
b = a * a + b * b;
return b < d ? (e.x = c.x, e.y = c.y, b) : d
}
function Il(a, b, c, d, e, g, h, k, l) {
var m = !1, n = (e - h) * (b - d) - (g - k) * (a - c);
if (0 === n)return!1;
l.x = ((e * k - g * h) * (a - c) - (e - h) * (a * d - b * c)) / n;
l.y = ((e * k - g * h) * (b - d) - (g - k) * (a * d - b * c)) / n;
(a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || D.Fa(l.y, e)) && (l.y < a || D.Fa(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || D.Fa(l.x, e)) && (l.x < a || D.Fa(l.x, a)) && (m = !0));
return m
}
Y.prototype.containedInRect = Y.prototype.nm = function (a, b) {
if (void 0 === b)return a.Jj(this.ua);
var c = this.La;
null === c && (lh(this, Infinity, Infinity), c = this.La);
var c = c.Hb, d = this.bb / 2, e = !1, g = t.M();
g.q(c.x - d, c.y - d);
a.Da(b.Ra(g)) && (g.q(c.x - d, c.bottom + d), a.Da(b.Ra(g)) && (g.q(c.right + d, c.bottom + d), a.Da(b.Ra(g)) && (g.q(c.right + d, c.y - d), a.Da(b.Ra(g)) && (e = !0))));
t.B(g);
return e
};
Y.prototype.intersectsRect = Y.prototype.Cf = function (a, b) {
if (this.nm(a, b) || void 0 === b && (b = this.transform, a.Jj(this.ua)))return!0;
var c = t.Ng();
c.set(b);
c.Qz();
var d = a.left, e = a.right, g = a.top, h = a.bottom, k = t.M();
k.q(d, g);
c.Ra(k);
if (this.Ij(k, !0))return t.B(k), !0;
k.q(e, g);
c.Ra(k);
if (this.Ij(k, !0))return t.B(k), !0;
k.q(d, h);
c.Ra(k);
if (this.Ij(k, !0))return t.B(k), !0;
k.q(e, h);
c.Ra(k);
if (this.Ij(k, !0))return t.B(k), !0;
var l = t.M(), m = t.M();
c.set(b);
c.vE(this.transform);
c.Qz();
l.x = e;
l.y = g;
l.transform(c);
k.x = d;
k.y =
g;
k.transform(c);
var n = !1;
Kl(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), Kl(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), Kl(this, k, l, m) ? n = !0 : (k.x = d, k.y = g, k.transform(c), Kl(this, k, l, m) && (n = !0))));
t.B(k);
t.Oe(c);
t.B(l);
t.B(m);
return n
};
function Kl(a, b, c, d) {
if (!a.Go(b, c, d))return!1;
a = b.x;
b = b.y;
var e = c.x, g = c.y;
c = d.x;
d = d.y;
if (a === e) {
var h;
b < g ? (h = b, a = g) : (h = g, a = b);
return d >= h && d <= a
}
a < e ? (h = a, a = e) : h = e;
return c >= h && c <= a
}
Y.prototype.tD = function (a, b, c) {
function d(a, b) {
for (var c = a.length, d = 0; d < c; d++) {
var g = a[d];
if (b.os(g[0], g[1]) > e)return!0
}
return!1
}
if (c && null !== this.fill && this.Ij(a, !0))return!0;
var e = a.Nj(b);
b = e;
1.5 < this.bb && (e = this.bb / 2 + Math.sqrt(e), e *= e);
var g = this.La;
null === g && (lh(this, Infinity, Infinity), g = this.La);
if (!c) {
var h = g.Hb, k = h.x, l = h.y, m = h.x + h.width, h = h.y + h.height;
if (Qa(a.x, a.y, k, l) <= e && Qa(a.x, a.y, m, l) <= e && Qa(a.x, a.y, k, h) <= e && Qa(a.x, a.y, m, h) <= e)return!0
}
k = g.Yb;
l = g.ic;
m = g.cd;
h = g.pd;
if (g.type === Gc) {
if (c =
Pa(a.x, a.y, k, l, m, h), g = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= g ? e : b))return!0
} else {
if (g.type === Hc)return b = !1, c && (b = Pa(a.x, a.y, k, l, k, h) <= e || Pa(a.x, a.y, k, l, m, l) <= e || Pa(a.x, a.y, m, l, m, h) <= e || Pa(a.x, a.y, k, h, m, h) <= e), b;
if (g.type === Ic) {
b = a.x - (k + m) / 2;
var g = a.y - (l + h) / 2, n = Math.abs(m - k) / 2, p = Math.abs(h - l) / 2;
if (0 === n || 0 === p)return c = Pa(a.x, a.y, k, l, m, h), c <= e ? !0 : !1;
if (c) {
if (a = D.nH(n, p, b, g), a * a <= e)return!0
} else return Qa(b, g, -n, 0) >= e || Qa(b, g, 0, -p) >= e || Qa(b, g, 0, p) >= e || Qa(b, g, n, 0) >= e ? !1 :
!0
} else if (g.type === Bc) {
h = g.Hb;
k = h.x;
l = h.y;
m = h.x + h.width;
h = h.y + h.height;
if (a.x > m && a.x < k && a.y > h && a.y < l && Pa(a.x, a.y, k, l, k, h) > e && Pa(a.x, a.y, k, l, m, l) > e && Pa(a.x, a.y, m, h, k, h) > e && Pa(a.x, a.y, m, h, m, l) > e)return!1;
b = Math.sqrt(e);
if (c) {
if (null === this.fill ? ld(g, a.x, a.y, b) : g.Da(a, b, !0))return!0
} else {
c = g.ob;
for (b = 0; b < c.count; b++) {
k = c.p[b];
n = k.la;
p = k.ma;
if (a.os(n, p) > e)return!1;
l = k.Ca.p;
m = l.length;
for (h = 0; h < m; h++) {
var q = l[h];
switch (q.type) {
case Yc:
case Kc:
n = q.D;
p = q.F;
if (a.os(n, p) > e)return!1;
break;
case Zc:
g = t.yb();
D.te(n, p, q.pb, q.Gb, q.je, q.ke, q.D, q.F, 0.8, g);
n = d(g, a);
t.xa(g);
if (n)return!1;
n = q.D;
p = q.F;
if (a.os(n, p) > e)return!1;
break;
case $c:
g = t.yb();
D.hp(n, p, q.pb, q.Gb, q.D, q.F, 0.8, g);
n = d(g, a);
t.xa(g);
if (n)return!1;
n = q.D;
p = q.F;
if (a.os(n, p) > e)return!1;
break;
case ad:
case bd:
var q = q.type === ad ? cd(q, k) : id(q, k, n, p), r = q.length, s = null, g = t.yb();
for (b = 0; b < r; b++)if (s = q[b], g.length = 0, D.te(s.x1, s.y1, s.x2, s.y2, s.Rd, s.Sd, s.Jb, s.Kb, 0.8, g), d(g, a))return t.xa(g), !1;
t.xa(g);
null !== s && (n = s.Jb, p = s.Kb);
break;
default:
t.m("Unknown Segment type: " +
q.type)
}
}
}
return!0
}
}
}
return!1
};
t.g(Y, "geometry", Y.prototype.Wc);
t.defineProperty(Y, {Wc: "geometry"}, function () {
return this.ok ? this.ok : this.La
}, function (a) {
var b = this.La;
if (b !== a) {
null !== a ? (f && t.j(a, I, Y, "geometry"), this.ok = this.La = a.freeze()) : this.ok = this.La = null;
var c = this.S;
c && (c.kj = NaN);
this.Bg = !0;
this.Y();
this.i("geometry", b, a)
}
});
t.g(Y, "geometryString", Y.prototype.CD);
t.defineProperty(Y, {CD: "geometryString"}, function () {
return this.Wc.toString()
}, function (a) {
var b = Nc(a);
a = b.normalize();
this.Wc = b;
var b = t.M(), c = this.position;
c.P() ? b.q(c.x - a.x, c.y - a.y) : b.q(-a.x, -a.y);
this.position = b;
t.B(b)
});
t.defineProperty(Y, {Rz: "isGeometryPositioned"}, function () {
return this.vq
}, function (a) {
f && t.k(a, "boolean", Y, "isGeometryPositioned");
var b = this.vq;
b !== a && (this.vq = a, this.Y(), this.i("isGeometryPositioned", b, a))
});
Y.prototype.Df = function () {
this.Bg ? this.ok = null : this.La = null;
this.Y()
};
t.g(Y, "fill", Y.prototype.fill);
t.defineProperty(Y, {fill: "fill"}, function () {
return this.Cc
}, function (a) {
var b = this.Cc;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.Cc = a, this.ra(), this.i("fill", b, a))
});
t.g(Y, "stroke", Y.prototype.stroke);
t.defineProperty(Y, {stroke: "stroke"}, function () {
return this.tb
}, function (a) {
var b = this.tb;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.tb = a, this.ra(), this.i("stroke", b, a))
});
t.g(Y, "strokeWidth", Y.prototype.bb);
t.defineProperty(Y, {bb: "strokeWidth"}, function () {
return this.Cg
}, function (a) {
var b = this.Cg;
if (b !== a)if (f && t.o(a, Y, "strokeWidth"), 0 <= a) {
this.Cg = a;
this.Y();
var c = this.S;
c && (c.kj = NaN);
this.i("strokeWidth", b, a)
} else t.ia(a, "val >= 0", Y, "strokeWidth:val")
});
t.g(Y, "strokeCap", Y.prototype.mF);
t.defineProperty(Y, {mF: "strokeCap"}, function () {
return this.Un
}, function (a) {
var b = this.Un;
b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? t.ia(a, '"butt", "round", or "square"', Y, "strokeCap") : (this.Un = a, this.ra(), this.i("strokeCap", b, a)))
});
t.g(Y, "strokeJoin", Y.prototype.DI);
t.defineProperty(Y, {DI: "strokeJoin"}, function () {
return this.Vn
}, function (a) {
var b = this.Vn;
b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? t.ia(a, '"miter", "bevel", or "round"', Y, "strokeJoin") : (this.Vn = a, this.ra(), this.i("strokeJoin", b, a)))
});
t.g(Y, "strokeMiterLimit", Y.prototype.EI);
t.defineProperty(Y, {EI: "strokeMiterLimit"}, function () {
return this.bm
}, function (a) {
var b = this.bm;
if (b !== a)if (f && t.o(a, Y, "strokeMiterLimit"), 0 < a) {
this.bm = a;
this.ra();
var c = this.S;
c && (c.kj = NaN);
this.i("strokeMiterLimit", b, a)
} else t.ia(a, "val > 0", Y, "strokeWidth:val")
});
t.g(Y, "strokeDashArray", Y.prototype.zw);
t.defineProperty(Y, {zw: "strokeDashArray"}, function () {
return this.am
}, function (a) {
var b = this.am;
if (b !== a) {
null === a || Array.isArray(a) || t.Nb(a, "Array", Y, "strokeDashArray:val");
if (null !== a)for (var c = a.length, d = 0; d < c; d++) {
var e = a[d];
("number" !== typeof e || isNaN(e) || 0 > e || !isFinite(e)) && t.m("strokeDashArray:val " + e + " is a negative number or not a real number.")
}
this.am = a;
this.ra();
this.i("strokeDashArray", b, a)
}
});
t.g(Y, "strokeDashOffset", Y.prototype.nF);
t.defineProperty(Y, {nF: "strokeDashOffset"}, function () {
return this.Sc
}, function (a) {
var b = this.Sc;
b !== a && (f && t.o(a, Y, "strokeDashOffset"), 0 <= a && (this.Sc = a, this.ra(), this.i("strokeDashOffset", b, a)))
});
t.g(Y, "figure", Y.prototype.Db);
t.defineProperty(Y, {Db: "figure"}, function () {
return this.on
}, function (a) {
var b = this.on;
if (b !== a) {
f && t.k(a, "string", Y, "figure");
var c = D.zi[a];
"function" === typeof c ? c = a : (c = D.zi[a.toLowerCase()]) || t.m("Unknown Shape.figure: " + a);
if (b !== c) {
if (a = this.S)a.kj = NaN;
this.on = c;
this.Bg = !1;
this.Df();
this.i("figure", b, c)
}
}
});
t.g(Y, "toArrow", Y.prototype.Nm);
t.defineProperty(Y, {Nm: "toArrow"}, function () {
return this.Xn
}, function (a) {
var b = this.Xn;
!0 === a ? a = "Standard" : !1 === a && (a = "None");
if (b !== a) {
f && t.k(a, "string", Y, "toArrow");
var c = D.yo(a);
c instanceof I ? c = a : (c = D.yo(a.toLowerCase())) || t.m("Unknown Shape.toArrow: " + a);
b !== c && (this.Xn = c, this.Bg = !1, this.Df(), Ll(this, c), this.i("toArrow", b, c))
}
});
t.g(Y, "fromArrow", Y.prototype.Qv);
t.defineProperty(Y, {Qv: "fromArrow"}, function () {
return this.qn
}, function (a) {
var b = this.qn;
!0 === a ? a = "Standard" : !1 === a && (a = "None");
if (b !== a) {
f && t.k(a, "string", Y, "fromArrow");
var c = D.yo(a);
c instanceof I ? c = a : (c = D.yo(a.toLowerCase())) || t.m("Unknown Shape.fromArrow: " + a);
b !== c && (this.qn = c, this.Bg = !1, this.Df(), Ll(this, c), this.i("fromArrow", b, c))
}
});
function Ll(a, b) {
var c = a.h;
if (null === c || !c.va.kb) {
a.ct = Ml;
c = Tb;
switch (b) {
case "halfarrowtop":
c = Pb;
break;
case "halftriangletop":
c = Pb;
break;
case "openrighttriangletop":
c = Pb;
break;
case "opentriangletop":
c = Pb
}
"None" !== a.Xn ? (a.of = -1, a.Dj = c) : "None" !== a.qn && (a.of = 0, a.Dj = new H(1 - c.x, c.y))
}
}
t.defineProperty(Y, {G: "spot1"}, function () {
return this.hi
}, function (a) {
t.j(a, H, Y, "spot1");
var b = this.hi;
b.K(a) || (this.hi = a = a.W(), this.Y(), this.i("spot1", b, a))
});
t.defineProperty(Y, {H: "spot2"}, function () {
return this.ii
}, function (a) {
t.j(a, H, Y, "spot2");
var b = this.ii;
b.K(a) || (this.ii = a = a.W(), this.Y(), this.i("spot2", b, a))
});
t.defineProperty(Y, {tc: "parameter1"}, function () {
return this.hr
}, function (a) {
var b = this.hr;
b !== a && (this.hr = a, this.Y(), this.i("parameter1", b, a))
});
t.defineProperty(Y, {Vs: "parameter2"}, function () {
return this.ir
}, function (a) {
var b = this.ir;
b !== a && (this.ir = a, this.Y(), this.i("parameter2", b, a))
});
t.A(Y, {Oa: "naturalBounds"}, function () {
if (null !== this.La)return this.Ec.assign(this.La.Hb), this.Ec;
var a = this.ya;
return new w(0, 0, a.width, a.height)
});
t.g(Y, "isRectangular", Y.prototype.PH);
t.defineProperty(Y, {PH: "isRectangular"}, function () {
return this.Aq
}, function (a) {
var b = this.Aq;
b !== a && (f && t.k(a, "boolean", Y, "isRectangular"), this.Aq = a, this.Y(), this.i("isRectangular", b, a))
});
t.g(Y, "pathObject", Y.prototype.kA);
t.defineProperty(Y, {kA: "pathObject"}, function () {
return this.kr
}, function (a) {
var b = this.kr;
b !== a && (f && t.j(a, Q, Y, "pathObject"), this.kr = a, this.ra(), this.i("pathObject", b, a))
});
t.g(Y, "geometryStretch", Y.prototype.Rv);
t.defineProperty(Y, {Rv: "geometryStretch"}, function () {
return this.qq
}, function (a) {
var b = this.qq;
b !== a && (t.nb(a, Q, Y, "geometryStretch"), this.qq = a, this.i("geometryStretch", b, a))
});
t.g(Y, "interval", Y.prototype.interval);
t.defineProperty(Y, {interval: "interval"}, function () {
return this.uq
}, function (a) {
var b = this.uq;
f && t.o(a, Y, "interval");
a = Math.floor(a);
b !== a && 0 <= a && (this.uq = a, this.h && qi(this.h), this.Y(), this.i("interval", b, a))
});
function la() {
Q.call(this);
this.$d = "";
this.tb = "black";
this.Zg = "13px sans-serif";
this.Dd = "start";
this.xq = !0;
this.Fl = this.Gl = !1;
this.Mn = Nl;
this.cm = Ol;
this.ou = this.Jq = 0;
this.pn = this.my = this.ny = null;
this.Fn = {};
this.jq = !1;
this.Ze = this.xj = this.Rr = null
}
t.ea("TextBlock", la);
t.Ja(la, Q);
la.prototype.cloneProtected = function (a) {
Q.prototype.cloneProtected.call(this, a);
a.$d = this.$d;
a.tb = this.tb;
a.Zg = this.Zg;
a.Dd = this.Dd;
a.xq = this.xq;
a.Gl = this.Gl;
a.Fl = this.Fl;
a.cm = this.cm;
a.Mn = this.Mn;
a.Jq = this.Jq;
a.ou = this.ou;
a.ny = this.ny;
a.my = this.my;
a.pn = this.pn;
a.Fn = this.Fn;
a.jq = this.jq;
a.Rr = this.Rr;
a.xj = this.xj;
a.Ze = this.Ze
};
la.prototype.toString = function () {
return 22 < this.$d.length ? 'TextBlock("' + this.$d.substring(0, 20) + '"...)' : 'TextBlock("' + this.$d + '")'
};
var Pl;
la.None = Pl = t.w(la, "None", 0);
var Ql;
la.WrapFit = Ql = t.w(la, "WrapFit", 1);
var Ol;
la.WrapDesiredSize = Ol = t.w(la, "WrapDesiredSize", 2);
var Nl;
la.OverflowClip = Nl = t.w(la, "OverflowClip", 0);
var Rl;
la.OverflowEllipsis = Rl = t.w(la, "OverflowEllipsis", 1);
la.prototype.Y = function () {
Q.prototype.Y.call(this);
this.my = this.ny = null
};
t.g(la, "font", la.prototype.font);
t.defineProperty(la, {font: "font"}, function () {
return this.Zg
}, function (a) {
var b = this.Zg;
b !== a && (f && t.k(a, "string", la, "font"), this.Zg = a, this.pn = null, this.Y(), this.i("font", b, a))
});
t.g(la, "text", la.prototype.text);
t.defineProperty(la, {text: "text"}, function () {
return this.$d
}, function (a) {
var b = this.$d;
a = null !== a && void 0 !== a ? a.toString() : "";
b !== a && (this.$d = a, this.Y(), this.i("text", b, a))
});
t.g(la, "textAlign", la.prototype.textAlign);
t.defineProperty(la, {textAlign: "textAlign"}, function () {
return this.Dd
}, function (a) {
var b = this.Dd;
b !== a && (f && t.k(a, "string", la, "textAlign"), "start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Dd = a, this.ra(), this.i("textAlign", b, a)) : t.ia(a, '"start", "end", "left", "right", or "center"', la, "textAlign"))
});
t.A(la, {Oa: "naturalBounds"}, function () {
if (!this.Ec.P()) {
var a = Sl(this, this.$d, {}, 999999).width, b = Tl(this, a, {}), c = this.ya;
isNaN(c.width) || (a = c.width);
isNaN(c.height) || (b = c.height);
Ua(this.Ec, a, b)
}
return this.Ec
});
t.g(la, "isMultiline", la.prototype.$v);
t.defineProperty(la, {$v: "isMultiline"}, function () {
return this.xq
}, function (a) {
var b = this.xq;
b !== a && (f && t.k(a, "boolean", la, "isMultiline"), this.xq = a, this.Y(), this.i("isMultiline", b, a))
});
t.g(la, "isUnderline", la.prototype.SH);
t.defineProperty(la, {SH: "isUnderline"}, function () {
return this.Gl
}, function (a) {
var b = this.Gl;
b !== a && (f && t.k(a, "boolean", la, "isUnderline"), this.Gl = a, this.ra(), this.i("isUnderline", b, a))
});
t.g(la, "isStrikethrough", la.prototype.QH);
t.defineProperty(la, {QH: "isStrikethrough"}, function () {
return this.Fl
}, function (a) {
var b = this.Fl;
b !== a && (f && t.k(a, "boolean", la, "isStrikethrough"), this.Fl = a, this.ra(), this.i("isStrikethrough", b, a))
});
t.g(la, "wrap", la.prototype.SA);
t.defineProperty(la, {SA: "wrap"}, function () {
return this.cm
}, function (a) {
var b = this.cm;
b !== a && (f && t.nb(a, la, la, "wrap"), this.cm = a, this.Y(), this.i("wrap", b, a))
});
t.g(la, "overflow", la.prototype.overflow);
t.defineProperty(la, {overflow: "overflow"}, function () {
return this.Mn
}, function (a) {
var b = this.Mn;
b !== a && (f && t.nb(a, la, la, "overflow"), this.Mn = a, this.Y(), this.i("overflow", b, a))
});
t.g(la, "stroke", la.prototype.stroke);
t.defineProperty(la, {stroke: "stroke"}, function () {
return this.tb
}, function (a) {
var b = this.tb;
b !== a && (null === a || "string" === typeof a || a instanceof Nd) && (a instanceof Nd && a.freeze(), this.tb = a, this.ra(), this.i("stroke", b, a))
});
t.A(la, {fE: "lineCount"}, function () {
return this.Jq
});
t.g(la, "editable", la.prototype.Hv);
t.defineProperty(la, {Hv: "editable"}, function () {
return this.jq
}, function (a) {
var b = this.jq;
b !== a && (f && t.k(a, "boolean", la, "editable"), this.jq = a, this.i("editable", b, a))
});
t.g(la, "textEditor", la.prototype.LA);
t.defineProperty(la, {LA: "textEditor"}, function () {
return this.Rr
}, function (a) {
var b = this.Rr;
b !== a && (a instanceof HTMLElement || t.m("textEditor must be an HTMLElement"), this.Rr = a, this.i("textEditor", b, a))
});
t.g(la, "errorFunction", la.prototype.ps);
t.defineProperty(la, {ps: "errorFunction"}, function () {
return this.Ze
}, function (a) {
var b = this.Ze;
b !== a && (null !== a && t.k(a, "function", la, "errorFunction"), this.Ze = a, this.i("errorFunction", b, a))
});
function ck(a, b) {
var c = a.Zg;
null !== c && b.rt !== c && (b.font = c, b.rt = c)
}
la.prototype.Vk = function (a, b) {
if (null !== this.tb && 0 !== this.$d.length && null !== this.Zg) {
var c = this.Oa.width, d = mh(this);
a.textAlign = this.Dd;
dk(this, a, this.tb, !0);
(this.Gl || this.Fl) && dk(this, a, this.tb, !1);
var e = this.Fn, g = 0, h = !1, k = t.cc(0, 0);
this.ae.Ra(k);
var l = t.cc(0, d);
this.ae.Ra(l);
var m = k.Nj(l);
t.B(k);
t.B(l);
k = b.scale;
8 > m * k * k && (h = !0);
m = e.ni.length;
for (k = 0; k < m; k++) {
var n = e.ni[k], l = e.gm[k];
n > c && (n = c);
var p = l, l = a, q = g, r = c, s = d, u = 0;
h ? ("start" === this.Dd || "left" === this.Dd ? u = 0 : "end" === this.Dd || "right" === this.Dd ?
u = r - n : "center" === this.Dd ? u = (r - n) / 2 : t.m("textAlign must be start, end, left, right, or center"), l.fillRect(0 + u, q + 0.25 * s, n, 1)) : ("start" === this.Dd || "left" === this.Dd ? u = 0 : "end" === this.Dd || "right" === this.Dd ? u = r : "center" === this.Dd ? u = r / 2 : t.m("textAlign must be start, end, left, right, or center"), l.fillText(p, 0 + u, q + s - 0.25 * s), p = s / 20 | 0, this.Gl && ("end" === this.Dd || "right" === this.Dd ? u -= n : "center" === this.Dd && (u -= n / 2), l.beginPath(), l.lineWidth = p, l.moveTo(0 + u, q + s - 0.2 * s), l.lineTo(0 + u + n, q + s - 0.2 * s), l.stroke()), this.Fl &&
(l.beginPath(), l.lineWidth = p, q = q + s - s / 2.2 | 0, 0 !== p % 2 && (q += 0.5), l.moveTo(0, q), l.lineTo(0 + n, q), l.stroke()));
g += d
}
}
};
la.prototype.Js = function (a, b, c, d) {
var e = {}, g = 0, h = 0;
if (isNaN(this.ya.width)) {
g = this.$d;
if (0 === g.length)g = 0; else if (this.$v) {
for (var k = h = 0, l = !1, m = {Fh: 0}; !l;) {
var n = Ul(g, k, m);
-1 === n && (n = g.length, l = !0);
k = Vl(g.substr(k, n - k).replace(/^\s+|\s+$/g, ""), this.Zg);
k > h && (h = k);
k = m.Fh
}
g = h
} else h = Ul(g, 0, {}), 0 <= h && (g = g.substr(0, h)), g = k = Vl(g, this.Zg);
g = Math.min(g, a / this.scale);
g = Math.max(8, g)
} else g = this.ya.width;
this.fa && (g = Math.min(g, this.fa.Be.width), g = Math.max(g, this.fa.Te.width));
h = Tl(this, g, e);
h = isNaN(this.ya.height) ?
Math.min(h, b / this.scale) : this.ya.height;
if (this.SA === Ql || isNaN(this.ya.width))g = e.Gi, isNaN(this.ya.width) && (g = Math.max(8, g));
g = Math.max(c, g);
h = Math.max(d, h);
Ua(this.Ec, g, h);
Nj(this, 0, 0, g, h);
this.Fn = e
};
la.prototype.Hj = function (a, b, c, d) {
Uj(this, a, b, c, d)
};
function Sl(a, b, c, d) {
b = b.replace(/^\s+|\s+$/g, "");
void 0 === c.Gi && (c.Gi = 0);
void 0 === c.ni && (c.ni = []);
void 0 === c.gm && (c.gm = []);
var e = 0, g, h, k = a.Zg;
a.Mn === Rl ? (t.rp !== k && (t.qp.font = k, t.rp = k), g = 0, void 0 !== t.Fz[k] && 5E3 > t.wD ? g = t.Fz[k] : (g = t.qp.measureText(t.rD).width, t.Fz[k] = g, t.wD++)) : g = 0;
var l = g;
if (a.cm === Pl) {
c.Fh = 1;
g = Vl(b, k);
if (0 === l || g <= d)return c.Gi = g, c.ni.push(c.Gi), c.gm.push(b), new da(g, mh(a));
var m = Wl(b);
b = b.substr(m.length);
h = Wl(b);
for (g = Vl(m + h, k); 0 < h.length && g <= d;)m += h, b = b.substr(h.length), h = Wl(b),
g = Vl((m + h).replace(/^\s+|\s+$/g, ""), k);
m += h.replace(/^\s+|\s+$/g, "");
for (d = Math.max(1, d - l); Vl(m, k) > d && 1 < m.length;)m = m.substr(0, m.length - 1);
m += t.rD;
h = Vl(m, k);
c.ni.push(h);
c.Gi = h;
c.gm.push(m);
return new da(h, mh(a))
}
l = 0;
0 === b.length && (l = 1, c.ni.push(0), c.gm.push(b));
for (; 0 < b.length;) {
m = Wl(b);
for (b = b.substr(m.length); Vl(m, k) > d;) {
var n = 1;
g = Vl(m.substr(0, n), k);
for (h = 0; g <= d;)n++, h = g, g = Vl(m.substr(0, n), k);
1 === n ? (c.ni[l] = g, e = Math.max(e, g)) : (c.ni[l] = h, e = Math.max(e, h));
n--;
1 > n && (n = 1);
c.gm[l] = m.substr(0, n);
l++;
m = m.substr(n)
}
h = Wl(b);
for (g = Vl(m + h, k); 0 < h.length && g <= d;)m += h, b = b.substr(h.length), h = Wl(b), g = Vl((m + h).replace(/^\s+|\s+$/g, ""), k);
m = m.replace(/^\s+|\s+$/g, "");
"" !== m && (0 === h.length ? (c.ni.push(g), e = Math.max(e, g)) : (h = Vl(m, k), c.ni.push(h), e = Math.max(e, h)), c.gm.push(m), l++)
}
c.Fh = l;
c.Gi = Math.max(c.Gi, e);
return new da(c.Gi, mh(a) * c.Fh)
}
function Wl(a) {
for (var b = a.length, c = 0; c < b && " " !== a.charAt(c);)c++;
for (; c < b && " " === a.charAt(c);)c++;
return c >= b ? a : a.substr(0, c)
}
function Vl(a, b) {
t.rp !== b && (t.qp.font = b, t.rp = b);
return t.qp.measureText(a).width
}
function mh(a) {
if (null !== a.pn)return a.pn;
var b = a.Zg;
t.rp !== b && (t.qp.font = b, t.rp = b);
var c = 0;
void 0 !== t.Gz[b] && 5E3 > t.xD ? c = t.Gz[b] : (c = 1.3 * t.qp.measureText("M").width, t.Gz[b] = c, t.xD++);
return a.pn = c
}
function Ul(a, b, c) {
void 0 === c.Fh && (c.Fh = 0);
var d = a.indexOf("\r", b);
-1 === d && (d = a.indexOf("\n", b));
0 <= d && (c.Fh = "\r" === a[d] && d + 1 < a.length && "\n" === a[d + 1] ? d + 2 : d + 1);
return d
}
function Tl(a, b, c) {
var d = a.$d, e = mh(a);
if (0 === d.length)return c.Gi = 0, a.Jq = 1, e;
if (!a.$v) {
var g = Ul(d, 0, {});
0 <= g && (d = d.substr(0, g))
}
for (var h = g = 0, k = 0, l = -1, m = {Fh: 0}, n = !1; !n;)l = Ul(d, k, m), -1 === l && (l = d.length, n = !0), k <= l && (k = d.substr(k, l - k), a.cm !== Pl ? (c.Fh = 0, k = Sl(a, k, c, b), g += k.height, h += c.Fh) : (Sl(a, k, c, b), g += e, h++)), k = m.Fh;
a.Jq = h;
return a.ou = g
}
t.g(la, "textValidation", la.prototype.lt);
t.defineProperty(la, {lt: "textValidation"}, function () {
return this.xj
}, function (a) {
var b = this.xj;
b !== a && (null !== a && t.k(a, "function", la, "textValidation"), this.xj = a, this.i("textValidation", b, a))
});
function Ck() {
Q.call(this);
this.Lf = null;
this.Lr = "";
this.wj = (new w(NaN, NaN, NaN, NaN)).freeze();
this.sn = Fc;
this.Pr = this.Ze = null;
this.gu = this.Gn = !1
}
t.ea("Picture", Ck);
t.Ja(Ck, Q);
Ck.cacheFlush = function () {
t.Nz = {};
t.Oz = 0
};
Ck.prototype.cloneProtected = function (a) {
Q.prototype.cloneProtected.call(this, a);
a.element = this.Lf;
a.Lr = this.Lr;
a.wj.assign(this.wj);
a.sn = this.sn;
a.Ze = this.Ze
};
Ck.prototype.toString = function () {
return"Picture(" + this.source + ")#" + t.jc(this)
};
t.g(Ck, "element", Ck.prototype.element);
t.defineProperty(Ck, {element: "element"}, function () {
return this.Lf
}, function (a) {
var b = this.Lf;
if (b !== a) {
a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || t.m("Picture.element must be an instance of Image, Canvas, or Video.");
var c = this;
a instanceof HTMLCanvasElement ? this.gu = !0 : (this.gu = !1, a.onerror = function (a) {
null !== c.Ze && c.Ze(c, a)
});
this.Lf = a;
!0 === a.complete || void 0 === a.complete ? (this.Gn = !0, this.ya.P() || (Rj(this, !1), this.Y())) : (t.PA.push(this), null === t.nw &&
(t.nw = setInterval(function () {
for (var a = [], b = t.PA, c = b.length, h = 0; h < c; h++) {
var k = b[h], l;
l = k;
var m = l.Lf;
if (m)if (m.complete) {
l.Gn = !0;
l.ya.P() || (Rj(l, !1), l.Y());
if (l.h)l.ya.P() || l.h.vc(), l.h.ra(); else {
l = t.nD;
var n = l.length;
if (0 === n)for (var n = document.getElementsByTagName("canvas"), p = n.length, m = 0; m < p; m++) {
var q = n[m];
q.parentElement && q.parentElement.ba && l.push(q.parentElement.ba)
}
n = l.length;
for (m = 0; m < n; m++)l[m].ra()
}
l = !0
} else l = !1; else l = !0;
l || a.push(k)
}
0 === a.length && (clearInterval(t.nw), t.nw = null);
t.PA =
a
}, 200)));
this.i("element", b, a);
this.ra()
}
});
t.g(Ck, "source", Ck.prototype.source);
t.defineProperty(Ck, {source: "source"}, function () {
return this.Lr
}, function (a) {
var b = this.Lr;
if (b !== a) {
t.k(a, "string", Ck, "source");
this.Lr = a;
var c = t.Nz;
if (void 0 !== c[a])this.element = c[a]; else {
10 < t.Oz && (Ck.cacheFlush(), c = t.Nz);
var d = document.createElement("img");
d.src = a;
c[a] = d;
t.Oz++;
d instanceof HTMLImageElement && (this.element = d)
}
this.ra();
this.i("source", b, a)
}
});
t.g(Ck, "sourceRect", Ck.prototype.Bh);
t.defineProperty(Ck, {Bh: "sourceRect"}, function () {
return this.wj
}, function (a) {
var b = this.wj;
b.K(a) || (t.j(a, w, Ck, "sourceRect"), this.wj = a = a.W(), this.ra(), this.i("sourceRect", b, a))
});
t.g(Ck, "imageStretch", Ck.prototype.GH);
t.defineProperty(Ck, {GH: "imageStretch"}, function () {
return this.sn
}, function (a) {
var b = this.sn;
b !== a && (t.nb(a, Q, Ck, "imageStretch"), this.sn = a, this.ra(), this.i("imageStretch", b, a))
});
t.g(Ck, "errorFunction", Ck.prototype.ps);
t.defineProperty(Ck, {ps: "errorFunction"}, function () {
return this.Ze
}, function (a) {
var b = this.Ze;
if (b !== a) {
null !== a && t.k(a, "function", Ck, "errorFunction");
this.Ze = a;
if (this.Lf) {
var c = this;
this.Lf.onerror = function (a) {
null !== c.Ze && c.Ze(c, a)
}
}
this.i("errorFunction", b, a)
}
});
Ck.prototype.Vk = function (a, b) {
if (!b.ln) {
if (null === this.Pr)if (null === this.Lf)this.Pr = !1; else {
var c = document.createElement("canvas").getContext("2d");
0 !== this.Lf.width && 0 !== this.Lf.height && c.drawImage(this.Lf, 0, 0);
try {
c.getImageData(0, 0, 1, 1), this.Pr = !1
} catch (d) {
this.Pr = !0
}
}
if (this.Pr)return
}
c = this.Lf;
if (null !== c) {
var e = c.src;
null !== e && "" !== e || t.m("Element has no source attribute: " + c);
var e = this.Oa, g = 0, h = 0, k = this.gu, l = k ? +c.width : c.naturalWidth, k = k ? +c.height : c.naturalHeight;
if (0 !== l && 0 !== k) {
void 0 ===
l && c.videoWidth && (l = c.videoWidth || e.width);
void 0 === k && c.videoHeight && (k = c.videoHeight || e.height);
this.Bh.P() && (g = this.wj.x, h = this.wj.y, l = this.wj.width, k = this.wj.height);
var m = l, n = k, p = this.sn;
switch (p) {
case Pg:
if (this.Bh.P())break;
g += Math.max((m - e.width) / 2, 0);
h += Math.max((n - e.height) / 2, 0);
l = Math.min(e.width, m);
k = Math.min(e.height, n);
break;
case Fc:
m = e.width;
n = e.height;
break;
case Rg:
case Sg:
p === Rg ? (p = Math.min(e.height / n, e.width / m), m *= p, n *= p) : p === Sg && (p = Math.max(e.height / n, e.width / m), m *= p, n *= p, g += (m -
e.width) / 2, h += (n - e.height) / 2, l *= 1 / (m / e.width), k *= 1 / (n / e.height), m = e.width, n = e.height)
}
a.drawImage(c, g, h, l, k, Math.max((e.width - m) / 2, 0), Math.max((e.height - n) / 2, 0), Math.min(e.width, m), Math.min(e.height, n))
}
}
};
t.A(Ck, {Oa: "naturalBounds"}, function () {
return this.Ec
});
Ck.prototype.Js = function (a, b, c, d) {
var e = this.ya, g = Qj(this), h = this.Lf, k = this.gu;
if (k || !this.Gn && h && h.complete)this.Gn = !0;
null === h && (b = a = 0);
g !== Fc && g !== Ij ? isFinite(e.width) ? a = e.width : null !== h && !1 !== this.Gn && (a = this.Bh.P() ? this.Bh.width : k ? +h.width : h.naturalWidth) : (isFinite(a) || (a = this.Bh.P() ? this.Bh.width : k ? +h.width : h.naturalWidth), c = 0);
g !== Fc && g !== Hj ? isFinite(e.height) ? b = e.height : null !== h && !1 !== this.Gn && (b = this.Bh.P() ? this.Bh.height : k ? +h.height : h.naturalHeight) : (isFinite(b) || (b = this.Bh.P() ? this.Bh.height :
k ? +h.height : h.naturalHeight), d = 0);
e = this.Be;
g = this.Te;
c = Math.max(c, g.width);
d = Math.max(d, g.height);
a = Math.min(e.width, a);
b = Math.min(e.height, b);
a = Math.max(c, a);
b = Math.max(d, b);
null === h || h.complete || (isFinite(a) || (a = 0), isFinite(b) || (b = 0));
Ua(this.Ec, a, b);
Nj(this, 0, 0, a, b)
};
Ck.prototype.Hj = function (a, b, c, d) {
Uj(this, a, b, c, d)
};
function ha() {
this.s = new I;
this.Lb = null
}
aa = ha.prototype;
aa.reset = function () {
this.s = new I;
this.Lb = null
};
function J(a, b, c, d, e, g) {
null === a.s && t.m("StreamGeometryContext has been closed");
void 0 !== e && !0 === e ? (null === a.Lb && t.m("Need to call beginFigure first"), d = new O(Yc), d.D = b, d.F = c, a.Lb.Ca.add(d)) : (a.Lb = new Cc, a.Lb.la = b, a.Lb.ma = c, a.Lb.Lo = d, a.s.ob.add(a.Lb));
void 0 !== g && (a.Lb.xn = g)
}
function M(a) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Lb && t.m("Need to call beginFigure first");
var b = a.Lb.Ca.length;
0 < b && a.Lb.Ca.p[b - 1].close()
}
function Vc(a) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Lb && t.m("Need to call beginFigure first");
0 < a.Lb.Ca.length && (a.Lb.Lo = !0)
}
aa.Xa = function (a) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Lb && t.m("Need to call beginFigure first");
this.Lb.Ei = a
};
aa.moveTo = function (a, b, c) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Lb && t.m("Need to call beginFigure first");
var d = new O(Yc);
d.D = a;
d.F = b;
c && d.close();
this.Lb.Ca.add(d)
};
aa.lineTo = function (a, b, c) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Lb && t.m("Need to call beginFigure first");
var d = new O(Kc);
d.D = a;
d.F = b;
c && d.close();
this.Lb.Ca.add(d)
};
function K(a, b, c, d, e, g, h, k) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Lb && t.m("Need to call beginFigure first");
var l = new O(Zc);
l.pb = b;
l.Gb = c;
l.je = d;
l.ke = e;
l.D = g;
l.F = h;
k && l.close();
a.Lb.Ca.add(l)
}
function Tc(a, b, c, d, e) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Lb && t.m("Need to call beginFigure first");
var g = new O($c);
g.pb = b;
g.Gb = c;
g.D = d;
g.F = e;
a.Lb.Ca.add(g)
}
aa.arcTo = function (a, b, c, d, e, g, h) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Lb && t.m("Need to call beginFigure first");
var k = new O(ad);
k.kg = a;
k.Dh = b;
k.Aa = c;
k.Ma = d;
k.radiusX = e;
k.radiusY = g ? g : e;
h && k.close();
this.Lb.Ca.add(k)
};
function Uc(a, b, c, d, e, g, h, k) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Lb && t.m("Need to call beginFigure first");
b = new O(bd, h, k, b, c, d, e, g);
a.Lb.Ca.add(b)
}
D.makeGeometry = function (a, b, c) {
var d = a.ya, e = d.width, d = d.height;
void 0 !== b && !isNaN(b) && isFinite(b) && (e = b);
void 0 !== c && !isNaN(c) && isFinite(c) && (d = c);
isFinite(e) || (e = 100);
isFinite(d) || (d = 100);
var g = void 0;
if ("None" !== a.Nm)g = D.yo(a.Nm); else if ("None" !== a.Qv)g = D.yo(a.Qv); else {
var h = D.zi[a.Db];
"string" === typeof h && (h = D.zi[h]);
void 0 === h && t.m("Unknown Shape.figure: " + a.Db);
g = h(a, e, d);
g.Wd = new da(e, d)
}
void 0 === g && (h = D.zi.Rectangle) && (g = h(a, e, d));
g.fu = b;
g.eu = c;
return g
};
D.qi = function (a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
var s = 1 - l;
a = a * s + c * l;
b = b * s + d * l;
c = c * s + e * l;
d = d * s + g * l;
e = e * s + h * l;
g = g * s + k * l;
k = a * s + c * l;
h = b * s + d * l;
c = c * s + e * l;
d = d * s + g * l;
m.x = a;
m.y = b;
n.x = k;
n.y = h;
p.x = k * s + c * l;
p.y = h * s + d * l;
q.x = c;
q.y = d;
r.x = e;
r.y = g
};
D.ro = function (a) {
a = D.pm(a);
var b = t.yb();
b[0] = a[0];
for (var c = 1, d = 1; c < a.length; c += 2, d += 3)b[d] = a[c], b[d + 1] = a[c], b[d + 2] = a[c + 1];
t.xa(a);
return b
};
D.pm = function (a) {
var b = D.Sk(a), c = t.yb(), d = Math.floor(b.length / 2), e = b.length - 1;
a = 0 === a % 2 ? 2 : 1;
for (var g = 0; g < e; g++) {
var h = b[g], k = b[g + 1], l = b[(d + g - 1) % e], m = b[(d + g + a) % e];
c[2 * g] = h;
c[2 * g + 1] = D.Xk(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new v)
}
c[c.length] = c[0];
t.xa(b);
return c
};
D.Xk = function (a, b, c, d, e, g, h, k, l) {
c = a - c;
h = e - h;
0 === c || 0 === h ? 0 === c ? (h = (g - k) / h, k = a, e = h * k + (g - h * e)) : (d = (b - d) / c, k = e, e = d * k + (b - d * a)) : (d = (b - d) / c, h = (g - k) / h, a = b - d * a, k = (g - h * e - a) / (d - h), e = d * k + a);
l.q(k, e);
return l
};
D.Sk = function (a) {
for (var b = t.yb(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++)d = 2 * Math.PI / a * e + c, b[e] = new v(0.5 + 0.5 * Math.cos(d), 0.5 + 0.5 * Math.sin(d));
b.push(b[0]);
return b
};
D.VA = (new H(0.156, 0.156)).Ia();
D.WA = (new H(0.844, 0.844)).Ia();
D.zi = {None: "Rectangle", Rectangle: function (a, b, c) {
a = new I;
a.type = Hc;
a.la = 0;
a.ma = 0;
a.D = b;
a.F = c;
return a
}, Square: function (a, b, c) {
a = new I;
a.fc = Rg;
a.type = Hc;
a.la = 0;
a.ma = 0;
a.D = b;
a.F = c;
return a
}, Ellipse: function (a, b, c) {
a = new I;
a.type = Ic;
a.la = 0;
a.ma = 0;
a.D = b;
a.F = c;
a.G = D.VA;
a.H = D.WA;
return a
}, Circle: function (a, b, c) {
a = new I;
a.fc = Rg;
a.type = Ic;
a.la = 0;
a.ma = 0;
a.D = b;
a.F = c;
a.G = D.VA;
a.H = D.WA;
return a
}, Connector: "Ellipse", TriangleRight: function (a, b, c) {
a = new I;
var d = new Cc, e = new O;
e.D = b;
e.F = 0.5 * c;
d.Ca.add(e);
b = new O;
b.D = 0;
b.F = c;
d.Ca.add(b.close());
a.ob.add(d);
a.G = new H(0, 0.25);
a.H = new H(0.5, 0.75);
return a
}, TriangleDown: function (a, b, c) {
a = new I;
var d = new Cc, e = new O;
e.D = b;
e.F = 0;
d.Ca.add(e);
e = new O;
e.D = 0.5 * b;
e.F = c;
d.Ca.add(e.close());
a.ob.add(d);
a.G = new H(0.25, 0);
a.H = new H(0.75, 0.5);
return a
}, TriangleLeft: function (a, b, c) {
a = new I;
var d = new Cc;
d.la = b;
d.ma = c;
var e = new O;
e.D = 0;
e.F = 0.5 * c;
d.Ca.add(e);
c = new O;
c.D = b;
c.F = 0;
d.Ca.add(c.close());
a.ob.add(d);
a.G = new H(0.5, 0.25);
a.H = new H(1, 0.75);
return a
}, TriangleUp: function (a, b, c) {
a = new I;
var d = new Cc;
d.la = b;
d.ma = c;
var e = new O;
e.D = 0;
e.F = c;
d.Ca.add(e);
c = new O;
c.D = 0.5 * b;
c.F = 0;
d.Ca.add(c.close());
a.ob.add(d);
a.G = new H(0.25, 0.5);
a.H = new H(0.75, 1);
return a
}, Line1: function (a, b, c) {
a = new I;
a.type = Gc;
a.la = 0;
a.ma = 0;
a.D = b;
a.F = c;
return a
}, Line2: function (a, b, c) {
a = new I;
a.type = Gc;
a.la = b;
a.ma = 0;
a.D = 0;
a.F = c;
return a
}, MinusLine: "LineH", LineH: function (a, b, c) {
a = new I;
a.type = Gc;
a.la = 0;
a.ma = c / 2;
a.D = b;
a.F = c / 2;
return a
}, LineV: function (a, b, c) {
a = new I;
a.type = Gc;
a.la = b / 2;
a.ma = 0;
a.D = b / 2;
a.F = c;
return a
},
Curve1: function (a, b, c) {
var d = D.sa;
a = t.u();
J(a, 0, 0, !1);
K(a, d * b, 0, 1 * b, (1 - d) * c, b, c);
b = a.s;
t.v(a);
return b
}, Curve2: function (a, b, c) {
var d = D.sa;
a = t.u();
J(a, 0, 0, !1);
K(a, 0, d * c, (1 - d) * b, c, b, c);
b = a.s;
t.v(a);
return b
}, Curve3: function (a, b, c) {
var d = D.sa;
a = t.u();
J(a, 1 * b, 0, !1);
K(a, 1 * b, d * c, d * b, 1 * c, 0, 1 * c);
b = a.s;
t.v(a);
return b
}, Curve4: function (a, b, c) {
var d = D.sa;
a = t.u();
J(a, 1 * b, 0, !1);
K(a, (1 - d) * b, 0, 0, (1 - d) * c, 0, 1 * c);
b = a.s;
t.v(a);
return b
}, Alternative: "Triangle", Merge: "Triangle", Triangle: function (a, b, c) {
a = t.u();
J(a, 0.5 *
b, 0 * c, !0);
a.lineTo(0 * b, 1 * c);
a.lineTo(1 * b, 1 * c, !0);
b = a.s;
b.G = new H(0.25, 0.5);
b.H = new H(0.75, 1);
t.v(a);
return b
}, Decision: "Diamond", Diamond: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(0, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 * b, 0.5 * c, !0);
b = a.s;
b.G = new H(0.25, 0.25);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, Pentagon: function (a, b, c) {
var d = D.Sk(5);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 5 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.2, 0.22);
b.H = new H(0.8, 0.9);
t.v(a);
return b
}, DataTransmission: "Hexagon",
Hexagon: function (a, b, c) {
var d = D.Sk(6);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 6 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.07, 0.25);
b.H = new H(0.93, 0.75);
t.v(a);
return b
}, Heptagon: function (a, b, c) {
var d = D.Sk(7);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 7 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.2, 0.15);
b.H = new H(0.8, 0.85);
t.v(a);
return b
}, Octagon: function (a, b, c) {
var d = D.Sk(8);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 8 > e; e++)a.lineTo(d[e].x *
b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.15, 0.15);
b.H = new H(0.85, 0.85);
t.v(a);
return b
}, Nonagon: function (a, b, c) {
var d = D.Sk(9);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 9 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.17, 0.13);
b.H = new H(0.82, 0.82);
t.v(a);
return b
}, Decagon: function (a, b, c) {
var d = D.Sk(10);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 10 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.16, 0.16);
b.H = new H(0.84, 0.84);
t.v(a);
return b
}, Dodecagon: function (a, b, c) {
var d = D.Sk(12);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 12 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.16, 0.16);
b.H = new H(0.84, 0.84);
t.v(a);
return b
}, FivePointedStar: function (a, b, c) {
var d = D.pm(5);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 10 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.312, 0.383);
b.H = new H(0.693, 0.765);
t.v(a);
return b
}, SixPointedStar: function (a, b, c) {
var d = D.pm(6);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 12 > e; e++)a.lineTo(d[e].x *
b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.17, 0.251);
b.H = new H(0.833, 0.755);
t.v(a);
return b
}, SevenPointedStar: function (a, b, c) {
var d = D.pm(7);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 14 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.363, 0.361);
b.H = new H(0.641, 0.709);
t.v(a);
return b
}, EightPointedStar: function (a, b, c) {
var d = D.pm(8);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 16 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.252, 0.255);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, NinePointedStar: function (a, b, c) {
var d = D.pm(9);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 18 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.355, 0.361);
b.H = new H(0.645, 0.651);
t.v(a);
return b
}, TenPointedStar: function (a, b, c) {
var d = D.pm(10);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; 20 > e; e++)a.lineTo(d[e].x * b, d[e].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.281, 0.261);
b.H = new H(0.723, 0.748);
t.v(a);
return b
}, FivePointedBurst: function (a, b, c) {
var d = D.ro(5);
a = t.u();
J(a, d[0].x * b, d[0].y *
c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.312, 0.383);
b.H = new H(0.693, 0.765);
t.v(a);
return b
}, SixPointedBurst: function (a, b, c) {
var d = D.ro(6);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.17, 0.251);
b.H = new H(0.833, 0.755);
t.v(a);
return b
}, SevenPointedBurst: function (a, b, c) {
var d = D.ro(7);
a = t.u();
J(a, d[0].x *
b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.363, 0.361);
b.H = new H(0.641, 0.709);
t.v(a);
return b
}, EightPointedBurst: function (a, b, c) {
var d = D.ro(8);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.252, 0.255);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, NinePointedBurst: function (a, b, c) {
var d = D.ro(9);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.355, 0.361);
b.H = new H(0.645, 0.651);
t.v(a);
return b
}, TenPointedBurst: function (a, b, c) {
var d = D.ro(10);
a = t.u();
J(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)K(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
t.xa(d);
M(a);
b = a.s;
b.G = new H(0.281, 0.261);
b.H = new H(0.723, 0.748);
t.v(a);
return b
}, Cloud: function (a, b, c) {
a = t.u();
J(a, 0.08034461 *
b, 0.1944299 * c, !0);
K(a, -0.09239631 * b, 0.07836421 * c, 0.1406031 * b, -0.0542823 * c, 0.2008615 * b, 0.05349299 * c);
K(a, 0.2450511 * b, -0.00697547 * c, 0.3776197 * b, -0.01112067 * c, 0.4338609 * b, 0.074219 * c);
K(a, 0.4539471 * b, 0, 0.6066018 * b, -0.02526587 * c, 0.6558228 * b, 0.07004196 * c);
K(a, 0.6914277 * b, -0.01904177 * c, 0.8921095 * b, -0.01220843 * c, 0.8921095 * b, 0.08370865 * c);
K(a, 1.036446 * b, 0.04105738 * c, 1.020377 * b, 0.3022052 * c, 0.9147671 * b, 0.3194596 * c);
K(a, 1.04448 * b, 0.360238 * c, 0.992256 * b, 0.5219009 * c, 0.9082935 * b, 0.562044 * c);
K(a, 1.032337 * b, 0.5771781 *
c, 1.018411 * b, 0.8120651 * c, 0.9212406 * b, 0.8217117 * c);
K(a, 1.028411 * b, 0.9571472 * c, 0.8556702 * b, 1.052487 * c, 0.7592566 * b, 0.9156953 * c);
K(a, 0.7431877 * b, 1.009325 * c, 0.5624123 * b, 1.021761 * c, 0.5101666 * b, 0.9310455 * c);
K(a, 0.4820677 * b, 1.031761 * c, 0.3030112 * b, 1.002796 * c, 0.2609328 * b, 0.9344623 * c);
K(a, 0.2329994 * b, 1.01518 * c, 0.03213784 * b, 1.01518 * c, 0.08034461 * b, 0.870098 * c);
K(a, -0.02812061 * b, 0.9032597 * c, -0.01205169 * b, 0.6835638 * c, 0.06829292 * b, 0.6545475 * c);
K(a, -0.01812061 * b, 0.6089503 * c, -0.00606892 * b, 0.4555777 * c, 0.06427569 * b, 0.4265613 *
c);
K(a, -0.01606892 * b, 0.3892545 * c, -0.01205169 * b, 0.1944299 * c, 0.08034461 * b, 0.1944299 * c);
M(a);
b = a.s;
b.G = new H(0.1, 0.1);
b.H = new H(0.9, 0.9);
t.v(a);
return b
}, Gate: "Crescent", Crescent: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
K(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c);
K(a, 0.5 * b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
M(a);
b = a.s;
b.G = new H(0.511, 0.19);
b.H = new H(0.776, 0.76);
t.v(a);
return b
}, FramedRectangle: function (a, b, c) {
var d = t.u(), e = a ? a.tc : 0;
a = a ? a.Vs : 0;
0 === e && (e = 0.1);
0 === a && (a = 0.1);
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c,
!0);
J(d, e * b, a * c, !1, !0);
d.lineTo(e * b, (1 - a) * c);
d.lineTo((1 - e) * b, (1 - a) * c);
d.lineTo((1 - e) * b, a * c, !0);
b = d.s;
b.G = new H(e, a);
b.H = new H(1 - e, 1 - a);
t.v(d);
return b
}, Delay: "HalfEllipse", HalfEllipse: function (a, b, c) {
var d = D.sa;
a = t.u();
J(a, 0, 0, !0);
K(a, d * b, 0, 1 * b, (0.5 - d / 2) * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 + d / 2) * c, d * b, 1 * c, 0, 1 * c);
M(a);
b = a.s;
b.G = new H(0, 0.2);
b.H = new H(0.75, 0.8);
t.v(a);
return b
}, Heart: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 1 * c, !0);
K(a, 0.1 * b, 0.8 * c, 0, 0.5 * c, 0 * b, 0.3 * c);
K(a, 0 * b, 0, 0.45 * b, 0, 0.5 * b, 0.3 * c);
K(a, 0.55 * b, 0, 1 * b,
0, 1 * b, 0.3 * c);
K(a, b, 0.5 * c, 0.9 * b, 0.8 * c, 0.5 * b, 1 * c);
M(a);
b = a.s;
b.G = new H(0.15, 0.29);
b.H = new H(0.86, 0.68);
t.v(a);
return b
}, Spade: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(0.51 * b, 0.01 * c);
K(a, 0.6 * b, 0.2 * c, b, 0.25 * c, b, 0.5 * c);
K(a, b, 0.8 * c, 0.6 * b, 0.8 * c, 0.55 * b, 0.7 * c);
K(a, 0.5 * b, 0.75 * c, 0.55 * b, 0.95 * c, 0.75 * b, c);
a.lineTo(0.25 * b, c);
K(a, 0.45 * b, 0.95 * c, 0.5 * b, 0.75 * c, 0.45 * b, 0.7 * c);
K(a, 0.4 * b, 0.8 * c, 0, 0.8 * c, 0, 0.5 * c);
K(a, 0, 0.25 * c, 0.4 * b, 0.2 * c, 0.49 * b, 0.01 * c);
M(a);
b = a.s;
b.G = new H(0.19, 0.26);
b.H = new H(0.8, 0.68);
t.v(a);
return b
},
Club: function (a, b, c) {
a = t.u();
J(a, 0.4 * b, 0.6 * c, !0);
K(a, 0.5 * b, 0.75 * c, 0.45 * b, 0.95 * c, 0.15 * b, 1 * c);
a.lineTo(0.85 * b, c);
K(a, 0.55 * b, 0.95 * c, 0.5 * b, 0.75 * c, 0.6 * b, 0.6 * c);
var d = 0.2, e = 0.3, g = 0, h = 4 * (Math.SQRT2 - 1) / 3 * d;
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e + 0.05) * b, (0.5 - h + g - 0.02) * c, 0.65 * b, 0.36771243 *
c);
d = 0.2;
e = 0;
g = -0.3;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, 0.35 * b, 0.36771243 * c);
d = 0.2;
e = -0.3;
g = 0;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
K(a, (0.5 + d + e - 0.05) * b, (0.5 - h + g - 0.02) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d +
e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, 0.4 * b, 0.6 * c);
M(a);
b = a.s;
b.G = new H(0.06, 0.39);
b.H = new H(0.93, 0.58);
t.v(a);
return b
}, Ring: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
J(a, b, 0.5 * c, !0);
K(a, b, (0.5 - d) * c, (0.5 + d) * b, 0, 0.5 * b, 0);
K(a, (0.5 - d) * b, 0, 0, (0.5 - d) * c, 0, 0.5 * c);
K(a, 0, (0.5 + d) * c, (0.5 - d) * b, c, 0.5 * b, c);
K(a, (0.5 + d) * b, c, b, (0.5 + d) * c, b, 0.5 * c);
d = 4 * (Math.SQRT2 - 1) / 3 * 0.4;
J(a,
0.5 * b, 0.1 * c, !0, !0);
K(a, (0.5 + d) * b, 0.1 * c, 0.9 * b, (0.5 - d) * c, 0.9 * b, 0.5 * c);
K(a, 0.9 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 * c, 0.5 * b, 0.9 * c);
K(a, (0.5 - d) * b, 0.9 * c, 0.1 * b, (0.5 + d) * c, 0.1 * b, 0.5 * c);
K(a, 0.1 * b, (0.5 - d) * c, (0.5 - d) * b, 0.1 * c, 0.5 * b, 0.1 * c);
b = a.s;
b.G = new H(0.146, 0.146);
b.H = new H(0.853, 0.853);
b.fc = Rg;
t.v(a);
return b
}, YinYang: function (a, b, c) {
var d = 0.5;
a = t.u();
d = 0.5;
J(a, 0.5 * b, 0, !0);
a.arcTo(270, 180, 0.5 * b, 0.5 * b, 0.5 * b);
K(a, 1 * b, d * c, 0, d * c, d * b, 0, !0);
var d = 0.1, e = 0.25;
J(a, (0.5 + d) * b, e * c, !0, !0);
a.arcTo(0, -360, 0.5 * b, c * e, d * b);
M(a);
J(a, 0.5 *
b, 0, !1);
a.arcTo(270, -180, 0.5 * b, 0.5 * b, 0.5 * b);
a.Xa(!1);
e = 0.75;
J(a, (0.5 + d) * b, e * c, !0);
a.arcTo(0, 360, 0.5 * b, c * e, d * b);
M(a);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, Peace: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
J(a, b, 0.5 * c, !0);
K(a, b, (0.5 - d) * c, (0.5 + d) * b, 0, 0.5 * b, 0);
K(a, (0.5 - d) * b, 0, 0, (0.5 - d) * c, 0, 0.5 * c);
K(a, 0, (0.5 + d) * c, (0.5 - d) * b, c, 0.5 * b, c);
K(a, (0.5 + d) * b, c, b, (0.5 + d) * c, b, 0.5 * c);
d = 4 * (Math.SQRT2 - 1) / 3 * 0.4;
J(a, 0.5 * b, 0.1 * c, !0, !0);
K(a, (0.5 + d) * b, 0.1 * c, 0.9 * b, (0.5 - d) * c, 0.9 * b, 0.5 * c);
K(a, 0.9 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 *
c, 0.5 * b, 0.9 * c);
K(a, (0.5 - d) * b, 0.9 * c, 0.1 * b, (0.5 + d) * c, 0.1 * b, 0.5 * c);
K(a, 0.1 * b, (0.5 - d) * c, (0.5 - d) * b, 0.1 * c, 0.5 * b, 0.1 * c);
var d = 0.07, e = 0, g = -0.707 * 0.11, h = 4 * (Math.SQRT2 - 1) / 3 * d;
J(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
d = 0.07;
e = -0.707 * 0.11;
g = 0.707 * 0.11;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
J(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
d = 0.07;
e = 0.707 * 0.11;
g = 0.707 * 0.11;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
J(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h +
e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
b = a.s;
b.G = new H(0.146, 0.146);
b.H = new H(0.853, 0.853);
b.fc = Rg;
t.v(a);
return b
}, NotAllowed: function (a, b, c) {
var d = D.sa, e = 0.5 * d, g = 0.5;
a = t.u();
J(a, 0.5 * b, (0.5 - g) * c, !0);
K(a, (0.5 - e) * b, (0.5 - g) * c, (0.5 - g) * b, (0.5 - e) * c, (0.5 - g) * b, 0.5 * c);
K(a, (0.5 - g) * b,
(0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
K(a, (0.5 + g) * b, (0.5 - e) * c, (0.5 + e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
var g = 0.4, e = 0.4 * d, d = t.M(), h = t.M(), k = t.M(), l = t.M();
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.42, d, h, k, l, l);
var m = t.M(), n = t.M(), p = t.M();
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.58, l, l, p, m, n);
var q = t.M(), r = t.M(), s = t.M();
D.qi(0.5, 0.5 + g, 0.5 - e, 0.5 + g, 0.5 - g, 0.5 + e, 0.5 - g, 0.5, 0.42, q, r, s, l, l);
var u = t.M(), x = t.M(), E = t.M();
D.qi(0.5,
0.5 + g, 0.5 - e, 0.5 + g, 0.5 - g, 0.5 + e, 0.5 - g, 0.5, 0.58, l, l, E, u, x);
J(a, E.x * b, E.y * c, !0, !0);
K(a, u.x * b, u.y * c, x.x * b, x.y * c, (0.5 - g) * b, 0.5 * c);
K(a, (0.5 - g) * b, (0.5 - e) * c, (0.5 - e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
K(a, d.x * b, d.y * c, h.x * b, h.y * c, k.x * b, k.y * c);
a.lineTo(E.x * b, E.y * c);
M(a);
J(a, s.x * b, s.y * c, !0, !0);
a.lineTo(p.x * b, p.y * c);
K(a, m.x * b, m.y * c, n.x * b, n.y * c, (0.5 + g) * b, 0.5 * c);
K(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 + e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c);
M(a);
t.B(d);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
t.B(p);
t.B(q);
t.B(r);
t.B(s);
t.B(u);
t.B(x);
t.B(E);
b = a.s;
t.v(a);
b.fc = Rg;
return b
}, Fragile: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.25 * b, 0);
a.lineTo(0.2 * b, 0.15 * c);
a.lineTo(0.3 * b, 0.25 * c);
a.lineTo(0.29 * b, 0.33 * c);
a.lineTo(0.35 * b, 0.25 * c);
a.lineTo(0.3 * b, 0.15 * c);
a.lineTo(0.4 * b, 0);
a.lineTo(1 * b, 0);
K(a, 1 * b, 0.25 * c, 0.75 * b, 0.5 * c, 0.55 * b, 0.5 * c);
a.lineTo(0.55 * b, 0.9 * c);
a.lineTo(0.7 * b, 0.9 * c);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0.3 * b, 0.9 * c);
a.lineTo(0.45 * b, 0.9 * c);
a.lineTo(0.45 * b, 0.5 * c);
K(a, 0.25 * b, 0.5 * c, 0, 0.25 * c,
0, 0);
M(a);
b = a.s;
b.G = new H(0.25, 0);
b.H = new H(0.75, 0.4);
t.v(a);
return b
}, HourGlass: function (a, b, c) {
a = t.u();
J(a, 0.65 * b, 0.5 * c, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.35 * b, 0.5 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
M(a);
b = a.s;
t.v(a);
return b
}, Lightning: function (a, b, c) {
a = t.u();
J(a, 0 * b, 0.55 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(0.25 * b, 0.45 * c);
a.lineTo(0.9 * b, 0.48 * c);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.65 * b, 0.55 * c);
M(a);
b = a.s;
t.v(a);
return b
}, Parallelogram1: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d = t.u();
J(d, a * b, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo((1 - a) * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
b = d.s;
b.G = new H(a, 0);
b.H = new H(1 - a, 1);
t.v(d);
return b
}, Input: "Output", Output: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !0);
a.lineTo(0.1 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.9 * b, 1 * c);
M(a);
b = a.s;
b.G = new H(0.1, 0);
b.H = new H(0.9, 1);
t.v(a);
return b
}, Parallelogram2: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.25);
var d = t.u();
J(d, a * b, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo((1 - a) * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
b = d.s;
b.G = new H(a, 0);
b.H = new H(1 - a, 1);
t.v(d);
return b
},
ThickCross: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.25);
var d = t.u();
J(d, (0.5 - a / 2) * b, 0, !0);
d.lineTo((0.5 + a / 2) * b, 0);
d.lineTo((0.5 + a / 2) * b, (0.5 - a / 2) * c);
d.lineTo(1 * b, (0.5 - a / 2) * c);
d.lineTo(1 * b, (0.5 + a / 2) * c);
d.lineTo((0.5 + a / 2) * b, (0.5 + a / 2) * c);
d.lineTo((0.5 + a / 2) * b, 1 * c);
d.lineTo((0.5 - a / 2) * b, 1 * c);
d.lineTo((0.5 - a / 2) * b, (0.5 + a / 2) * c);
d.lineTo(0, (0.5 + a / 2) * c);
d.lineTo(0, (0.5 - a / 2) * c);
d.lineTo((0.5 - a / 2) * b, (0.5 - a / 2) * c);
M(d);
b = d.s;
b.G = new H(0.5 - a / 2, 0.5 - a / 2);
b.H = new H(0.5 + a / 2, 0.5 + a / 2);
t.v(d);
return b
}, ThickX: function (a, b, c) {
a = 0.25 / Math.SQRT2;
var d = t.u();
J(d, 0.3 * b, 0, !0);
d.lineTo(0.5 * b, 0.2 * c);
d.lineTo(0.7 * b, 0);
d.lineTo(1 * b, 0.3 * c);
d.lineTo(0.8 * b, 0.5 * c);
d.lineTo(1 * b, 0.7 * c);
d.lineTo(0.7 * b, 1 * c);
d.lineTo(0.5 * b, 0.8 * c);
d.lineTo(0.3 * b, 1 * c);
d.lineTo(0, 0.7 * c);
d.lineTo(0.2 * b, 0.5 * c);
d.lineTo(0, 0.3 * c);
M(d);
b = d.s;
b.G = new H(0.5 - a, 0.5 - a);
b.H = new H(0.5 + a, 0.5 + a);
t.v(d);
return b
}, ThinCross: function (a, b, c) {
var d = a ? a.tc : 0;
0 === d && (d = 0.1);
a = t.u();
J(a, (0.5 - d / 2) * b, 0, !0);
a.lineTo((0.5 + d / 2) * b, 0);
a.lineTo((0.5 + d / 2) * b, (0.5 - d / 2) * c);
a.lineTo(1 * b,
(0.5 - d / 2) * c);
a.lineTo(1 * b, (0.5 + d / 2) * c);
a.lineTo((0.5 + d / 2) * b, (0.5 + d / 2) * c);
a.lineTo((0.5 + d / 2) * b, 1 * c);
a.lineTo((0.5 - d / 2) * b, 1 * c);
a.lineTo((0.5 - d / 2) * b, (0.5 + d / 2) * c);
a.lineTo(0, (0.5 + d / 2) * c);
a.lineTo(0, (0.5 - d / 2) * c);
a.lineTo((0.5 - d / 2) * b, (0.5 - d / 2) * c);
M(a);
b = a.s;
t.v(a);
return b
}, ThinX: function (a, b, c) {
a = t.u();
J(a, 0.1 * b, 0, !0);
a.lineTo(0.5 * b, 0.4 * c);
a.lineTo(0.9 * b, 0);
a.lineTo(1 * b, 0.1 * c);
a.lineTo(0.6 * b, 0.5 * c);
a.lineTo(1 * b, 0.9 * c);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.5 * b, 0.6 * c);
a.lineTo(0.1 * b, 1 * c);
a.lineTo(0, 0.9 * c);
a.lineTo(0.4 *
b, 0.5 * c);
a.lineTo(0, 0.1 * c);
M(a);
return a.s
}, RightTriangle: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
M(a);
b = a.s;
b.G = new H(0, 0.5);
b.H = new H(0.5, 1);
t.v(a);
return b
}, RoundedIBeam: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(1 * b, 0);
K(a, 0.5 * b, 0.25 * c, 0.5 * b, 0.75 * c, 1 * b, 1 * c);
a.lineTo(0, 1 * c);
K(a, 0.5 * b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
M(a);
b = a.s;
t.v(a);
return b
}, RoundedRectangle: function (a, b, c) {
var d = a ? a.tc : 0;
0 >= d && (d = 5);
d = Math.min(d, b / 3);
d = Math.min(d, c / 3);
a = d * D.sa;
var e = t.u();
J(e, d, 0, !0);
e.lineTo(b - d, 0);
K(e, b - a, 0, b, a, b, d);
e.lineTo(b, c - d);
K(e, b, c - a, b - a, c, b - d, c);
e.lineTo(d, c);
K(e, a, c, 0, c - a, 0, c - d);
e.lineTo(0, d);
K(e, 0, a, a, 0, d, 0);
M(e);
b = e.s;
1 < a ? (b.G = new H(0, 0, a, a), b.H = new H(1, 1, -a, -a)) : (b.G = yb, b.H = Pb);
t.v(e);
return b
}, Border: function (a, b, c) {
var d = a ? a.tc : 0;
0 >= d && (d = 5);
d = Math.min(d, b / 3);
d = Math.min(d, c / 3);
a = t.u();
J(a, d, 0, !0);
a.lineTo(b - d, 0);
K(a, b - 0, 0, b, 0, b, d);
a.lineTo(b, c - d);
K(a, b, c - 0, b - 0, c, b - d, c);
a.lineTo(d, c);
K(a, 0, c, 0, c - 0, 0, c - d);
a.lineTo(0, d);
K(a, 0, 0, 0, 0, d, 0);
M(a);
b = a.s;
b.G = yb;
b.H = Pb;
t.v(a);
return b
}, SquareIBeam: function (a, b, c) {
var d = a ? a.tc : 0;
0 === d && (d = 0.2);
a = t.u();
J(a, 0, 0, !0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, d * c);
a.lineTo((0.5 + d / 2) * b, d * c);
a.lineTo((0.5 + d / 2) * b, (1 - d) * c);
a.lineTo(1 * b, (1 - d) * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, (1 - d) * c);
a.lineTo((0.5 - d / 2) * b, (1 - d) * c);
a.lineTo((0.5 - d / 2) * b, d * c);
a.lineTo(0, d * c);
M(a);
b = a.s;
t.v(a);
return b
}, Trapezoid: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.2);
var d = t.u();
J(d, a * b, 0, !0);
d.lineTo((1 - a) * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
b = d.s;
b.G = new H(a, 0);
b.H = new H(1 - a, 1);
t.v(d);
return b
}, ManualLoop: "ManualOperation", ManualOperation: function (a, b, c) {
var d = a ? a.tc : 0;
a = t.u();
J(a, d, 0, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.1 * b, 1 * c);
M(a);
b = a.s;
b.G = new H(0.1, 0);
b.H = new H(0.9, 1);
t.v(a);
return b
}, GenderMale: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.4 * d, g = 0.4, h = t.M(), k = t.M(), l = t.M(), m = t.M();
J(a, (0.5 - g) * b, 0.5 * c, !0);
K(a, (0.5 - g) * b, (0.5 - e) * c, (0.5 - e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5,
0.44, l, m, k, h, h);
K(a, l.x * b, l.y * c, m.x * b, m.y * c, k.x * b, k.y * c);
var n = t.cc(k.x, k.y);
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.56, h, h, k, l, m);
var p = t.cc(k.x, k.y);
a.lineTo((0.1 * n.x + 0.855) * b, 0.1 * n.y * c);
a.lineTo(0.85 * b, 0.1 * n.y * c);
a.lineTo(0.85 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.15 * c);
a.lineTo((0.1 * p.x + 0.9) * b, 0.15 * c);
a.lineTo((0.1 * p.x + 0.9) * b, (0.1 * p.y + 0.05 * 0.9) * c);
a.lineTo(p.x * b, p.y * c);
K(a, l.x * b, l.y * c, m.x * b, m.y * c, (0.5 + g) * b, 0.5 * c);
K(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 + e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, (0.5 - e) *
b, (0.5 + g) * c, (0.5 - g) * b, (0.5 + e) * c, (0.5 - g) * b, 0.5 * c);
g = 0.35;
e = 0.35 * d;
J(a, 0.5 * b, (0.5 - g) * c, !0, !0);
K(a, (0.5 - e) * b, (0.5 - g) * c, (0.5 - g) * b, (0.5 - e) * c, (0.5 - g) * b, 0.5 * c);
K(a, (0.5 - g) * b, (0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
K(a, (0.5 + g) * b, (0.5 - e) * c, (0.5 + e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
J(a, (0.5 - g) * b, 0.5 * c, !0);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
t.B(p);
b = a.s;
b.G = new H(0.202, 0.257);
b.H = new H(0.692, 0.839);
b.fc = Rg;
t.v(a);
return b
}, GenderFemale: function (a, b, c) {
a = t.u();
var d = 0.375, e = 0, g = -0.125, h = 4 * (Math.SQRT2 - 1) / 3 * d;
J(a, (0.525 + e) * b, (0.5 + d + g) * c, !0);
K(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
K(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.475 + e) * b, (0.5 + d + g) * c);
a.lineTo(0.475 * b, 0.85 * c);
a.lineTo(0.425 * b, 0.85 * c);
a.lineTo(0.425 * b, 0.9 * c);
a.lineTo(0.475 * b, 0.9 * c);
a.lineTo(0.475 *
b, 1 * c);
a.lineTo(0.525 * b, 1 * c);
a.lineTo(0.525 * b, 0.9 * c);
a.lineTo(0.575 * b, 0.9 * c);
a.lineTo(0.575 * b, 0.85 * c);
a.lineTo(0.525 * b, 0.85 * c);
M(a);
d = 0.325;
e = 0;
g = -0.125;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
J(a, (0.5 + d + e) * b, (0.5 + g) * c, !0, !0);
K(a, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
K(a, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
K(a, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
K(a, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + d + e) * b, (0.5 +
g) * c);
J(a, (0.525 + e) * b, (0.5 + d + g) * c, !0);
b = a.s;
b.G = new H(0.232, 0.136);
b.H = new H(0.782, 0.611);
b.fc = Rg;
t.v(a);
return b
}, PlusLine: function (a, b, c) {
a = t.u();
J(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, XLine: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !1);
a.lineTo(1 * b, 0);
a.moveTo(0, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, AsteriskLine: function (a, b, c) {
a = t.u();
var d = 0.2 / Math.SQRT2;
J(a, d * b, (1 - d) * c, !1);
a.lineTo((1 - d) * b, d * c);
a.moveTo(d * b, d * c);
a.lineTo((1 - d) * b, (1 - d) *
c);
a.moveTo(0 * b, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0 * c);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, CircleLine: function (a, b, c) {
var d = 0.5 * D.sa;
a = t.u();
J(a, 1 * b, 0.5 * c, !1);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new H(0.146, 0.146);
b.H = new H(0.853, 0.853);
b.fc = Rg;
t.v(a);
return b
}, Pie: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
J(a, (0.5 * Math.SQRT2 / 2 + 0.5) * b, (0.5 -
0.5 * Math.SQRT2 / 2) * c, !0);
K(a, 0.7 * b, 0 * c, 0.5 * b, 0 * c, 0.5 * b, 0 * c);
K(a, (0.5 - d + 0) * b, 0 * c, 0 * b, (0.5 - d + 0) * c, 0 * b, 0.5 * c);
K(a, 0 * b, (0.5 + d + 0) * c, (0.5 - d + 0) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 + d + 0) * b, 1 * c, 1 * b, (0.5 + d + 0) * c, 1 * b, 0.5 * c);
a.lineTo(0.5 * b, 0.5 * c);
M(a);
b = a.s;
t.v(a);
return b
}, PiePiece: function (a, b, c) {
var d = D.sa / Math.SQRT2 * 0.5, e = Math.SQRT2 / 2, g = 1 - Math.SQRT2 / 2;
a = t.u();
J(a, b, c, !0);
K(a, b, (1 - d) * c, (e + d) * b, (g + d) * c, e * b, g * c);
a.lineTo(0, c);
M(a);
b = a.s;
t.v(a);
return b
}, StopSign: function (a, b, c) {
a = 1 / (Math.SQRT2 + 2);
var d = t.u();
J(d, a * b, 0, !0);
d.lineTo((1 - a) * b, 0);
d.lineTo(1 * b, a * c);
d.lineTo(1 * b, (1 - a) * c);
d.lineTo((1 - a) * b, 1 * c);
d.lineTo(a * b, 1 * c);
d.lineTo(0, (1 - a) * c);
d.lineTo(0, a * c);
M(d);
b = d.s;
b.G = new H(a / 2, a / 2);
b.H = new H(1 - a / 2, 1 - a / 2);
t.v(d);
return b
}, LogicImplies: function (a, b, c) {
var d = a ? a.tc : 0;
0 === d && (d = 0.2);
a = t.u();
J(a, (1 - d) * b, 0 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, c);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
b = a.s;
b.G = yb;
b.H = new H(0.8, 0.5);
t.v(a);
return b
}, LogicIff: function (a, b, c) {
var d = a ? a.tc : 0;
0 === d && (d = 0.2);
a = t.u();
J(a, (1 - d) * b, 0 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, c);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
a.moveTo(d * b, 0);
a.lineTo(0, 0.5 * c);
a.lineTo(d * b, c);
b = a.s;
b.G = new H(0.2, 0);
b.H = new H(0.8, 0.5);
t.v(a);
return b
}, LogicNot: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, LogicAnd: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !1);
a.lineTo(0.5 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new H(0.25, 0.5);
b.H = new H(0.75, 1);
t.v(a);
return b
}, LogicOr: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 *
b, 0);
b = a.s;
b.G = new H(0.219, 0);
b.H = new H(0.78, 0.409);
t.v(a);
return b
}, LogicXor: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.moveTo(0, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
var d = 0.5 * D.sa;
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, LogicTruth: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
},
LogicFalsity: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !1);
a.lineTo(1 * b, 1 * c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0);
b = a.s;
t.v(a);
return b
}, LogicThereExists: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 0.5 * c);
a.moveTo(1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
b = a.s;
t.v(a);
return b
}, LogicForAll: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 * b, 0);
a.moveTo(0.25 * b, 0.5 * c);
a.lineTo(0.75 * b, 0.5 * c);
b = a.s;
b.G = new H(0.25, 0);
b.H = new H(0.75, 0.5);
t.v(a);
return b
},
LogicIsDefinedAs: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(b, 0);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
a.moveTo(0, c);
a.lineTo(b, c);
b = a.s;
b.G = new H(0.01, 0.01);
b.H = new H(0.99, 0.49);
t.v(a);
return b
}, LogicIntersect: function (a, b, c) {
var d = 0.5 * D.sa;
a = t.u();
J(a, 0, 1 * c, !1);
a.lineTo(0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new H(0, 0.5);
b.H = Pb;
t.v(a);
return b
}, LogicUnion: function (a, b, c) {
var d = 0.5 * D.sa;
a = t.u();
J(a, 1 * b, 0, !1);
a.lineTo(1 * b,
0.5 * c);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
a.lineTo(0, 0);
b = a.s;
b.G = yb;
b.H = new H(1, 0.5);
t.v(a);
return b
}, Arrow: function (a, b, c) {
var d = a ? a.tc : 0, e = a ? a.Vs : 0;
0 === d && (d = 0.3);
0 === e && (e = 0.3);
a = t.u();
J(a, 0, (0.5 - e / 2) * c, !0);
a.lineTo((1 - d) * b, (0.5 - e / 2) * c);
a.lineTo((1 - d) * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, 1 * c);
a.lineTo((1 - d) * b, (0.5 + e / 2) * c);
a.lineTo(0, (0.5 + e / 2) * c);
M(a);
b = a.s;
b.G = new H(0, 0.5 - e / 2);
d = D.Xk(0, 0.5 + e / 2, 1, 0.5 + e / 2, 1 - d, 1, 1, 0.5, t.M());
b.H = new H(d.x, d.y);
t.B(d);
t.v(a);
return b
}, ISOProcess: "Chevron", Chevron: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.5 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
M(a);
b = a.s;
t.v(a);
return b
}, DoubleArrow: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.3 * b, 0.214 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0.3 * b, 0.786 * c);
a.lineTo(0, 1 * c);
M(a);
J(a, 0.3 * b, 0.214 * c, !1);
a.lineTo(0.3 * b, 0.786 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, DoubleEndArrow: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0.3 * b, 0.7 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0, 0.5 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(0.3 * b, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
M(a);
b = a.s;
c = D.Xk(0, 0.5, 0.3, 0, 0, 0.3, 0.3, 0.3, t.M());
b.G = new H(c.x, c.y);
c = D.Xk(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, c);
b.H = new H(c.x, c.y);
t.B(c);
t.v(a);
return b
}, IBeamArrow: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0.2 * b, 0.7 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.2 * b, 0);
a.lineTo(0.2 * b, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
M(a);
b = a.s;
b.G = new H(0, 0.3);
c = D.Xk(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, t.M());
b.H = new H(c.x, c.y);
t.B(c);
t.v(a);
return b
}, Pointer: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0.2 * b, 0.5 * c);
a.lineTo(0, 0);
M(a);
b = a.s;
b.G = new H(0.2, 0.35);
c = D.Xk(0.2, 0.65, 1, 0.65, 0, 1, 1, 0.5, t.M());
b.H = new H(c.x, c.y);
t.B(c);
t.v(a);
return b
}, RoundedPointer: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
K(a, 0.5 *
b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
M(a);
b = a.s;
b.G = new H(0.4, 0.35);
c = D.Xk(0.2, 0.65, 1, 0.65, 0, 1, 1, 0.5, t.M());
b.H = new H(c.x, c.y);
t.B(c);
t.v(a);
return b
}, SplitEndArrow: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0, 0.7 * c);
a.lineTo(0.2 * b, 0.5 * c);
a.lineTo(0, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
M(a);
b = a.s;
b.G = new H(0.2, 0.3);
c = D.Xk(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, t.M());
b.H = new H(c.x, c.y);
t.B(c);
t.v(a);
return b
}, MessageToUser: "SquareArrow", SquareArrow: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.7 * b, 0);
M(a);
b = a.s;
b.G = yb;
b.H = new H(0.7, 1);
t.v(a);
return b
}, Cone1: function (a, b, c) {
var d = D.sa;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
J(d, 0, 0.9 * c, !0);
d.lineTo(0.5 * b, 0);
d.lineTo(1 * b, 0.9 * c);
K(d, 1 * b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
K(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
M(d);
b = d.s;
b.G = new H(0.25, 0.5);
b.H = new H(0.75, 0.97);
t.v(d);
return b
}, Cone2: function (a, b, c) {
a = t.u();
J(a, 0, 0.9 * c, !0);
K(a, (1 - 0.85 / 0.9) * b, 1 * c, 0.85 / 0.9 * b, 1 * c,
1 * b, 0.9 * c);
a.lineTo(0.5 * b, 0);
a.lineTo(0, 0.9 * c);
M(a);
J(a, 0, 0.9 * c, !1);
K(a, (1 - 0.85 / 0.9) * b, 0.8 * c, 0.85 / 0.9 * b, 0.8 * c, 1 * b, 0.9 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.5);
b.H = new H(0.75, 0.82);
t.v(a);
return b
}, Cube1: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 1 * c, !0);
a.lineTo(1 * b, 0.85 * c);
a.lineTo(1 * b, 0.15 * c);
a.lineTo(0.5 * b, 0 * c);
a.lineTo(0 * b, 0.15 * c);
a.lineTo(0 * b, 0.85 * c);
M(a);
J(a, 0.5 * b, 1 * c, !1);
a.lineTo(0.5 * b, 0.3 * c);
a.lineTo(0, 0.15 * c);
a.moveTo(0.5 * b, 0.3 * c);
a.lineTo(1 * b, 0.15 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.3);
b.H = new H(0.5, 0.85);
t.v(a);
return b
}, Cube2: function (a, b, c) {
a = t.u();
J(a, 0, 0.3 * c, !0);
a.lineTo(0 * b, 1 * c);
a.lineTo(0.7 * b, c);
a.lineTo(1 * b, 0.7 * c);
a.lineTo(1 * b, 0 * c);
a.lineTo(0.3 * b, 0 * c);
M(a);
J(a, 0, 0.3 * c, !1);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(1 * b, 0 * c);
a.moveTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 1 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.3);
b.H = new H(0.7, 1);
t.v(a);
return b
}, MagneticData: "Cylinder1", Cylinder1: function (a, b, c) {
var d = D.sa;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
J(d, 0, 0.1 * c, !0);
K(d, 0, (0.1 - e) * c, (0.5 - a) * b, 0, 0.5 * b, 0);
K(d, (0.5 + a) * b, 0, 1 * b, (0.1 - e) * c, 1 *
b, 0.1 * c);
d.lineTo(b, 0.9 * c);
K(d, 1 * b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
K(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
d.lineTo(0, 0.1 * c);
J(d, 0, 0.1 * c, !1);
K(d, 0, (0.1 + e) * c, (0.5 - a) * b, 0.2 * c, 0.5 * b, 0.2 * c);
K(d, (0.5 + a) * b, 0.2 * c, 1 * b, (0.1 + e) * c, 1 * b, 0.1 * c);
d.Xa(!1);
b = d.s;
b.G = new H(0, 0.2);
b.H = new H(1, 0.9);
t.v(d);
return b
}, Cylinder2: function (a, b, c) {
var d = D.sa;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
J(d, 0, 0.9 * c, !0);
d.lineTo(0, 0.1 * c);
K(d, 0, (0.1 - e) * c, (0.5 - a) * b, 0, 0.5 * b, 0);
K(d, (0.5 + a) * b, 0, 1 * b, (0.1 - e) * c, 1 * b, 0.1 * c);
d.lineTo(1 * b, 0.9 * c);
K(d, 1 *
b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
K(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
J(d, 0, 0.9 * c, !1);
K(d, 0, (0.9 - e) * c, (0.5 - a) * b, 0.8 * c, 0.5 * b, 0.8 * c);
K(d, (0.5 + a) * b, 0.8 * c, 1 * b, (0.9 - e) * c, 1 * b, 0.9 * c);
d.Xa(!1);
b = d.s;
b.G = new H(0, 0.1);
b.H = new H(1, 0.8);
t.v(d);
return b
}, Cylinder3: function (a, b, c) {
var d = D.sa;
a = 0.1 * d;
var e = 0.5 * d, d = t.u();
J(d, 0.1 * b, 0, !0);
d.lineTo(0.9 * b, 0);
K(d, (0.9 + a) * b, 0, 1 * b, (0.5 - e) * c, 1 * b, 0.5 * c);
K(d, 1 * b, (0.5 + e) * c, (0.9 + a) * b, 1 * c, 0.9 * b, 1 * c);
d.lineTo(0.1 * b, 1 * c);
K(d, (0.1 - a) * b, 1 * c, 0, (0.5 + e) * c, 0, 0.5 * c);
K(d, 0, (0.5 -
e) * c, (0.1 - a) * b, 0, 0.1 * b, 0);
J(d, 0.1 * b, 0, !1);
K(d, (0.1 + a) * b, 0, 0.2 * b, (0.5 - e) * c, 0.2 * b, 0.5 * c);
K(d, 0.2 * b, (0.5 + e) * c, (0.1 + a) * b, 1 * c, 0.1 * b, 1 * c);
d.Xa(!1);
b = d.s;
b.G = new H(0.2, 0);
b.H = new H(0.9, 1);
t.v(d);
return b
}, DirectData: "Cylinder4", Cylinder4: function (a, b, c) {
var d = D.sa;
a = 0.1 * d;
var e = 0.5 * d, d = t.u();
J(d, 0.9 * b, 0, !0);
K(d, (0.9 + a) * b, 0, 1 * b, (0.5 - e) * c, 1 * b, 0.5 * c);
K(d, 1 * b, (0.5 + e) * c, (0.9 + a) * b, 1 * c, 0.9 * b, 1 * c);
d.lineTo(0.1 * b, 1 * c);
K(d, (0.1 - a) * b, 1 * c, 0, (0.5 + e) * c, 0, 0.5 * c);
K(d, 0, (0.5 - e) * c, (0.1 - a) * b, 0, 0.1 * b, 0);
d.lineTo(0.9 * b, 0);
J(d,
0.9 * b, 0, !1);
K(d, (0.9 - a) * b, 0, 0.8 * b, (0.5 - e) * c, 0.8 * b, 0.5 * c);
K(d, 0.8 * b, (0.5 + e) * c, (0.9 - a) * b, 1 * c, 0.9 * b, 1 * c);
d.Xa(!1);
b = d.s;
b.G = new H(0.1, 0);
b.H = new H(0.8, 1);
t.v(d);
return b
}, Prism1: function (a, b, c) {
a = t.u();
J(a, 0.25 * b, 0.25 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(b, 0.5 * c);
a.lineTo(0.5 * b, c);
a.lineTo(0, c);
M(a);
J(a, 0.25 * b, 0.25 * c, !1);
a.lineTo(0.5 * b, c);
a.Xa(!1);
b = a.s;
b.G = new H(0.408, 0.172);
b.H = new H(0.833, 0.662);
t.v(a);
return b
}, Prism2: function (a, b, c) {
a = t.u();
J(a, 0, 0.25 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(0.75 * b, 0.75 * c);
a.lineTo(0, 1 * c);
M(a);
J(a, 0, c, !1);
a.lineTo(0.25 * b, 0.5 * c);
a.lineTo(b, 0.25 * c);
a.moveTo(0, 0.25 * c);
a.lineTo(0.25 * b, 0.5 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.5);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, Pyramid1: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(b, 0.75 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.75 * c);
M(a);
J(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.367);
b.H = new H(0.75, 0.875);
t.v(a);
return b
}, Pyramid2: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(b, 0.85 *
c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.85 * c);
M(a);
J(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.7 * c);
a.lineTo(0, 0.85 * c);
a.moveTo(0.5 * b, 0.7 * c);
a.lineTo(1 * b, 0.85 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.367);
b.H = new H(0.75, 0.875);
t.v(a);
return b
}, Actor: function (a, b, c) {
var d = D.sa, e = 0.2 * d, g = 0.1 * d, h = 0.5, k = 0.1;
a = t.u();
J(a, h * b, (k + 0.1) * c, !0);
K(a, (h - e) * b, (k + 0.1) * c, (h - 0.2) * b, (k + g) * c, (h - 0.2) * b, k * c);
K(a, (h - 0.2) * b, (k - g) * c, (h - e) * b, (k - 0.1) * c, h * b, (k - 0.1) * c);
K(a, (h + e) * b, (k - 0.1) * c, (h + 0.2) * b, (k - g) * c, (h + 0.2) * b, k * c);
K(a, (h + 0.2) * b, (k + g) * c,
(h + e) * b, (k + 0.1) * c, h * b, (k + 0.1) * c);
e = 0.05;
g = d * e;
J(a, 0.5 * b, 0.2 * c, !0);
a.lineTo(0.95 * b, 0.2 * c);
h = 0.95;
k = 0.25;
K(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
a.lineTo(1 * b, 0.6 * c);
a.lineTo(0.85 * b, 0.6 * c);
a.lineTo(0.85 * b, 0.35 * c);
e = 0.025;
g = d * e;
h = 0.825;
k = 0.35;
K(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
K(a, (h - g) * b, (k - e) * c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0.55 * b, 1 * c);
a.lineTo(0.55 * b, 0.7 * c);
e = 0.05;
g = d * e;
h = 0.5;
k = 0.7;
K(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
K(a, (h - g) * b, (k - e) *
c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.45 * b, 1 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0.2 * b, 0.35 * c);
e = 0.025;
g = d * e;
h = 0.175;
k = 0.35;
K(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
K(a, (h - g) * b, (k - e) * c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.15 * b, 0.6 * c);
a.lineTo(0 * b, 0.6 * c);
a.lineTo(0 * b, 0.25 * c);
e = 0.05;
g = d * e;
h = 0.05;
k = 0.25;
K(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
a.lineTo(0.5 * b, 0.2 * c);
b = a.s;
b.G = new H(0.2, 0.2);
b.H = new H(0.8, 0.65);
t.v(a);
return b
}, Card: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0 * c, !0);
a.lineTo(1 *
b, 1 * c);
a.lineTo(0 * b, 1 * c);
a.lineTo(0 * b, 0.2 * c);
a.lineTo(0.2 * b, 0 * c);
M(a);
b = a.s;
b.G = new H(0, 0.2);
b.H = Pb;
t.v(a);
return b
}, Collate: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0.5 * c, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.5 * b, 0.5 * c);
J(a, 0.5 * b, 0.5 * c, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
b = a.s;
b.G = new H(0.25, 0);
b.H = new H(0.75, 0.25);
t.v(a);
return b
}, CreateRequest: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
J(d, 0, a *
c, !1);
d.lineTo(1 * b, a * c);
d.moveTo(0, (1 - a) * c);
d.lineTo(1 * b, (1 - a) * c);
d.Xa(!1);
b = d.s;
b.G = new H(0, a);
b.H = new H(1, 1 - a);
t.v(d);
return b
}, Database: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.5 * d, d = 0.1 * d;
J(a, 1 * b, 0.1 * c, !0);
a.lineTo(1 * b, 0.9 * c);
K(a, 1 * b, (0.9 + d) * c, (0.5 + e) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - e) * b, 1 * c, 0, (0.9 + d) * c, 0, 0.9 * c);
a.lineTo(0, 0.1 * c);
K(a, 0, (0.1 - d) * c, (0.5 - e) * b, 0, 0.5 * b, 0);
K(a, (0.5 + e) * b, 0, 1 * b, (0.1 - d) * c, 1 * b, 0.1 * c);
J(a, 1 * b, 0.1 * c, !1);
K(a, 1 * b, (0.1 + d) * c, (0.5 + e) * b, 0.2 * c, 0.5 * b, 0.2 * c);
K(a, (0.5 - e) * b, 0.2 * c, 0, (0.1 + d) *
c, 0, 0.1 * c);
a.moveTo(1 * b, 0.2 * c);
K(a, 1 * b, (0.2 + d) * c, (0.5 + e) * b, 0.3 * c, 0.5 * b, 0.3 * c);
K(a, (0.5 - e) * b, 0.3 * c, 0, (0.2 + d) * c, 0, 0.2 * c);
a.moveTo(1 * b, 0.3 * c);
K(a, 1 * b, (0.3 + d) * c, (0.5 + e) * b, 0.4 * c, 0.5 * b, 0.4 * c);
K(a, (0.5 - e) * b, 0.4 * c, 0, (0.3 + d) * c, 0, 0.3 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.4);
b.H = new H(1, 0.9);
t.v(a);
return b
}, StoredData: "DataStorage", DataStorage: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
K(a, 1 * b, 0, 1 * b, 1 * c, 0.75 * b, 1 * c);
a.lineTo(0, 1 * c);
K(a, 0.25 * b, 0.9 * c, 0.25 * b, 0.1 * c, 0, 0);
M(a);
b = a.s;
b.G = new H(0.226, 0);
b.H = new H(0.81,
1);
t.v(a);
return b
}, DiskStorage: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.5 * d, d = 0.1 * d;
J(a, 1 * b, 0.1 * c, !0);
a.lineTo(1 * b, 0.9 * c);
K(a, 1 * b, (0.9 + d) * c, (0.5 + e) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - e) * b, 1 * c, 0, (0.9 + d) * c, 0, 0.9 * c);
a.lineTo(0, 0.1 * c);
K(a, 0, (0.1 - d) * c, (0.5 - e) * b, 0, 0.5 * b, 0);
K(a, (0.5 + e) * b, 0, 1 * b, (0.1 - d) * c, 1 * b, 0.1 * c);
J(a, 1 * b, 0.1 * c, !1);
K(a, 1 * b, (0.1 + d) * c, (0.5 + e) * b, 0.2 * c, 0.5 * b, 0.2 * c);
K(a, (0.5 - e) * b, 0.2 * c, 0, (0.1 + d) * c, 0, 0.1 * c);
a.moveTo(1 * b, 0.2 * c);
K(a, 1 * b, (0.2 + d) * c, (0.5 + e) * b, 0.3 * c, 0.5 * b, 0.3 * c);
K(a, (0.5 - e) * b, 0.3 * c, 0, (0.2 + d) *
c, 0, 0.2 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.3);
b.H = new H(1, 0.9);
t.v(a);
return b
}, Display: function (a, b, c) {
a = t.u();
J(a, 0.25 * b, 0, !0);
a.lineTo(0.75 * b, 0);
K(a, 1 * b, 0, 1 * b, 1 * c, 0.75 * b, 1 * c);
a.lineTo(0.25 * b, 1 * c);
a.lineTo(0, 0.5 * c);
M(a);
b = a.s;
b.G = new H(0.25, 0);
b.H = new H(0.75, 1);
t.v(a);
return b
}, DividedEvent: function (a, b, c) {
a = a ? a.tc : 0;
0 === a ? a = 0.2 : 0.15 > a && (a = 0.15);
var d = t.u(), e = 0.2 * D.sa;
J(d, 0, 0.2 * c, !0);
K(d, 0, (0.2 - e) * c, (0.2 - e) * b, 0, 0.2 * b, 0);
d.lineTo(0.8 * b, 0);
K(d, (0.8 + e) * b, 0, 1 * b, (0.2 - e) * c, 1 * b, 0.2 * c);
d.lineTo(1 * b, 0.8 * c);
K(d, 1 * b, (0.8 + e) * c, (0.8 + e) * b, 1 * c, 0.8 * b, 1 * c);
d.lineTo(0.2 * b, 1 * c);
K(d, (0.2 - e) * b, 1 * c, 0, (0.8 + e) * c, 0, 0.8 * c);
d.lineTo(0, 0.2 * c);
J(d, 0, a * c, !1);
d.lineTo(1 * b, a * c);
d.Xa(!1);
b = d.s;
b.G = new H(0, a);
b.H = new H(1, 1 - a);
t.v(d);
return b
}, DividedProcess: function (a, b, c) {
a = a ? a.tc : 0;
0.1 > a && (a = 0.1);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
J(d, 0, a * c, !1);
d.lineTo(1 * b, a * c);
d.Xa(!1);
b = d.s;
b.G = new H(0, a);
b.H = Pb;
t.v(d);
return b
}, Document: function (a, b, c) {
c /= 0.8;
a = t.u();
J(a, 0, 0.7 * c, !0);
a.lineTo(0,
0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.7 * c);
K(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
M(a);
b = a.s;
b.G = yb;
b.H = new H(1, 0.6);
t.v(a);
return b
}, ExternalOrganization: function (a, b, c) {
a = a ? a.tc : 0;
0.2 > a && (a = 0.2);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
J(d, a * b, 0, !1);
d.lineTo(0, a * c);
d.moveTo(1 * b, a * c);
d.lineTo((1 - a) * b, 0);
d.moveTo(0, (1 - a) * c);
d.lineTo(a * b, 1 * c);
d.moveTo((1 - a) * b, 1 * c);
d.lineTo(1 * b, (1 - a) * c);
d.Xa(!1);
b = d.s;
b.G = new H(a / 2, a / 2);
b.H = new H(1 - a / 2, 1 - a / 2);
t.v(d);
return b
}, ExternalProcess: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.5 * c);
M(a);
J(a, 0.1 * b, 0.4 * c, !1);
a.lineTo(0.1 * b, 0.6 * c);
a.moveTo(0.9 * b, 0.6 * c);
a.lineTo(0.9 * b, 0.4 * c);
a.moveTo(0.6 * b, 0.1 * c);
a.lineTo(0.4 * b, 0.1 * c);
a.moveTo(0.4 * b, 0.9 * c);
a.lineTo(0.6 * b, 0.9 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.25);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, File: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
M(a);
J(a, 0.75 * b, 0, !1);
a.lineTo(0.75 * b, 0.25 * c);
a.lineTo(1 * b, 0.25 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.25);
b.H = Pb;
t.v(a);
return b
}, Interrupt: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0.5 * c);
J(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 1 * c);
J(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 0);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(0.5, 0.75);
t.v(a);
return b
}, InternalStorage: function (a, b, c) {
var d = a ? a.tc : 0;
a = a ? a.Vs : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.1);
var e = t.u();
J(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo(1 * b, 1 * c);
e.lineTo(0, 1 * c);
M(e);
J(e, d * b, 0, !1);
e.lineTo(d *
b, 1 * c);
e.moveTo(0, a * c);
e.lineTo(1 * b, a * c);
e.Xa(!1);
b = e.s;
b.G = new H(d, a);
b.H = Pb;
t.v(e);
return b
}, Junction: function (a, b, c) {
a = t.u();
var d = 1 / Math.SQRT2, e = (1 - 1 / Math.SQRT2) / 2, g = 0.5 * D.sa;
J(a, 1 * b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + g) * c, (0.5 + g) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - g) * b, 1 * c, 0, (0.5 + g) * c, 0, 0.5 * c);
K(a, 0, (0.5 - g) * c, (0.5 - g) * b, 0, 0.5 * b, 0);
K(a, (0.5 + g) * b, 0, 1 * b, (0.5 - g) * c, 1 * b, 0.5 * c);
J(a, (e + d) * b, (e + d) * c, !1);
a.lineTo(e * b, e * c);
a.moveTo(e * b, (e + d) * c);
a.lineTo((e + d) * b, e * c);
a.Xa(!1);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, LinedDocument: function (a, b, c) {
c /= 0.8;
a = t.u();
J(a, 0, 0.7 * c, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.7 * c);
K(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
M(a);
J(a, 0.1 * b, 0, !1);
a.lineTo(0.1 * b, 0.75 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.1, 0);
b.H = new H(1, 0.6);
t.v(a);
return b
}, LoopLimit: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !0);
a.lineTo(0, 0.25 * c);
a.lineTo(0.25 * b, 0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(1 * b, 1 * c);
M(a);
b = a.s;
b.G = new H(0, 0.25);
b.H = Pb;
t.v(a);
return b
}, SequentialData: "MagneticTape", MagneticTape: function (a, b, c) {
a = t.u();
var d =
0.5 * D.sa;
J(a, 0.5 * b, 1 * c, !0);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 * c, 0.6 * b, 0.9 * c);
a.lineTo(1 * b, 0.9 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
b.G = new H(0.15, 0.15);
b.H = new H(0.85, 0.8);
t.v(a);
return b
}, ManualInput: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.25 * c);
M(a);
b = a.s;
b.G = new H(0, 0.25);
b.H = Pb;
t.v(a);
return b
}, MessageFromUser: function (a, b, c) {
a =
a ? a.tc : 0;
0 === a && (a = 0.7);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(a * b, 0.5 * c);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
b = d.s;
b.G = yb;
b.H = new H(a, 1);
t.v(d);
return b
}, MicroformProcessing: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.25);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(0.5 * b, a * c);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0.5 * b, (1 - a) * c);
d.lineTo(0, 1 * c);
M(d);
b = d.s;
b.G = new H(0, a);
b.H = new H(1, 1 - a);
t.v(d);
return b
}, MicroformRecording: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.75 * b, 0.25 * c);
a.lineTo(1 * b,
0.15 * c);
a.lineTo(1 * b, 0.85 * c);
a.lineTo(0.75 * b, 0.75 * c);
a.lineTo(0, 1 * c);
M(a);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(1, 0.75);
t.v(a);
return b
}, MultiDocument: function (a, b, c) {
c /= 0.8;
a = t.u();
J(a, b, 0, !0);
a.lineTo(b, 0.5 * c);
K(a, 0.96 * b, 0.47 * c, 0.93 * b, 0.45 * c, 0.9 * b, 0.44 * c);
a.lineTo(0.9 * b, 0.6 * c);
K(a, 0.86 * b, 0.57 * c, 0.83 * b, 0.55 * c, 0.8 * b, 0.54 * c);
a.lineTo(0.8 * b, 0.7 * c);
K(a, 0.4 * b, 0.4 * c, 0.4 * b, 1 * c, 0, 0.7 * c);
a.lineTo(0, 0.2 * c);
a.lineTo(0.1 * b, 0.2 * c);
a.lineTo(0.1 * b, 0.1 * c);
a.lineTo(0.2 * b, 0.1 * c);
a.lineTo(0.2 * b, 0);
M(a);
J(a, 0.1 * b, 0.2 * c,
!1);
a.lineTo(0.8 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.54 * c);
a.moveTo(0.2 * b, 0.1 * c);
a.lineTo(0.9 * b, 0.1 * c);
a.lineTo(0.9 * b, 0.44 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(0.8, 0.77);
t.v(a);
return b
}, MultiProcess: function (a, b, c) {
a = t.u();
J(a, 0.1 * b, 0.1 * c, !0);
a.lineTo(0.2 * b, 0.1 * c);
a.lineTo(0.2 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0.9 * b, 0.8 * c);
a.lineTo(0.9 * b, 0.9 * c);
a.lineTo(0.8 * b, 0.9 * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.2 * c);
a.lineTo(0.1 * b, 0.2 * c);
M(a);
J(a, 0.2 * b, 0.1 * c, !1);
a.lineTo(0.9 * b,
0.1 * c);
a.lineTo(0.9 * b, 0.8 * c);
a.moveTo(0.1 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.9 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0, 0.2);
b.H = new H(0.8, 1);
t.v(a);
return b
}, OfflineStorage: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d = 1 - a, e = t.u();
J(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo(0.5 * b, 1 * c);
M(e);
J(e, 0.5 * a * b, a * c, !1);
e.lineTo((1 - 0.5 * a) * b, a * c);
e.Xa(!1);
b = e.s;
b.G = new H(d / 4 + 0.5 * a, a);
b.H = new H(3 * d / 4 + 0.5 * a, a + 0.5 * d);
t.v(e);
return b
}, OffPageConnector: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 *
b, 0.5 * c);
a.lineTo(0.75 * b, 1 * c);
a.lineTo(0, 1 * c);
M(a);
b = a.s;
b.G = yb;
b.H = new H(0.75, 1);
t.v(a);
return b
}, Or: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 1 * b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
J(a, 1 * b, 0.5 * c, !1);
a.lineTo(0, 0.5 * c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0);
a.Xa(!1);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, PaperTape: function (a, b, c) {
c /= 0.8;
a = t.u();
J(a, 0, 0.7 * c, !0);
a.lineTo(0,
0.3 * c);
K(a, 0.5 * b, 0.6 * c, 0.5 * b, 0, 1 * b, 0.3);
a.lineTo(1 * b, 0.7 * c);
K(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
M(a);
b = a.s;
b.G = new H(0, 0.49);
b.H = new H(1, 0.75);
t.v(a);
return b
}, PrimitiveFromCall: function (a, b, c) {
var d = a ? a.tc : 0;
a = a ? a.Vs : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.3);
var e = t.u();
J(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo((1 - a) * b, 0.5 * c);
e.lineTo(1 * b, 1 * c);
e.lineTo(0, 1 * c);
M(e);
b = e.s;
b.G = new H(d, 0);
b.H = new H(1 - a, 1);
t.v(e);
return b
}, PrimitiveToCall: function (a, b, c) {
var d = a ? a.tc : 0;
a = a ? a.Vs : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.3);
var e =
t.u();
J(e, 0, 0, !0);
e.lineTo((1 - a) * b, 0);
e.lineTo(1 * b, 0.5 * c);
e.lineTo((1 - a) * b, 1 * c);
e.lineTo(0, 1 * c);
M(e);
b = e.s;
b.G = new H(d, 0);
b.H = new H(1 - a, 1);
t.v(e);
return b
}, Subroutine: "Procedure", Procedure: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
J(d, (1 - a) * b, 0, !1);
d.lineTo((1 - a) * b, 1 * c);
d.moveTo(a * b, 0);
d.lineTo(a * b, 1 * c);
d.Xa(!1);
b = d.s;
b.G = new H(a, 0);
b.H = new H(1 - a, 1);
t.v(d);
return b
}, Process: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d =
t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
M(d);
J(d, a * b, 0, !1);
d.lineTo(a * b, 1 * c);
d.Xa(!1);
b = d.s;
b.G = new H(a, 0);
b.H = Pb;
t.v(d);
return b
}, Sort: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.5 * c);
M(a);
J(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0.25);
b.H = new H(0.75, 0.5);
t.v(a);
return b
}, Start: function (a, b, c) {
a = t.u();
J(a, 0.25 * b, 0, !0);
J(a, 0.25 * b, 0, !0);
a.arcTo(270, 180, 0.75 * b, 0.5 * c, 0.25 * b, 0.5 * c);
a.arcTo(90, 180, 0.25 *
b, 0.5 * c, 0.25 * b, 0.5 * c);
J(a, 0.25 * b, 0, !1);
a.lineTo(0.25 * b, 1 * c);
a.moveTo(0.75 * b, 0);
a.lineTo(0.75 * b, 1 * c);
a.Xa(!1);
b = a.s;
b.G = new H(0.25, 0);
b.H = new H(0.75, 1);
t.v(a);
return b
}, Terminator: function (a, b, c) {
a = t.u();
J(a, 0.25 * b, 0, !0);
a.arcTo(270, 180, 0.75 * b, 0.5 * c, 0.25 * b, 0.5 * c);
a.arcTo(90, 180, 0.25 * b, 0.5 * c, 0.25 * b, 0.5 * c);
b = a.s;
b.G = new H(0.23, 0);
b.H = new H(0.77, 1);
t.v(a);
return b
}, TransmittalTape: function (a, b, c) {
a = a ? a.tc : 0;
0 === a && (a = 0.1);
var d = t.u();
J(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0.75 * b, (1 - a) *
c);
d.lineTo(0, (1 - a) * c);
M(d);
b = d.s;
b.G = yb;
b.H = new H(1, 1 - a);
t.v(d);
return b
}, AndGate: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 0, 0, !0);
a.lineTo(0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
a.lineTo(0, 1 * c);
M(a);
b = a.s;
b.G = yb;
b.H = new H(0.55, 1);
t.v(a);
return b
}, Buffer: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 1 * c);
M(a);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(0.5, 0.75);
t.v(a);
return b
}, Clock: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 1 *
b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
J(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
J(a, 0.8 * b, 0.75 * c, !1);
a.lineTo(0.8 * b, 0.25 * c);
a.lineTo(0.6 * b, 0.25 * c);
a.lineTo(0.6 * b, 0.75 * c);
a.lineTo(0.4 * b, 0.75 * c);
a.lineTo(0.4 * b, 0.25 * c);
a.lineTo(0.2 * b, 0.25 * c);
a.lineTo(0.2 * b, 0.75 * c);
a.Xa(!1);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, Ground: function (a, b, c) {
a = t.u();
J(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.4 * c);
a.moveTo(0.2 * b, 0.6 * c);
a.lineTo(0.8 * b, 0.6 * c);
a.moveTo(0.3 * b, 0.8 * c);
a.lineTo(0.7 * b, 0.8 * c);
a.moveTo(0.4 * b, 1 * c);
a.lineTo(0.6 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Inverter: function (a, b, c) {
a = t.u();
var d = 0.1 * D.sa;
J(a, 0.8 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.8 * b, 0.5 * c);
J(a, 1 * b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + d) * c, (0.9 + d) * b, 0.6 * c, 0.9 * b, 0.6 * c);
K(a, (0.9 - d) * b, 0.6 * c, 0.8 * b, (0.5 + d) * c, 0.8 * b, 0.5 * c);
K(a, 0.8 * b, (0.5 - d) * c, (0.9 - d) * b, 0.4 * c, 0.9 * b, 0.4 * c);
K(a, (0.9 + d) * b, 0.4 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(0.4, 0.75);
t.v(a);
return b
}, NandGate: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.5 * d, g = 0.4 * d, d = 0.1 * d;
J(a, 0.8 * b, 0.5 * c, !0);
K(a, 0.8 * b, (0.5 + g) * c, (0.4 + e) * b, 1 * c, 0.4 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.4 * b, 0);
K(a, (0.4 + e) * b, 0, 0.8 * b, (0.5 - g) * c, 0.8 * b, 0.5 * c);
J(a, 1 * b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + d) * c, (0.9 + d) * b, 0.6 * c, 0.9 * b, 0.6 * c);
K(a, (0.9 - d) * b, 0.6 * c, 0.8 * b, (0.5 + d) * c, 0.8 * b, 0.5 * c);
K(a, 0.8 * b, (0.5 - d) * c, (0.9 - d) * b, 0.4 * c, 0.9 * b, 0.4 * c);
K(a, (0.9 + d) * b, 0.4 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new H(0, 0.05);
b.H = new H(0.55,
0.95);
t.v(a);
return b
}, NorGate: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.5, g = d * e, h = 0, k = 0.5;
J(a, 0.8 * b, 0.5 * c, !0);
K(a, 0.7 * b, (k + g) * c, (h + g) * b, (k + e) * c, 0, 1 * c);
K(a, 0.25 * b, 0.75 * c, 0.25 * b, 0.25 * c, 0, 0);
K(a, (h + g) * b, (k - e) * c, 0.7 * b, (k - g) * c, 0.8 * b, 0.5 * c);
e = 0.1;
g = 0.1 * d;
h = 0.9;
k = 0.5;
J(a, (h - e) * b, k * c, !0);
K(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
K(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
K(a, (h + e) * b, (k + g) * c, (h + g) * b, (k + e) * c, h * b, (k + e) * c);
K(a, (h - g) * b, (k + e) * c, (h - e) * b, (k + g) * c, (h - e) * b, k * c);
b = a.s;
b.G = new H(0.2, 0.25);
b.H = new H(0.6, 0.75);
t.v(a);
return b
}, OrGate: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 0, 0, !0);
K(a, (0 + d + d) * b, 0 * c, 0.8 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 0.8 * b, (0.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c);
K(a, 0.25 * b, 0.75 * c, 0.25 * b, 0.25 * c, 0, 0);
M(a);
b = a.s;
b.G = new H(0.2, 0.25);
b.H = new H(0.75, 0.75);
t.v(a);
return b
}, XnorGate: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.5, g = d * e, h = 0.2, k = 0.5;
J(a, 0.1 * b, 0, !1);
K(a, 0.35 * b, 0.25 * c, 0.35 * b, 0.75 * c, 0.1 * b, 1 * c);
J(a, 0.8 * b, 0.5 * c, !0);
K(a, 0.7 * b, (k + g) * c, (h + g) * b, (k + e) * c, 0.2 * b, 1 * c);
K(a, 0.45 * b, 0.75 * c, 0.45 *
b, 0.25 * c, 0.2 * b, 0);
K(a, (h + g) * b, (k - e) * c, 0.7 * b, (k - g) * c, 0.8 * b, 0.5 * c);
e = 0.1;
g = 0.1 * d;
h = 0.9;
k = 0.5;
J(a, (h - e) * b, k * c, !0);
K(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
K(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
K(a, (h + e) * b, (k + g) * c, (h + g) * b, (k + e) * c, h * b, (k + e) * c);
K(a, (h - g) * b, (k + e) * c, (h - e) * b, (k + g) * c, (h - e) * b, k * c);
b = a.s;
b.G = new H(0.4, 0.25);
b.H = new H(0.65, 0.75);
t.v(a);
return b
}, XorGate: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 0.1 * b, 0, !1);
K(a, 0.35 * b, 0.25 * c, 0.35 * b, 0.75 * c, 0.1 * b, 1 * c);
J(a, 0.2 * b, 0, !0);
K(a, (0.2 +
d) * b, 0 * c, 0.9 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 0.9 * b, (0.5 + d) * c, (0.2 + d) * b, 1 * c, 0.2 * b, 1 * c);
K(a, 0.45 * b, 0.75 * c, 0.45 * b, 0.25 * c, 0.2 * b, 0);
M(a);
b = a.s;
b.G = new H(0.4, 0.25);
b.H = new H(0.8, 0.75);
t.v(a);
return b
}, Capacitor: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(0, 1 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Resistor: function (a, b, c) {
a = t.u();
J(a, 0, 0.5 * c, !1);
a.lineTo(0.1 * b, 0);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.5 * b, 0);
a.lineTo(0.6 * b, 1 * c);
a.lineTo(0.7 * b, 0.5 * c);
b = a.s;
t.v(a);
return b
}, Inductor: function (a, b, c) {
a = t.u();
var d = 0.1 * D.sa, e = 0.1, g = 0.5;
J(a, (e - 0.5 * d) * b, (g + 0.1) * c, !1);
K(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.3;
g = 0.5;
K(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
K(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
g = e = 0.5;
K(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
K(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.7;
g = 0.5;
K(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
K(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) *
b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.9;
g = 0.5;
K(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, (e + 0.5 * d) * b, (g + 0.1) * c);
b = a.s;
t.v(a);
return b
}, ACvoltageSource: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 0 * b, 0.5 * c, !1);
K(a, 0 * b, (0.5 - d) * c, (0.5 - d) * b, 0 * c, 0.5 * b, 0 * c);
K(a, (0.5 + d) * b, 0 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0 * b, (0.5 + d) * c, 0 * b, 0.5 * c);
a.moveTo(0.1 * b, 0.5 * c);
K(a, 0.5 * b, 0 * c, 0.5 * b, 1 * c, 0.9 * b, 0.5 * c);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, DCvoltageSource: function (a, b, c) {
a = t.u();
J(a, 0, 0.75 * c, !1);
a.lineTo(0, 0.25 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Diode: function (a, b, c) {
a = t.u();
J(a, 1 * b, 0, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new H(0, 0.25);
b.H = new H(0.5, 0.75);
t.v(a);
return b
}, Wifi: function (a, b, c) {
var d = b, e = c;
b *= 0.38;
c *= 0.6;
a = t.u();
var g = D.sa, h = 0.8 * g, k = 0.8, l = 0, m = 0.5, d = (d - b) / 2, e = (e - c) / 2;
J(a, l * b + d, (m + k) * c + e, !0);
K(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
K(a, (l - k) * b + d, (m - h) *
c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
K(a, l * b + d, (m - k) * c + e, (l - k + 0.5 * h) * b + d, (m - h) * c + e, (l - k + 0.5 * h) * b + d, m * c + e);
K(a, (l - k + 0.5 * h) * b + d, (m + h) * c + e, l * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
M(a);
h = 0.4 * g;
k = 0.4;
l = 0.2;
m = 0.5;
J(a, l * b + d, (m + k) * c + e, !0);
K(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
K(a, (l - k) * b + d, (m - h) * c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
K(a, l * b + d, (m - k) * c + e, (l - k + 0.5 * h) * b + d, (m - h) * c + e, (l - k + 0.5 * h) * b + d, m * c + e);
K(a, (l - k + 0.5 * h) * b + d, (m + h) * c + e, l * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
M(a);
h = 0.2 * g;
k = 0.2;
m = l = 0.5;
J(a, (l - k) * b + d, m * c + e, !0);
K(a, (l - k) * b + d, (m - h) * c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
K(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
K(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
K(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
h = 0.4 * g;
k = 0.4;
l = 0.8;
m = 0.5;
J(a, l * b + d, (m - k) * c + e, !0);
K(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
K(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
K(a, l * b + d, (m + k) * c + e, (l + k - 0.5 * h) * b + d, (m + h) * c + e, (l + k - 0.5 *
h) * b + d, m * c + e);
K(a, (l + k - 0.5 * h) * b + d, (m - h) * c + e, l * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
M(a);
h = 0.8 * g;
k = 0.8;
l = 1;
m = 0.5;
J(a, l * b + d, (m - k) * c + e, !0);
K(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
K(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
K(a, l * b + d, (m + k) * c + e, (l + k - 0.5 * h) * b + d, (m + h) * c + e, (l + k - 0.5 * h) * b + d, m * c + e);
K(a, (l + k - 0.5 * h) * b + d, (m - h) * c + e, l * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
M(a);
b = a.s;
t.v(a);
return b
}, Email: function (a, b, c) {
a = t.u();
J(a, 0, 0, !0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 *
c);
a.lineTo(0, 0);
M(a);
J(a, 0, 0, !1);
a.lineTo(0.5 * b, 0.6 * c);
a.lineTo(1 * b, 0);
a.moveTo(0, 1 * c);
a.lineTo(0.45 * b, 0.54 * c);
a.moveTo(1 * b, 1 * c);
a.lineTo(0.55 * b, 0.54 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, Ethernet: function (a, b, c) {
a = t.u();
J(a, 0.35 * b, 0, !0);
a.lineTo(0.65 * b, 0);
a.lineTo(0.65 * b, 0.4 * c);
a.lineTo(0.35 * b, 0.4 * c);
a.lineTo(0.35 * b, 0);
M(a);
J(a, 0.1 * b, 1 * c, !0, !0);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.4 * b, 0.6 * c);
a.lineTo(0.1 * b, 0.6 * c);
a.lineTo(0.1 * b, 1 * c);
M(a);
J(a, 0.6 * b, 1 * c, !0, !0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.9 * b, 0.6 * c);
a.lineTo(0.6 *
b, 0.6 * c);
a.lineTo(0.6 * b, 1 * c);
M(a);
J(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.5 * b, 0.4 * c);
a.moveTo(0.75 * b, 0.5 * c);
a.lineTo(0.75 * b, 0.6 * c);
a.moveTo(0.25 * b, 0.5 * c);
a.lineTo(0.25 * b, 0.6 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, Power: function (a, b, c) {
a = t.u();
var d = D.sa, e = 0.4 * d, g = 0.4, h = t.M(), k = t.M(), l = t.M(), m = t.M();
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.5, h, h, k, l, m);
var n = t.cc(k.x, k.y);
J(a, k.x * b, k.y * c, !0);
K(a, l.x * b, l.y * c, m.x * b, m.y * c, (0.5 + g) * b, 0.5 * c);
K(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 +
e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, (0.5 - e) * b, (0.5 + g) * c, (0.5 - g) * b, (0.5 + e) * c, (0.5 - g) * b, 0.5 * c);
D.qi(0.5 - g, 0.5, 0.5 - g, 0.5 - e, 0.5 - e, 0.5 - g, 0.5, 0.5 - g, 0.5, l, m, k, h, h);
K(a, l.x * b, l.y * c, m.x * b, m.y * c, k.x * b, k.y * c);
e = 0.3 * d;
g = 0.3;
D.qi(0.5 - g, 0.5, 0.5 - g, 0.5 - e, 0.5 - e, 0.5 - g, 0.5, 0.5 - g, 0.5, l, m, k, h, h);
a.lineTo(k.x * b, k.y * c);
K(a, m.x * b, m.y * c, l.x * b, l.y * c, (0.5 - g) * b, 0.5 * c);
K(a, (0.5 - g) * b, (0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
K(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
D.qi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 -
e, 0.5 + g, 0.5, 0.5, h, h, k, l, m);
K(a, m.x * b, m.y * c, l.x * b, l.y * c, k.x * b, k.y * c);
M(a);
J(a, 0.45 * b, 0, !0);
a.lineTo(0.45 * b, 0.5 * c);
a.lineTo(0.55 * b, 0.5 * c);
a.lineTo(0.55 * b, 0);
M(a);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
b = a.s;
b.G = new H(0.25, 0.55);
b.H = new H(0.75, 0.8);
t.v(a);
return b
}, Fallout: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 0 * b, 0.5 * c, !0);
K(a, 0 * b, (0.5 - d) * c, (0.5 - d) * b, 0 * c, 0.5 * b, 0 * c);
K(a, (0.5 + d) * b, 0 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0 * b, (0.5 + d) * c, 0 * b, 0.5 * c);
var e =
d = 0;
J(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
d = 0.4;
e = 0;
M(a);
J(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
d = 0.2;
e = -0.3;
M(a);
J(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
M(a);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}, IrritationHazard: function (a, b, c) {
a = t.u();
J(a, 0.2 * b, 0 * c, !0);
a.lineTo(0.5 *
b, 0.3 * c);
a.lineTo(0.8 * b, 0 * c);
a.lineTo(1 * b, 0.2 * c);
a.lineTo(0.7 * b, 0.5 * c);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0.5 * b, 0.7 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0 * b, 0.8 * c);
a.lineTo(0.3 * b, 0.5 * c);
a.lineTo(0 * b, 0.2 * c);
M(a);
b = a.s;
b.G = new H(0.3, 0.3);
b.H = new H(0.7, 0.7);
t.v(a);
return b
}, ElectricalHazard: function (a, b, c) {
a = t.u();
J(a, 0.37, 0 * c, !0);
a.lineTo(0.5 * b, 0.11 * c);
a.lineTo(0.77 * b, 0.04 * c);
a.lineTo(0.33 * b, 0.49 * c);
a.lineTo(1 * b, 0.37 * c);
a.lineTo(0.63 * b, 0.86 * c);
a.lineTo(0.77 * b, 0.91 * c);
a.lineTo(0.34 * b, 1 * c);
a.lineTo(0.34 *
b, 0.78 * c);
a.lineTo(0.44 * b, 0.8 * c);
a.lineTo(0.65 * b, 0.56 * c);
a.lineTo(0 * b, 0.68 * c);
M(a);
b = a.s;
t.v(a);
return b
}, FireHazard: function (a, b, c) {
a = t.u();
J(a, 0.1 * b, 1 * c, !0);
K(a, -0.25 * b, 0.63 * c, 0.45 * b, 0.44 * c, 0.29 * b, 0 * c);
K(a, 0.48 * b, 0.17 * c, 0.54 * b, 0.35 * c, 0.51 * b, 0.42 * c);
K(a, 0.59 * b, 0.29 * c, 0.58 * b, 0.28 * c, 0.59 * b, 0.18 * c);
K(a, 0.8 * b, 0.34 * c, 0.88 * b, 0.43 * c, 0.75 * b, 0.6 * c);
K(a, 0.87 * b, 0.48 * c, 0.88 * b, 0.43 * c, 0.88 * b, 0.31 * c);
K(a, 1.17 * b, 0.76 * c, 0.82 * b, 0.8 * c, 0.9 * b, 1 * c);
M(a);
b = a.s;
b.G = new H(0.05, 0.645);
b.H = new H(0.884, 0.908);
t.v(a);
return b
},
BpmnActivityLoop: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
J(a, (0.5 * Math.SQRT2 / 2 + 0.5) * b, (1 - (0.5 - 0.5 * Math.SQRT2 / 2)) * c, !1);
K(a, 1 * b, 0.7 * c, 1 * b, 0.5 * c, 1 * b, 0.5 * c);
K(a, 1 * b, (0.5 - d + 0) * c, (0.5 + d + 0) * b, 0 * c, 0.5 * b, 0 * c);
K(a, (0.5 - d + 0) * b, 0 * c, 0 * b, (0.5 - d + 0) * c, 0 * b, 0.5 * c);
K(a, 0 * b, (0.5 + d + 0) * c, (0.5 - d + 0) * b, 1 * c, 0.35 * b, 0.98 * c);
a.moveTo(0.35 * b, 0.8 * c);
a.lineTo(0.35 * b, 1 * c);
a.lineTo(0.15 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityParallel: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(0, 1 * c);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 *
b, 1 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivitySequential: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.moveTo(0, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0, 1 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityAdHoc: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
J(a, 1 * b, 1 * c, !1);
J(a, 0, 0.5 * c, !1);
K(a, 0.2 * b, 0.35 * c, 0.3 * b, 0.35 * c, 0.5 * b, 0.5 * c);
K(a, 0.7 * b, 0.65 * c, 0.8 * b, 0.65 * c, 1 * b, 0.5 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityCompensation: function (a, b, c) {
a = t.u();
J(a, 0, 0.5 * c, !0);
a.lineTo(0.5 *
b, 0);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(1 * b, 0);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
M(a);
b = a.s;
t.v(a);
return b
}, BpmnTaskMessage: function (a, b, c) {
a = t.u();
J(a, 0, 0.2 * c, !0);
a.lineTo(1 * b, 0.2 * c);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0, 0.8 * c);
a.lineTo(0, 0.8 * c);
M(a);
J(a, 0, 0.2 * c, !1);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(1 * b, 0.2 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, BpmnTaskScript: function (a, b, c) {
a = t.u();
J(a, 0.7 * b, 1 * c, !0);
a.lineTo(0.3 * b, 1 * c);
K(a, 0.6 * b, 0.5 * c, 0, 0.5 * c, 0.3 * b, 0);
a.lineTo(0.7 * b, 0);
K(a, 0.4 * b, 0.5 * c,
1 * b, 0.5 * c, 0.7 * b, 1 * c);
M(a);
J(a, 0.45 * b, 0.73 * c, !1);
a.lineTo(0.7 * b, 0.73 * c);
a.moveTo(0.38 * b, 0.5 * c);
a.lineTo(0.63 * b, 0.5 * c);
a.moveTo(0.31 * b, 0.27 * c);
a.lineTo(0.56 * b, 0.27 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, BpmnTaskUser: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
J(a, 0.335 * b, (1 - 0.555) * c, !0);
a.lineTo(0.335 * b, 0.595 * c);
a.lineTo(0.665 * b, 0.595 * c);
a.lineTo(0.665 * b, (1 - 0.555) * c);
K(a, 0.88 * b, 0.46 * c, 0.98 * b, 0.54 * c, 1 * b, 0.68 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.68 * c);
K(a, 0.02 * b, 0.54 * c, 0.12 * b, 0.46 * c, 0.335 * b, (1 - 0.555) *
c);
a.lineTo(0.365 * b, 0.405 * c);
var d = 0.5 - 0.285, e = Math.PI / 4, g = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)), e = g * d, g = g * d;
K(a, (0.5 - (e + d) / 2) * b, (d + (d + g) / 2) * c, (0.5 - d) * b, (d + g) * c, (0.5 - d) * b, d * c);
K(a, (0.5 - d) * b, (d - g) * c, (0.5 - e) * b, (d - d) * c, 0.5 * b, (d - d) * c);
K(a, (0.5 + e) * b, (d - d) * c, (0.5 + d) * b, (d - g) * c, (0.5 + d) * b, d * c);
K(a, (0.5 + d) * b, (d + g) * c, (0.5 + (e + d) / 2) * b, (d + (d + g) / 2) * c, 0.635 * b, 0.405 * c);
a.lineTo(0.635 * b, 0.405 * c);
a.lineTo(0.665 * b, (1 - 0.555) * c);
a.lineTo(0.665 * b, 0.595 * c);
a.lineTo(0.335 * b, 0.595 * c);
J(a, 0.2 * b, 1 * c, !1);
a.lineTo(0.2 * b, 0.8 * c);
J(a,
0.8 * b, 1 * c, !1);
a.lineTo(0.8 * b, 0.8 * c);
b = a.s;
t.v(a);
return b
}, BpmnEventConditional: function (a, b, c) {
a = t.u();
J(a, 0.1 * b, 0, !0);
a.lineTo(0.9 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.1 * b, 1 * c);
M(a);
J(a, 0.2 * b, 0.2 * c, !1);
a.lineTo(0.8 * b, 0.2 * c);
a.moveTo(0.2 * b, 0.4 * c);
a.lineTo(0.8 * b, 0.4 * c);
a.moveTo(0.2 * b, 0.6 * c);
a.lineTo(0.8 * b, 0.6 * c);
a.moveTo(0.2 * b, 0.8 * c);
a.lineTo(0.8 * b, 0.8 * c);
a.Xa(!1);
b = a.s;
t.v(a);
return b
}, BpmnEventError: function (a, b, c) {
a = t.u();
J(a, 0, 1 * c, !0);
a.lineTo(0.33 * b, 0);
a.lineTo(0.66 * b, 0.5 * c);
a.lineTo(1 * b, 0);
a.lineTo(0.66 *
b, 1 * c);
a.lineTo(0.33 * b, 0.5 * c);
M(a);
b = a.s;
t.v(a);
return b
}, BpmnEventEscalation: function (a, b, c) {
a = t.u();
J(a, 0, 0, !1);
J(a, 1 * b, 1 * c, !1);
J(a, 0.1 * b, 1 * c, !0);
a.lineTo(0.5 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
M(a);
b = a.s;
t.v(a);
return b
}, BpmnEventTimer: function (a, b, c) {
a = t.u();
var d = 0.5 * D.sa;
J(a, 1 * b, 0.5 * c, !0);
K(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
K(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
K(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
K(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
J(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.15 *
c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0.85 * c);
a.moveTo(0, 0.5 * c);
a.lineTo(0.15 * b, 0.5 * c);
a.moveTo(1 * b, 0.5 * c);
a.lineTo(0.85 * b, 0.5 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.58 * b, 0.1 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.78 * b, 0.54 * c);
a.Xa(!1);
b = a.s;
b.fc = Rg;
t.v(a);
return b
}};
for (var Xl in D.zi)D.zi[Xl.toLowerCase()] = Xl;
D.rv = {"": "", Standard: "F1 m 0,0 l 8,4 -8,4 2,-4 z", Backward: "F1 m 8,0 l -2,4 2,4 -8,-4 z", Triangle: "F1 m 0,0 l 8,4.62 -8,4.62 z", BackwardTriangle: "F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z", Boomerang: "F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z", BackwardBoomerang: "F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z", SidewaysV: "m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z", BackwardV: "m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z", OpenTriangle: "m 0,0 l 8,4 -8,4", BackwardOpenTriangle: "m 8,0 l -8,4 8,4", OpenTriangleLine: "m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
BackwardOpenTriangleLine: "m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8", OpenTriangleTop: "m 0,0 l 8,4 m 0,4", BackwardOpenTriangleTop: "m 8,0 l -8,4 m 0,4", OpenTriangleBottom: "m 0,8 l 8,-4", BackwardOpenTriangleBottom: "m 0,4 l 8,4", HalfTriangleTop: "F1 m 0,0 l 0,4 8,0 z m 0,8", BackwardHalfTriangleTop: "F1 m 8,0 l 0,4 -8,0 z m 0,8", HalfTriangleBottom: "F1 m 0,4 l 0,4 8,-4 z", BackwardHalfTriangleBottom: "F1 m 8,4 l 0,4 -8,-4 z", ForwardSemiCircle: "m 4,0 b 270 180 0 4 4", BackwardSemiCircle: "m 4,8 b 90 180 0 -4 4", Feather: "m 0,0 l 3,4 -3,4",
BackwardFeather: "m 3,0 l -3,4 3,4", DoubleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4", BackwardDoubleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4", TripleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4", BackwardTripleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4", ForwardSlash: "m 0,8 l 5,-8", BackSlash: "m 0,0 l 5,8", DoubleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8", DoubleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8", TripleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
TripleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8", Fork: "m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4", BackwardFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4", LineFork: "m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4", BackwardLineFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8", CircleFork: "F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3", CircleLineFork: "F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
BackwardCircleLineFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3", Circle: "F1 m 8,4 b 0 360 -4 0 4 z", Block: "F1 m 0,0 l 0,8 8,0 0,-8 z", StretchedDiamond: "F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z", Diamond: "F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z", Chevron: "F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z", StretchedChevron: "F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z", NormalArrow: "F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z", X: "m 0,0 l 8,8 m 0,-8 l -8,8", TailedNormalArrow: "F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
DoubleTriangle: "F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z", BigEndArrow: "F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z", ConcaveTailArrow: "F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z", RoundedTriangle: "F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z", SimpleArrow: "F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z", AccelerationArrow: "F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z", BoxArrow: "F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
TriangleLine: "F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8", CircleEndedArrow: "F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z", DynamicWidthArrow: "F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z", EquilibriumArrow: "m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3", FastForward: "F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z", Kite: "F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z", HalfArrowTop: "F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8", HalfArrowBottom: "F1 m 0,8 l 4,-4 4,0 -8,4 z",
OpposingDirectionDoubleArrow: "F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z", PartialDoubleTriangle: "F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z", LineCircle: "F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z", DoubleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z", TripleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z", CircleLine: "F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8", DiamondCircle: "F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z", PlusCircle: "F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
OpenRightTriangleTop: "m 8,0 l 0,4 -8,0 m 0,4", OpenRightTriangleBottom: "m 8,8 l 0,-4 -8,0", Line: "m 0,0 l 0,8", DoubleLine: "m 0,0 l 0,8 m 2,0 l 0,-8", TripleLine: "m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8", PentagonArrow: "F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z", None: ""};
D.mA = {};
D.sv = {};
D.yo = function (a) {
if (D.rv) {
for (var b in D.rv) {
var c = Nc(D.rv[b], !1);
D.sv[b] = c;
b.toLowerCase() !== b && (D.sv[b.toLowerCase()] = b)
}
D.rv = void 0
}
return D.sv[a]
};
Y.FigureGenerators = D.zi;
Y.ArrowheadGeometries = D.sv;
function B(a) {
0 === arguments.length ? y.call(this) : y.call(this, a);
this.aa = 49663;
this.Cn = this.Sg = "";
this.ur = this.rr = this.Dr = this.Hq = null;
this.Fr = "";
this.Ih = this.Er = this.Xl = null;
this.tr = "";
this.Qn = null;
this.sr = (new da(NaN, NaN)).freeze();
this.vr = "";
this.Rn = null;
this.$d = "";
this.Bn = this.Xp = this.pk = null;
this.Wh = (new v(NaN, NaN)).freeze();
this.Pq = "";
this.Ck = null;
this.Qq = yb;
this.Zq = D.UF;
this.Sq = D.TF;
this.gq = null;
this.Iq = Yl;
this.$l = (new v(6, 6)).freeze();
this.Zl = "gray";
this.Yl = 4;
this.gG = -1;
this.dG = new w;
this.mj =
null;
this.kj = NaN
}
t.ea("Part", B);
t.Ja(B, y);
B.prototype.cloneProtected = function (a) {
y.prototype.cloneProtected.call(this, a);
a.aa = this.aa & -4097 | 49152;
a.Sg = this.Sg;
a.Cn = this.Cn;
a.Hq = this.Hq;
a.Dr = this.Dr;
a.rr = this.rr;
a.ur = this.ur;
a.Fr = this.Fr;
a.Er = this.Er;
a.Ih = null;
a.tr = this.tr;
a.sr.assign(this.sr);
a.vr = this.vr;
a.$d = this.$d;
a.Xp = this.Xp;
a.Wh.assign(this.Wh);
a.Pq = this.Pq;
a.Qq = this.Qq.W();
a.Zq = this.Zq.W();
a.Sq = this.Sq.W();
a.gq = this.gq;
a.Iq = this.Iq;
a.$l.assign(this.$l);
a.Zl = this.Zl;
a.Yl = this.Yl
};
B.prototype.th = function (a) {
y.prototype.th.call(this, a);
Wj(a);
a.Xl = null;
a.Qn = null;
a.Rn = null;
a.Ck = null;
a.mj = null
};
B.prototype.toString = function () {
var a = t.Fg(Object.getPrototypeOf(this)) + "#" + t.jc(this);
this.data && (a += "(" + td(this.data) + ")");
return a
};
B.LayoutNone = 0;
var Hi;
B.LayoutAdded = Hi = 1;
var Mi;
B.LayoutRemoved = Mi = 2;
var Fh;
B.LayoutShown = Fh = 4;
var Gh;
B.LayoutHidden = Gh = 8;
B.LayoutNodeSized = 16;
var dj;
B.LayoutGroupLayout = dj = 32;
B.LayoutNodeReplaced = 64;
var Yl;
B.LayoutStandard = Yl = Hi | Mi | Fh | Gh | 16 | dj | 64;
B.prototype.Hm = function (a, b, c, d, e, g, h) {
var k = this.h;
null !== k && (a === rd && "elements" === b ? e instanceof y && Ii(e, function (a) {
Ji(k, a)
}) : a === sd && "elements" === b && e instanceof y && Ii(e, function (a) {
Li(k, a)
}), k.Yc(a, b, c, d, e, g, h))
};
B.prototype.updateTargetBindings = B.prototype.Eb = function (a) {
y.prototype.Eb.call(this, a);
if (null !== this.data)for (a = this.elements; a.next();) {
var b = a.value;
b instanceof y && Ii(b, function (a) {
null !== a.data && a.Eb()
})
}
};
t.A(B, {mv: "adornments"}, function () {
return null === this.Ih ? t.Pg : this.Ih.l
});
B.prototype.findAdornment = B.prototype.xo = function (a) {
f && t.k(a, "string", B, "findAdornment:category");
var b = this.Ih;
return null === b ? null : b.wa(a)
};
B.prototype.addAdornment = B.prototype.Kk = function (a, b) {
if (null !== b) {
f && (t.k(a, "string", B, "addAdornment:category"), t.j(b, Ce, B, "addAdornment:ad"));
var c = null, d = this.Ih;
null !== d && (c = d.wa(a));
if (c !== b) {
if (null !== c) {
var e = c.h;
null !== e && e.remove(c)
}
null === d && (this.Ih = d = new ia("string", Ce));
b.Sg !== a && (b.Ic = a);
d.add(a, b);
c = this.h;
null !== c && (c.add(b), b.data = this.data)
}
}
};
B.prototype.removeAdornment = B.prototype.el = function (a) {
f && t.k(a, "string", B, "removeAdornment:category");
var b = this.Ih;
if (null !== b) {
var c = b.wa(a);
if (null !== c) {
var d = c.h;
null !== d && d.remove(c)
}
b.remove(a);
0 === b.count && (this.Ih = null)
}
};
B.prototype.clearAdornments = B.prototype.ue = function () {
var a = this.Ih;
if (null !== a) {
for (var b = t.yb(), a = a.l; a.next();)b.push(a.key);
for (var a = b.length, c = 0; c < a; c++)this.el(b[c]);
t.xa(b)
}
};
B.prototype.updateAdornments = function () {
var a = this.h;
if (null !== a) {
Zl(this, a);
for (var a = a.zb.mf.p, b = a.length, c = 0; c < b; c++) {
var d = a[c];
d.isEnabled && d.updateAdornments(this)
}
for (a = this.mv; a.next();)b = a.value, b.$k || null !== b.rb && b.Y()
}
};
function Zl(a, b) {
if (a.Za && a.ZE) {
var c = a.dt;
if (null === c || !(a.ua.P() && a.ub() && c.al() && c.ua.P()))return;
var d = a.xo("Selection");
if (null === d) {
d = a.$E;
null === d && (a instanceof X ? d = b.jE : a instanceof B && (d = a instanceof U ? b.HD : b.yE));
if (!(d instanceof Ce))return;
Ee(d);
d = d.copy();
if (!(d instanceof Ce))return;
d.Ic = "Selection";
d.$k = !0;
d.Hc = c
}
if (null !== d) {
var e = d.placeholder;
if (null !== e) {
var g = c.Tj(), h = 0;
c instanceof Y && (h = c.bb);
var k = t.jl();
k.q((c.Oa.width + h) * g, (c.Oa.height + h) * g);
e.ya = k;
t.Rj(k)
}
d.angle = c.Wk();
d.type !== vg ? (e = t.M(), d.location = c.$a(yb, e), t.B(e)) : d.Y();
a.Kk("Selection", d);
return
}
}
a.el("Selection")
}
t.A(B, {layer: "layer"}, function () {
return this.Bn
});
t.A(B, {h: "diagram"}, function () {
var a = this.Bn;
return null !== a ? a.h : null
});
t.g(B, "layerName", B.prototype.Md);
t.defineProperty(B, {Md: "layerName"}, function () {
return this.Cn
}, function (a) {
var b = this.Cn;
if (b !== a) {
t.k(a, "string", B, "layerName");
var c = this.h;
if (null === c || null !== c.qs(a))if (this.Cn = a, this.i("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.h, null !== c && (a = c.qs(a), null !== a && a !== b))) {
var d = b.Pe(-1, this, !0);
0 <= d && c.Yc(sd, "parts", b, this, null, d, !0);
d = a.ym(99999999, this, !0);
0 <= d && c.Yc(rd, "parts", a, null, this, !0, d);
d = this.Po;
if (null !== d) {
var e = c.Sa;
c.Sa = !0;
d(this, b, a);
c.Sa = e
}
}
}
});
t.g(B, "layerChanged", B.prototype.Po);
t.defineProperty(B, {Po: "layerChanged"}, function () {
return this.Hq
}, function (a) {
var b = this.Hq;
b !== a && (null !== a && t.k(a, "function", B, "layerChanged"), this.Hq = a, this.i("layerChanged", b, a))
});
t.A(B, {kc: "isTemporary"}, function () {
return null !== this.Bn ? this.Bn.kc : !1
});
function $l(a) {
var b = a.h;
null !== b && (Yh(b), 0 !== (a.aa & 16384) !== !0 && (a.aa |= 16384, a.ra(), b.Of.add(a), b.Hf()))
}
function Bh(a) {
0 !== (a.aa & 16384) !== !1 && (a.updateAdornments(), a.aa &= -16385, a = a.h, null !== a && (a.Ee = !0))
}
t.g(B, "location", B.prototype.location);
t.defineProperty(B, {location: "location"}, function () {
return this.Wh
}, function (a) {
var b = this.Wh;
if (!(b.K(a) || this instanceof X)) {
f && t.j(a, v, B, "location");
a = a.W();
var c = this.h;
this.Wh = a;
if (!1 === wi(this)) {
var d = this.sb, e = a.x - b.x, g = a.y - b.y, h = d.copy();
d.q(h.x + e, h.y + g);
rk(this);
!d.K(h) && c && this.i("position", h, d)
}
this.i("location", b, a)
}
});
function rk(a) {
if (!1 === xi(a)) {
var b = a.h;
null !== b && (b.Of.add(a), a instanceof S && !b.va.kb && a.Hg(), b.Hf());
am(a, !0)
}
}
function sk(a) {
if (!1 !== xi(a)) {
var b = a.position, c = a.location;
c.P() && b.P() || (bm(a, b, c), Sj(a));
var b = a.sb, c = a.Ob, d = c.copy();
c.Qa();
c.x = b.x;
c.y = b.y;
c.freeze();
Tj(a, d, c);
am(a, !1)
}
}
t.A(B, {Zb: "locationObject"}, function () {
if (null === this.Ck) {
var a = this.fw;
void 0 !== a && null !== a && "" !== a ? (a = this.ee(a), this.Ck = null !== a ? a : this) : this.Ck = this instanceof Ce && this.Z !== vg && null !== this.rb ? this.rb : this
}
return this.Ck.visible ? this.Ck : this
});
t.g(B, "minLocation", B.prototype.rE);
t.defineProperty(B, {rE: "minLocation"}, function () {
return this.Zq
}, function (a) {
var b = this.Zq;
b.K(a) || (f && t.j(a, v, B, "minLocation"), this.Zq = a = a.W(), this.i("minLocation", b, a))
});
t.g(B, "maxLocation", B.prototype.lE);
t.defineProperty(B, {lE: "maxLocation"}, function () {
return this.Sq
}, function (a) {
var b = this.Sq;
b.K(a) || (f && t.j(a, v, B, "maxLocation"), this.Sq = a = a.W(), this.i("maxLocation", b, a))
});
t.g(B, "locationObjectName", B.prototype.fw);
t.defineProperty(B, {fw: "locationObjectName"}, function () {
return this.Pq
}, function (a) {
var b = this.Pq;
b !== a && (f && t.k(a, "string", B, "locationObjectName"), this.Pq = a, this.Ck = null, jk(this), this.i("locationObjectName", b, a))
});
t.g(B, "locationSpot", B.prototype.Re);
t.defineProperty(B, {Re: "locationSpot"}, function () {
return this.Qq
}, function (a) {
var b = this.Qq;
b.K(a) || (f && (t.j(a, H, B, "locationSpot"), a.jd() || t.m("Part.locationSpot must be a specific Spot value, not: " + a)), this.Qq = a = a.W(), jk(this), this.i("locationSpot", b, a))
});
B.prototype.move = B.prototype.move = function (a) {
this.position = a
};
B.prototype.moveTo = B.prototype.moveTo = function (a, b) {
var c = t.cc(a, b);
this.move(c);
t.B(c)
};
B.prototype.isVisible = B.prototype.ub = function () {
if (!this.visible)return!1;
var a = this.layer;
if (null !== a && !a.visible)return!1;
a = this.ib;
if (!(null === a || a.gf && a.ub()))return!1;
if (this instanceof S) {
a = this.vD();
if (null !== a && !a.Kc)return!1;
a = this.kd;
if (null !== a) {
var b = {};
b[t.jc(this)] = !0;
return cm(a, b)
}
} else if (this instanceof X) {
var b = !0, c = this.h;
null !== c && (b = c.Xc);
c = this.ca;
if (null !== c) {
if (this.sc && b && !c.Kc)return!1;
c = dm(c);
if (null === c || c === a)return!1
}
c = this.ga;
if (null !== c) {
if (this.sc && !b && !c.Kc)return!1;
b = dm(c);
if (null === b || b === a)return!1
}
}
return!0
};
function cm(a, b) {
var c = a.ca;
if (null !== c) {
var d = c.kd;
if (null !== d)b[t.jc(c)] || (b[t.jc(c)] = !0, cm(d, b)); else if (null === dm(c))return!1
}
c = a.ga;
if (null !== c)if (d = c.kd, null !== d)b[t.jc(c)] || (b[t.jc(c)] = !0, cm(d, b)); else if (null === dm(c))return!1;
return!0
}
B.prototype.findObject = B.prototype.ee = function (a) {
if (this.name === a)return this;
null === this.mj && (this.mj = {});
var b = this.mj;
if (void 0 !== b[a])return b[a];
for (var c = this.za.p, d = c.length, e = 0; e < d; e++) {
var g = c[e];
if (g.name === a)return b[a] = g;
if (g instanceof y)if (!g.ZD()) {
if (g = g.ee(a), null !== g)return b[a] = g
} else if (Al(g) && (g = g.za.Ya(), null !== g && g.name === a))return b[a] = g
}
return b[a] = null
};
function em(a, b, c, d) {
void 0 === d && (d = new v);
c.hd() && (c = Hb);
var e = b.Oa;
d.q(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY);
if (null === b || b === a)return d;
b.transform.Ra(d);
for (b = b.fa; null !== b && b !== a;)b.transform.Ra(d), b = b.fa;
a.Bk.Ra(d);
d.offset(-a.Dc.x, -a.Dc.y);
return d
}
B.prototype.ensureBounds = B.prototype.zf = function () {
lh(this, Infinity, Infinity);
this.yc()
};
function Eh(a, b, c) {
c = void 0 === c ? a.dG : c;
var d;
isNaN(a.kj) && (a.kj = Cl(a));
d = a.kj;
var e = 2 * d;
if (!a.Ei)return c.q(b.x - 1 - d, b.y - 1 - d, b.width + 2 + e, b.height + 2 + e), c;
d = b.x;
var e = b.y, g = b.width;
b = b.height;
var h = a.shadowBlur;
a = a.eF;
g += h;
b += h;
d -= h / 2;
e -= h / 2;
0 < a.x ? g += a.x : (d += a.x, g -= a.x);
0 < a.y ? b += a.y : (e += a.y, b -= a.y);
c.q(d - 1, e - 1, g + 2, b + 2);
return c
}
B.prototype.yc = function () {
Sj(this);
if (!1 === wi(this))sk(this); else {
var a = t.rf();
a.assign(this.Ob);
gk(this);
this.Ob.Qa();
var b = Ah(this);
this.Hj(0, 0, this.Dc.width, this.Dc.height);
var c = this.position;
bm(this, c, this.location);
var d = this.Ob;
d.x = c.x;
d.y = c.y;
d.freeze();
Sj(this);
Tj(this, a, d);
a.K(d) ? this.If(b) : !this.Jd() || D.I(a.width, d.width) && D.I(a.height, d.height) || this.J(16);
t.Jc(a);
am(this, !1)
}
};
function bm(a, b, c) {
var d = NaN, e = NaN, g = t.M(), h = a.Re, d = a.Zb;
h.hd() && t.m("Spot must be real: " + h.toString());
var e = d.Oa, k = 0;
d.bb && (k = d.Cg);
g.ft(0, 0, e.width + k, e.height + k, h);
if (d !== a)for (d.bb && g.offset(-k / 2, -k / 2), d.transform.Ra(g), h = d.fa; null !== h && h !== a;)h.transform.Ra(g), h = h.fa;
a.Bk.Ra(g);
g.offset(-a.Dc.x, -a.Dc.y);
h = a.h;
c.P() ? (d = c.x - g.x, e = c.y - g.y, c = b.copy(), b.q(d, e), b.K(c) || null === h || (d = h.xb, h.xb = !0, a.i("position", c, b), h.xb = d)) : b.P() && (d = b.x, e = b.y, b = c.copy(), c.q(d + g.x, e + g.y), c.K(b) || null === h || (d = h.xb,
h.xb = !0, a.i("location", b, c), h.xb = d));
t.B(g)
}
function Ki(a, b, c) {
Yj(a, !1);
a instanceof S && nj(c, a);
a.layer.kc || b || c.vc();
b = a.Ob;
var d = c.lb;
d.P() ? (Ah(a) ? ab(b, d) || (a.If(!1), $l(a)) : b.Cf(d) && a.If(!0), a.updateAdornments()) : c.yk = !0
}
B.prototype.Zk = function () {
return!0
};
function Ch(a, b) {
if (a.visible) {
var c = a.Ob;
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
var d = a.transform, e = a.fa, g = a.pl;
g.reset();
null !== e && (e.Og() ? g.multiply(e.ae) : null !== e.fa && g.multiply(e.fa.ae));
g.multiply(a.qd);
null !== a.dc && (dk(a, b, a.dc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height));
null === a.dc && null === a.Bb && (b.fillStyle = "rgba(0,0,0,0.4)", b.fillRect(c.x, c.y, c.width, c.height));
null !== a.Bb && (d.Es() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), e = a.Oa, c = e.width, e = e.height, dk(a, b, a.Bb,
!0), b.fillRect(0, 0, c + 0, e + 0), d.Es() || (c = 1 / (d.m11 * d.m22 - d.m12 * d.m21), b.transform(d.m22 * c, -d.m12 * c, -d.m21 * c, d.m11 * c, c * (d.m21 * d.dy - d.m22 * d.dx), c * (d.m12 * d.dx - d.m11 * d.dy))))
}
}
}
B.prototype.Jd = function () {
return!0
};
t.g(B, "category", B.prototype.Ic);
t.defineProperty(B, {Ic: "category"}, function () {
return this.Sg
}, function (a) {
var b = this.Sg;
if (b !== a) {
t.k(a, "string", B, "category");
this.Sg = a;
this.i("category", b, a);
var c = this.h, d = this.data;
if (null !== c && null !== d) {
var e = c.da;
this instanceof X ? (e instanceof P ? e.cF(d, a) : e instanceof Dd && e.AI(d, a), c = c.findTemplateForLinkData(d, a), c instanceof X && (Ee(c), c = c.copy(), c instanceof X && fm(this, c, b, a))) : this instanceof Ce || (null !== e && e.uw(d, a), c = c.findTemplateForNodeData(d, a), c instanceof B && (Ee(c), c = c.copy(), c instanceof
B && !(c instanceof X) && fm(this, c, b, a)))
}
this instanceof Ce && (a = this.Cj, null !== a && (c = a.Ih, null !== c && c.remove(b), a.Kk(this.Sg, this)))
}
});
function fm(a, b, c, d) {
b.constructor === a.constructor || t.IF || (t.IF = !0, t.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), t.trace(" Old class: " + t.Fg(a) + ", new class: " + t.Fg(b) + ", part: " + a.toString()));
a.ue();
var e = a.data;
c = a.Md;
var g = a.Za, h = !0, k = !0, l = !1;
a instanceof S && (h = a.xh, k = a.Kc, l = a.Om);
b.th(a);
b.cloneProtected(a);
a.Sg = d;
a.Y();
a.ra();
b = a.h;
d = !0;
null !== b && (d = b.xb, b.xb = !0);
a.wl = e;
null !== e && a.Eb();
null !== b && (b.xb = d);
e = a.Md;
e !== c && (a.Cn = c, a.Md = e);
a instanceof
S && (a.xh = h, a.Kc = k, a.Om = l, a.Jd() && a.J(64));
a.Za = g
}
B.prototype.canCopy = function () {
if (!this.$C)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Ej)return!1;
a = a.h;
return null === a ? !0 : a.Ej ? !0 : !1
};
B.prototype.canDelete = function () {
if (!this.iD)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Nk)return!1;
a = a.h;
return null === a ? !0 : a.Nk ? !0 : !1
};
B.prototype.canEdit = function () {
if (!this.qF)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.lo)return!1;
a = a.h;
return null === a ? !0 : a.lo ? !0 : !1
};
B.prototype.canGroup = function () {
if (!this.JD)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.fo)return!1;
a = a.h;
return null === a ? !0 : a.fo ? !0 : !1
};
B.prototype.canMove = function () {
if (!this.uE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Ok)return!1;
a = a.h;
return null === a ? !0 : a.Ok ? !0 : !1
};
B.prototype.canReshape = function () {
if (!this.JE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.ho)return!1;
a = a.h;
return null === a ? !0 : a.ho ? !0 : !1
};
B.prototype.canResize = function () {
if (!this.KE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.io)return!1;
a = a.h;
return null === a ? !0 : a.io ? !0 : !1
};
B.prototype.canRotate = function () {
if (!this.QE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.jo)return!1;
a = a.h;
return null === a ? !0 : a.jo ? !0 : !1
};
B.prototype.canSelect = function () {
if (!this.fl)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Ie)return!1;
a = a.h;
return null === a ? !0 : a.Ie ? !0 : !1
};
t.g(B, "copyable", B.prototype.$C);
t.defineProperty(B, {$C: "copyable"}, function () {
return 0 !== (this.aa & 1)
}, function (a) {
var b = 0 !== (this.aa & 1);
b !== a && (f && t.k(a, "boolean", B, "copyable"), this.aa ^= 1, this.i("copyable", b, a))
});
t.g(B, "deletable", B.prototype.iD);
t.defineProperty(B, {iD: "deletable"}, function () {
return 0 !== (this.aa & 2)
}, function (a) {
var b = 0 !== (this.aa & 2);
b !== a && (f && t.k(a, "boolean", B, "deletable"), this.aa ^= 2, this.i("deletable", b, a))
});
t.g(B, "textEditable", B.prototype.qF);
t.defineProperty(B, {qF: "textEditable"}, function () {
return 0 !== (this.aa & 4)
}, function (a) {
var b = 0 !== (this.aa & 4);
b !== a && (f && t.k(a, "boolean", B, "textEditable"), this.aa ^= 4, this.i("textEditable", b, a), this.updateAdornments())
});
t.g(B, "groupable", B.prototype.JD);
t.defineProperty(B, {JD: "groupable"}, function () {
return 0 !== (this.aa & 8)
}, function (a) {
var b = 0 !== (this.aa & 8);
b !== a && (f && t.k(a, "boolean", B, "groupable"), this.aa ^= 8, this.i("groupable", b, a))
});
t.g(B, "movable", B.prototype.uE);
t.defineProperty(B, {uE: "movable"}, function () {
return 0 !== (this.aa & 16)
}, function (a) {
var b = 0 !== (this.aa & 16);
b !== a && (f && t.k(a, "boolean", B, "movable"), this.aa ^= 16, this.i("movable", b, a))
});
t.g(B, "selectionAdorned", B.prototype.ZE);
t.defineProperty(B, {ZE: "selectionAdorned"}, function () {
return 0 !== (this.aa & 32)
}, function (a) {
var b = 0 !== (this.aa & 32);
b !== a && (f && t.k(a, "boolean", B, "selectionAdorned"), this.aa ^= 32, this.i("selectionAdorned", b, a), this.updateAdornments())
});
t.g(B, "isInDocumentBounds", B.prototype.Tz);
t.defineProperty(B, {Tz: "isInDocumentBounds"}, function () {
return 0 !== (this.aa & 64)
}, function (a) {
var b = 0 !== (this.aa & 64);
b !== a && (f && t.k(a, "boolean", B, "isInDocumentBounds"), this.aa ^= 64, this.i("isInDocumentBounds", b, a))
});
t.g(B, "isLayoutPositioned", B.prototype.Vz);
t.defineProperty(B, {Vz: "isLayoutPositioned"}, function () {
return 0 !== (this.aa & 128)
}, function (a) {
var b = 0 !== (this.aa & 128);
b !== a && (f && t.k(a, "boolean", B, "isLayoutPositioned"), this.aa ^= 128, this.i("isLayoutPositioned", b, a), this.J(a ? Fh : Gh))
});
t.g(B, "selectable", B.prototype.fl);
t.defineProperty(B, {fl: "selectable"}, function () {
return 0 !== (this.aa & 256)
}, function (a) {
var b = 0 !== (this.aa & 256);
b !== a && (f && t.k(a, "boolean", B, "selectable"), this.aa ^= 256, this.i("selectable", b, a), this.updateAdornments())
});
t.g(B, "reshapable", B.prototype.JE);
t.defineProperty(B, {JE: "reshapable"}, function () {
return 0 !== (this.aa & 512)
}, function (a) {
var b = 0 !== (this.aa & 512);
b !== a && (f && t.k(a, "boolean", B, "reshapable"), this.aa ^= 512, this.i("reshapable", b, a), this.updateAdornments())
});
t.g(B, "resizable", B.prototype.KE);
t.defineProperty(B, {KE: "resizable"}, function () {
return 0 !== (this.aa & 1024)
}, function (a) {
var b = 0 !== (this.aa & 1024);
b !== a && (f && t.k(a, "boolean", B, "resizable"), this.aa ^= 1024, this.i("resizable", b, a), this.updateAdornments())
});
t.g(B, "rotatable", B.prototype.QE);
t.defineProperty(B, {QE: "rotatable"}, function () {
return 0 !== (this.aa & 2048)
}, function (a) {
var b = 0 !== (this.aa & 2048);
b !== a && (f && t.k(a, "boolean", B, "rotatable"), this.aa ^= 2048, this.i("rotatable", b, a), this.updateAdornments())
});
t.g(B, "isSelected", B.prototype.Za);
t.defineProperty(B, {Za: "isSelected"}, function () {
return 0 !== (this.aa & 4096)
}, function (a) {
var b = 0 !== (this.aa & 4096);
if (b !== a) {
f && t.k(a, "boolean", B, "isSelected");
var c = this.h;
if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.mE)) {
this.aa ^= 4096;
var d = !1;
if (null !== c) {
d = c.xb;
c.xb = !0;
var e = c.selection;
e.Qa();
a ? e.add(this) : e.remove(this);
e.freeze()
}
this.i("isSelected", b, a);
$l(this);
a = this.aF;
null !== a && a(this);
null !== c && (c.Hf(), c.xb = d)
}
}
});
t.g(B, "isShadowed", B.prototype.Ei);
t.defineProperty(B, {Ei: "isShadowed"}, function () {
return 0 !== (this.aa & 8192)
}, function (a) {
var b = 0 !== (this.aa & 8192);
b !== a && (f && t.k(a, "boolean", B, "isShadowed"), this.aa ^= 8192, this.i("isShadowed", b, a), this.ra())
});
function xi(a) {
return 0 !== (a.aa & 32768)
}
function am(a, b) {
a.aa = b ? a.aa | 32768 : a.aa & -32769
}
function Yj(a, b) {
a.aa = b ? a.aa | 65536 : a.aa & -65537
}
function Ah(a) {
return 0 !== (a.aa & 131072)
}
B.prototype.If = function (a) {
this.aa = a ? this.aa | 131072 : this.aa & -131073
};
t.g(B, "selectionObjectName", B.prototype.tw);
t.defineProperty(B, {tw: "selectionObjectName"}, function () {
return this.Fr
}, function (a) {
var b = this.Fr;
b !== a && (f && t.k(a, "string", B, "selectionObjectName"), this.Fr = a, this.Xl = null, this.i("selectionObjectName", b, a))
});
t.g(B, "selectionAdornmentTemplate", B.prototype.$E);
t.defineProperty(B, {$E: "selectionAdornmentTemplate"}, function () {
return this.Dr
}, function (a) {
var b = this.Dr;
b !== a && (f && t.j(a, Ce, B, "selectionAdornmentTemplate"), this instanceof X && (a.type = vg), this.Dr = a, this.i("selectionAdornmentTemplate", b, a))
});
t.A(B, {dt: "selectionObject"}, function () {
if (null === this.Xl) {
var a = this.tw;
null !== a && "" !== a ? (a = this.ee(a), this.Xl = null !== a ? a : this) : this instanceof X ? (a = this.path, this.Xl = null !== a ? a : this) : this.Xl = this
}
return this.Xl
});
t.g(B, "selectionChanged", B.prototype.aF);
t.defineProperty(B, {aF: "selectionChanged"}, function () {
return this.Er
}, function (a) {
var b = this.Er;
b !== a && (null !== a && t.k(a, "function", B, "selectionChanged"), this.Er = a, this.i("selectionChanged", b, a))
});
t.g(B, "resizeAdornmentTemplate", B.prototype.LE);
t.defineProperty(B, {LE: "resizeAdornmentTemplate"}, function () {
return this.rr
}, function (a) {
var b = this.rr;
b !== a && (f && t.j(a, Ce, B, "resizeAdornmentTemplate"), this.rr = a, this.i("resizeAdornmentTemplate", b, a))
});
t.g(B, "resizeObjectName", B.prototype.OE);
t.defineProperty(B, {OE: "resizeObjectName"}, function () {
return this.tr
}, function (a) {
var b = this.tr;
b !== a && (f && t.k(a, "string", B, "resizeObjectName"), this.tr = a, this.Qn = null, this.i("resizeObjectName", b, a))
});
t.A(B, {NE: "resizeObject"}, function () {
if (null === this.Qn) {
var a = this.OE;
null !== a && "" !== a ? (a = this.ee(a), this.Qn = null !== a ? a : this) : this.Qn = this
}
return this.Qn
});
t.g(B, "resizeCellSize", B.prototype.ME);
t.defineProperty(B, {ME: "resizeCellSize"}, function () {
return this.sr
}, function (a) {
var b = this.sr;
b.K(a) || (f && t.j(a, da, B, "resizeCellSize"), this.sr = a = a.W(), this.i("resizeCellSize", b, a))
});
t.g(B, "rotateAdornmentTemplate", B.prototype.RE);
t.defineProperty(B, {RE: "rotateAdornmentTemplate"}, function () {
return this.ur
}, function (a) {
var b = this.ur;
b !== a && (f && t.j(a, Ce, B, "rotateAdornmentTemplate"), this.ur = a, this.i("rotateAdornmentTemplate", b, a))
});
t.g(B, "rotateObjectName", B.prototype.TE);
t.defineProperty(B, {TE: "rotateObjectName"}, function () {
return this.vr
}, function (a) {
var b = this.vr;
b !== a && (f && t.k(a, "string", B, "rotateObjectName"), this.vr = a, this.Rn = null, this.i("rotateObjectName", b, a))
});
t.A(B, {SE: "rotateObject"}, function () {
if (null === this.Rn) {
var a = this.TE;
null !== a && "" !== a ? (a = this.ee(a), this.Rn = null !== a ? a : this) : this.Rn = this
}
return this.Rn
});
t.g(B, "text", B.prototype.text);
t.defineProperty(B, {text: "text"}, function () {
return this.$d
}, function (a) {
var b = this.$d;
b !== a && (f && t.k(a, "string", B, "text"), this.$d = a, this.i("text", b, a))
});
t.g(B, "containingGroup", B.prototype.ib);
t.defineProperty(B, {ib: "containingGroup"}, function () {
return this.pk
}, function (a) {
if (this.Jd()) {
var b = this.pk;
if (b !== a) {
f && null !== a && t.j(a, U, B, "containingGroup");
null === a || this !== a && !a.Fs(this) || (this === a && t.m("Cannot make a Group a member of itself: " + this.toString()), t.m("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString()));
this.J(Mi);
var c = this.h;
null !== b ? gm(b, this) : this instanceof U && null !== c && c.Ik.remove(this);
this.pk = a;
null !== a ? hm(a, this) : this instanceof
U && null !== c && c.Ik.add(this);
this.J(Hi);
if (null !== c) {
var d = this.data, e = c.da;
null !== d && e instanceof P && e.DA(d, e.Ib(null !== a ? a.data : null))
}
d = this.wz;
null !== d && (e = !0, null !== c && (e = c.Sa, c.Sa = !0), d(this, b, a), null !== c && (c.Sa = e));
if (this instanceof U)for (c = new ka(B), Be(c, this, !0, 0), c = c.l; c.next();)if (d = c.value, d instanceof S)for (d = d.ie; d.next();)e = d.value, $i(e);
if (this instanceof S)for (d = this.ie; d.next();)e = d.value, $i(e);
this.i("containingGroup", b, a);
null !== a && a.xw()
}
} else t.m("cannot set the Part.containingGroup of a Link or Adornment")
});
function Wj(a) {
a = a.ib;
null !== a && (a.Y(), null !== a.rb && a.rb.Y(), a.Hg())
}
B.prototype.As = function () {
var a = this.pk;
null !== a && hm(a, this)
};
B.prototype.Bs = function () {
var a = this.pk;
null !== a && gm(a, this)
};
B.prototype.rm = function () {
var a = this.data;
if (null !== a) {
var b = this.h;
null !== b && (b = b.da, null !== b && b.pw(a))
}
};
t.g(B, "containingGroupChanged", B.prototype.wz);
t.defineProperty(B, {wz: "containingGroupChanged"}, function () {
return this.Xp
}, function (a) {
var b = this.Xp;
b !== a && (null !== a && t.k(a, "function", B, "containingGroupChanged"), this.Xp = a, this.i("containingGroupChanged", b, a))
});
B.prototype.findTopLevelPart = function () {
return im(this, this)
};
function im(a, b) {
var c = b.ib;
return null !== c ? im(a, c) : b instanceof S && (c = b.kd, null !== c) ? im(a, c) : b
}
t.A(B, {Oo: "isTopLevel"}, function () {
return null !== this.ib || this instanceof S && this.vh ? !1 : !0
});
B.prototype.isMemberOf = B.prototype.Fs = function (a) {
return a instanceof U ? jm(this, this, a) : !1
};
function jm(a, b, c) {
if (b === c || null === c)return!1;
var d = b.ib;
return null === d || d !== c && !jm(a, d, c) ? b instanceof S && (b = b.kd, null !== b) ? jm(a, b, c) : !1 : !0
}
B.prototype.findCommonContainingGroup = B.prototype.tH = function (a) {
return km(this, this, a)
};
function km(a, b, c) {
if (null === b || null === c)return null;
var d = b.ib;
if (null === d)return null;
if (b === c)return d;
var e = c.ib;
return null === e ? null : d === e ? e : jm(a, c, d) ? d : jm(a, b, e) ? e : km(a, d, e)
}
t.g(B, "layoutConditions", B.prototype.eE);
t.defineProperty(B, {eE: "layoutConditions"}, function () {
return this.Iq
}, function (a) {
var b = this.Iq;
b !== a && (f && t.k(a, "number", B, "layoutConditions"), this.Iq = a, this.i("layoutConditions", b, a))
});
B.prototype.canLayout = function () {
if (!this.Vz || !this.ub())return!1;
var a = this.layer;
return null !== a && a.kc || this instanceof S && this.vh ? !1 : !0
};
B.prototype.invalidateLayout = B.prototype.J = function (a) {
void 0 === a && (a = 16777215);
var b;
this.Vz && 0 !== (a & this.eE) ? (b = this.layer, null !== b && b.kc || this instanceof S && this.vh ? b = !1 : (b = this.h, b = null !== b && b.va.kb ? !1 : !0)) : b = !1;
if (b)if (b = this.pk, null !== b) {
var c = b.Vb;
null !== c ? c.J() : b.J(a)
} else a = this.h, null !== a && (c = a.Vb, null !== c && c.J())
};
t.g(B, "dragComputation", B.prototype.Bz);
t.defineProperty(B, {Bz: "dragComputation"}, function () {
return this.gq
}, function (a) {
var b = this.gq;
b !== a && (null !== a && t.k(a, "function", B, "dragComputation"), this.gq = a, this.i("dragComputation", b, a))
});
t.g(B, "shadowOffset", B.prototype.eF);
t.defineProperty(B, {eF: "shadowOffset"}, function () {
return this.$l
}, function (a) {
var b = this.$l;
b.K(a) || (f && t.j(a, v, B, "shadowOffset"), this.$l = a = a.W(), this.ra(), this.i("shadowOffset", b, a))
});
t.g(B, "shadowColor", B.prototype.shadowColor);
t.defineProperty(B, {shadowColor: "shadowColor"}, function () {
return this.Zl
}, function (a) {
var b = this.Zl;
b !== a && (f && t.k(a, "string", B, "shadowColor"), this.Zl = a, this.ra(), this.i("shadowColor", b, a))
});
t.g(B, "shadowBlur", B.prototype.shadowBlur);
t.defineProperty(B, {shadowBlur: "shadowBlur"}, function () {
return this.Yl
}, function (a) {
var b = this.Yl;
b !== a && (f && t.k(a, "number", B, "shadowBlur"), this.Yl = a, this.ra(), this.i("shadowBlur", b, a))
});
function Ce(a) {
0 === arguments.length ? B.call(this, Ug) : B.call(this, a);
this.Md = "Adornment";
this.Ga = null;
this.aa &= -257;
this.Wh = new v(NaN, NaN);
this.Jh = new A(w);
this.rb = null;
this.gy = !1
}
t.ea("Adornment", Ce);
t.Ja(Ce, B);
aa = Ce.prototype;
aa.toString = function () {
var a = this.Cj;
return"Adornment(" + this.Ic + ")" + (null !== a ? a.toString() : "")
};
aa.aj = function () {
return this.Ga && this.Ga.S instanceof X ? this.Ga.S.aj() : null
};
aa.rq = function () {
return null
};
aa.gw = function () {
var a = this.Hc.S, b = this.Hc;
if (a instanceof X && b instanceof Y) {
var c = a.path, b = c.La;
a.gw();
for (var b = c.La, a = this.za, c = a.length, d = 0; d < c; d++) {
var e = a.p[d];
e.Di && e instanceof Y && (e.La = b)
}
}
};
aa.Qx = function () {
var a = this.Cj;
return a instanceof X ? a.qc : null
};
t.A(Ce, {placeholder: "placeholder"}, function () {
return this.rb
});
t.g(Ce, "isStandard", Ce.prototype.$k);
t.defineProperty(Ce, {$k: "isStandard"}, function () {
return this.gy
}, function (a) {
var b = this.gy;
b !== a && (f && t.k(a, "boolean", Ce, "isStandard"), this.gy = a, this.i("isStandard", b, a))
});
t.g(Ce, "adornedObject", Ce.prototype.Hc);
t.defineProperty(Ce, {Hc: "adornedObject"}, function () {
return this.Ga
}, function (a) {
f && null !== a && t.j(a, Q, B, "adornedObject:val");
var b = this.Cj, c = null;
null !== a && (c = a.S);
null === b || null !== a && b === c || b.el(this.Ic);
this.Ga = a;
c && c.Kk(this.Ic, this)
});
t.A(Ce, {Cj: "adornedPart"}, function () {
var a = this.Ga;
return null !== a ? a.S : null
});
Ce.prototype.Zk = function () {
var a = this.Ga;
if (null === a)return!0;
a = a.S;
return null === a || !wi(a)
};
Ce.prototype.Jd = function () {
return!1
};
t.A(Ce, {ib: "containingGroup"}, function () {
return null
});
Ce.prototype.Hm = function (a, b, c, d, e, g, h) {
if (a === rd && "elements" === b)if (e instanceof Og)null === this.rb ? this.rb = e : this.rb !== e && t.m("Cannot insert a second Placeholder into the visual tree of an Adornment."); else {
if (e instanceof y) {
var k = zl(e, e, function (a) {
return a instanceof Og
});
k instanceof Og && (null === this.rb ? this.rb = k : this.rb !== k && t.m("Cannot insert a second Placeholder into the visual tree of an Adornment."))
}
} else a === sd && "elements" === b && null !== this.rb && (d === this.rb ? this.rb = null : d instanceof y &&
this.rb.Ci(d) && (this.rb = null));
B.prototype.Hm.call(this, a, b, c, d, e, g, h)
};
Ce.prototype.updateAdornments = function () {
};
Ce.prototype.rm = function () {
};
function S(a) {
0 === arguments.length ? B.call(this, Ug) : B.call(this, a);
this.Wb = new A(X);
this.An = this.Ak = this.Mq = this.Lq = null;
this.Cq = !0;
this.$r = !1;
this.Vr = null;
this.Qp = this.Dq = !0;
this.Rp = D.WF;
this.Zd = this.Rg = null;
this.ph = !1
}
t.ea("Node", S);
t.Ja(S, B);
S.prototype.cloneProtected = function (a) {
B.prototype.cloneProtected.call(this, a);
a.Lq = this.Lq;
a.Mq = this.Mq;
a.Ak = this.Ak;
a.Cq = this.Cq;
a.$r = this.$r;
a.Vr = this.Vr;
a.Dq = this.Dq;
a.Qp = this.Qp;
a.Rp = this.Rp.W()
};
S.prototype.th = function (a) {
B.prototype.th.call(this, a);
a.Hg();
a.Rg = this.Rg;
a.Zd = null
};
var lm;
S.DirectionDefault = lm = t.w(S, "DirectionDefault", 0);
S.DirectionAbsolute = t.w(S, "DirectionAbsolute", 1);
var mm;
S.DirectionRotatedNode = mm = t.w(S, "DirectionRotatedNode", 2);
var Kj;
S.DirectionRotatedNodeOrthogonal = Kj = t.w(S, "DirectionRotatedNodeOrthogonal", 3);
function nm(a, b) {
null !== b && (null === a.Rg && (a.Rg = new ka(om)), a.Rg.add(b))
}
S.prototype.Hm = function (a, b, c, d, e, g, h) {
a === rd && "elements" === b ? this.Zd = null : a === sd && "elements" === b && (null === this.h ? this.Zd = null : d instanceof Q && xl(this, d, function (a, b) {
tk(a, b, !0)
}));
B.prototype.Hm.call(this, a, b, c, d, e, g, h)
};
S.prototype.invalidateConnectedLinks = S.prototype.Hg = function (a) {
void 0 === a && (a = null);
for (var b = this.ie; b.next();) {
var c = b.value;
if (null === a || !a.contains(c)) {
var d = c.Vc;
null !== d && (d.Yd = null);
var e = c.Qd;
null !== e && e !== d && (e.Yd = null);
c.Tb()
}
}
};
S.prototype.Zk = function () {
return!0
};
t.g(S, "avoidable", S.prototype.qz);
t.defineProperty(S, {qz: "avoidable"}, function () {
return this.Qp
}, function (a) {
var b = this.Qp;
if (b !== a) {
f && t.k(a, "boolean", S, "avoidable");
this.Qp = a;
var c = this.h;
null !== c && nj(c, this);
this.i("avoidable", b, a)
}
});
t.g(S, "avoidableMargin", S.prototype.LC);
t.defineProperty(S, {LC: "avoidableMargin"}, function () {
return this.Rp
}, function (a) {
"number" === typeof a ? a = new Wa(a) : t.j(a, Wa, S, "avoidableMargin");
var b = this.Rp;
if (!b.K(a)) {
this.Rp = a = a.W();
var c = this.h;
null !== c && nj(c, this);
this.i("avoidableMargin", b, a)
}
});
S.prototype.canAvoid = function () {
return this.qz && !this.vh
};
S.prototype.getAvoidableRect = function (a) {
a.set(this.ua);
a.lv(this.LC);
return a
};
function dm(a) {
for (; null !== a && !a.ub();)a = a.ib;
return a
}
t.A(S, {ie: "linksConnected"}, function () {
return this.Wb.l
});
S.prototype.findLinksConnected = S.prototype.uH = function (a) {
void 0 === a && (a = null);
if (null === a)return this.Wb.l;
f && t.k(a, "string", S, "findLinksConnected:pid");
var b = new za(this.Wb), c = this;
b.dl = function (b) {
return b.ca === c && b.Bf === a || b.ga === c && b.ng === a
};
return b
};
S.prototype.findLinksOutOf = S.prototype.Mv = function (a) {
void 0 === a && (a = null);
f && null !== a && t.k(a, "string", S, "findLinksOutOf:pid");
var b = new za(this.Wb), c = this;
b.dl = function (b) {
return b.ca !== c ? !1 : null === a ? !0 : b.Bf === a
};
return b
};
S.prototype.findLinksInto = S.prototype.Zf = function (a) {
void 0 === a && (a = null);
f && null !== a && t.k(a, "string", S, "findLinksInto:pid");
var b = new za(this.Wb), c = this;
b.dl = function (b) {
return b.ga !== c ? !1 : null === a ? !0 : b.ng === a
};
return b
};
S.prototype.findNodesConnected = S.prototype.sD = function (a) {
void 0 === a && (a = null);
f && null !== a && t.k(a, "string", S, "findNodesConnected:pid");
for (var b = null, c = null, d = this.Wb.l; d.next();) {
var e = d.value;
if (e.ca === this) {
if (null === a || e.Bf === a)e = e.ga, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ka(S), b.add(c), b.add(e)) : c = e
} else e.ga !== this || null !== a && e.ng !== a || (e = e.ca, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ka(S), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new ya(c) : t.Pg
};
S.prototype.findNodesOutOf = function (a) {
void 0 === a && (a = null);
f && null !== a && t.k(a, "string", S, "findNodesOutOf:pid");
for (var b = null, c = null, d = this.Wb.l; d.next();) {
var e = d.value;
e.ca !== this || null !== a && e.Bf !== a || (e = e.ga, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ka(S), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new ya(c) : t.Pg
};
S.prototype.findNodesInto = function (a) {
void 0 === a && (a = null);
f && null !== a && t.k(a, "string", S, "findNodesInto:pid");
for (var b = null, c = null, d = this.Wb.l; d.next();) {
var e = d.value;
e.ga !== this || null !== a && e.ng !== a || (e = e.ca, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ka(S), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new ya(c) : t.Pg
};
S.prototype.findLinksBetween = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
f && (t.j(a, S, S, "findLinksBetween:othernode"), null !== b && t.k(b, "string", S, "findLinksBetween:pid"), null !== c && t.k(c, "string", S, "findLinksBetween:otherpid"));
var d = new za(this.Wb), e = this;
d.dl = function (d) {
return(d.ca !== e || d.ga !== a || null !== b && d.Bf !== b || null !== c && d.ng !== c) && (d.ca !== a || d.ga !== e || null !== c && d.Bf !== c || null !== b && d.ng !== b) ? !1 : !0
};
return d
};
S.prototype.findLinksTo = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
f && (t.j(a, S, S, "findLinksTo:othernode"), null !== b && t.k(b, "string", S, "findLinksTo:pid"), null !== c && t.k(c, "string", S, "findLinksTo:otherpid"));
var d = new za(this.Wb), e = this;
d.dl = function (d) {
return d.ca !== e || d.ga !== a || null !== b && d.Bf !== b || null !== c && d.ng === c ? !1 : !0
};
return d
};
t.g(S, "linkConnected", S.prototype.gE);
t.defineProperty(S, {gE: "linkConnected"}, function () {
return this.Lq
}, function (a) {
var b = this.Lq;
b !== a && (null !== a && t.k(a, "function", S, "linkConnected"), this.Lq = a, this.i("linkConnected", b, a))
});
t.g(S, "linkDisconnected", S.prototype.hE);
t.defineProperty(S, {hE: "linkDisconnected"}, function () {
return this.Mq
}, function (a) {
var b = this.Mq;
b !== a && (null !== a && t.k(a, "function", S, "linkDisconnected"), this.Mq = a, this.i("linkDisconnected", b, a))
});
t.g(S, "linkValidation", S.prototype.Yo);
t.defineProperty(S, {Yo: "linkValidation"}, function () {
return this.Ak
}, function (a) {
var b = this.Ak;
b !== a && (null !== a && t.k(a, "function", S, "linkValidation"), this.Ak = a, this.i("linkValidation", b, a))
});
function pm(a, b, c) {
if (!a.Wb.contains(b)) {
a.Wb.add(b);
var d = a.gE;
if (null !== d) {
var e = !0, g = a.h;
null !== g && (e = g.Sa, g.Sa = !0);
d(a, b, c);
null !== g && (g.Sa = e)
}
b.sc && (c = b.ca, b = b.ga, null !== c && null !== b && c !== b && (d = !0, g = a.h, null !== g && (d = g.Xc), a = d ? b : c, e = d ? c : b, a.ph || (a.ph = e), !e.xh || null !== g && g.va.kb || (d ? c === e && (e.xh = !1) : b === e && (e.xh = !1))))
}
}
function qm(a, b, c) {
if (a.Wb.remove(b)) {
var d = a.hE, e = a.h;
if (null !== d) {
var g = !0;
null !== e && (g = e.Sa, e.Sa = !0);
d(a, b, c);
null !== e && (e.Sa = g)
}
b.sc && (c = !0, null !== e && (c = e.Xc), a = c ? b.ga : b.ca, b = c ? b.ca : b.ga, null !== a && (a.ph = !1), null === b || b.xh || (0 === b.Wb.count ? (b.ph = null, null !== e && e.va.kb || (b.xh = !0)) : ej(b)))
}
}
function ej(a) {
a.ph = !1;
if (0 !== a.Wb.count) {
var b = !0, c = a.h;
if (null === c || !c.va.kb) {
null !== c && (b = c.Xc);
for (c = a.Wb.l; c.next();) {
var d = c.value;
if (d.sc)if (b) {
if (d.ca === a) {
a.xh = !1;
return
}
} else if (d.ga === a) {
a.xh = !1;
return
}
}
a.xh = !0
}
}
}
S.prototype.As = function () {
B.prototype.As.call(this);
ej(this);
var a = this.An;
null !== a && rm(a, this)
};
S.prototype.Bs = function () {
B.prototype.Bs.call(this);
var a = this.An;
null !== a && null !== a.$e && (a.$e.remove(this), a.Y())
};
S.prototype.rm = function () {
if (0 < this.Wb.count) {
var a = this.h;
if (null === a)return;
for (var b = this.Wb.copy().l; b.next();)a.remove(b.value)
}
this.kd = null;
B.prototype.rm.call(this)
};
t.A(S, {vh: "isLinkLabel"}, function () {
return null !== this.An
});
t.g(S, "labeledLink", S.prototype.kd);
t.defineProperty(S, {kd: "labeledLink"}, function () {
return this.An
}, function (a) {
var b = this.An;
if (b !== a) {
f && null !== a && t.j(a, X, S, "labeledLink");
var c = this.h, d = this.data;
if (null !== b && (null !== b.$e && (b.$e.remove(this), b.Y()), null !== c && null !== d && !c.va.kb)) {
var e = b.data, g = c.da;
if (null !== e && g instanceof P) {
var h = g.Ib(d);
void 0 !== h && g.uI(e, h)
}
}
this.An = a;
null !== a && (rm(a, this), null === c || null === d || c.va.kb || (e = a.data, g = c.da, null !== e && g instanceof P && (h = g.Ib(d), void 0 !== h && g.DC(e, h))));
jk(this);
this.i("labeledLink",
b, a)
}
});
S.prototype.findPort = S.prototype.ts = function (a) {
f && t.k(a, "string", S, "findPort:pid");
if (null === this.Zd) {
if ("" === a && !1 === this.bj)return this;
uk(this)
}
var b = this.Zd.wa(a);
return null !== b || "" !== a && (b = this.Zd.wa(""), null !== b) ? b : this
};
t.A(S, {port: "port"}, function () {
return this.ts("")
});
t.A(S, {ports: "ports"}, function () {
null === this.Zd && uk(this);
return this.Zd.l
});
function uk(a) {
null === a.Zd ? a.Zd = new ia("string", Q) : a.Zd.clear();
xl(a, a, function (a, c) {
var d = c.ld;
null !== d && a.Zd.add(d, c)
});
0 === a.Zd.count && a.Zd.add("", a)
}
function tk(a, b, c) {
var d = b.ld;
if (null !== d && (null !== a.Zd && a.Zd.remove(d), b = a.h, null !== b && c)) {
c = null;
for (a = a.uH(d); a.next();)null === c && (c = t.yb()), c.push(a.value);
if (null !== c) {
for (a = 0; a < c.length; a++)b.remove(c[a]);
t.xa(c)
}
}
}
S.prototype.isInTreeOf = function (a) {
if (null === a || a === this)return!1;
var b = !0, c = this.h;
null !== c && (b = c.Xc);
c = this;
if (b)for (; c !== a;) {
for (var b = null, d = c.Wb.l; d.next();) {
var e = d.value;
if (e.sc && (b = e.ca, b !== c && b !== this))break
}
if (b === this || null === b || b === c)return!1;
c = b
} else for (; c !== a;) {
b = null;
for (d = c.Wb.l; d.next() && (e = d.value, !e.sc || (b = e.ga, b === c || b === this)););
if (b === this || null === b || b === c)return!1;
c = b
}
return!0
};
S.prototype.findTreeRoot = function () {
var a = !0, b = this.h;
null !== b && (a = b.Xc);
b = this;
if (a)for (; ;) {
for (var a = null, c = b.Wb.l; c.next();) {
var d = c.value;
if (d.sc && (a = d.ca, a !== b && a !== this))break
}
if (a === this)return this;
if (null === a || a === b)return b;
b = a
} else for (; ;) {
a = null;
for (c = b.Wb.l; c.next() && (d = c.value, !d.sc || (a = d.ga, a === b || a === this)););
if (a === this)return this;
if (null === a || a === b)return b;
b = a
}
};
S.prototype.findTreeParentLink = S.prototype.us = function () {
var a = !0, b = this.h;
null !== b && (a = b.Xc);
b = this.Wb.l;
if (a)for (; b.next();) {
if (a = b.value, a.sc && a.ca !== this)return a
} else for (; b.next();)if (a = b.value, a.sc && a.ga !== this)return a;
return null
};
S.prototype.findTreeParentNode = S.prototype.vD = function () {
if (null === this.ph || this.ph instanceof S)return this.ph;
var a = !0, b = this.h;
null !== b && (a = b.Xc);
var b = this.Wb.p, c = b.length;
if (a)for (a = 0; a < c; a++) {
var d = b[a];
if (d.sc && (d = d.ca, d !== this))return this.ph = d
} else for (a = 0; a < c; a++)if (d = b[a], d.sc && (d = d.ga, d !== this))return this.ph = d;
return this.ph = null
};
S.prototype.findTreeChildrenLinks = S.prototype.Pv = function () {
var a = !0, b = this.h;
null !== b && (a = b.Xc);
if (a) {
var a = new za(this.Wb), c = this;
a.dl = function (a) {
return a.sc && a.ca === c ? !0 : !1
}
} else a = new za(this.Wb), c = this, a.dl = function (a) {
return a.sc && a.ga === c ? !0 : !1
};
return a
};
S.prototype.findTreeChildrenNodes = S.prototype.uD = function () {
var a = !0, b = this.h;
null !== b && (a = b.Xc);
var c = b = null, d = this.Wb.l;
if (a)for (; d.next();)a = d.value, a.sc && a.ca === this && (a = a.ga, null !== b ? b.add(a) : null !== c && c !== a ? (b = new A(S), b.add(c), b.add(a)) : c = a); else for (; d.next();)a = d.value, a.sc && a.ga === this && (a = a.ca, null !== b ? b.add(a) : null !== c && c !== a ? (b = new A(S), b.add(c), b.add(a)) : c = a);
return null !== b ? b.l : null !== c ? new ya(c) : t.Pg
};
S.prototype.findTreeParts = function (a) {
void 0 === a && (a = Infinity);
t.k(a, "number", S, "collapseTree:level");
var b = new ka(B);
Be(b, this, !1, a);
return b
};
S.prototype.collapseTree = S.prototype.collapseTree = function (a) {
void 0 === a && (a = 1);
t.o(a, S, "collapseTree:level");
1 > a && (a = 1);
var b = this.h;
if (null !== b && !b.Gd) {
b.Gd = !0;
var c = b.Xc, d = new ka(S);
d.add(this);
sm(this, d, c, a, this.Kc);
b.Gd = !1;
b.ra()
}
};
function sm(a, b, c, d, e) {
if (1 < d)for (e = c ? a.Mv() : a.Zf(); e.next();) {
var g = e.value;
g.sc && (g = g.Jz(a), null === g || g === a || b.contains(g) || (b.add(g), sm(g, b, c, d - 1, g.Kc)))
} else tm(a, b, c, e)
}
function tm(a, b, c, d) {
a.Kc = !1;
for (var e = c ? a.Mv() : a.Zf(); e.next();) {
var g = e.value;
d && g.ue();
g.sc && (g = g.Jz(a), null === g || g === a || b.contains(g) || (b.add(g), d && (g.ra(), g.ue(), Wj(g), g.J(Gh)), g.Kc && (g.Om = g.Kc, tm(g, b, c, g.Om))))
}
}
S.prototype.expandTree = S.prototype.expandTree = function (a) {
void 0 === a && (a = 2);
t.o(a, S, "collapseTree:level");
2 > a && (a = 2);
var b = this.h;
if (null !== b && !b.Gd) {
b.Gd = !0;
var c = b.Xc, d = new ka(S);
d.add(this);
um(this, d, c, a, this.Kc);
b.Gd = !1
}
};
function um(a, b, c, d, e) {
a.Kc = !0;
for (var g = c ? a.Mv() : a.Zf(); g.next();) {
var h = g.value;
h.sc && (e || (h.Dg || h.Tb(), h.updateAdornments()), h = h.Jz(a), null !== h && h !== a && !b.contains(h) && (b.add(h), e || (h.ra(), h.updateAdornments(), Wj(h), h.J(Fh)), 2 < d || h.Om)) && (h.Om = !1, um(h, b, c, d - 1, h.Kc))
}
}
t.g(S, "isTreeExpanded", S.prototype.Kc);
t.defineProperty(S, {Kc: "isTreeExpanded"}, function () {
return this.Cq
}, function (a) {
var b = this.Cq;
if (b !== a) {
f && t.k(a, "boolean", S, "isTreeExpanded");
this.Cq = a;
var c = this.h;
this.i("isTreeExpanded", b, a);
b = this.BF;
if (null !== b) {
var d = !0;
null !== c && (d = c.Sa, c.Sa = !0);
b(this);
null !== c && (c.Sa = d)
}
null !== c && c.va.kb || (a ? (a = 2, 2 > a && (a = 2), null === c || c.Gd || (c.Gd = !0, b = c.Xc, d = new ka(S), d.add(this), um(this, d, b, a, !1), c.Gd = !1)) : (a = 1, 1 > a && (a = 1), null === c || c.Gd || (c.Gd = !0, b = c.Xc, d = new ka(S), d.add(this), sm(this, d, b, a, !0), c.Gd = !1)))
}
});
t.g(S, "wasTreeExpanded", S.prototype.Om);
t.defineProperty(S, {Om: "wasTreeExpanded"}, function () {
return this.$r
}, function (a) {
var b = this.$r;
b !== a && (f && t.k(a, "boolean", S, "wasTreeExpanded"), this.$r = a, this.i("wasTreeExpanded", b, a))
});
t.g(S, "treeExpandedChanged", S.prototype.BF);
t.defineProperty(S, {BF: "treeExpandedChanged"}, function () {
return this.Vr
}, function (a) {
var b = this.Vr;
b !== a && (null !== a && t.k(a, "function", S, "treeExpandedChanged"), this.Vr = a, this.i("treeExpandedChanged", b, a))
});
t.g(S, "isTreeLeaf", S.prototype.xh);
t.defineProperty(S, {xh: "isTreeLeaf"}, function () {
return this.Dq
}, function (a) {
var b = this.Dq;
b !== a && (f && t.k(a, "boolean", S, "isTreeLeaf"), this.Dq = a, this.i("isTreeLeaf", b, a))
});
function X() {
B.call(this, vg);
this.Mf = null;
this.$g = "";
this.Uf = this.pq = null;
this.oh = "";
this.Ur = null;
this.qr = this.pr = this.or = !1;
this.Eq = !0;
this.Lp = yg;
this.Yp = 0;
this.aq = yg;
this.bq = NaN;
this.Tl = Hk;
this.Kr = 0.5;
this.ei = this.$e = null;
this.qc = (new A(v)).freeze();
this.oe = null;
this.Dg = !1;
this.Dy = null;
this.Py = !1;
this.Xm = this.Rh = this.La = null;
this.Xe = 0;
this.gn = this.cn = null;
this.Jh = new A(w);
this.Uy = new v;
this.rC = this.pC = null;
this.qx = !1;
this.T = null
}
t.ea("Link", X);
t.Ja(X, B);
X.prototype.cloneProtected = function (a) {
B.prototype.cloneProtected.call(this, a);
a.$g = this.$g;
a.pq = this.pq;
a.oh = this.oh;
a.Ur = this.Ur;
a.or = this.or;
a.pr = this.pr;
a.qr = this.qr;
a.Eq = this.Eq;
a.Lp = this.Lp;
a.Yp = this.Yp;
a.aq = this.aq;
a.bq = this.bq;
a.Tl = this.Tl;
a.Kr = this.Kr
};
X.prototype.th = function (a) {
B.prototype.th.call(this, a);
this.$g = a.$g;
this.oh = a.oh;
a.ei = null;
a.oe = null;
a.Tb();
a.Xm = this.Xm;
a.Xe = this.Xe
};
var Hk;
X.Normal = Hk = t.w(X, "Normal", 1);
X.Orthogonal = t.w(X, "Orthogonal", 2);
X.AvoidsNodes = t.w(X, "AvoidsNodes", 6);
var vm;
X.AvoidsNodesStraight = vm = t.w(X, "AvoidsNodesStraight", 7);
var yg;
X.None = yg = t.w(X, "None", 0);
var Jg;
X.Bezier = Jg = t.w(X, "Bezier", 9);
var xg;
X.JumpGap = xg = t.w(X, "JumpGap", 10);
var wg;
X.JumpOver = wg = t.w(X, "JumpOver", 11);
var Ek;
X.End = Ek = t.w(X, "End", 17);
var Fk;
X.Scale = Fk = t.w(X, "Scale", 18);
var Gk;
X.Stretch = Gk = t.w(X, "Stretch", 19);
var Ml;
X.OrientAlong = Ml = t.w(X, "OrientAlong", 21);
var wm;
X.OrientPlus90 = wm = t.w(X, "OrientPlus90", 22);
var xm;
X.OrientMinus90 = xm = t.w(X, "OrientMinus90", 23);
var ym;
X.OrientOpposite = ym = t.w(X, "OrientOpposite", 24);
var zm;
X.OrientUpright = zm = t.w(X, "OrientUpright", 25);
var Am;
X.OrientPlus90Upright = Am = t.w(X, "OrientPlus90Upright", 26);
var Bm;
X.OrientMinus90Upright = Bm = t.w(X, "OrientMinus90Upright", 27);
var Cm;
X.OrientUpright45 = Cm = t.w(X, "OrientUpright45", 28);
X.prototype.Ae = function () {
this.T = {$i: xb, Bj: xb, Yi: NaN, zj: NaN, Xi: lm, yj: lm, Zi: NaN, Aj: NaN}
};
X.prototype.Zk = function () {
var a = this.ca;
if (null !== a && (wi(a) || xi(a)))return!1;
a = this.ga;
return null !== a && (wi(a) || xi(a)) ? !1 : !0
};
X.prototype.Jd = function () {
return!1
};
X.prototype.computeAngle = function (a, b, c) {
switch (b) {
default:
case yg:
a = 0;
break;
case Ml:
a = c;
break;
case wm:
a = c + 90;
break;
case xm:
a = c - 90;
break;
case ym:
a = c + 180;
break;
case zm:
a = D.Ts(c);
90 < a && 270 > a && (a -= 180);
break;
case Am:
a = D.Ts(c + 90);
90 < a && 270 > a && (a -= 180);
break;
case Bm:
a = D.Ts(c - 90);
90 < a && 270 > a && (a -= 180);
break;
case Cm:
a = D.Ts(c);
if (45 < a && 135 > a || 225 < a && 315 > a)return 0;
90 < a && 270 > a && (a -= 180)
}
return D.Ts(a)
};
t.g(X, "fromNode", X.prototype.ca);
t.defineProperty(X, {ca: "fromNode"}, function () {
return this.Mf
}, function (a) {
var b = this.Mf;
if (b !== a) {
f && null !== a && t.j(a, S, X, "fromNode");
var c = this.Vc;
null !== b && (this.Uf !== b && qm(b, this, c), null !== c && (c.Yd = null), Dm(this), b.J(Mi));
this.Mf = a;
this.Rh = null;
this.Tb();
var d = this.h;
if (null !== d) {
var e = this.data, g = d.da;
if (null !== e)if (g instanceof P) {
var h = null !== a ? a.data : null;
g.BA(e, g.Ib(h))
} else g instanceof Dd && (h = null !== a ? a.data : null, d.Xc ? g.Ah(e, g.Ib(h)) : (null !== b && g.Ah(b.data, void 0), g.Ah(h, g.Ib(null !== this.Uf ?
this.Uf.data : null))))
}
e = this.Vc;
g = this.Iz;
null !== g && (h = !0, null !== d && (h = d.Sa, d.Sa = !0), g(this, c, e), null !== d && (d.Sa = h));
null !== a && (this.Uf !== a && pm(a, this, e), null !== e && (e.Yd = null), Em(this), a.J(Hi));
this.i("fromNode", b, a);
$i(this)
}
});
t.g(X, "fromPortId", X.prototype.Bf);
t.defineProperty(X, {Bf: "fromPortId"}, function () {
return this.$g
}, function (a) {
var b = this.$g;
if (b !== a) {
f && t.k(a, "string", X, "fromPortId");
var c = this.Vc;
null !== c && (c.Yd = null);
Dm(this);
this.$g = a;
var d = this.Vc;
null !== d && (d.Yd = null);
var e = this.h;
if (null !== e) {
var g = this.data, h = e.da;
null !== g && h instanceof P && h.CA(g, a)
}
c !== d && (this.Rh = null, this.Tb(), g = this.Iz, null !== g && (h = !0, null !== e && (h = e.Sa, e.Sa = !0), g(this, c, d), null !== e && (e.Sa = h)));
Em(this);
this.i("fromPortId", b, a)
}
});
t.A(X, {Vc: "fromPort"}, function () {
var a = this.Mf;
return null === a ? null : a.ts(this.$g)
});
t.g(X, "fromPortChanged", X.prototype.Iz);
t.defineProperty(X, {Iz: "fromPortChanged"}, function () {
return this.pq
}, function (a) {
var b = this.pq;
b !== a && (null !== a && t.k(a, "function", X, "fromPortChanged"), this.pq = a, this.i("fromPortChanged", b, a))
});
t.g(X, "toNode", X.prototype.ga);
t.defineProperty(X, {ga: "toNode"}, function () {
return this.Uf
}, function (a) {
var b = this.Uf;
if (b !== a) {
f && null !== a && t.j(a, S, X, "toNode");
var c = this.Qd;
null !== b && (this.Mf !== b && qm(b, this, c), null !== c && (c.Yd = null), Dm(this), b.J(Mi));
this.Uf = a;
this.Rh = null;
this.Tb();
var d = this.h;
if (null !== d) {
var e = this.data, g = d.da;
if (null !== e)if (g instanceof P) {
var h = null !== a ? a.data : null;
g.GA(e, g.Ib(h))
} else g instanceof Dd && (h = null !== a ? a.data : null, d.Xc ? (null !== b && g.Ah(b.data, void 0), g.Ah(h, g.Ib(null !== this.Mf ? this.Mf.data : null))) :
g.Ah(e, g.Ib(h)))
}
e = this.Qd;
g = this.OA;
null !== g && (h = !0, null !== d && (h = d.Sa, d.Sa = !0), g(this, c, e), null !== d && (d.Sa = h));
null !== a && (this.Mf !== a && pm(a, this, e), null !== e && (e.Yd = null), Em(this), a.J(Hi));
this.i("toNode", b, a);
$i(this)
}
});
t.g(X, "toPortId", X.prototype.ng);
t.defineProperty(X, {ng: "toPortId"}, function () {
return this.oh
}, function (a) {
var b = this.oh;
if (b !== a) {
f && t.k(a, "string", X, "toPortId");
var c = this.Qd;
null !== c && (c.Yd = null);
Dm(this);
this.oh = a;
var d = this.Qd;
null !== d && (d.Yd = null);
var e = this.h;
if (null !== e) {
var g = this.data, h = e.da;
null !== g && h instanceof P && h.HA(g, a)
}
c !== d && (this.Rh = null, this.Tb(), g = this.OA, null !== g && (h = !0, null !== e && (h = e.Sa, e.Sa = !0), g(this, c, d), null !== e && (e.Sa = h)));
Em(this);
this.i("toPortId", b, a)
}
});
t.A(X, {Qd: "toPort"}, function () {
var a = this.Uf;
return null === a ? null : a.ts(this.oh)
});
t.g(X, "toPortChanged", X.prototype.OA);
t.defineProperty(X, {OA: "toPortChanged"}, function () {
return this.Ur
}, function (a) {
var b = this.Ur;
b !== a && (null !== a && t.k(a, "function", X, "toPortChanged"), this.Ur = a, this.i("toPortChanged", b, a))
});
t.defineProperty(X, {fb: "fromSpot"}, function () {
return null !== this.T ? this.T.$i : xb
}, function (a) {
null === this.T && this.Ae();
var b = this.T.$i;
b.K(a) || (f && t.j(a, H, X, "fromSpot"), a = a.W(), this.T.$i = a, this.i("fromSpot", b, a), this.Tb())
});
t.defineProperty(X, {Sj: "fromEndSegmentLength"}, function () {
return null !== this.T ? this.T.Yi : NaN
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Yi;
b !== a && (f && t.k(a, "number", X, "fromEndSegmentLength"), 0 > a && t.ia(a, ">= 0", X, "fromEndSegmentLength"), this.T.Yi = a, this.i("fromEndSegmentLength", b, a), this.Tb())
});
t.defineProperty(X, {Co: "fromEndSegmentDirection"}, function () {
return null !== this.T ? this.T.Xi : lm
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Xi;
b !== a && (f && t.nb(a, S, X, "fromEndSegmentDirection"), this.T.Xi = a, this.i("fromEndSegmentDirection", b, a), this.Tb())
});
t.defineProperty(X, {Do: "fromShortLength"}, function () {
return null !== this.T ? this.T.Zi : NaN
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Zi;
b !== a && (f && t.k(a, "number", X, "fromShortLength"), this.T.Zi = a, this.i("fromShortLength", b, a), this.Tb())
});
t.defineProperty(X, {gb: "toSpot"}, function () {
return null !== this.T ? this.T.Bj : xb
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Bj;
b.K(a) || (f && t.j(a, H, X, "toSpot"), a = a.W(), this.T.Bj = a, this.i("toSpot", b, a), this.Tb())
});
t.defineProperty(X, {$j: "toEndSegmentLength"}, function () {
return null !== this.T ? this.T.zj : NaN
}, function (a) {
null === this.T && this.Ae();
var b = this.T.zj;
b !== a && (f && t.k(a, "number", X, "toEndSegmentLength"), 0 > a && t.ia(a, ">= 0", X, "toEndSegmentLength"), this.T.zj = a, this.i("toEndSegmentLength", b, a), this.Tb())
});
t.defineProperty(X, {vp: "toEndSegmentDirection"}, function () {
return null !== this.T ? this.T.yj : lm
}, function (a) {
null === this.T && this.Ae();
var b = this.T.yj;
b !== a && (f && t.nb(a, S, X, "toEndSegmentDirection"), this.T.yj = a, this.i("toEndSegmentDirection", b, a), this.Tb())
});
t.defineProperty(X, {wp: "toShortLength"}, function () {
return null !== this.T ? this.T.Aj : NaN
}, function (a) {
null === this.T && this.Ae();
var b = this.T.Aj;
b !== a && (f && t.k(a, "number", X, "toShortLength"), this.T.Aj = a, this.i("toShortLength", b, a), this.Tb())
});
function $i(a) {
var b = a.ca, c = a.ga;
null !== b && null !== c ? Fm(a, b.tH(c)) : Fm(a, null)
}
function Fm(a, b) {
var c = a.pk;
if (c !== b) {
null !== c && gm(c, a);
a.pk = b;
null !== b && hm(b, a);
var d = a.wz;
if (null !== d) {
var e = !0, g = a.h;
null !== g && (e = g.Sa, g.Sa = !0);
d(a, c, b);
null !== g && (g.Sa = e)
}
!a.Dg || a.pC !== c && a.rC !== c || a.Tb()
}
}
X.prototype.getOtherNode = X.prototype.Jz = function (a) {
f && t.j(a, S, X, "getOtherNode:node");
var b = this.ca;
return a === b ? this.ga : b
};
X.prototype.getOtherPort = function (a) {
f && t.j(a, Q, X, "getOtherPort:port");
var b = this.Vc;
return a === b ? this.Qd : b
};
t.A(X, {gJ: "isLabeledLink"}, function () {
return null === this.$e ? !1 : 0 < this.$e.count
});
t.A(X, {Wj: "labelNodes"}, function () {
return null === this.$e ? t.Pg : this.$e.l
});
function rm(a, b) {
null === a.$e && (a.$e = new ka(S));
a.$e.add(b);
a.Y()
}
X.prototype.As = function () {
B.prototype.As.call(this);
Gm(this) && zg(this, this.ua);
var a = this.Mf, b = this.Uf;
if (null !== a) {
var c = this.Vc;
null !== c && (c.Yd = null);
pm(a, this, c);
Em(this)
}
null !== b && (c = this.Qd, null !== c && (c.Yd = null), pm(b, this, c), Em(this))
};
X.prototype.Bs = function () {
B.prototype.Bs.call(this);
Gm(this) && zg(this, this.ua);
var a = this.Mf, b = this.Uf;
if (null !== a) {
var c = this.Vc;
null !== c && (c.Yd = null);
qm(a, this, c);
Dm(this)
}
null !== b && (c = this.Qd, null !== c && (c.Yd = null), qm(b, this, c), Dm(this))
};
X.prototype.rm = function () {
if (null !== this.$e) {
var a = this.h;
if (null === a)return;
for (var b = this.$e.copy().l; b.next();)a.remove(b.value)
}
b = this.data;
null !== b && (a = this.h, null !== a && (a = a.da, a instanceof P ? a.vA(b) : a instanceof Dd && a.Ah(b, void 0)))
};
X.prototype.move = X.prototype.move = function (a) {
var b = this.position, c = b.x;
isNaN(c) && (c = 0);
b = b.y;
isNaN(b) && (b = 0);
c = a.x - c;
b = a.y - b;
B.prototype.move.call(this, a);
this.bl(c, b);
for (a = this.Wj; a.next();) {
var d = a.value, e = d.position;
d.moveTo(e.x + c, e.y + b)
}
};
t.g(X, "relinkableFrom", X.prototype.DE);
t.defineProperty(X, {DE: "relinkableFrom"}, function () {
return this.or
}, function (a) {
var b = this.or;
b !== a && (f && t.k(a, "boolean", X, "relinkableFrom"), this.or = a, this.i("relinkableFrom", b, a), this.updateAdornments())
});
t.g(X, "relinkableTo", X.prototype.EE);
t.defineProperty(X, {EE: "relinkableTo"}, function () {
return this.pr
}, function (a) {
var b = this.pr;
b !== a && (f && t.k(a, "boolean", X, "relinkableTo"), this.pr = a, this.i("relinkableTo", b, a), this.updateAdornments())
});
X.prototype.canRelinkFrom = function () {
if (!this.DE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Fj)return!1;
a = a.h;
return null === a || a.Fj ? !0 : !1
};
X.prototype.canRelinkTo = function () {
if (!this.EE)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Fj)return!1;
a = a.h;
return null === a || a.Fj ? !0 : !1
};
t.g(X, "resegmentable", X.prototype.ip);
t.defineProperty(X, {ip: "resegmentable"}, function () {
return this.qr
}, function (a) {
var b = this.qr;
b !== a && (f && t.k(a, "boolean", X, "resegmentable"), this.qr = a, this.i("resegmentable", b, a), this.updateAdornments())
});
t.g(X, "isTreeLink", X.prototype.sc);
t.defineProperty(X, {sc: "isTreeLink"}, function () {
return this.Eq
}, function (a) {
var b = this.Eq;
b !== a && (f && t.k(a, "boolean", X, "isTreeLink"), this.Eq = a, this.i("isTreeLink", b, a), null !== this.ca && ej(this.ca), null !== this.ga && ej(this.ga))
});
t.A(X, {path: "path"}, function () {
var a = this.ei;
if (null !== a)return a;
a = this.za;
a = kk(this, a, a.length);
return a instanceof Y ? this.ei = a : null
});
X.prototype.rq = function () {
return this.path
};
X.prototype.Qx = function () {
return this.qc
};
X.prototype.aj = function () {
this.updateRoute();
var a = new w;
this.df(a);
return this.Dy = a
};
X.prototype.df = function (a) {
var b = Infinity, c = Infinity, d = this.ka;
if (0 === d)return a.q(NaN, NaN, 0, 0), a;
if (1 === d)d = this.n(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.q(d.x, d.y, 0, 0); else if (2 === d) {
var e = this.n(0), g = this.n(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y);
a.q(e.x, e.y, 0, 0);
a.Li(g)
} else if (this.computeCurve() === Jg && 3 <= d && !this.Ub)if (e = this.n(0), b = e.x, c = e.y, a.q(b, c, 0, 0), 3 === d)d = this.n(1), b = Math.min(d.x, b), c = Math.min(d.y, c), g = this.n(2), b = Math.min(g.x, b), c = Math.min(g.y, c), D.oo(e.x, e.y, d.x, d.y, d.x, d.y, g.x,
g.y, 0.5, a); else for (var h, k, l = 3; l < d; l += 3)h = this.n(l - 2), l + 3 >= d && (l = d - 1), k = this.n(l - 1), g = this.n(l), D.oo(e.x, e.y, h.x, h.y, k.x, k.y, g.x, g.y, 0.5, a), b = Math.min(g.x, b), c = Math.min(g.y, c), e = g; else for (e = this.n(0), g = this.n(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y), a.q(e.x, e.y, 0, 0), a.Li(g), l = 2; l < d; l++)e = this.n(l), b = Math.min(e.x, b), c = Math.min(e.y, c), a.Li(e);
this.Uy.q(b - a.x, c - a.y);
return a
};
t.A(X, {qE: "midPoint"}, function () {
this.updateRoute();
return this.computeMidPoint(new v)
});
X.prototype.computeMidPoint = function (a) {
var b = this.ka;
if (0 === b)return a.assign(D.VF), a;
if (1 === b)return a.assign(this.n(0)), a;
if (2 === b) {
var c = this.n(0), d = this.n(1);
a.q((c.x + d.x) / 2, (c.y + d.y) / 2);
return a
}
if (this.computeCurve() === Jg && 3 <= b && !this.Ub) {
if (3 === b)return this.n(1);
var b = (b - 1) / 3 | 0, e = 3 * (b / 2 | 0);
1 === b % 2 ? (c = this.n(e), d = this.n(e + 1), b = this.n(e + 2), e = this.n(e + 3), D.SG(c.x, c.y, d.x, d.y, b.x, b.y, e.x, e.y, a)) : a.assign(this.n(e));
return a
}
for (var e = 0, g = t.yb(), h = 0; h < b - 1; h++)c = this.n(h), d = this.n(h + 1), D.Fa(c.x,
d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : D.Fa(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.Nj(d)), g.push(c), e += c;
for (d = h = c = 0; c < e / 2 && h < b;) {
d = g[h];
if (c + d > e / 2)break;
c += d;
h++
}
t.xa(g);
b = this.n(h);
g = this.n(h + 1);
b.x === g.x ? b.y > g.y ? a.q(b.x, b.y - (e / 2 - c)) : a.q(b.x, b.y + (e / 2 - c)) : b.y === g.y ? b.x > g.x ? a.q(b.x - (e / 2 - c), b.y) : a.q(b.x + (e / 2 - c), b.y) : (e = (e / 2 - c) / d, a.q(b.x + e * (g.x - b.x), b.y + e * (g.y - b.y)));
return a
};
t.A(X, {pE: "midAngle"}, function () {
this.updateRoute();
return this.computeMidAngle()
});
X.prototype.computeMidAngle = function () {
var a = this.ka;
if (2 > a)return NaN;
if (this.computeCurve() === Jg && 4 <= a && !this.Ub) {
var b = (a - 1) / 3 | 0, c = 3 * (b / 2 | 0);
if (1 === b % 2) {
var c = Math.floor(c), a = this.n(c), b = this.n(c + 1), d = this.n(c + 2), c = this.n(c + 3);
return D.RG(a.x, a.y, b.x, b.y, d.x, d.y, c.x, c.y)
}
if (0 < c && c + 1 < a)return a = this.n(c - 1), b = this.n(c + 1), a.ui(b)
}
d = a / 2 | 0;
if (0 === a % 2)return a = this.n(d - 1), b = this.n(d), a.ui(b);
var a = this.n(d - 1), b = this.n(d), d = this.n(d + 1), c = a.Nj(b), e = b.Nj(d);
return c > e ? a.ui(b) : b.ui(d)
};
t.g(X, "points", X.prototype.points);
t.defineProperty(X, {points: "points"}, function () {
return this.qc
}, function (a) {
f && t.j(a, A, X, "points");
var b = this.qc;
if (b !== a && null !== a) {
a = a.copy();
for (var c = a.l; c.next();)c.value.freeze();
a.freeze();
this.qc = a;
this.Df();
Hm(this);
this.i("points", b, a)
}
});
t.A(X, {ka: "pointsCount"}, function () {
return this.qc.count
});
X.prototype.getPoint = X.prototype.n = function (a) {
return this.qc.p[a]
};
X.prototype.setPoint = X.prototype.pf = function (a, b) {
f && (t.j(b, v, X, "setPoint"), b.P() || t.m("Link.setPoint called with a Point that does not have real numbers: " + b.toString()));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.jg(a, b)
};
X.prototype.setPointAt = X.prototype.U = function (a, b, c) {
f && (t.o(b, X, "setPointAt:x"), t.o(c, X, "setPointAt:y"));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.jg(a, new v(b, c))
};
X.prototype.insertPoint = function (a, b) {
f && (t.j(b, v, X, "insertPoint"), b.P() || t.m("Link.insertPoint called with a Point that does not have real numbers: " + b.toString()));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.Fd(a, b)
};
X.prototype.insertPointAt = X.prototype.C = function (a, b, c) {
f && (t.o(b, X, "insertPointAt:x"), t.o(c, X, "insertPointAt:y"));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.Fd(a, new v(b, c))
};
X.prototype.addPoint = X.prototype.qh = function (a) {
f && (t.j(a, v, X, "addPoint"), a.P() || t.m("Link.addPoint called with a Point that does not have real numbers: " + a.toString()));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.add(a)
};
X.prototype.addPointAt = X.prototype.Lk = function (a, b) {
f && (t.o(a, X, "insertPointAt:x"), t.o(b, X, "insertPointAt:y"));
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.add(new v(a, b))
};
X.prototype.removePoint = X.prototype.HE = function (a) {
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.ud(a)
};
X.prototype.clearPoints = X.prototype.po = function () {
null === this.oe && t.m("Call Link.startRoute before modifying the points of the route.");
this.qc.clear()
};
X.prototype.movePoints = X.prototype.bl = function (a, b) {
for (var c = new A(v), d = this.qc.l; d.next();) {
var e = d.value;
c.add((new v(e.x + a, e.y + b)).freeze())
}
c.freeze();
d = this.qc;
this.qc = c;
this.Df();
Hm(this);
this.i("points", d, c)
};
X.prototype.startRoute = X.prototype.il = function () {
null === this.oe && (this.oe = this.qc, this.qc = this.qc.copy())
};
X.prototype.commitRoute = X.prototype.ri = function () {
if (null !== this.oe) {
for (var a = this.oe, b = this.qc, c = Infinity, d = Infinity, e = a.count, g = 0; g < e; g++)var h = a.p[g], c = Math.min(h.x, c), d = Math.min(h.y, d);
for (var k = Infinity, l = Infinity, m = b.count, g = 0; g < m; g++)h = b.p[g], k = Math.min(h.x, k), l = Math.min(h.y, l), h.freeze();
b.freeze();
if (m === e)for (g = 0; g < m; g++)if (e = a.p[g], h = b.p[g], e.x - c !== h.x - k || e.y - d !== h.y - l) {
this.Df();
break
}
this.oe = null;
Hm(this);
this.i("points", a, b)
}
};
X.prototype.rollbackRoute = X.prototype.wI = function () {
null !== this.oe && (this.qc = this.oe, this.oe = null)
};
function Hm(a) {
0 === a.qc.count ? a.Dg = !1 : (a.Dg = !0, a.cn = a.n(0).copy(), a.gn = a.n(a.ka - 1).copy(), Im(a, !1))
}
X.prototype.invalidateRoute = X.prototype.Tb = function () {
if (!(this.Py || this.h && this.h.va.kb)) {
var a = this.rq();
null !== a && (this.Dg = !1, this.Df(), a.Y())
}
};
t.defineProperty(X, {up: null}, function () {
return this.Py
}, function (a) {
this.Py = a
});
X.prototype.updateRoute = function () {
if (!this.Dg && !this.qx) {
var a = !0;
try {
this.qx = !0, this.il(), a = this.computePoints()
} finally {
this.qx = !1, a ? this.ri() : this.wI()
}
}
};
X.prototype.computePoints = function () {
var a = this.h;
if (null === a)return!1;
var b = this.ca, c = null;
null === b ? (a.Ul || (a.Lu = new Y, a.Lu.ya = D.Qm, a.Lu.bb = 0, a.Ul = new S, a.Ul.add(a.Lu), a.Ul.zf()), this.cn && (a.Ul.position = a.Ul.location = this.cn, a.Ul.zf(), b = a.Ul, c = a.Lu)) : c = this.Vc;
if (null !== c) {
var d = vk(c);
d !== b && b.ub() ? c = d : (d = dm(b), null !== d && d !== b ? (b = d, c = d.ts("")) : b = d)
}
this.pC = b;
if (null === b || null === c || !b.location.P())return!1;
var d = this.ga, e = null;
null === d ? (a.Vl || (a.Mu = new Y, a.Mu.ya = D.Qm, a.Mu.bb = 0, a.Vl = new S, a.Vl.add(a.Mu),
a.Vl.zf()), this.gn && (a.Vl.position = a.Vl.location = this.gn, a.Vl.zf(), d = a.Vl, e = a.Mu)) : e = this.Qd;
null !== e && (a = vk(e), a !== d && d.ub() ? e = a : (a = dm(d), null !== a && a !== d ? (d = a, e = a.ts("")) : d = a));
this.rC = d;
if (null === d || null === e || !d.location.P())return!1;
var a = this.ka, g = Jm(this, c), h = Km(this, e), k = c === e, l = this.Ub, m = this.ye === Jg;
this.Rh = k && !l ? m = !0 : !1;
var n = this.eo === yg || k;
if (l || g !== wb || h !== wb || k) {
m = this.Bi;
n && (l && m || k) && this.po();
var p = k ? this.computeCurviness() : 0, q = this.getLinkPoint(b, c, g, !0, l, d, e), r = 0, s = 0, u = 0;
if (l || g !==
wb || k) {
var x = this.computeEndSegmentLength(b, c, g, !0), u = this.getLinkDirection(b, c, q, g, !0, l, d, e);
k && (u -= l ? 90 : 30, 0 > p && (u -= 180));
0 > u ? u += 360 : 360 <= u && (u -= 360);
k && (x += Math.abs(p));
0 === u ? r = x : 90 === u ? s = x : 180 === u ? r = -x : 270 === u ? s = -x : (r = x * Math.cos(u * Math.PI / 180), s = x * Math.sin(u * Math.PI / 180));
if (g.hd() && k) {
var E = c.$a(Hb, t.M()), F = t.cc(E.x + 1E3 * r, E.y + 1E3 * s);
this.getLinkPointFromPoint(b, c, E, F, !0, q);
t.B(E);
t.B(F)
}
}
var x = this.getLinkPoint(d, e, h, !1, l, b, c), G = 0, L = 0, N = 0;
if (l || h !== wb || k)E = this.computeEndSegmentLength(d, e, h,
!1), N = this.getLinkDirection(d, e, x, h, !1, l, b, c), k && (N += l ? 0 : 30, 0 > p && (N += 180)), 0 > N ? N += 360 : 360 <= N && (N -= 360), k && (E += Math.abs(p)), 0 === N ? G = E : 90 === N ? L = E : 180 === N ? G = -E : 270 === N ? L = -E : (G = E * Math.cos(N * Math.PI / 180), L = E * Math.sin(N * Math.PI / 180)), h.hd() && k && (E = e.$a(Hb, t.M()), F = t.cc(E.x + 1E3 * G, E.y + 1E3 * L), this.getLinkPointFromPoint(d, e, E, F, !1, x), t.B(E), t.B(F));
e = q;
if (l || g !== wb || k)e = new v(q.x + r, q.y + s);
c = x;
if (l || h !== wb || k)c = new v(x.x + G, x.y + L);
!n && !l && g.hd() && 3 < a && this.adjustPoints(0, q, a - 2, c) ? this.pf(a - 1, x) : !n && !l && h.hd() &&
3 < a && this.adjustPoints(1, e, a - 1, x) ? this.pf(0, q) : !n && !l && 4 < a && this.adjustPoints(1, e, a - 2, c) ? (this.pf(0, q), this.pf(a - 1, x)) : !n && l && 6 <= a && !m && this.adjustPoints(1, e, a - 2, c) ? (this.pf(0, q), this.pf(a - 1, x)) : (this.po(), this.qh(q), (l || g !== wb || k) && this.qh(e), l && this.addOrthoPoints(e, u, c, N, b, d), (l || h !== wb || k) && this.qh(c), this.qh(x))
} else g = !1, !n && 3 <= a && (n = this.getLinkPoint(b, c, wb, !0, !1, d, e), g = this.getLinkPoint(d, e, wb, !1, !1, b, c), g = this.adjustPoints(0, n, a - 1, g)), g || (this.po(), m ? (a = this.getLinkPoint(b, c, wb, !0, !1, d, e),
n = this.getLinkPoint(d, e, wb, !1, !1, b, c), g = n.x - a.x, h = n.y - a.y, k = this.computeCurviness(), m = l = 0, q = a.x + g / 3, u = a.y + h / 3, r = q, s = u, D.I(h, 0) ? s = 0 < g ? s - k : s + k : (l = -g / h, m = Math.sqrt(k * k / (l * l + 1)), 0 > k && (m = -m), r = (0 > h ? -1 : 1) * m + q, s = l * (r - q) + u), q = a.x + 2 * g / 3, u = a.y + 2 * h / 3, x = q, G = u, D.I(h, 0) ? G = 0 < g ? G - k : G + k : (x = (0 > h ? -1 : 1) * m + q, G = l * (x - q) + u), this.po(), this.qh(a), this.Lk(r, s), this.Lk(x, G), this.qh(n), this.pf(0, this.getLinkPoint(b, c, wb, !0, !1, d, e)), this.pf(3, this.getLinkPoint(d, e, wb, !1, !1, b, c))) : (a = d, d = this.getLinkPoint(b, c, wb, !0, !1, a, e), e = this.getLinkPoint(a,
e, wb, !1, !1, b, c), this.hasCurviness() ? (h = e.x - d.x, b = e.y - d.y, c = this.computeCurviness(), a = d.x + h / 2, n = d.y + b / 2, g = a, k = n, D.I(b, 0) ? k = 0 < h ? k - c : k + c : (h = -h / b, g = Math.sqrt(c * c / (h * h + 1)), 0 > c && (g = -g), g = (0 > b ? -1 : 1) * g + a, k = h * (g - a) + n), this.qh(d), this.Lk(g, k)) : this.qh(d), this.qh(e)));
return!0
};
function Lm(a, b) {
Math.abs(b.x - a.x) > Math.abs(b.y - a.y) ? (b.x = b.x >= a.x ? a.x + 9E9 : a.x - 9E9, b.y = a.y) : (b.y = b.y >= a.y ? a.y + 9E9 : a.y - 9E9, b.x = a.x);
return b
}
X.prototype.getLinkPointFromPoint = function (a, b, c, d, e, g) {
void 0 === g && (g = new v);
if (null === a || null === b)return g.assign(c), g;
a.ub() || (e = dm(a), null !== e && e !== a && (b = e.port));
var h;
a = null;
if (null === b.fa)e = d.x, d = d.y, h = c.x, c = c.y; else {
a = b.fa.ae;
e = 1 / (a.m11 * a.m22 - a.m12 * a.m21);
h = a.m22 * e;
var k = -a.m12 * e, l = -a.m21 * e, m = a.m11 * e, n = e * (a.m21 * a.dy - a.m22 * a.dx), p = e * (a.m12 * a.dx - a.m11 * a.dy);
e = d.x * h + d.y * l + n;
d = d.x * k + d.y * m + p;
h = c.x * h + c.y * l + n;
c = c.x * k + c.y * m + p
}
b.ws(e, d, h, c, g);
a && g.transform(a);
return g
};
function Mm(a, b) {
var c = b.Yd;
null === c && (c = new Nm, c.port = b, c.Bc = b.S, b.Yd = c);
return Om(c, a)
}
X.prototype.getLinkPoint = function (a, b, c, d, e, g, h, k) {
void 0 === k && (k = new v);
if (c.jd())return b.$a(c, k), k;
if (c.No() && (c = Mm(this, b), null !== c)) {
k.assign(c.Uo);
if (e && this.at === vm) {
var l = Mm(this, h);
if (c.om < l.om) {
c = t.M();
var l = t.M(), m = new w(b.$a(yb, c), b.$a(Pb, l)), n = this.computeSpot(!d);
a = this.getLinkPoint(g, h, n, !d, e, a, b, l);
a.x >= m.x && a.x <= m.x + m.width ? k.x = a.x : a.y >= m.y && a.y <= m.y + m.height && (k.y = a.y);
t.B(c);
t.B(l)
}
}
return k
}
g = b.$a(Hb, t.M());
c = null;
this.ka > (e ? 6 : 2) ? (h = d ? this.n(1) : this.n(this.ka - 2), e && (h = Lm(g, h.copy()))) :
(c = t.M(), h = h.$a(Hb, c), e && (h = Lm(g, h)));
this.getLinkPointFromPoint(a, b, g, h, d, k);
t.B(g);
null !== c && t.B(c);
return k
};
X.prototype.getLinkDirection = function (a, b, c, d, e, g, h, k) {
a:if (d.jd())c = d.x > d.y ? d.x > 1 - d.y ? 0 : d.x < 1 - d.y ? 270 : 315 : d.x < d.y ? d.x > 1 - d.y ? 90 : d.x < 1 - d.y ? 180 : 135 : 0.5 > d.x ? 225 : 0.5 < d.x ? 45 : 0; else {
if (d.No() && (a = Mm(this, b), null !== a))switch (a.De) {
case t.vd:
c = 270;
break a;
case t.$c:
c = 180;
break a;
default:
case t.nd:
c = 0;
break a;
case t.md:
c = 90;
break a
}
a = b.$a(Hb, t.M());
d = null;
this.ka > (g ? 6 : 2) ? (k = e ? this.n(1) : this.n(this.ka - 2), k = g ? Lm(a, k.copy()) : c) : (d = t.M(), k = k.$a(Hb, d));
c = Math.abs(k.x - a.x) > Math.abs(k.y - a.y) ? k.x >= a.x ? 0 : 180 : k.y >=
a.y ? 90 : 270;
t.B(a);
null !== d && t.B(d)
}
g = lm;
g = e ? this.Co : this.vp;
g === lm && (g = e ? b.Co : b.vp);
switch (g) {
case mm:
b = b.Wk();
c += b;
360 <= c && (c -= 360);
break;
case lm:
case Kj:
b = b.Wk();
if (0 === b)break;
45 <= b && 135 > b ? c += 90 : 135 <= b && 225 > b ? c += 180 : 225 <= b && 315 > b && (c += 270);
360 <= c && (c -= 360)
}
return c
};
X.prototype.computeEndSegmentLength = function (a, b, c, d) {
if (c.No() && (a = Mm(this, b), null !== a))return a.Jv;
a = NaN;
a = d ? this.Sj : this.$j;
isNaN(a) && (a = d ? b.Sj : b.$j);
isNaN(a) && (a = 10);
return a
};
X.prototype.computeSpot = function (a) {
return a ? Jm(this, this.Vc) : Km(this, this.Qd)
};
function Jm(a, b) {
var c = a.fb;
c.Ac() && (void 0 === b && (b = a.Vc), null !== b && (c = b.fb));
return c === xb ? wb : c
}
function Km(a, b) {
var c = a.gb;
c.Ac() && (void 0 === b && (b = a.Qd), null !== b && (c = b.gb));
return c === xb ? wb : c
}
X.prototype.computeOtherPoint = function (a, b) {
var c = b.$a(Hb), d;
d = b.Yd;
d = null !== d ? Om(d, this) : null;
null !== d && (c = d.Uo);
return c
};
X.prototype.computeShortLength = function (a) {
return a ? Pm(this) : Qm(this)
};
function Pm(a) {
var b = a.Do;
isNaN(b) && (a = a.Vc, null !== a && (b = a.Do));
return isNaN(b) ? 0 : b
}
function Qm(a) {
var b = a.wp;
isNaN(b) && (a = a.Qd, null !== a && (b = a.wp));
return isNaN(b) ? 0 : b
}
X.prototype.Qj = function (a, b, c, d, e, g) {
if (!1 === this.nf)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
var h = g;
void 0 === g && (h = t.Ng(), h.reset());
h.multiply(this.transform);
if (this.nm(a, h))return Dl(this, b, c, e), void 0 === g && t.Oe(h), !0;
if (this.Cf(a, h)) {
var k = !1;
if (!this.tg)for (var l = this.za.length; l--;) {
var m = this.za.p[l];
if (m.visible || m === this.Zb) {
var n = m.ua, p = this.Oa;
if (!(n.x > p.width || n.y > p.height || 0 > n.x + n.width || 0 > n.y + n.height)) {
n = t.Ng();
n.set(h);
if (m instanceof y)k = m.Qj(a, b, c, d, e, n); else if (this.path ===
m) {
var k = m, q = a, r = d, p = n;
if (!1 === k.nf)k = !1; else if (p.multiply(k.transform), r)b:{
var s = q, u = p;
if (k.nm(s, u))k = !0; else {
if (void 0 === u && (u = k.transform, s.Jj(k.ua))) {
k = !0;
break b
}
var p = s.left, q = s.right, r = s.top, s = s.bottom, x = t.M(), E = t.M(), F = t.M(), G = t.Ng();
G.set(u);
G.vE(k.transform);
G.Qz();
E.x = q;
E.y = r;
E.transform(G);
x.x = p;
x.y = r;
x.transform(G);
u = !1;
Kl(k, x, E, F) ? u = !0 : (x.x = q, x.y = s, x.transform(G), Kl(k, x, E, F) ? u = !0 : (E.x = p, E.y = s, E.transform(G), Kl(k, x, E, F) ? u = !0 : (x.x = p, x.y = r, x.transform(G), Kl(k, x, E, F) && (u = !0))));
t.Oe(G);
t.B(x);
t.B(E);
t.B(F);
k = u
}
} else k = k.nm(q, p)
} else k = Pj(m, a, d, n);
k && (null !== b && (m = b(m)), m && (null === c || c(m)) && e.add(m));
t.Oe(n)
}
}
}
void 0 === g && t.Oe(h);
return k || null !== this.background || null !== this.Gj
}
void 0 === g && t.Oe(h);
return!1
};
t.A(X, {Ub: "isOrthogonal"}, function () {
return 2 === (this.Tl.value & 2)
});
t.A(X, {Bi: "isAvoiding"}, function () {
return 4 === (this.Tl.value & 4)
});
X.prototype.computeCurve = function () {
if (null === this.Rh) {
var a = this.Ub;
this.Rh = this.Vc === this.Qd && !a
}
return this.Rh ? Jg : this.ye
};
X.prototype.computeCorner = function () {
if (this.ye === Jg)return 0;
var a = this.Cv;
if (isNaN(a) || 0 > a)a = 10;
return a
};
X.prototype.computeCurviness = function () {
var a = this.ns;
if (isNaN(a)) {
var b = this.Xe;
if (0 !== b) {
var a = 10, c = this.h;
null !== c && (a = c.Vo);
c = Math.abs(b);
a = a / 2 + ((c - 1) / 2 | 0) * a;
0 === c % 2 && (a = -a);
0 > b && (a = -a)
} else a = 10
}
return a
};
X.prototype.hasCurviness = function () {
return!isNaN(this.ns) || 0 !== this.Xe && !this.Ub
};
X.prototype.adjustPoints = function (a, b, c, d) {
var e = this.eo;
if (this.Ub) {
if (e === Fk)return!1;
e === Gk && (e = Ek)
}
switch (e) {
case Fk:
var g = this.n(a), h = this.n(c);
if (!g.K(b) || !h.K(d)) {
var e = g.x, g = g.y, k = h.x - e, l = h.y - g, m = Math.sqrt(k * k + l * l);
if (!D.I(m, 0)) {
var n;
D.I(k, 0) ? n = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (n = Math.atan(l / Math.abs(k)), 0 > k && (n = Math.PI - n));
var h = b.x, p = b.y, k = d.x - h, q = d.y - p, l = Math.sqrt(k * k + q * q);
D.I(k, 0) ? q = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(q / Math.abs(k)), 0 > k && (q = Math.PI - q));
m = l / m;
n = q - n;
this.pf(a, b);
for (a += 1; a < c; a++)b =
this.n(a), k = b.x - e, l = b.y - g, b = Math.sqrt(k * k + l * l), D.I(b, 0) || (D.I(k, 0) ? l = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (l = Math.atan(l / Math.abs(k)), 0 > k && (l = Math.PI - l)), k = l + n, b *= m, this.U(a, h + b * Math.cos(k), p + b * Math.sin(k)));
this.pf(c, d)
}
}
return!0;
case Gk:
g = this.n(a);
p = this.n(c);
if (!g.K(b) || !p.K(d)) {
e = g.x;
g = g.y;
h = p.x;
p = p.y;
m = (h - e) * (h - e) + (p - g) * (p - g);
k = b.x;
n = b.y;
var l = d.x, q = d.y, r = 0, s = 1, r = 0 !== l - k ? (q - n) / (l - k) : 9E9;
0 !== r && (s = Math.sqrt(1 + 1 / (r * r)));
this.pf(a, b);
for (a += 1; a < c; a++) {
b = this.n(a);
var u = b.x, x = b.y, E = 0.5;
0 !== m && (E = ((e - u) * (e -
h) + (g - x) * (g - p)) / m);
var F = e + E * (h - e), G = g + E * (p - g);
b = Math.sqrt((u - F) * (u - F) + (x - G) * (x - G));
x < r * (u - F) + G && (b = -b);
0 < r && (b = -b);
u = k + E * (l - k);
E = n + E * (q - n);
0 !== r ? (b = u + b / s, this.U(a, b, E - (b - u) / r)) : this.U(a, u, E + b)
}
this.pf(c, d)
}
return!0;
case Ek:
return this.Ub && (e = this.n(a), g = this.n(a + 1), h = this.n(a + 2), D.I(e.y, g.y) ? D.I(g.x, h.x) ? this.U(a + 1, g.x, b.y) : D.I(g.y, h.y) && this.U(a + 1, b.x, g.y) : D.I(e.x, g.x) && (D.I(g.y, h.y) ? this.U(a + 1, b.x, g.y) : D.I(g.x, h.x) && this.U(a + 1, g.x, b.y)), e = this.n(c), g = this.n(c - 1), h = this.n(c - 2), D.I(e.y, g.y) ? D.I(g.x,
h.x) ? this.U(c - 1, g.x, d.y) : D.I(g.y, h.y) && this.U(c - 1, d.x, g.y) : D.I(e.x, g.x) && (D.I(g.y, h.y) ? this.U(c - 1, d.x, g.y) : D.I(g.x, h.x) && this.U(c - 1, g.x, d.y))), this.pf(a, b), this.pf(c, d), !0;
default:
return!1
}
};
X.prototype.addOrthoPoints = function (a, b, c, d, e, g) {
b = -45 <= b && 45 > b ? 0 : 45 <= b && 135 > b ? 90 : 135 <= b && 225 > b ? 180 : 270;
d = -45 <= d && 45 > d ? 0 : 45 <= d && 135 > d ? 90 : 135 <= d && 225 > d ? 180 : 270;
var h = e.ua.copy(), k = g.ua.copy();
if (h.P() && k.P()) {
h.Gg(8, 8);
k.Gg(8, 8);
h.Li(a);
k.Li(c);
var l, m;
if (0 === b)if (c.x > a.x || 270 === d && c.y < a.y && k.right > a.x || 90 === d && c.y > a.y && k.right > a.x)l = new v(c.x, a.y), m = new v(c.x, (a.y + c.y) / 2), 180 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x < k.left ? this.computeMidOrthoPosition(a.x,
k.left, !1) : a.x < k.right && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.right, m.x = l.x, m.y = c.y) : 0 === d && a.x < k.left && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y); else {
l = new v(a.x, c.y);
m = new v((a.x + c.x) / 2, c.y);
if (180 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom)180 === d && (k.Da(a) || h.Da(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (180 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y,
k.bottom), !0) : c.y > a.y && (180 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
if (l.y > h.top && l.y < h.bottom)if (c.x >= h.left && c.x <= a.x || a.x <= k.right && a.x >= c.x) {
if (90 === d || 270 === d)l = new v(Math.max((a.x + c.x) / 2, a.x), a.y), m = new v(l.x, c.y)
} else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 0 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 0 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
} else if (180 === b)if (c.x < a.x || 270 === d && c.y < a.y && k.left < a.x ||
90 === d && c.y > a.y && k.left < a.x)l = new v(c.x, a.y), m = new v(c.x, (a.y + c.y) / 2), 0 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x > k.right ? this.computeMidOrthoPosition(a.x, k.right, !1) : a.x > k.left && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.left, m.x = l.x, m.y = c.y) : 180 === d && a.x > k.right && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y); else {
l = new v(a.x, c.y);
m = new v((a.x +
c.x) / 2, c.y);
if (0 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom)0 === d && (k.Da(a) || h.Da(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (0 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (0 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
if (l.y > h.top && l.y < h.bottom)if (c.x <= h.right && c.x >= a.x || a.x >= k.left && a.x <= c.x) {
if (90 === d || 270 === d)l = new v(Math.min((a.x + c.x) / 2, a.x), a.y), m = new v(l.x, c.y)
} else l.y = 270 ===
d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 180 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 180 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
} else if (90 === b)if (c.y > a.y || 180 === d && c.x < a.x && k.bottom > a.y || 0 === d && c.x > a.x && k.bottom > a.y)l = new v(a.x, c.y), m = new v((a.x + c.x) / 2, c.y), 270 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x > a.x ? (l.y = a.y < k.top ? this.computeMidOrthoPosition(a.y, k.top, !0) : a.y < k.bottom && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ?
this.computeMidOrthoPosition(a.y, c.y, !0) : k.bottom, m.x = c.x, m.y = l.y) : 90 === d && a.y < k.top && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x); else {
l = new v(c.x, a.y);
m = new v(c.x, (a.y + c.y) / 2);
if (270 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right)270 === d && (k.Da(a) || h.Da(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (270 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (270 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right,
Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
if (l.x > h.left && l.x < h.right)if (c.y >= h.top && c.y <= a.y || a.y <= k.bottom && a.y >= c.y) {
if (0 === d || 180 === d)l = new v(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new v(c.x, l.y)
} else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 90 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 90 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y
} else if (c.y < a.y || 180 === d && c.x < a.x && k.top < a.y || 0 === d && c.x > a.x && k.top < a.y)l = new v(a.x, c.y), m = new v((a.x + c.x) / 2, c.y), 90 === d ? (l.y = this.computeMidOrthoPosition(a.y,
c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x >= a.x ? (l.y = a.y > k.bottom ? this.computeMidOrthoPosition(a.y, k.bottom, !0) : a.y > k.top && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.top, m.x = c.x, m.y = l.y) : 270 === d && a.y > k.bottom && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x); else {
l = new v(c.x, a.y);
m = new v(c.x, (a.y + c.y) / 2);
if (90 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right)90 === d && (k.Da(a) || h.Da(c)) ? l.x = this.computeMidOrthoPosition(a.x,
c.x, !1) : c.x < a.x && (90 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (90 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
if (l.x > h.left && l.x < h.right)if (c.y <= h.bottom && c.y >= a.y || a.y >= k.top && a.y <= c.y) {
if (0 === d || 180 === d)l = new v(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new v(c.x, l.y)
} else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 270 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 270 === d ? h.right : Math.max(h.right,
k.right)), m.x = l.x, m.y = c.y
}
var n = l, p = m;
if (this.Bi) {
var q = this.h;
if (null === q || h.Da(c) || k.Da(a) || e === g || this.layer.kc)a = !1; else if (e = gj(q, this), Rm(e, Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && Rm(e, Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && Rm(e, Math.min(p.x, c.x), Math.min(p.y, c.y), Math.abs(p.x - c.x), Math.abs(p.y - c.y)))a = !1; else if (h = h.copy().ak(k), h.Gg(2 * e.km, 2 * e.jm), Sm(e, a, b, c, d, h), k = Tm(e, c.x, c.y), e.abort || k !== Um || (jj(e), k = e.iF, h.Gg(e.km * k,
e.jm * k), Sm(e, a, b, c, d, h), k = Tm(e, c.x, c.y)), e.abort || k !== Um || (jj(e), k = e.cE, h.Gg(e.km * k, e.jm * k), Sm(e, a, b, c, d, h), k = Tm(e, c.x, c.y)), !e.abort && k === Um && e.PF && (jj(e), Sm(e, a, b, c, d, e.Hb), k = Tm(e, c.x, c.y)), !e.abort && k < Um && 0 !== Tm(e, c.x, c.y)) {
Vm(this, e, c.x, c.y, d, !0);
d = this.n(2);
if (4 > this.ka)0 === b || 180 === b ? (d.x = a.x, d.y = c.y) : (d.x = c.x, d.y = a.y), this.U(2, d.x, d.y), this.C(3, d.x, d.y); else if (c = this.n(3), 0 === b || 180 === b)D.I(d.x, c.x) ? (b = 0 === b ? Math.max(d.x, a.x) : Math.min(d.x, a.x), this.U(2, b, a.y), this.U(3, b, c.y)) : D.I(d.y, c.y) ?
(Math.abs(a.y - d.y) <= e.jm / 2 && (this.U(2, d.x, a.y), this.U(3, c.x, a.y)), this.C(2, d.x, a.y)) : this.U(2, a.x, d.y); else if (90 === b || 270 === b)D.I(d.y, c.y) ? (b = 90 === b ? Math.max(d.y, a.y) : Math.min(d.y, a.y), this.U(2, a.x, b), this.U(3, c.x, b)) : D.I(d.x, c.x) ? (Math.abs(a.x - d.x) <= e.km / 2 && (this.U(2, a.x, d.y), this.U(3, a.x, c.y)), this.C(2, a.x, d.y)) : this.U(2, d.x, a.y);
a = !0
} else a = !1
} else a = !1;
a || (this.qh(l), this.qh(m))
}
};
X.prototype.computeMidOrthoPosition = function (a, b) {
if (this.hasCurviness()) {
var c = this.computeCurviness();
return(a + b) / 2 + c
}
return(a + b) / 2
};
function xf(a) {
if (!a.Bi)return!1;
var b = a.points.p, c = b.length;
if (4 > c)return!1;
a = gj(a.h, a);
for (var d = 1; d < c - 2; d++) {
var e = b[d], g = b[d + 1];
if (!Rm(a, Math.min(e.x, g.x), Math.min(e.y, g.y), Math.abs(e.x - g.x), Math.abs(e.y - g.y)))return!0
}
return!1
}
function Vm(a, b, c, d, e, g) {
var h = b.km, k = b.jm, l = Tm(b, c, d), m = c, n = d;
for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; l > Wm && Tm(b, m, n) === l - Xm;)c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= Xm;
if (g) {
if (l > Wm)if (180 === e || 0 === e)c = Math.floor(c / h) * h + h / 2; else if (90 === e || 270 === e)d = Math.floor(d / k) * k + k / 2
} else c = Math.floor(c / h) * h + h / 2, d = Math.floor(d / k) * k + k / 2;
l > Wm && (g = e, m = c, n = d, 0 === e ? (g = 90, n += k) : 90 === e ? (g = 180, m -= h) : 180 === e ? (g = 270, n -= k) : 270 === e && (g = 0, m += h), Tm(b, m, n) === l - Xm ? Vm(a, b, m, n, g, !1) : (m = c, n = d, 0 === e ? (g = 270, n -=
k) : 90 === e ? (g = 0, m += h) : 180 === e ? (g = 90, n += k) : 270 === e && (g = 180, m -= h), Tm(b, m, n) === l - Xm && Vm(a, b, m, n, g, !1)));
a.Lk(c, d)
}
X.prototype.findClosestSegment = function (a) {
f && t.j(a, v, X, "findClosestSegment:p");
var b = a.x;
a = a.y;
for (var c = this.n(0), d = this.n(1), e = Pa(b, a, c.x, c.y, d.x, d.y), g = 0, h = 1; h < this.ka - 1; h++) {
var c = this.n(h + 1), k = Pa(b, a, d.x, d.y, c.x, c.y), d = c;
k < e && (g = h, e = k)
}
return g
};
X.prototype.invalidateGeometry = X.prototype.Df = function () {
this.ei = this.La = null;
this.Y()
};
t.A(X, {Wc: "geometry"}, function () {
null === this.La && (this.updateRoute(), this.La = this.makeGeometry());
return this.La
});
X.prototype.gw = function () {
if (null === this.La && !1 !== this.Dg) {
this.La = this.makeGeometry();
var a = this.rq();
if (null !== a) {
a.La = this.La;
for (var b = this.za, c = b.length, d = 0; d < c; d++) {
var e = b.p[d];
e !== a && e.Di && e instanceof Y && (e.La = this.La)
}
}
}
};
X.prototype.makeGeometry = function () {
var a = this.ka;
if (2 > a) {
var b = new I(Bc), c = new Cc(0, 0);
b.ob.add(c);
return b
}
var d = this.n(0).copy(), e = d.copy(), g = this.computeCurve();
if (g === Jg && 3 <= a && !D.Fa(this.Lm, 0))if (3 === a)var h = this.n(1), b = Math.min(d.x, h.x), c = Math.min(d.y, h.y), h = this.n(2), b = Math.min(b, h.x), c = Math.min(c, h.y); else {
if (this.Ub)for (h = 0; h < a; h++)b = this.qc.p[h], e.x = Math.min(b.x, e.x), e.y = Math.min(b.y, e.y); else for (var k, h = 3; h < a; h += 3)h + 3 >= a && (h = a - 1), k = this.n(h), e.x = Math.min(k.x, e.x), e.y = Math.min(k.y, e.y);
b = e.x;
c = e.y
} else {
for (h = 0; h < a; h++)b = this.qc.p[h], e.x = Math.min(b.x, e.x), e.y = Math.min(b.y, e.y);
b = e.x;
c = e.y
}
b -= this.Uy.x;
c -= this.Uy.y;
d.x -= b;
d.y -= c;
if (2 === a) {
var l = this.n(1).copy();
l.x -= b;
l.y -= c;
0 !== Pm(this) && Ym(this, d, !0, e);
0 !== Qm(this) && Ym(this, l, !1, e);
b = new I(Gc);
b.la = d.x;
b.ma = d.y;
b.D = l.x;
b.F = l.y
} else {
l = t.u();
0 !== Pm(this) && Ym(this, d, !0, e);
J(l, d.x, d.y, !1, !1);
if (g === Jg && 3 <= a && !D.Fa(this.Lm, 0))if (3 === a)h = this.n(1), a = h.x - b, d = h.y - c, h = this.n(2).copy(), h.x -= b, h.y -= c, 0 !== Qm(this) && Ym(this, h, !1, e), K(l, a, d,
a, d, h.x, h.y); else if (this.Ub) {
d = new v(b, c);
g = this.n(1).copy();
k = new v(b, c);
for (var a = new v(b, c), e = this.n(0), m = null, n = this.Lm / 3, h = 1; h < this.ka - 1; h++) {
var m = this.n(h), p = e, q = m, r = this.n(Zm(this, m, h, !1));
if (!D.Fa(p.x, q.x) || !D.Fa(q.x, r.x))if (!D.Fa(p.y, q.y) || !D.Fa(q.y, r.y)) {
var s = n, u = k, x = a;
isNaN(s) && (s = this.Lm / 3);
var E = p.x, p = p.y, F = q.x, q = q.y, G = r.x, r = r.y, L = s * $m(E, p, F, q), s = s * $m(F, q, G, r);
D.Fa(p, q) && D.Fa(F, G) && (F > E ? r > q ? (u.x = F - L, u.y = q - L, x.x = F + s, x.y = q + s) : (u.x = F - L, u.y = q + L, x.x = F + s, x.y = q - s) : r > q ? (u.x = F + L, u.y = q - L, x.x =
F - s, x.y = q + s) : (u.x = F + L, u.y = q + L, x.x = F - s, x.y = q - s));
D.Fa(E, F) && D.Fa(q, r) && (q > p ? (G > F ? (u.x = F - L, u.y = q - L, x.x = F + s) : (u.x = F + L, u.y = q - L, x.x = F - s), x.y = q + s) : (G > F ? (u.x = F - L, u.y = q + L, x.x = F + s) : (u.x = F + L, u.y = q + L, x.x = F - s), x.y = q - s));
if (D.Fa(E, F) && D.Fa(F, G) || D.Fa(p, q) && D.Fa(q, r))E = 0.5 * (E + G), p = 0.5 * (p + r), u.x = E, u.y = p, x.x = E, x.y = p;
1 === h ? (g.x = 0.5 * (e.x + m.x), g.y = 0.5 * (e.y + m.y)) : 2 === h && D.Fa(e.x, this.n(0).x) && D.Fa(e.y, this.n(0).y) && (g.x = 0.5 * (e.x + m.x), g.y = 0.5 * (e.y + m.y));
K(l, g.x - b, g.y - c, k.x - b, k.y - c, m.x - b, m.y - c);
d.set(k);
g.set(a);
e = m
}
}
h =
e.x;
e = e.y;
d = this.n(this.ka - 1);
h = 0.5 * (h + d.x);
e = 0.5 * (e + d.y);
K(l, a.x - b, a.y - c, h - b, e - c, d.x - b, d.y - c)
} else for (h = 3; h < a; h += 3)e = this.n(h - 2), h + 3 >= a && (h = a - 1), d = this.n(h - 1), k = this.n(h), h === a - 1 && 0 !== Qm(this) && (k = k.copy(), Ym(this, k, !1, D.bk)), K(l, e.x - b, e.y - c, d.x - b, d.y - c, k.x - b, k.y - c); else {
e = t.M();
e.assign(this.n(0));
for (h = 1; h < a;) {
h = Zm(this, e, h, 1 < h);
n = this.n(h);
if (h >= a - 1) {
e !== n && (0 !== Qm(this) && (n = n.copy(), Ym(this, n, !1, D.bk)), an(this, l, -b, -c, e, n));
break
}
h = Zm(this, n, h + 1, h < a - 3);
d = l;
g = -b;
k = -c;
m = e;
u = this.n(h);
x = e;
D.I(m.y,
n.y) && D.I(n.x, u.x) ? (E = this.computeCorner(), E = Math.min(E, Math.abs(n.x - m.x) / 2), E = p = Math.min(E, Math.abs(u.y - n.y) / 2), D.I(E, 0) ? (an(this, d, g, k, m, n), x.assign(n)) : (s = n.x, F = n.y, q = s, G = F, s = n.x > m.x ? n.x - E : n.x + E, G = u.y > n.y ? n.y + p : n.y - p, an(this, d, g, k, m, new v(s, F)), Tc(d, n.x + g, n.y + k, q + g, G + k), x.q(q, G))) : D.I(m.x, n.x) && D.I(n.y, u.y) ? (E = this.computeCorner(), p = Math.min(E, Math.abs(n.y - m.y) / 2), p = E = Math.min(p, Math.abs(u.x - n.x) / 2), D.I(E, 0) ? (an(this, d, g, k, m, n), x.assign(n)) : (s = n.x, G = F = n.y, F = n.y > m.y ? n.y - p : n.y + p, q = u.x > n.x ? n.x + E :
n.x - E, an(this, d, g, k, m, new v(s, F)), Tc(d, n.x + g, n.y + k, q + g, G + k), x.q(q, G))) : (an(this, d, g, k, m, n), x.assign(n))
}
t.B(e)
}
b = l.s;
t.v(l)
}
return b
};
function $m(a, b, c, d) {
a = c - a;
if (isNaN(a) || Infinity === a || -Infinity === a)return NaN;
0 > a && (a = -a);
b = d - b;
if (isNaN(b) || Infinity === b || -Infinity === b)return NaN;
0 > b && (b = -b);
return D.Fa(a, 0) ? b : D.Fa(b, 0) ? a : Math.sqrt(a * a + b * b)
}
function Ym(a, b, c, d) {
var e = a.ka;
if (!(2 > e))if (c) {
var g = a.n(1);
c = g.x - d.x;
d = g.y - d.y;
g = $m(b.x, b.y, c, d);
0 !== g && (e = 2 === e ? 0.5 * g : g, a = Pm(a), a > e && (a = e), c = a * (c - b.x) / g, a = a * (d - b.y) / g, b.x += c, b.y += a)
} else g = a.n(e - 2), c = g.x - d.x, d = g.y - d.y, g = $m(b.x, b.y, c, d), 0 !== g && (e = 2 === e ? 0.5 * g : g, a = Qm(a), a > e && (a = e), c = a * (b.x - c) / g, a = a * (b.y - d) / g, b.x -= c, b.y -= a)
}
function Zm(a, b, c, d) {
for (var e = a.ka, g = b; D.Fa(b.x, g.x) && D.Fa(b.y, g.y);) {
if (c >= e)return e - 1;
g = a.n(c++)
}
if (!D.Fa(b.x, g.x) && !D.Fa(b.y, g.y))return c - 1;
for (var h = g; D.Fa(b.x, g.x) && D.Fa(g.x, h.x) && (!d || (b.y >= g.y ? g.y >= h.y : g.y <= h.y)) || D.Fa(b.y, g.y) && D.Fa(g.y, h.y) && (!d || (b.x >= g.x ? g.x >= h.x : g.x <= h.x));) {
if (c >= e)return e - 1;
h = a.n(c++)
}
return c - 2
}
function an(a, b, c, d, e, g) {
if (Gm(a)) {
var h = new A("number"), k = bn(a, e, g, h), l = e.x, l = e.y;
if (0 < k)if (D.I(e.y, g.y))if (e.x < g.x)for (var m = 0; m < k;) {
var n = Math.max(e.x, Math.min(h.p[m++] - 5, g.x - 10));
b.lineTo(n + c, g.y + d);
for (var l = n + c, p = Math.min(n + 10, g.x); m < k;) {
var q = h.p[m];
if (q < p + 10)m++, p = Math.min(q + 5, g.x); else break
}
q = (n + p) / 2 + c;
q = g.y - 10 + d;
n = p + c;
p = g.y + d;
a.ye === xg ? J(b, n, p, !1, !1) : K(b, l, q, n, q, n, p)
} else for (m = k - 1; 0 <= m;) {
n = Math.min(e.x, Math.max(h.p[m--] + 5, g.x + 10));
b.lineTo(n + c, g.y + d);
l = n + c;
for (p = Math.max(n - 10, g.x); 0 <=
m;)if (q = h.p[m], q > p - 10)m--, p = Math.max(q - 5, g.x); else break;
q = g.y - 10 + d;
n = p + c;
p = g.y + d;
a.ye === xg ? J(b, n, p, !1, !1) : K(b, l, q, n, q, n, p)
} else if (D.I(e.x, g.x))if (e.y < g.y)for (m = 0; m < k;) {
n = Math.max(e.y, Math.min(h.p[m++] - 5, g.y - 10));
b.lineTo(g.x + c, n + d);
l = n + d;
for (p = Math.min(n + 10, g.y); m < k;)if (q = h.p[m], q < p + 10)m++, p = Math.min(q + 5, g.y); else break;
q = g.x - 10 + c;
n = g.x + c;
p += d;
a.ye === xg ? J(b, n, p, !1, !1) : K(b, q, l, q, p, n, p)
} else for (m = k - 1; 0 <= m;) {
n = Math.min(e.y, Math.max(h.p[m--] + 5, g.y + 10));
b.lineTo(g.x + c, n + d);
l = n + d;
for (p = Math.max(n - 10,
g.y); 0 <= m;)if (q = h.p[m], q > p - 10)m--, p = Math.max(q - 5, g.y); else break;
q = g.x - 10 + c;
n = g.x + c;
p += d;
a.ye === xg ? J(b, n, p, !1, !1) : K(b, q, l, q, p, n, p)
}
}
b.lineTo(g.x + c, g.y + d)
}
function bn(a, b, c, d) {
var e = a.h;
if (null === e)return 0;
Math.min(b.x, c.x);
Math.min(b.y, c.y);
Math.max(b.x, c.x);
Math.max(b.y, c.y);
for (e = e.cw; e.next();) {
var g = e.value;
if (null !== g && g.visible)for (var g = g.qb.p, h = g.length, k = 0; k < h; k++) {
var l = g[k];
if (l === a)return 0 < d.length && d.sort(function (a, b) {
return a - b
}), d.length;
if (l instanceof X && a.ub() && l.ub() && Gm(l)) {
var m = l.aj();
m.P() && a.aj().Cf(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.al() && cn(b, c, d, l))
}
}
}
0 < d.length && d.sort(function (a, b) {
return a - b
});
return d.length
}
function cn(a, b, c, d) {
for (var e = d.ka, g = 1; g < e; g++) {
var h = d.n(g - 1), k = d.n(g), l = t.M(), m;
a:{
m = a;
var n = b, p = l;
if (!D.I(m.x, n.x)) {
if (D.I(h.x, k.x) && Math.min(m.x, n.x) <= h.x && Math.max(m.x, n.x) >= h.x && Math.min(h.y, k.y) <= m.y && Math.max(h.y, k.y) >= m.y && !D.I(h.y, k.y)) {
p.x = h.x;
p.y = m.y;
m = !0;
break a
}
} else if (D.I(h.y, k.y) && Math.min(m.y, n.y) <= h.y && Math.max(m.y, n.y) >= h.y && Math.min(h.x, k.x) <= m.x && Math.max(h.x, k.x) >= m.x && !D.I(h.x, k.x)) {
p.x = m.x;
p.y = h.y;
m = !0;
break a
}
p.x = 0;
p.y = 0;
m = !1
}
m && (D.I(a.y, b.y) ? c.add(l.x) : c.add(l.y));
t.B(l)
}
}
t.A(X, {vs: "firstPickIndex"}, function () {
return 2 >= this.ka ? 0 : this.Ub || Jm(this) !== wb ? 1 : 0
});
t.A(X, {bw: "lastPickIndex"}, function () {
var a = this.ka;
return 0 === a ? 0 : 2 >= a ? a - 1 : this.Ub || Km(this) !== wb ? a - 2 : a - 1
});
function Gm(a) {
a = a.ye;
return a === wg || a === xg
}
function Im(a, b) {
if (b || Gm(a)) {
var c = a.h;
null === c || c.kn.contains(a) || null === a.Dy || c.kn.add(a, a.Dy)
}
}
function zg(a, b) {
var c = a.layer;
if (null !== c && c.visible && !c.kc) {
var d = c.h;
if (null !== d)for (var e = !1, d = d.cw; d.next();) {
var g = d.value;
if (g.visible)if (g === c)for (var e = !0, h = !1, g = g.qb.p, k = g.length, l = 0; l < k; l++) {
var m = g[l];
m instanceof X && (m === a ? h = !0 : h && dn(a, m, b))
} else if (e)for (g = g.qb.p, k = g.length, l = 0; l < k; l++)m = g[l], m instanceof X && dn(a, m, b)
}
}
}
function dn(a, b, c) {
if (null !== b && Gm(b) && null !== b.La) {
var d = b.aj();
d.P() && (a.aj().Cf(d) || c.Cf(d)) && (a.usesSamePort(b) || b.Df())
}
}
X.prototype.usesSamePort = function (a) {
var b = this.ka, c = a.ka;
if (0 < b && 0 < c) {
if (this.n(0).xi(a.n(0)) || this.n(b - 1).xi(a.n(c - 1)))return!0
} else if (this.ca === a.ca || this.ga === a.ga)return!0;
return!1
};
t.g(X, "adjusting", X.prototype.eo);
t.defineProperty(X, {eo: "adjusting"}, function () {
return this.Lp
}, function (a) {
var b = this.Lp;
b !== a && (f && t.nb(a, X, X, "adjusting"), this.Lp = a, this.i("adjusting", b, a))
});
t.g(X, "corner", X.prototype.Cv);
t.defineProperty(X, {Cv: "corner"}, function () {
return this.Yp
}, function (a) {
var b = this.Yp;
b !== a && (f && t.k(a, "number", X, "corner"), this.Yp = a, this.Df(), this.i("corner", b, a))
});
t.g(X, "curve", X.prototype.ye);
t.defineProperty(X, {ye: "curve"}, function () {
return this.aq
}, function (a) {
var b = this.aq;
b !== a && (f && t.nb(a, X, X, "curve"), this.aq = a, this.Tb(), Im(this, b === xg || b === wg || a === xg || a === wg), this.i("curve", b, a))
});
t.g(X, "curviness", X.prototype.ns);
t.defineProperty(X, {ns: "curviness"}, function () {
return this.bq
}, function (a) {
var b = this.bq;
b !== a && (f && t.k(a, "number", X, "curviness"), this.bq = a, this.Tb(), this.i("curviness", b, a))
});
t.g(X, "routing", X.prototype.at);
t.defineProperty(X, {at: "routing"}, function () {
return this.Tl
}, function (a) {
var b = this.Tl;
b !== a && (f && t.nb(a, X, X, "routing"), this.Tl = a, this.Rh = null, this.Tb(), Im(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.i("routing", b, a))
});
t.g(X, "smoothness", X.prototype.Lm);
t.defineProperty(X, {Lm: "smoothness"}, function () {
return this.Kr
}, function (a) {
var b = this.Kr;
b !== a && (f && t.k(a, "number", X, "smoothness"), this.Kr = a, this.Df(), this.i("smoothness", b, a))
});
function Em(a) {
var b = a.Mf;
if (null !== b) {
var c = a.Uf;
if (null !== c) {
var d = a.$g;
a = a.oh;
var e;
a:{
if (null !== c && null !== b.Rg)for (e = b.Rg.l; e.next();) {
var g = e.value;
if (g.cp === b && g.Qs === c && g.kw === d && g.lw === a || g.cp === c && g.Qs === b && g.kw === a && g.lw === d) {
e = g;
break a
}
}
e = null
}
for (var h = g = null, k = b.Wb.p, l = k.length, m = 0; m < l; m++) {
var n = k[m];
if (n.Mf === b && n.$g === d && n.Uf === c && n.oh === a || n.Mf === c && n.$g === a && n.Uf === b && n.oh === d)null === h ? h = n : (null === g && (g = new A(X), g.add(h)), g.add(n))
}
if (null !== g)for (null === e && (e = new om, e.cp = b, e.kw =
d, e.Qs = c, e.lw = a, nm(b, e), nm(c, e)), e.links = g, m = 0; m < g.count; m++)if (n = g.p[m], 0 === n.Xe) {
b = 1;
for (c = 0; c < g.count; c++)Math.abs(g.p[c].Xe) === b && (b++, c = -1);
n.Xm = e;
n.Xe = n.ca === e.cp ? b : -b;
n.Tb()
}
}
}
}
function Dm(a) {
var b = a.Xm;
if (null !== b) {
var c = a.Xe;
a.Xm = null;
a.Xe = 0;
a.Tb();
b.links.remove(a);
if (2 > b.links.count)1 === b.links.count && (c = b.links.p[0], c.Xm = null, c.Xe = 0, c.Tb()), c = b.cp, null !== b && null !== c.Rg && c.Rg.remove(b), c = b.Qs, null !== b && null !== c.Rg && c.Rg.remove(b); else for (c = Math.abs(c), a = 0 === c % 2, b = b.links.l; b.next();) {
var d = b.value, e = Math.abs(d.Xe), g = 0 === e % 2;
e > c && a === g && (d.Xe = 0 < d.Xe ? d.Xe - 2 : d.Xe + 2, d.Tb())
}
}
}
function om() {
t.uc(this);
this.links = this.lw = this.Qs = this.kw = this.cp = null
}
t.ce(om, {cp: !0, kw: !0, Qs: !0, lw: !0, links: !0, spacing: !0});
function hj() {
t.uc(this);
this.group = null;
this.Cs = !0;
this.abort = !1;
this.Rf = this.Qf = 1;
this.Uq = this.Tq = -1;
this.Ud = this.Td = 8;
this.ec = null;
this.PF = !1;
this.iF = 22;
this.cE = 111
}
t.ce(hj, {group: !0, Cs: !0, abort: !0, PF: !0, iF: !0, cE: !0});
var Wm = 1, Xm = 1, Um = 999999999, en = Um;
hj.prototype.initialize = function (a) {
if (!(0 >= a.width || 0 >= a.height)) {
var b = a.y, c = a.x + a.width, d = a.y + a.height;
this.Qf = Math.floor((a.x - this.Td) / this.Td) * this.Td;
this.Rf = Math.floor((b - this.Ud) / this.Ud) * this.Ud;
this.Tq = Math.ceil((c + 2 * this.Td) / this.Td) * this.Td;
this.Uq = Math.ceil((d + 2 * this.Ud) / this.Ud) * this.Ud;
a = 1 + (Math.ceil((this.Tq - this.Qf) / this.Td) | 0);
b = 1 + (Math.ceil((this.Uq - this.Rf) / this.Ud) | 0);
if (null === this.ec || this.Yn < a - 1 || this.Zn < b - 1) {
c = [];
for (d = 0; d <= a; d++) {
for (var e = [], g = 0; g <= b; g++)e[g] = 0;
c[d] = e
}
this.ec =
c;
this.Yn = a - 1;
this.Zn = b - 1
}
if (null !== this.ec)for (a = 0; a <= this.Yn; a++)for (b = 0; b <= this.Zn; b++)this.ec[a][b] = en
}
};
t.A(hj, {Hb: null}, function () {
return new w(this.Qf, this.Rf, this.Tq - this.Qf, this.Uq - this.Rf)
});
t.g(hj, "cellWidth", hj.prototype.km);
t.defineProperty(hj, {km: null}, function () {
return this.Td
}, function (a) {
0 < a && a !== this.Td && (this.Td = a, this.initialize(this.Hb))
});
t.g(hj, "cellHeight", hj.prototype.jm);
t.defineProperty(hj, {jm: null}, function () {
return this.Ud
}, function (a) {
0 < a && a !== this.Ud && (this.Ud = a, this.initialize(this.Hb))
});
function fn(a, b, c) {
return a.Qf <= b && b <= a.Tq && a.Rf <= c && c <= a.Uq
}
function Tm(a, b, c) {
if (!fn(a, b, c))return 0;
b -= a.Qf;
b /= a.Td;
c -= a.Rf;
c /= a.Ud;
return a.ec[b | 0][c | 0]
}
function kj(a, b, c) {
fn(a, b, c) && (b -= a.Qf, b /= a.Td, c -= a.Rf, c /= a.Ud, a.ec[b | 0][c | 0] = 0)
}
function jj(a) {
if (null !== a.ec)for (var b = 0; b <= a.Yn; b++)for (var c = 0; c <= a.Zn; c++)a.ec[b][c] >= Wm && (a.ec[b][c] |= Um)
}
function Rm(a, b, c, d, e) {
if (b > a.Tq || b + d < a.Qf || c > a.Uq || c + e < a.Rf)return!0;
b = (b - a.Qf) / a.Td | 0;
c = (c - a.Rf) / a.Ud | 0;
d = Math.max(0, d) / a.Td + 1 | 0;
var g = Math.max(0, e) / a.Ud + 1 | 0;
0 > b && (d += b, b = 0);
0 > c && (g += c, c = 0);
if (0 > d || 0 > g)return!0;
e = Math.min(b + d - 1, a.Yn) | 0;
for (d = Math.min(c + g - 1, a.Zn) | 0; b <= e; b++)for (g = c; g <= d; g++)if (0 === a.ec[b][g])return!1;
return!0
}
function gn(a, b, c, d, e, g, h, k, l) {
if (!(b < g || b > h || c < k || c > l)) {
var m, n;
m = b | 0;
n = c | 0;
var p = a.ec[m][n];
if (p >= Wm && p < Um)for (e ? n += d : m += d, p += Xm; g <= m && m <= h && k <= n && n <= l && !(p >= a.ec[m][n]);)a.ec[m][n] = p, p += Xm, e ? n += d : m += d;
m = e ? n : m;
if (e)if (0 < d)for (c += d; c < m; c += d)gn(a, b, c, 1, !e, g, h, k, l), gn(a, b, c, -1, !e, g, h, k, l); else for (c += d; c > m; c += d)gn(a, b, c, 1, !e, g, h, k, l), gn(a, b, c, -1, !e, g, h, k, l); else if (0 < d)for (b += d; b < m; b += d)gn(a, b, c, 1, !e, g, h, k, l), gn(a, b, c, -1, !e, g, h, k, l); else for (b += d; b > m; b += d)gn(a, b, c, 1, !e, g, h, k, l), gn(a, b, c, -1, !e, g, h,
k, l)
}
}
function hn(a, b, c, d, e, g, h, k, l, m, n) {
for (var p = b | 0, q = c | 0, r = a.ec[p][q]; 0 === r && p > k && p < l && q > m && q < n;)if (h ? q += g : p += g, r = a.ec[p][q], 1 >= Math.abs(p - d) && 1 >= Math.abs(q - e))return a.abort = !0, 0;
p = b | 0;
q = c | 0;
r = a.ec[p][q];
b = Wm;
for (a.ec[p][q] = b; 0 === r && p > k && p < l && q > m && q < n;)h ? q += g : p += g, r = a.ec[p][q], a.ec[p][q] = b, b += Xm;
return h ? q : p
}
function Sm(a, b, c, d, e, g) {
if (null !== a.ec) {
a.abort = !1;
var h = b.x, k = b.y;
if (fn(a, h, k)) {
var h = h - a.Qf, h = h / a.Td, k = k - a.Rf, k = k / a.Ud, l = d.x, m = d.y;
if (fn(a, l, m))if (l -= a.Qf, l /= a.Td, m -= a.Rf, m /= a.Ud, 1 >= Math.abs(h - l) && 1 >= Math.abs(k - m))a.abort = !0; else {
var n = g.x;
b = g.y;
d = g.x + g.width;
var p = g.y + g.height, n = n - a.Qf, n = n / a.Td;
b -= a.Rf;
b /= a.Ud;
d -= a.Qf;
d /= a.Td;
p -= a.Rf;
p /= a.Ud;
g = Math.max(0, Math.min(a.Yn, n | 0));
d = Math.min(a.Yn, Math.max(0, d | 0));
b = Math.max(0, Math.min(a.Zn, b | 0));
var p = Math.min(a.Zn, Math.max(0, p | 0)), h = h | 0, k = k | 0, l = l | 0,
m = m | 0, n = h, q = k, r = 0 === c || 90 === c ? 1 : -1;
(c = 90 === c || 270 === c) ? q = hn(a, h, k, l, m, r, c, g, d, b, p) : n = hn(a, h, k, l, m, r, c, g, d, b, p);
if (!a.abort) {
a:{
c = 0 === e || 90 === e ? 1 : -1;
e = 90 === e || 270 === e;
for (var r = l | 0, s = m | 0, u = a.ec[r][s]; 0 === u && r > g && r < d && s > b && s < p;)if (e ? s += c : r += c, u = a.ec[r][s], 1 >= Math.abs(r - h) && 1 >= Math.abs(s - k)) {
a.abort = !0;
break a
}
r = l | 0;
s = m | 0;
u = a.ec[r][s];
for (a.ec[r][s] = en; 0 === u && r > g && r < d && s > b && s < p;)e ? s += c : r += c, u = a.ec[r][s], a.ec[r][s] = en
}
a.abort || (gn(a, n, q, 1, !1, g, d, b, p), gn(a, n, q, -1, !1, g, d, b, p), gn(a, n, q, 1, !0, g, d, b, p), gn(a,
n, q, -1, !0, g, d, b, p))
}
}
}
}
}
function Nm() {
t.uc(this);
this.port = this.Bc = null;
this.dg = [];
this.Ps = !1
}
t.ce(Nm, {Bc: !0, port: !0, dg: !0, Ps: !0});
Nm.prototype.toString = function () {
for (var a = this.dg, b = this.Bc.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) {
var d = a[c];
null !== d && (b += "\n " + d.toString())
}
return b
};
function jn(a, b, c, d) {
b = b.offsetY;
switch (b) {
case t.md:
return 90;
case t.$c:
return 180;
case t.vd:
return 270;
case t.nd:
return 0
}
switch (b) {
case t.md | t.vd:
return 180 < c ? 270 : 90;
case t.$c | t.nd:
return 90 < c && 270 >= c ? 180 : 0
}
a = 180 * Math.atan2(a.height, a.width) / Math.PI;
switch (b) {
case t.$c | t.vd:
return c > a && c <= 180 + a ? 180 : 270;
case t.vd | t.nd:
return c > 180 - a && c <= 360 - a ? 270 : 0;
case t.nd | t.md:
return c > a && c <= 180 + a ? 90 : 0;
case t.md | t.$c:
return c > 180 - a && c <= 360 - a ? 180 : 90;
case t.$c | t.vd | t.nd:
return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 -
a ? 270 : 0;
case t.vd | t.nd | t.md:
return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0;
case t.nd | t.md | t.$c:
return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0;
case t.md | t.$c | t.vd:
return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90
}
d && b !== (t.$c | t.vd | t.nd | t.md) && (c -= 15, 0 > c && (c += 360));
return c > a && c < 180 - a ? 90 : c >= 180 - a && c <= 180 + a ? 180 : c > 180 + a && c < 360 - a ? 270 : 0
}
function Om(a, b) {
var c = a.dg;
if (0 === c.length) {
if (!a.Ps) {
c = a.Ps;
a.Ps = !0;
var d = a.Bc.ie, e = a.dg.length = 0, g = a.port.$a(yb, t.M()), h = a.port.$a(Pb, t.M()), k = t.Zj(g.x, g.y, 0, 0);
k.Li(h);
t.B(g);
t.B(h);
g = t.cc(k.x + k.width / 2, k.y + k.height / 2);
for (d = d.l; d.next();)if (h = d.value, h.ub()) {
var l = wb, l = h.Vc === a.port ? Jm(h, a.port) : Km(h, a.port);
if (l.No()) {
var m;
m = h.Vc === a.port ? h.Qd : h.Vc;
if (null !== m) {
var n = m.S;
if (null !== n) {
m = h.computeOtherPoint(n, m);
var n = g.ui(m), l = jn(k, l, n, h.Ub), p;
0 === l ? (p = t.nd, 180 < n && (n -= 360)) : p = 90 === l ? t.md : 180 ===
l ? t.$c : t.vd;
(l = a.dg[e]) ? (l.link = h, l.angle = n, l.De = p) : (l = new kn(h, n, p), a.dg[e] = l);
l.jw.set(m);
e++
}
}
}
}
t.B(g);
a.dg.sort(Nm.prototype.fI);
g = a.dg.length;
d = -1;
for (e = h = 0; e < g; e++)l = a.dg[e], null !== l && (l.De !== d && (d = l.De, h = 0), l.Jo = h, h++);
d = -1;
h = 0;
for (e = g - 1; 0 <= e; e--)l = a.dg[e], null !== l && (l.De !== d && (d = l.De, h = l.Jo + 1), l.om = h);
e = a.dg;
for (g = 0; g < e.length; g++)if (d = e[g], null !== d) {
l = d;
m = a.port;
d = t.M();
h = t.M();
switch (l.De) {
case t.md:
m.$a(Pb, d);
m.$a(Jb, h);
break;
case t.$c:
m.$a(Jb, d);
m.$a(yb, h);
break;
case t.vd:
m.$a(yb, d);
m.$a(Gb,
h);
break;
default:
case t.nd:
m.$a(Gb, d), m.$a(Pb, h)
}
m = h.y - d.y;
n = (l.Jo + 1) / (l.om + 1);
l = l.Uo;
l.x = d.x + (h.x - d.x) * n;
l.y = d.y + m * n;
t.B(d);
t.B(h)
}
e = a.dg;
for (g = 0; g < e.length; g++)d = e[g], null !== d && (d.Jv = a.computeEndSegmentLength(d));
a.Ps = c;
t.Jc(k)
}
c = a.dg
}
for (k = 0; k < c.length; k++)if (e = c[k], null !== e && e.link === b)return e;
return null
}
Nm.prototype.fI = function (a, b) {
return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.De < b.De ? -1 : a.De > b.De ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0
};
Nm.prototype.computeEndSegmentLength = function (a) {
var b = a.link, c = b.computeEndSegmentLength(this.Bc, this.port, wb, b.Vc === this.port), d = a.Jo;
if (0 > d)return c;
var e = a.om;
if (1 >= e || !b.Ub)return c;
var b = a.jw, g = a.Uo;
if (a.De === t.$c || a.De === t.md)d = e - 1 - d;
return((a = a.De === t.$c || a.De === t.nd) ? b.y < g.y : b.x < g.x) ? c + 8 * d : (a ? b.y === g.y : b.x === g.x) ? c : c + 8 * (e - 1 - d)
};
function kn(a, b, c) {
this.link = a;
this.angle = b;
this.De = c;
this.jw = new v;
this.om = this.Jo = 0;
this.Uo = new v;
this.Jv = 0
}
t.ce(kn, {link: !0, angle: !0, De: !0, jw: !0, Jo: !0, om: !0, Uo: !0, Jv: !0});
kn.prototype.toString = function () {
return this.link.toString() + " " + this.angle.toString() + " " + this.De.toString() + ":" + this.Jo.toString() + "/" + this.om.toString() + " " + this.Uo.toString() + " " + this.Jv.toString() + " " + this.jw.toString()
};
function U(a) {
0 === arguments.length ? S.call(this, Ug) : S.call(this, a);
this.Wq = new ka(B);
this.In = new ka(U);
this.Dk = this.Xq = this.Vq = null;
this.Yr = !1;
this.Bq = !0;
this.Zr = !1;
this.rb = this.Nr = null;
this.Up = !1;
this.Vp = !0;
this.Wp = !1;
this.Ad = new fe;
this.Ad.group = this
}
t.ea("Group", U);
t.Ja(U, S);
U.prototype.cloneProtected = function (a) {
S.prototype.cloneProtected.call(this, a);
a.Vq = this.Vq;
a.Xq = this.Xq;
a.Dk = this.Dk;
a.Yr = this.Yr;
a.Bq = this.Bq;
a.Zr = this.Zr;
a.Nr = this.Nr;
var b = zl(a, a, function (a) {
return a instanceof Og
});
a.rb = b instanceof Og ? b : null;
a.Up = this.Up;
a.Vp = this.Vp;
a.Wp = this.Wp;
null !== this.Ad ? (a.Ad = this.Ad.copy(), a instanceof U && (a.Ad.group = a)) : (null !== a.Ad && (a.Ad.group = null), a.Ad = null)
};
U.prototype.th = function (a) {
S.prototype.th.call(this, a);
var b = a.Ao();
for (a = a.Lc; a.next();) {
var c = a.value;
c.Y();
c.J(Gh);
c.ue();
c instanceof U && (c.Dw = c.gf, ln(c, b));
if (c instanceof S)c.Hg(b); else if (c instanceof X)for (c = c.Wj; c.next();)c.value.Hg(b)
}
};
U.prototype.Hm = function (a, b, c, d, e, g, h) {
if (a === rd && "elements" === b)if (e instanceof Og)null === this.rb ? this.rb = e : this.rb !== e && t.m("Cannot insert a second Placeholder into the visual tree of a Group."); else {
if (e instanceof y) {
var k = zl(e, e, function (a) {
return a instanceof Og
});
k instanceof Og && (null === this.rb ? this.rb = k : this.rb !== k && t.m("Cannot insert a second Placeholder into the visual tree of a Group."))
}
} else a === sd && "elements" === b && null !== this.rb && (d === this.rb ? this.rb = null : d instanceof y && this.rb.Ci(d) &&
(this.rb = null));
S.prototype.Hm.call(this, a, b, c, d, e, g, h)
};
U.prototype.Hj = function (a, b, c, d) {
this.Ck = this.rb;
y.prototype.Hj.call(this, a, b, c, d)
};
U.prototype.Zk = function () {
if (!S.prototype.Zk.call(this))return!1;
for (var a = this.Lc; a.next();) {
var b = a.value;
if (b instanceof S) {
if (b.ub() && wi(b))return!1
} else if (b instanceof X && b.ub() && wi(b) && b.ca !== this && b.ga !== this)return!1
}
return!0
};
t.A(U, {placeholder: "placeholder"}, function () {
return this.rb
});
t.g(U, "computesBoundsAfterDrag", U.prototype.vz);
t.defineProperty(U, {vz: "computesBoundsAfterDrag"}, function () {
return this.Up
}, function (a) {
var b = this.Up;
b !== a && (t.k(a, "boolean", U, "computesBoundsAfterDrag"), this.Up = a, this.i("computesBoundsAfterDrag", b, a))
});
t.g(U, "computesBoundsIncludingLinks", U.prototype.UC);
t.defineProperty(U, {UC: "computesBoundsIncludingLinks"}, function () {
return this.Vp
}, function (a) {
t.k(a, "boolean", U, "computesBoundsIncludingLinks");
var b = this.Vp;
b !== a && (this.Vp = a, this.i("computesBoundsIncludingLinks", b, a))
});
t.g(U, "computesBoundsIncludingLocation", U.prototype.VC);
t.defineProperty(U, {VC: "computesBoundsIncludingLocation"}, function () {
return this.Wp
}, function (a) {
t.k(a, "boolean", U, "computesBoundsIncludingLocation");
var b = this.Wp;
b !== a && (this.Wp = a, this.i("computesBoundsIncludingLocation", b, a))
});
t.A(U, {Lc: "memberParts"}, function () {
return this.Wq.l
});
function hm(a, b) {
if (a.Wq.add(b)) {
b instanceof U && a.In.add(b);
var c = a.nE;
if (null !== c) {
var d = !0, e = a.h;
null !== e && (d = e.Sa, e.Sa = !0);
c(a, b);
null !== e && (e.Sa = d)
}
}
c = a.rb;
null === c && (c = a);
c.Y()
}
function gm(a, b) {
if (a.Wq.remove(b)) {
b instanceof U && a.In.remove(b);
var c = a.oE;
if (null !== c) {
var d = !0, e = a.h;
null !== e && (d = e.Sa, e.Sa = !0);
c(a, b);
null !== e && (e.Sa = d)
}
}
c = a.rb;
null === c && (c = a);
c.Y()
}
U.prototype.rm = function () {
if (0 < this.Wq.count) {
var a = this.h;
if (null === a)return;
for (var b = this.Wq.copy().l; b.next();)a.remove(b.value)
}
S.prototype.rm.call(this)
};
U.prototype.xw = function () {
var a = this.layer;
null !== a && a.xw(this)
};
t.g(U, "layout", U.prototype.Vb);
t.defineProperty(U, {Vb: "layout"}, function () {
return this.Ad
}, function (a) {
var b = this.Ad;
b !== a && (null !== a && t.j(a, fe, U, "layout"), null !== b && (b.h = null, b.group = null), this.Ad = a, null !== a && (a.h = this.h, a.group = this), this.i("layout", b, a))
});
t.g(U, "memberAdded", U.prototype.nE);
t.defineProperty(U, {nE: "memberAdded"}, function () {
return this.Vq
}, function (a) {
var b = this.Vq;
b !== a && (null !== a && t.k(a, "function", U, "memberAdded"), this.Vq = a, this.i("memberAdded", b, a))
});
t.g(U, "memberRemoved", U.prototype.oE);
t.defineProperty(U, {oE: "memberRemoved"}, function () {
return this.Xq
}, function (a) {
var b = this.Xq;
b !== a && (null !== a && t.k(a, "function", U, "memberRemoved"), this.Xq = a, this.i("memberRemoved", b, a))
});
t.g(U, "memberValidation", U.prototype.Ks);
t.defineProperty(U, {Ks: "memberValidation"}, function () {
return this.Dk
}, function (a) {
var b = this.Dk;
b !== a && (null !== a && t.k(a, "function", U, "memberValidation"), this.Dk = a, this.i("memberValidation", b, a))
});
U.prototype.canAddMembers = function (a) {
var b = this.h;
if (null === b)return!1;
b = b.Le;
for (a = He(a).l; a.next();)if (!b.isValidMember(this, a.value))return!1;
return!0
};
U.prototype.addMembers = function (a, b) {
var c = this.h;
if (null === c)return!1;
for (var c = c.Le, d = !0, e = He(a).l; e.next();) {
var g = e.value;
!b || c.isValidMember(this, g) ? g.ib = this : d = !1
}
return d
};
t.g(U, "ungroupable", U.prototype.DF);
t.defineProperty(U, {DF: "ungroupable"}, function () {
return this.Yr
}, function (a) {
var b = this.Yr;
b !== a && (t.k(a, "boolean", U, "ungroupable"), this.Yr = a, this.i("ungroupable", b, a))
});
U.prototype.canUngroup = function () {
if (!this.DF)return!1;
var a = this.layer;
if (null !== a && !a.mo)return!1;
a = a.h;
return null === a || a.mo ? !0 : !1
};
U.prototype.findExternalLinksConnected = function () {
var a = this.Ao();
a.add(this);
for (var b = new ka(X), c = a.l; c.next();) {
var d = c.value;
if (d instanceof S)for (d = d.ie; d.next();) {
var e = d.value;
a.contains(e) || b.add(e)
}
}
return b.l
};
U.prototype.findExternalNodesConnected = function () {
var a = this.Ao();
a.add(this);
for (var b = new ka(S), c = a.l; c.next();) {
var d = c.value;
if (d instanceof S)for (d = d.ie; d.next();) {
var e = d.value, g = e.ca;
a.contains(g) && g !== this || b.add(g);
e = e.ga;
a.contains(e) && e !== this || b.add(e)
}
}
return b.l
};
U.prototype.findSubGraphParts = U.prototype.Ao = function () {
var a = new ka(B);
Be(a, this, !0, 0);
a.remove(this);
return a
};
U.prototype.collapseSubGraph = U.prototype.collapseSubGraph = function () {
var a = this.h;
if (null !== a && !a.Gd) {
a.Gd = !0;
var b = this.Ao();
ln(this, b);
a.Gd = !1
}
};
function ln(a, b) {
a.gf = !1;
for (var c = a.Lc; c.next();) {
var d = c.value;
d.Y();
d.J(Gh);
d.ue();
d instanceof U && (d.Dw = d.gf, ln(d, b));
if (d instanceof S)d.Hg(b); else if (d instanceof X)for (d = d.Wj; d.next();)d.value.Hg(b)
}
}
U.prototype.expandSubGraph = U.prototype.expandSubGraph = function () {
var a = this.h;
if (null !== a && !a.Gd) {
a.Gd = !0;
var b = this.Ao();
mn(this, b);
a.Gd = !1
}
};
function mn(a, b) {
a.gf = !0;
for (var c = a.Lc; c.next();) {
var d = c.value;
d.Y();
d.J(Fh);
d.updateAdornments();
d instanceof U && d.Dw && mn(d, b);
if (d instanceof S)d.Hg(b); else if (d instanceof X)for (d = d.Wj; d.next();)d.value.Hg(b)
}
}
t.g(U, "isSubGraphExpanded", U.prototype.gf);
t.defineProperty(U, {gf: "isSubGraphExpanded"}, function () {
return this.Bq
}, function (a) {
var b = this.Bq;
if (b !== a) {
t.k(a, "boolean", U, "isSubGraphExpanded");
this.Bq = a;
var c = this.h;
this.i("isSubGraphExpanded", b, a);
b = this.oF;
if (null !== b) {
var d = !0;
null !== c && (d = c.Sa, c.Sa = !0);
b(this);
null !== c && (c.Sa = d)
}
null !== c && c.va.kb || (a ? this.expandSubGraph() : this.collapseSubGraph())
}
});
t.g(U, "wasSubGraphExpanded", U.prototype.Dw);
t.defineProperty(U, {Dw: "wasSubGraphExpanded"}, function () {
return this.Zr
}, function (a) {
var b = this.Zr;
b !== a && (t.k(a, "boolean", U, "wasSubGraphExpanded"), this.Zr = a, this.i("wasSubGraphExpanded", b, a))
});
t.g(U, "subGraphExpandedChanged", U.prototype.oF);
t.defineProperty(U, {oF: "subGraphExpandedChanged"}, function () {
return this.Nr
}, function (a) {
var b = this.Nr;
b !== a && (null !== a && t.k(a, "function", U, "subGraphExpandedChanged"), this.Nr = a, this.i("subGraphExpandedChanged", b, a))
});
U.prototype.move = U.prototype.move = function (a) {
var b = this.position, c = b.x;
isNaN(c) && (c = 0);
b = b.y;
isNaN(b) && (b = 0);
var c = a.x - c, b = a.y - b, d = t.cc(c, b);
S.prototype.move.call(this, a);
for (a = this.Ao().l; a.next();) {
var e = a.value;
if (!(e instanceof X || e.vh)) {
var g = e.position;
d.x = g.x + c;
d.y = g.y + b;
S.prototype.move.call(e, d)
}
}
for (a.reset(); a.next();)e = a.value, e instanceof X && (g = e.position, d.x = g.x + c, d.y = g.y + b, e.move(d));
t.B(d)
};
function Og() {
Q.call(this);
this.Ge = D.Fp;
this.xr = new w(NaN, NaN, NaN, NaN)
}
t.ea("Placeholder", Og);
t.Ja(Og, Q);
Og.prototype.cloneProtected = function (a) {
Q.prototype.cloneProtected.call(this, a);
a.Ge = this.Ge.W();
a.xr = this.xr.copy()
};
Og.prototype.Ij = function (a) {
if (null === this.background && null === this.Gj)return!1;
var b = this.Oa;
return eb(0, 0, b.width, b.height, a.x, a.y)
};
Og.prototype.Js = function () {
var a = this.S;
null !== a && (a instanceof U || a instanceof Ce) || t.m("Placeholder is not inside a Group or Adornment.");
if (a instanceof U) {
var b = this.computeBorder(this.xr), c = this.Ec;
Ua(c, b.width || 0, b.height || 0);
Nj(this, 0, 0, c.width, c.height);
for (var c = a.Lc, d = !1; c.next();)if (c.value.ub()) {
d = !0;
break
}
!d || isNaN(b.x) || isNaN(b.y) || (c = new v, c.et(b, a.Re), a.location = new v(c.x, c.y))
} else {
var b = this.ya, c = this.Ec, a = this.padding, d = a.left + a.right, e = a.top + a.bottom;
if (b.P())Ua(c, b.width + d || 0,
b.height + e || 0), Nj(this, -a.left, -a.top, c.width, c.height); else {
var g = this.S, h = g.Hc, k = h.$a(yb, t.M()), b = t.Zj(k.x, k.y, 0, 0);
b.Li(h.$a(Pb, k));
b.Li(h.$a(Gb, k));
b.Li(h.$a(Jb, k));
g.Wh.q(b.x, b.y);
Ua(c, b.width + d || 0, b.height + e || 0);
Nj(this, -a.left, -a.top, c.width, c.height);
t.B(k);
t.Jc(b)
}
}
};
Og.prototype.Hj = function (a, b, c, d) {
var e = this.ua;
e.x = a;
e.y = b;
e.width = c;
e.height = d
};
Og.prototype.computeBorder = function (a) {
var b = this.S;
if (b instanceof U && b.vz && this.xr.P()) {
var c = b.h;
if (null !== c && (c = c.Na, c instanceof Ze && !c.hq && null !== c.rc && !c.rc.contains(b)))return a.assign(this.xr), a
}
var c = t.rf(), d = this.computeMemberBounds(c), e = this.padding;
a.q(d.x - e.left, d.y - e.top, d.width + e.left + e.right, d.height + e.top + e.bottom);
t.Jc(c);
b instanceof U && b.VC && b.location.P() && a.Li(b.location);
return a
};
Og.prototype.computeMemberBounds = function (a) {
var b = this.S;
if (!(b instanceof U))return a.q(0, 0, 0, 0), a;
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = b.Lc; h.next();) {
var k = h.value;
if (k.ub()) {
if (k instanceof X) {
if (!b.UC)continue;
if (vi(k))continue;
if (k.ca === b || k.ga === b)continue
}
k = k.ua;
k.left < c && (c = k.left);
k.top < d && (d = k.top);
k.right > e && (e = k.right);
k.bottom > g && (g = k.bottom)
}
}
isFinite(c) && isFinite(d) ? a.q(c, d, e - c, g - d) : (b = b.location, c = this.padding, a.q(b.x + c.left, b.y + c.top, 0, 0));
return a
};
t.g(Og, "padding", Og.prototype.padding);
t.defineProperty(Og, {padding: "padding"}, function () {
return this.Ge
}, function (a) {
"number" === typeof a ? (0 > a && t.ia(a, ">= 0", Og, "padding"), a = new Wa(a)) : (t.j(a, Wa, Og, "padding"), 0 > a.left && t.ia(a.left, ">= 0", Og, "padding:val.left"), 0 > a.right && t.ia(a.right, ">= 0", Og, "padding:val.right"), 0 > a.top && t.ia(a.top, ">= 0", Og, "padding:val.top"), 0 > a.bottom && t.ia(a.bottom, ">= 0", Og, "padding:val.bottom"));
var b = this.Ge;
b.K(a) || (this.Ge = a = a.W(), this.i("padding", b, a))
});
function fe() {
0 < arguments.length && t.m("Layout constructor cannot take any arguments.");
t.uc(this);
this.Ux = this.ba = null;
this.wq = this.yq = !0;
this.Fq = this.yn = !1;
this.Np = (new v(0, 0)).freeze();
this.ey = !0;
this.ty = null;
this.zq = !0
}
t.ea("Layout", fe);
fe.prototype.cloneProtected = function (a) {
a.yq = this.yq;
a.wq = this.wq;
this.wq || (a.yn = !0);
a.Fq = this.Fq;
a.Np.assign(this.Np);
a.zq = this.zq
};
fe.prototype.copy = function () {
var a = new this.constructor;
this.cloneProtected(a);
return a
};
fe.prototype.toString = function () {
var a = t.Fg(Object.getPrototypeOf(this)), a = a + "(";
null !== this.group && (a += " in " + this.group);
null !== this.h && (a += " for " + this.h);
return a + ")"
};
t.g(fe, "diagram", fe.prototype.h);
t.defineProperty(fe, {h: "diagram"}, function () {
return this.ba
}, function (a) {
this.ba !== a && (null !== a && t.j(a, z, fe, "diagram"), this.ba = a)
});
t.g(fe, "group", fe.prototype.group);
t.defineProperty(fe, {group: "group"}, function () {
return this.Ux
}, function (a) {
this.Ux !== a && (null !== a && t.j(a, U, fe, "group"), this.Ux = a)
});
t.g(fe, "isOngoing", fe.prototype.$D);
t.defineProperty(fe, {$D: "isOngoing"}, function () {
return this.yq
}, function (a) {
this.yq !== a && (t.k(a, "boolean", fe, "isOngoing"), this.yq = a)
});
t.g(fe, "isInitial", fe.prototype.YD);
t.defineProperty(fe, {YD: "isInitial"}, function () {
return this.wq
}, function (a) {
t.k(a, "boolean", fe, "isInitial");
this.wq = a;
a || (this.yn = !0)
});
t.g(fe, "isValidLayout", fe.prototype.hf);
t.defineProperty(fe, {hf: "isValidLayout"}, function () {
return this.yn
}, function (a) {
this.yn !== a && (t.k(a, "boolean", fe, "isValidLayout"), this.yn = a, a || (a = this.h, null !== a && (a.At = !0)))
});
fe.prototype.invalidateLayout = fe.prototype.J = function () {
if (this.yn) {
var a = this.h;
null !== a && !a.va.kb && (this.$D && a.Nf || this.YD && !a.Nf) && (this.hf = !1, a.Hf(!0))
}
};
t.g(fe, "isRealtime", fe.prototype.Wz);
t.defineProperty(fe, {Wz: "isRealtime"}, function () {
return this.zq
}, function (a) {
this.zq !== a && (t.k(a, "boolean", fe, "isRealtime"), this.zq = a)
});
t.g(fe, "isViewportSized", fe.prototype.Hs);
t.defineProperty(fe, {Hs: "isViewportSized"}, function () {
return this.Fq
}, function (a) {
this.Fq !== a && (t.k(a, "boolean", fe, "isViewportSized"), (this.Fq = a) && this.J())
});
t.g(fe, "isRouting", fe.prototype.Gs);
t.defineProperty(fe, {Gs: "isRouting"}, function () {
return this.ey
}, function (a) {
this.ey !== a && (t.k(a, "boolean", fe, "isRouting"), this.ey = a)
});
t.g(fe, "network", fe.prototype.network);
t.defineProperty(fe, {network: "network"}, function () {
return this.ty
}, function (a) {
var b = this.ty;
b !== a && (null !== a && t.j(a, ra, fe, "network"), null !== b && nn(b, null), this.ty = a, null !== a && nn(a, this))
});
fe.prototype.createNetwork = function () {
var a = new ra;
nn(a, this);
return a
};
fe.prototype.makeNetwork = function (a) {
var b = this.createNetwork();
a instanceof z ? (b.ds(a.Ji, !0), b.ds(a.links, !0)) : a instanceof U ? b.ds(a.Lc) : b.ds(a.l);
return b
};
fe.prototype.updateParts = function () {
var a = this.h;
if (null === a && null !== this.network)for (var b = this.network.vertexes.l; b.next();) {
var c = b.value.Bc;
if (null !== c && (a = c.h, null !== a))break
}
this.hf = !0;
null !== a && a.mc("Layout");
this.commitLayout();
null !== a && a.xe("Layout")
};
fe.prototype.commitLayout = function () {
};
fe.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
var b = new ka(B);
a === this.h ? (on(this, b, a.Ji, !0, this.fA, !0, !1, !0), on(this, b, a.gp, !0, this.fA, !0, !1, !0)) : a === this.group ? on(this, b, a.Lc, !1, this.fA, !0, !1, !0) : b.He(a.l);
var c = b.count;
if (0 < c) {
a = this.h;
null !== a && a.mc("Layout");
for (var c = Math.ceil(Math.sqrt(c)), d = this.rd.x, e = d, g = this.rd.y, h = 0, k = 0, b = b.l; b.next();) {
var l = b.value;
l.zf();
var m = l.Ba, n = m.width, m = m.height;
l.moveTo(e, g);
delete l.$B;
e += Math.max(n, 50) + 20;
k = Math.max(k, Math.max(m, 50));
h >= c - 1 ? (h = 0, e = d, g += k + 20, k = 0) : h++
}
null !== a && a.xe("Layout")
}
this.hf = !0
};
fe.prototype.fA = function (a) {
return!a.location.P() || a instanceof U && a.$B ? !0 : !1
};
function on(a, b, c, d, e, g, h, k) {
for (c = c.l; c.next();) {
var l = c.value;
d && !l.Oo || e && !e(l) || l.canLayout() && (g && l instanceof S ? l.vh || (l instanceof U && null === l.Vb ? on(a, b, l.Lc, !1, e, g, h, k) : b.add(l)) : h && l instanceof X ? b.add(l) : !k || !l.Jd() || l instanceof S || b.add(l))
}
}
t.g(fe, "arrangementOrigin", fe.prototype.rd);
t.defineProperty(fe, {rd: "arrangementOrigin"}, function () {
return this.Np
}, function (a) {
this.Np.K(a) || (t.j(a, v, fe, "arrangementOrigin"), this.Np.assign(a), this.J())
});
fe.prototype.initialOrigin = fe.prototype.Pz = function (a) {
var b = this.group;
if (null !== b) {
var c = b.location;
if (isNaN(c.x) || isNaN(c.y))return a;
a = b.placeholder;
null !== a ? (c = a.$a(yb), c.x += a.padding.left, c.y += a.padding.top) : c = b.position.copy();
return c
}
return a
};
function ra() {
t.uc(this);
this.Ad = null;
this.clear()
}
t.ea("LayoutNetwork", ra);
ra.prototype.clear = function () {
if (this.vertexes)for (var a = this.vertexes.l; a.next();) {
var b = a.value;
b.clear();
b.network = null
}
if (this.edges)for (a = this.edges.l; a.next();)b = a.value, b.clear(), b.network = null;
this.vertexes = new ka(sa);
this.edges = new ka(ta);
this.iA = new ia(S, sa);
this.Yz = new ia(X, ta)
};
ra.prototype.toString = function () {
return"LayoutNetwork" + (null !== this.Vb ? "(" + this.Vb.toString() + ")" : "")
};
t.A(ra, {Vb: "layout"}, function () {
return this.Ad
});
function nn(a, b) {
f && null !== b && t.j(b, fe, ra, "setLayout");
a.Ad = b
}
ra.prototype.createVertex = function () {
return new sa
};
ra.prototype.createEdge = function () {
return new ta
};
ra.prototype.addParts = ra.prototype.ds = function (a, b) {
if (null !== a) {
void 0 === b && (b = !1);
t.k(b, "boolean", ra, "addParts:toplevelonly");
for (var c = a.l; c.next();) {
var d = c.value;
if (d instanceof S && (!b || d.Oo) && d.canLayout() && !d.vh)if (d instanceof U && null === d.Vb)this.ds(d.Lc, !1); else if (null === this.vm(d)) {
var e = this.createVertex();
e.Bc = d;
this.Mk(e)
}
}
for (c.reset(); c.next();)if (d = c.value, d instanceof X && (!b || d.Oo) && d.canLayout() && null === this.Kv(d)) {
var g = d.ca, e = d.ga;
g !== e && (g = this.Lv(g), e = this.Lv(e), null !== g && null !==
e && this.Cm(g, e, d))
}
}
};
ra.prototype.findGroupVertex = ra.prototype.Lv = function (a) {
if (null === a)return null;
a = dm(a);
if (null === a)return null;
var b = this.vm(a);
if (null !== b)return b;
a = a.ib;
return null !== a && (b = this.vm(a), null !== b) ? b : null
};
ra.prototype.addVertex = ra.prototype.Mk = function (a) {
if (null !== a) {
f && t.j(a, sa, ra, "addVertex:vertex");
this.vertexes.add(a);
var b = a.Bc;
null !== b && this.iA.add(b, a);
a.network = this
}
};
ra.prototype.addNode = ra.prototype.co = function (a) {
if (null === a)return null;
f && t.j(a, S, ra, "addNode:node");
var b = this.vm(a);
null === b && (b = this.createVertex(), b.Bc = a, this.Mk(b));
return b
};
ra.prototype.deleteVertex = ra.prototype.lD = function (a) {
if (null !== a && (f && t.j(a, sa, ra, "deleteVertex:vertex"), pn(this, a))) {
for (var b = a.Ue, c = b.count - 1; 0 <= c; c--) {
var d = b.ta(c);
this.uo(d)
}
b = a.Me;
for (c = b.count - 1; 0 <= c; c--)d = b.ta(c), this.uo(d)
}
};
function pn(a, b) {
if (null === b)return!1;
var c = a.vertexes.remove(b);
c && (a.iA.remove(b.Bc), b.network = null);
return c
}
ra.prototype.deleteNode = function (a) {
null !== a && (f && t.j(a, S, ra, "deleteNode:node"), a = this.vm(a), null !== a && this.lD(a))
};
ra.prototype.findVertex = ra.prototype.vm = function (a) {
if (null === a)return null;
f && t.j(a, S, ra, "findVertex:node");
return this.iA.wa(a)
};
ra.prototype.addEdge = ra.prototype.bo = function (a) {
if (null !== a) {
f && t.j(a, ta, ra, "addEdge:edge");
this.edges.add(a);
var b = a.link;
null !== b && null === this.Kv(b) && this.Yz.add(b, a);
b = a.toVertex;
null !== b && b.EC(a);
b = a.fromVertex;
null !== b && b.CC(a);
a.network = this
}
};
ra.prototype.addLink = function (a) {
if (null === a)return null;
f && t.j(a, X, ra, "addLink:link");
var b = a.ca, c = a.ga, d = this.Kv(a);
null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.co(b)), null !== c && (d.toVertex = this.co(c)), this.bo(d)) : (d.fromVertex = null !== b ? this.co(b) : null, d.toVertex = null !== c ? this.co(c) : null);
return d
};
ra.prototype.deleteEdge = ra.prototype.uo = function (a) {
if (null !== a) {
f && t.j(a, ta, ra, "deleteEdge:edge");
var b = a.toVertex;
null !== b && b.kD(a);
b = a.fromVertex;
null !== b && b.jD(a);
qn(this, a)
}
};
function qn(a, b) {
null !== b && a.edges.remove(b) && (a.Yz.remove(b.link), b.network = null)
}
ra.prototype.deleteLink = function (a) {
null !== a && (f && t.j(a, X, ra, "deleteLink:link"), a = this.Kv(a), null !== a && this.uo(a))
};
ra.prototype.findEdge = ra.prototype.Kv = function (a) {
if (null === a)return null;
f && t.j(a, X, ra, "findEdge:link");
return this.Yz.wa(a)
};
ra.prototype.linkVertexes = ra.prototype.Cm = function (a, b, c) {
if (null === a || null === b)return null;
f && (t.j(a, sa, ra, "linkVertexes:fromVertex"), t.j(b, sa, ra, "linkVertexes:toVertex"), null !== c && t.j(c, X, ra, "linkVertexes:link"));
if (a.network === this && b.network === this) {
var d = this.createEdge();
d.link = c;
d.fromVertex = a;
d.toVertex = b;
this.bo(d);
return d
}
return null
};
ra.prototype.reverseEdge = ra.prototype.qw = function (a) {
if (null !== a) {
f && t.j(a, ta, ra, "reverseEdge:edge");
var b = a.fromVertex, c = a.toVertex;
null !== b && null !== c && (b.jD(a), c.kD(a), a.qw(), b.EC(a), c.CC(a))
}
};
ra.prototype.deleteSelfEdges = ra.prototype.Gv = function () {
for (var a = t.yb(), b = this.edges.l; b.next();) {
var c = b.value;
c.fromVertex === c.toVertex && a.push(c)
}
b = a.length;
for (c = 0; c < b; c++)this.uo(a[c]);
t.xa(a)
};
ra.prototype.deleteArtificialVertexes = function () {
for (var a = t.yb(), b = this.vertexes.l; b.next();) {
var c = b.value;
null === c.Bc && a.push(c)
}
c = a.length;
for (b = 0; b < c; b++)this.lD(a[b]);
c = t.yb();
for (b = this.edges.l; b.next();) {
var d = b.value;
null === d.link && c.push(d)
}
d = c.length;
for (b = 0; b < d; b++)this.uo(c[b]);
t.xa(a);
t.xa(c)
};
function rn(a) {
for (var b = t.yb(), c = a.edges.l; c.next();) {
var d = c.value;
null !== d.fromVertex && null !== d.toVertex || b.push(d)
}
c = b.length;
for (d = 0; d < c; d++)a.uo(b[d]);
t.xa(b)
}
ra.prototype.splitIntoSubNetworks = ra.prototype.CI = function () {
this.deleteArtificialVertexes();
rn(this);
this.Gv();
for (var a = new A(ra), b = !0; b;)for (var b = !1, c = this.vertexes.l; c.next();) {
var d = c.value;
if (0 < d.Ue.count || 0 < d.Me.count) {
b = this.Vb.createNetwork();
a.add(b);
sn(this, b, d);
b = !0;
break
}
}
a.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : b.vertexes.count - a.vertexes.count
});
return a
};
function sn(a, b, c) {
if (null !== c && c.network !== b) {
pn(a, c);
b.Mk(c);
for (var d = c.bc; d.next();) {
var e = d.value;
e.network !== b && (qn(a, e), b.bo(e), sn(a, b, e.fromVertex))
}
for (d = c.Sb; d.next();)e = d.value, e.network !== b && (qn(a, e), b.bo(e), sn(a, b, e.toVertex))
}
}
ra.prototype.findAllParts = function () {
for (var a = new ka(B), b = this.vertexes.l; b.next();)a.add(b.value.Bc);
for (b = this.edges.l; b.next();)a.add(b.value.link);
return a
};
function sa() {
t.uc(this);
this.network = null;
this.Q = (new w(0, 0, 10, 10)).freeze();
this.N = (new v(5, 5)).freeze();
this.clear()
}
t.ea("LayoutVertex", sa);
sa.prototype.clear = function () {
this.dd = null;
this.Ue = new A(ta);
this.Me = new A(ta)
};
sa.prototype.toString = function () {
return"LayoutVertex#" + t.jc(this) + (null !== this.Bc ? "(" + this.Bc.toString() + ")" : "")
};
t.g(sa, "node", sa.prototype.Bc);
t.defineProperty(sa, {Bc: "node"}, function () {
return this.dd
}, function (a) {
if (this.dd !== a) {
f && null !== a && t.j(a, S, sa, "node");
this.dd = a;
a.zf();
var b = a.ua, c = b.x, d = b.y, e = b.width, b = b.height;
isNaN(c) && (c = 0);
isNaN(d) && (d = 0);
this.Q.q(c, d, e, b);
c = a.Zb;
c === a || a instanceof U ? this.N.q(e / 2, b / 2) : (a = c.ua, this.N.q(a.x + a.width / 2, a.y + a.height / 2))
}
});
t.g(sa, "bounds", sa.prototype.Hb);
t.defineProperty(sa, {Hb: "bounds"}, function () {
return this.Q
}, function (a) {
this.Q.K(a) || (f && t.j(a, w, sa, "bounds"), this.Q.assign(a))
});
t.g(sa, "focus", sa.prototype.focus);
t.defineProperty(sa, {focus: "focus"}, function () {
return this.N
}, function (a) {
this.N.K(a) || (f && t.j(a, v, sa, "focus"), this.N.assign(a))
});
t.g(sa, "centerX", sa.prototype.Aa);
t.defineProperty(sa, {Aa: "centerX"}, function () {
return this.Q.x + this.N.x
}, function (a) {
var b = this.Q;
b.x + this.N.x !== a && (f && t.o(a, sa, "centerX"), b.Qa(), b.x = a - this.N.x, b.freeze())
});
t.g(sa, "centerY", sa.prototype.Ma);
t.defineProperty(sa, {Ma: "centerY"}, function () {
return this.Q.y + this.N.y
}, function (a) {
var b = this.Q;
b.y + this.N.y !== a && (f && t.o(a, sa, "centerY"), b.Qa(), b.y = a - this.N.y, b.freeze())
});
t.g(sa, "focusX", sa.prototype.vH);
t.defineProperty(sa, {vH: "focusX"}, function () {
return this.N.x
}, function (a) {
var b = this.N;
b.x !== a && (b.Qa(), b.x = a, b.freeze())
});
t.g(sa, "focusY", sa.prototype.wH);
t.defineProperty(sa, {wH: "focusY"}, function () {
return this.N.y
}, function (a) {
var b = this.N;
b.y !== a && (b.Qa(), b.y = a, b.freeze())
});
t.g(sa, "x", sa.prototype.x);
t.defineProperty(sa, {x: "x"}, function () {
return this.Q.x
}, function (a) {
var b = this.Q;
b.x !== a && (b.Qa(), b.x = a, b.freeze())
});
t.g(sa, "y", sa.prototype.y);
t.defineProperty(sa, {y: "y"}, function () {
return this.Q.y
}, function (a) {
var b = this.Q;
b.y !== a && (b.Qa(), b.y = a, b.freeze())
});
t.g(sa, "width", sa.prototype.width);
t.defineProperty(sa, {width: "width"}, function () {
return this.Q.width
}, function (a) {
var b = this.Q;
b.width !== a && (b.Qa(), b.width = a, b.freeze())
});
t.g(sa, "height", sa.prototype.height);
t.defineProperty(sa, {height: "height"}, function () {
return this.Q.height
}, function (a) {
var b = this.Q;
b.height !== a && (b.Qa(), b.height = a, b.freeze())
});
sa.prototype.commit = function () {
var a = this.Bc;
if (null !== a) {
var b = this.Hb;
a.moveTo(b.x, b.y)
}
};
sa.prototype.addSourceEdge = sa.prototype.EC = function (a) {
null !== a && (f && t.j(a, ta, sa, "addSourceEdge:edge"), this.Ue.contains(a) || this.Ue.add(a))
};
sa.prototype.deleteSourceEdge = sa.prototype.kD = function (a) {
null !== a && (f && t.j(a, ta, sa, "deleteSourceEdge:edge"), this.Ue.remove(a))
};
sa.prototype.addDestinationEdge = sa.prototype.CC = function (a) {
null !== a && (f && t.j(a, ta, sa, "addDestinationEdge:edge"), this.Me.contains(a) || this.Me.add(a))
};
sa.prototype.deleteDestinationEdge = sa.prototype.jD = function (a) {
null !== a && (f && t.j(a, ta, sa, "deleteDestinationEdge:edge"), this.Me.remove(a))
};
t.A(sa, {BI: "sourceVertexes"}, function () {
for (var a = new ka(sa), b = this.bc; b.next();) {
var c = b.value.fromVertex;
null === c || a.contains(c) || a.add(c)
}
return a.l
});
t.A(sa, {mH: "destinationVertexes"}, function () {
for (var a = new ka(sa), b = this.Sb; b.next();) {
var c = b.value.toVertex;
null === c || a.contains(c) || a.add(c)
}
return a.l
});
t.A(sa, {vertexes: "vertexes"}, function () {
for (var a = new ka(sa), b = this.bc; b.next();) {
var c = b.value, c = c.fromVertex;
null === c || a.contains(c) || a.add(c)
}
for (b = this.Sb; b.next();)c = b.value, c = c.toVertex, null === c || a.contains(c) || a.add(c);
return a.l
});
t.A(sa, {bc: "sourceEdges"}, function () {
return this.Ue.l
});
t.A(sa, {Sb: "destinationEdges"}, function () {
return this.Me.l
});
t.A(sa, {edges: "edges"}, function () {
for (var a = new A(ta), b = this.bc; b.next();) {
var c = b.value;
a.add(c)
}
for (b = this.Sb; b.next();)c = b.value, a.add(c);
return a.l
});
t.A(sa, {sH: "edgesCount"}, function () {
return this.Ue.count + this.Me.count
});
var tn;
sa.standardComparer = tn = function (a, b) {
f && t.j(a, sa, sa, "standardComparer:m");
f && t.j(b, sa, sa, "standardComparer:n");
var c = a.dd, d = b.dd;
return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0
};
sa.smartComparer = function (a, b) {
f && t.j(a, sa, sa, "smartComparer:m");
f && t.j(b, sa, sa, "smartComparer:n");
if (null !== a) {
if (null !== b) {
var c = a.dd, d = b.dd;
if (null !== c) {
if (null !== d) {
var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e;
for (e = 0; e < c.length; e++)if ("" !== d[e] && void 0 !== d[e]) {
var g = parseFloat(c[e]), h = parseFloat(d[e]);
if (isNaN(g)) {
if (!isNaN(h))return 1;
if (0 !== c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])
} else {
if (isNaN(h))return-1;
if (0 !== g - h)return g - h
}
} else if ("" !== c[e])return 1;
return"" !== d[e] && void 0 !== d[e] ? -1 : 0
}
return 1
}
return null !== d ? -1 : 0
}
return 1
}
return null !== b ? -1 : 0
};
function ta() {
t.uc(this);
this.network = null;
this.clear()
}
t.ea("LayoutEdge", ta);
ta.prototype.clear = function () {
this.toVertex = this.fromVertex = this.link = null
};
ta.prototype.toString = function () {
return"LayoutEdge#" + t.jc(this) + (null !== this.link ? "(" + this.link.toString() + ")" : "")
};
ta.prototype.qw = function () {
var a = this.fromVertex;
this.fromVertex = this.toVertex;
this.toVertex = a
};
ta.prototype.commit = function () {
};
ta.prototype.getOtherVertex = ta.prototype.zH = function (a) {
f && t.j(a, sa, ta, "getOtherVertex:v");
return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null
};
function Dj() {
0 < arguments.length && t.m("GridLayout constructor cannot take any arguments.");
fe.call(this);
this.Hs = !0;
this.as = this.bs = NaN;
this.Qi = (new da(NaN, NaN)).freeze();
this.mh = (new da(10, 10)).freeze();
this.le = Pk;
this.ad = Nk;
this.lh = Jk;
this.Ug = un
}
t.ea("GridLayout", Dj);
t.Ja(Dj, fe);
Dj.prototype.cloneProtected = function (a) {
fe.prototype.cloneProtected.call(this, a);
a.bs = this.bs;
a.as = this.as;
a.Qi.assign(this.Qi);
a.mh.assign(this.mh);
a.le = this.le;
a.ad = this.ad;
a.lh = this.lh;
a.Ug = this.Ug
};
Dj.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
var b = this.h;
null === b && t.m("The diagram for this layout is not set.");
this.rd = this.Pz(this.rd);
var c = new ka(B);
a === this.h ? (on(this, c, a.Ji, !0, null, !0, !0, !0), on(this, c, a.links, !0, null, !0, !0, !0), on(this, c, a.gp, !0, null, !0, !0, !0)) : a === this.group ? on(this, c, a.Lc, !1, null, !0, !0, !0) : c.He(a.l);
for (a = c.copy().l; a.next();) {
var d = a.value;
if (d instanceof X && (null !== d.ca ||
null !== d.ga))c.remove(d); else if (d.zf(), d instanceof U)for (d = d.Lc; d.next();)c.remove(d.value)
}
c = c.Ve();
if (0 !== c.length) {
switch (this.sorting) {
case Mk:
c.reverse();
break;
case Jk:
c.sort(this.comparer);
break;
case Kk:
c.sort(this.comparer), c.reverse()
}
d = this.QF;
isNaN(d) && (d = 0);
a = this.TA;
a = isNaN(a) ? Math.max(this.h.lb.width - b.padding.left - b.padding.right, 0) : Math.max(this.TA, 0);
0 >= d && 0 >= a && (d = 1);
var e = this.spacing.width;
isFinite(e) || (e = 0);
var g = this.spacing.height;
isFinite(g) || (g = 0);
b.mc("Layout");
switch (this.alignment) {
case Qk:
var h =
Math.max(this.Pk.width, 1);
if (!isFinite(h))for (var k = h = 0; k < c.length; k++)var l = c[k], m = l.Ba, h = Math.max(h, m.width);
var h = Math.max(h + e, 1), n = Math.max(this.Pk.height, 1);
if (!isFinite(n))for (k = n = 0; k < c.length; k++)l = c[k], m = l.Ba, n = Math.max(n, m.height);
for (var n = Math.max(n + g, 1), p = this.Je, q = this.rd.x, r = q, s = this.rd.y, u = 0, x = 0, k = 0; k < c.length; k++) {
var l = c[k], m = l.Ba, E = Math.ceil((m.width + e) / h) * h, F = Math.ceil((m.height + g) / n) * n, G;
switch (p) {
case Ok:
G = Math.abs(r - m.width) + q;
break;
default:
G = r + m.width - q
}
if (0 < d && u > d - 1 || 0 < a &&
0 < u && G > a)u = 0, r = q, s += x, x = 0;
x = Math.max(x, F);
switch (p) {
case Ok:
m = -m.width;
break;
default:
m = 0
}
l.moveTo(r + m, s);
switch (p) {
case Ok:
r -= E;
break;
default:
r += E
}
u++
}
break;
case Pk:
h = Math.max(this.Pk.width, 1);
k = x = u = 0;
l = t.M();
for (n = 0; n < c.length; n++)p = c[n], q = p.Ba, r = em(p, p.Zb, p.Re, l), u = Math.max(u, r.x), x = Math.max(x, q.width - r.x), k = Math.max(k, r.y);
s = this.Je;
switch (s) {
case Ok:
u += e;
break;
default:
x += e
}
var h = isFinite(h) ? Math.max(h + e, 1) : Math.max(u + x, 1), L = u = this.rd.x, x = this.rd.y, m = E = 0, F = Math.max(this.Pk.height, 1);
G = k = 0;
for (var N =
!0, V = t.M(), n = 0; n < c.length; n++) {
p = c[n];
q = p.Ba;
r = em(p, p.Zb, p.Re, l);
if (0 < E)switch (s) {
case Ok:
L = Math.floor((L - u - (q.width - r.x)) / h) * h + u;
break;
default:
L = Math.ceil((L - u + r.x) / h) * h + u
} else switch (s) {
case Ok:
m = L + r.x + q.width;
break;
default:
m = L - r.x
}
var T;
switch (s) {
case Ok:
T = -(L + r.x) + u + m;
break;
default:
T = L + q.width - r.x - u - m
}
if (0 < d && E > d - 1 || 0 < a && 0 < E && T > a) {
for (L = 0; L < E && n !== E; L++) {
T = c[n - E + L];
var W = em(T, T.Zb, T.Re, V);
T.moveTo(T.position.x, T.position.y + k - W.y)
}
G += g;
x = N ? x + G : x + (G + k);
E = G = k = 0;
L = u;
N = !1
}
k = Math.max(k, r.y);
G = Math.max(G,
q.height - r.y);
isFinite(F) && (G = Math.max(G, Math.max(q.height, F) - r.y));
N ? p.moveTo(L - r.x, x - r.y) : p.moveTo(L - r.x, x);
switch (s) {
case Ok:
L -= r.x + e;
break;
default:
L += q.width - r.x + e
}
E++
}
for (L = 0; L < E && n !== E; L++)T = c[n - E + L], W = em(T, T.Zb, T.Re, l), T.moveTo(T.position.x, T.position.y + k - W.y);
t.B(l);
t.B(V)
}
b.xe("Layout");
this.hf = !0
}
};
t.g(Dj, "wrappingWidth", Dj.prototype.TA);
t.defineProperty(Dj, {TA: "wrappingWidth"}, function () {
return this.bs
}, function (a) {
this.bs !== a && (0 < a || isNaN(a)) && (this.bs = a, this.Hs = isNaN(a), this.J())
});
t.g(Dj, "wrappingColumn", Dj.prototype.QF);
t.defineProperty(Dj, {QF: "wrappingColumn"}, function () {
return this.as
}, function (a) {
this.as !== a && (0 < a || isNaN(a)) && (this.as = a, this.J())
});
t.g(Dj, "cellSize", Dj.prototype.Pk);
t.defineProperty(Dj, {Pk: "cellSize"}, function () {
return this.Qi
}, function (a) {
this.Qi.K(a) || (this.Qi.assign(a), this.J())
});
t.g(Dj, "spacing", Dj.prototype.spacing);
t.defineProperty(Dj, {spacing: "spacing"}, function () {
return this.mh
}, function (a) {
this.mh.K(a) || (this.mh.assign(a), this.J())
});
t.g(Dj, "alignment", Dj.prototype.alignment);
t.defineProperty(Dj, {alignment: "alignment"}, function () {
return this.le
}, function (a) {
this.le !== a && (f && t.j(a, ca, Dj, "alignment"), a === Pk || a === Qk) && (this.le = a, this.J())
});
t.g(Dj, "arrangement", Dj.prototype.Je);
t.defineProperty(Dj, {Je: "arrangement"}, function () {
return this.ad
}, function (a) {
this.ad !== a && (f && t.j(a, ca, Dj, "arrangement"), a === Nk || a === Ok) && (this.ad = a, this.J())
});
t.g(Dj, "sorting", Dj.prototype.sorting);
t.defineProperty(Dj, {sorting: "sorting"}, function () {
return this.lh
}, function (a) {
this.lh !== a && (f && t.j(a, ca, Dj, "sorting"), a === Lk || a === Mk || a === Jk || a === Kk) && (this.lh = a, this.J())
});
t.g(Dj, "comparer", Dj.prototype.comparer);
t.defineProperty(Dj, {comparer: "comparer"}, function () {
return this.Ug
}, function (a) {
this.Ug !== a && (f && t.k(a, "function", Dj, "comparer"), this.Ug = a, this.J())
});
var un;
Dj.standardComparer = un = function (a, b) {
f && t.j(a, B, Dj, "standardComparer:a");
f && t.j(b, B, Dj, "standardComparer:b");
var c = a.text, d = b.text;
return c < d ? -1 : c > d ? 1 : 0
};
Dj.smartComparer = function (a, b) {
f && t.j(a, B, Dj, "standardComparer:a");
f && t.j(b, B, Dj, "standardComparer:b");
if (null !== a) {
if (null !== b) {
var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e;
for (e = 0; e < c.length; e++)if ("" !== d[e] && void 0 !== d[e]) {
var g = parseFloat(c[e]), h = parseFloat(d[e]);
if (isNaN(g)) {
if (!isNaN(h))return 1;
if (0 !== c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])
} else {
if (isNaN(h))return-1;
if (0 !== g - h)return g - h
}
} else if ("" !== c[e])return 1;
return"" !== d[e] && void 0 !== d[e] ? -1 : 0
}
return 1
}
return null !== b ? -1 : 0
};
var Qk;
Dj.Position = Qk = t.w(Dj, "Position", 0);
var Pk;
Dj.Location = Pk = t.w(Dj, "Location", 1);
var Nk;
Dj.LeftToRight = Nk = t.w(Dj, "LeftToRight", 2);
var Ok;
Dj.RightToLeft = Ok = t.w(Dj, "RightToLeft", 3);
var Lk;
Dj.Forward = Lk = t.w(Dj, "Forward", 4);
var Mk;
Dj.Reverse = Mk = t.w(Dj, "Reverse", 5);
var Jk;
Dj.Ascending = Jk = t.w(Dj, "Ascending", 6);
var Kk;
Dj.Descending = Kk = t.w(Dj, "Descending", 7);
function Rk() {
0 < arguments.length && t.m("CircularLayout constructor cannot take any arguments.");
fe.call(this);
this.Kx = this.mn = this.od = 0;
this.iq = 360;
this.Jx = cl;
this.rk = 0;
this.zB = cl;
this.Jt = this.Xf = this.uC = 0;
this.hv = new vn;
this.Mt = this.Ql = 0;
this.jG = 600;
this.mr = NaN;
this.Pp = 1;
this.re = 0;
this.se = 360;
this.ad = cl;
this.oa = Zk;
this.lh = Wk;
this.Ug = tn;
this.mh = 6;
this.gr = fl
}
t.ea("CircularLayout", Rk);
t.Ja(Rk, fe);
Rk.prototype.cloneProtected = function (a) {
fe.prototype.cloneProtected.call(this, a);
a.mr = this.mr;
a.Pp = this.Pp;
a.re = this.re;
a.se = this.se;
a.ad = this.ad;
a.oa = this.oa;
a.lh = this.lh;
a.Ug = this.Ug;
a.mh = this.mh;
a.gr = this.gr
};
Rk.prototype.createNetwork = function () {
var a = new wn;
nn(a, this);
return a
};
Rk.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
null === this.network && (this.network = this.makeNetwork(a));
a = this.network.vertexes;
if (1 >= a.count)1 === a.count && (a = a.Ya(), a.Aa = 0, a.Ma = 0); else {
var b = new A(xn);
b.He(a.l);
a = new A(xn);
var c = new A(xn), b = this.sort(b);
a = new A(xn);
var c = new A(xn), d = this.Jx, e = this.zB, g = this.od, h = this.mn, k = this.Kx, l = this.iq, m = this.rk, n = this.uC, p = this.Xf, q = this.Jt, d = this.Je, e = this.Rs, g =
this.CE;
if (!isFinite(g) || 0 >= g)g = NaN;
h = this.JC;
if (!isFinite(h) || 0 >= h)h = 1;
k = this.kg;
isFinite(k) || (k = 0);
l = this.Dh;
if (!isFinite(l) || 360 < l || 1 > l)l = 360;
m = this.spacing;
isFinite(m) || (m = NaN);
d === dl && e === el ? d = cl : d === dl && e !== el && (e = el, d = this.Je);
if ((this.direction === Xk || this.direction === Yk) && this.sorting !== Wk) {
for (var r = 0; !(r >= b.length); r += 2) {
a.add(b.ta(r));
if (r + 1 >= b.length)break;
c.add(b.ta(r + 1))
}
this.direction === Xk ? (this.Je === dl && a.reverse(), b = new A(xn), b.He(a), b.He(c)) : (this.Je === dl && c.reverse(), b = new A(xn),
b.He(c), b.He(a))
}
for (var s = b.length, u = n = 0, r = 0; r < b.length; r++) {
var p = k + l * u * (this.direction === Zk ? 1 : -1) / s, x = b.ta(r).diameter;
isNaN(x) && (x = yn(b.ta(r), p));
360 > l && (0 === r || r === b.length - 1) && (x /= 2);
n += x;
u++
}
if (isNaN(g) || d === dl) {
isNaN(m) && (m = 6);
if (d !== cl && d !== dl) {
x = -Infinity;
for (r = 0; r < s; r++) {
var q = b.ta(r), E = b.ta(r === s - 1 ? 0 : r + 1);
isNaN(q.diameter) && yn(q, 0);
isNaN(E.diameter) && yn(E, 0);
x = Math.max(x, (q.diameter + E.diameter) / 2)
}
q = x + m;
d === al ? (p = 2 * Math.PI / s, g = (x + m) / p) : g = zn(this, q * (360 <= l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI /
180)
} else g = zn(this, n + (360 <= l ? s : s - 1) * (d !== dl ? m : 1.6 * m), h, k * Math.PI / 180, l * Math.PI / 180);
p = g * h
} else if (p = g * h, u = An(this, g, p, k * Math.PI / 180, l * Math.PI / 180), isNaN(m)) {
if (d === cl || d === dl)m = (u - n) / (360 <= l ? s : s - 1)
} else if (d === cl || d === dl)r = (u - n) / (360 <= l ? s : s - 1), r < m ? (g = zn(this, n + m * (360 <= l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI / 180), p = g * h) : m = r; else {
x = -Infinity;
for (r = 0; r < s; r++)q = b.ta(r), E = b.ta(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && yn(q, 0), isNaN(E.diameter) && yn(E, 0), x = Math.max(x, (q.diameter + E.diameter) / 2);
q = x + m;
r = zn(this, q * (360 <=
l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI / 180);
r > g ? (g = r, p = g * h) : q = u / (360 <= l ? s : s - 1)
}
this.Jx = d;
this.zB = e;
this.od = g;
this.mn = h;
this.Kx = k;
this.iq = l;
this.rk = m;
this.uC = n;
this.Xf = p;
this.Jt = q;
c = [b, a, c];
b = c[0];
a = c[1];
c = c[2];
d = this.Jx;
e = this.od;
h = this.Kx;
k = this.iq;
l = this.rk;
m = this.Xf;
n = this.Jt;
if (this.direction !== Xk && this.direction !== Yk || d !== dl)if (this.direction === Xk || this.direction === Yk) {
g = 0;
switch (d) {
case bl:
g = 180 * Bn(this, e, m, h, n) / Math.PI;
break;
case cl:
n = b = 0;
g = a.Ya();
null !== g && (b = yn(g, Math.PI / 2));
g = c.Ya();
null !==
g && (n = yn(g, Math.PI / 2));
g = 180 * Bn(this, e, m, h, l + (b + n) / 2) / Math.PI;
break;
case al:
g = k / b.length
}
if (this.direction === Xk) {
switch (d) {
case bl:
Cn(this, a, h, $k);
break;
case cl:
Dn(this, a, h, $k);
break;
case al:
En(this, a, k / 2, h, $k)
}
switch (d) {
case bl:
Cn(this, c, h + g, Zk);
break;
case cl:
Dn(this, c, h + g, Zk);
break;
case al:
En(this, c, k / 2, h + g, Zk)
}
} else {
switch (d) {
case bl:
Cn(this, c, h, $k);
break;
case cl:
Dn(this, c, h, $k);
break;
case al:
En(this, c, k / 2, h, $k)
}
switch (d) {
case bl:
Cn(this, a, h + g, Zk);
break;
case cl:
Dn(this, a, h + g, Zk);
break;
case al:
En(this,
a, k / 2, h + g, Zk)
}
}
} else switch (d) {
case bl:
Cn(this, b, h, this.direction);
break;
case cl:
Dn(this, b, h, this.direction);
break;
case al:
En(this, b, k, h, this.direction);
break;
case dl:
Fn(this, b, k, h, this.direction)
} else Fn(this, b, k, h - k / 2, Zk)
}
this.updateParts();
this.network = null;
this.hf = !0
};
function En(a, b, c, d, e) {
var g = a.iq, h = a.od;
a = a.Xf;
d = d * Math.PI / 180;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = d + (e === Zk ? l * c / (360 <= g ? k : k - 1) : -(l * c) / k), n = b.ta(l), p = h * Math.tan(m) / a, p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p));
n.Aa = p * Math.cos(m);
n.Ma = p * Math.sin(m);
n.actualAngle = 180 * m / Math.PI
}
}
function Dn(a, b, c, d) {
var e = a.od, g = a.Xf, h = a.rk;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = b.ta(l), n = b.ta(l === k - 1 ? 0 : l + 1), p = g * Math.sin(c);
m.Aa = e * Math.cos(c);
m.Ma = p;
m.actualAngle = 180 * c / Math.PI;
isNaN(m.diameter) && yn(m, 0);
isNaN(n.diameter) && yn(n, 0);
m = Bn(a, e, g, d === Zk ? c : -c, (m.diameter + n.diameter) / 2 + h);
c += d === Zk ? m : -m
}
}
function Cn(a, b, c, d) {
var e = a.od, g = a.Xf, h = a.Jt;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = b.ta(l);
m.Aa = e * Math.cos(c);
m.Ma = g * Math.sin(c);
m.actualAngle = 180 * c / Math.PI;
m = Bn(a, e, g, d === Zk ? c : -c, h);
c += d === Zk ? m : -m
}
}
function Fn(a, b, c, d, e) {
var g = a.Mt, g = a.iq;
a.Ql = 0;
a.hv = new vn;
if (360 > c) {
for (g = d + (e === Zk ? g : -g); 0 > g;)g += 360;
g %= 360;
180 < g && (g -= 360);
g *= Math.PI / 180;
a.Mt = g;
Gn(a, b, c, d, e)
} else Hn(a, b, c, d, e);
a.hv.commit(b)
}
function Hn(a, b, c, d, e) {
var g = a.od, h = a.rk, k = a.mn, l = g * Math.cos(d * Math.PI / 180), m = a.Xf * Math.sin(d * Math.PI / 180), n = b.Ve();
if (3 === n.length)n[0].Aa = g, n[0].Ma = 0, n[1].Aa = n[0].Aa - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].Aa = (n[0].Aa + n[1].Aa) / 2, n[2].y = n[0].y - n[2].height - h; else if (4 === n.length)n[0].Aa = g, n[0].Ma = 0, n[2].Aa = -n[0].Aa, n[2].Ma = n[0].Ma, n[1].Aa = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].Aa = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h); else {
for (g = 0; g < n.length; g++) {
n[g].Aa =
l;
n[g].Ma = m;
if (g >= n.length - 1)break;
var p = In(a, l, m, n, g, e);
p[0] || (p = Jn(a, l, m, n, g, e));
l = p[1];
m = p[2]
}
a.Ql++;
if (!(23 < a.Ql)) {
var l = n[0].Aa, m = n[0].Ma, g = n[n.length - 1].Aa, p = n[n.length - 1].Ma, q = Math.abs(l - g) - ((n[0].width + n[n.length - 1].width) / 2 + h), r = Math.abs(m - p) - ((n[0].height + n[n.length - 1].height) / 2 + h), h = 0;
1 > Math.abs(r) ? Math.abs(l - g) < (n[0].width + n[n.length - 1].width) / 2 && (h = 0) : h = 0 < r ? r : 1 > Math.abs(q) ? 0 : q;
q = !1;
q = Math.abs(g) > Math.abs(p) ? 0 < g !== m > p : 0 < p !== l < g;
if (q = e === Zk ? q : !q)h = -Math.abs(h), h = Math.min(h, -n[n.length -
1].width), h = Math.min(h, -n[n.length - 1].height);
l = a.hv;
if (0 < h && 0 > l.Eo || Math.abs(h) < Math.abs(l.Eo) && !(0 > h && 0 < l.Eo))for (l.Eo = h, l.Pm = [], l.zp = [], m = 0; m < n.length; m++)l.Pm[m] = n[m].Hb.x, l.zp[m] = n[m].Hb.y;
1 < Math.abs(h) && (a.od = 8 > a.Ql ? a.od - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.od / 2 : a.od - (0 < h ? 1.7 : -2.3), a.Xf = a.od * k, Hn(a, b, c, d, e))
}
}
}
function Gn(a, b, c, d, e) {
for (var g = a.od, h = a.Xf, k = a.mn, l = g * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = b.Ve(), p = 0; p < n.length; p++) {
n[p].Aa = l;
n[p].Ma = m;
if (p >= n.length - 1)break;
var q = In(a, l, m, n, p, e);
q[0] || (q = Jn(a, l, m, n, p, e));
l = q[1];
m = q[2]
}
a.Ql++;
if (!(23 < a.Ql)) {
l = Math.atan2(m, l);
l = e === Zk ? a.Mt - l : l - a.Mt;
l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI;
g = l * (g + h) / 2;
h = a.hv;
if (Math.abs(g) < Math.abs(h.Eo))for (h.Eo = g, h.Pm = [], h.zp = [], l = 0; l < n.length; l++)h.Pm[l] = n[l].Hb.x, h.zp[l] = n[l].Hb.y;
1 < Math.abs(g) &&
(a.od = 8 > a.Ql ? a.od - g / (2 * Math.PI) : a.od - (0 < g ? 1.7 : -2.3), a.Xf = a.od * k, Gn(a, b, c, d, e))
}
}
function In(a, b, c, d, e, g) {
var h = a.od, k = a.Xf, l = 0, m = 0;
a = (d[e].width + d[e + 1].width) / 2 + a.rk;
var n = !1;
if (0 <= c !== (g === Zk)) {
if (l = b + a, l > h) {
l = b - a;
if (l < -h)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
} else if (l = b - a, l < -h) {
l = b + a;
if (l > h)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
m = Math.sqrt(1 - Math.min(1, l * l / (h * h))) * k;
0 > c !== n && (m = -m);
b = Math.abs(c - m) > (d[e].height + d[e + 1].height) / 2 ? [!1] : [!0];
b[1] = l;
b[2] = m;
return b
}
function Jn(a, b, c, d, e, g) {
var h = a.od, k = a.Xf, l = 0, m = 0;
a = (d[e].height + d[e + 1].height) / 2 + a.rk;
var n = !1;
if (0 <= b !== (g === Zk)) {
if (m = c - a, m < -k) {
m = c + a;
if (m > k)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
} else if (m = c + a, m > k) {
m = c - a;
if (m < -k)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
l = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * h;
0 > b !== n && (l = -l);
b = Math.abs(b - l) > (d[e].width + d[e + 1].width) / 2 ? [!1] : [!0];
b[1] = l;
b[2] = m;
return b
}
function vn() {
this.Eo = -Infinity;
this.zp = this.Pm = null
}
vn.prototype.commit = function (a) {
if (null !== this.Pm && null !== this.zp)for (var b = 0; b < this.Pm.length; b++) {
var c = a.ta(b);
c.x = this.Pm[b];
c.y = this.zp[b]
}
};
Rk.prototype.commitLayout = function () {
this.commitNodes();
this.Gs && this.commitLinks()
};
Rk.prototype.commitNodes = function () {
for (var a = this.rG, b = this.network.vertexes.l, c; b.next();)c = b.value, c.x += a.x, c.y += a.y, c.commit()
};
Rk.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
function An(a, b, c, d, e) {
var g = a.jG;
if (0.001 > Math.abs(a.mn - 1))return void 0 !== d && void 0 !== e ? e * b : 2 * Math.PI * b;
a = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c;
var h = 0, k;
k = void 0 !== d && void 0 !== e ? e / (g + 1) : Math.PI / (2 * (g + 1));
for (var l = 0; l <= g; l++)var m = Math.sin(void 0 !== d && void 0 !== e ? d + l * e / g : l * Math.PI / (2 * g)), h = h + Math.sqrt(1 - a * a * m * m) * k;
return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h
}
function zn(a, b, c, d, e) {
a = void 0 !== d && void 0 !== e ? An(a, 1, c, d, e) : An(a, 1, c);
return b / a
}
function Bn(a, b, c, d, e) {
if (0.001 > Math.abs(a.mn - 1))return e / b;
var g = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c, h = 0;
a = 2 * Math.PI / (700 * a.network.vertexes.count);
b > c && (d += Math.PI / 2);
for (var k = 0; ; k++) {
var l = Math.sin(d + k * a), h = h + (b > c ? b : c) * Math.sqrt(1 - g * g * l * l) * a;
if (h >= e)return k * a
}
return 0
}
Rk.prototype.sort = function (a) {
switch (this.sorting) {
case Uk:
break;
case Vk:
a.reverse();
break;
case Sk:
a.sort(this.comparer);
break;
case Tk:
a.sort(this.comparer);
a.reverse();
break;
case Wk:
for (var b = [], c = 0; c < a.length; c++)b.push(0);
for (var d = new A(xn), c = 0; c < a.length; c++) {
var e = -1, g = -1;
if (0 === c)for (var h = 0; h < a.length; h++) {
var k = a.ta(h).sH;
k > e && (e = k, g = h)
} else for (h = 0; h < a.length; h++)k = b[h], k > e && (e = k, g = h);
d.add(a.ta(g));
b[g] = -1;
g = a.ta(g);
e = g.bc;
for (g = g.Sb; e.next();)h = e.value, h = h.fromVertex, h = a.indexOf(h), 0 >
h || 0 <= b[h] && b[h]++;
for (; g.next();)h = g.value, h = h.toVertex, h = a.indexOf(h), 0 > h || 0 <= b[h] && b[h]++
}
a = [];
for (b = 0; b < d.length; b++) {
k = d.ta(b);
a[b] = [];
for (var c = k.Sb, e = k.bc, l, m; c.next();)l = c.value, m = d.indexOf(l.toVertex), m !== b && 0 > a[b].indexOf(m) && a[b].push(m);
for (; e.next();)l = e.value, m = d.indexOf(l.fromVertex), m !== b && 0 > a[b].indexOf(m) && a[b].push(m)
}
k = [];
for (b = 0; b < a.length; b++)k[b] = 0;
for (var c = [], n = [], p = [], e = [], g = new A(xn), h = b = 0; b < a.length; b++) {
var q = a[b].length;
if (1 === q)e.push(b); else if (0 === q)g.add(d.ta(b));
else {
if (0 === h)c.push(b); else {
for (var r = Infinity, s = Infinity, u = -1, x = [], q = 0; q < c.length; q++)0 > a[c[q]].indexOf(c[q === c.length - 1 ? 0 : q + 1]) && x.push(q === c.length - 1 ? 0 : q + 1);
if (0 === x.length)for (q = 0; q < c.length; q++)x.push(q);
for (q = 0; q < x.length; q++) {
var E = x[q], F;
m = a[b];
l = n;
F = p;
for (var G = k, L = E, N = c, V = 0, T = 0; T < l.length; T++) {
var W = G[l[T]], ea = G[F[T]], R = 0, wa = 0;
W < ea ? (R = W, wa = ea) : (R = ea, wa = W);
if (R < L && L <= wa)for (W = 0; W < m.length; W++)ea = m[W], 0 > N.indexOf(ea) || R < G[ea] && G[ea] < wa || R === G[ea] || wa === G[ea] || V++; else for (W = 0; W < m.length; W++)ea =
m[W], 0 > N.indexOf(ea) || R < G[ea] && G[ea] < wa && R !== G[ea] && wa !== G[ea] && V++
}
F = V;
for (l = G = 0; l < a[b].length; l++)m = c.indexOf(a[b][l]), 0 <= m && (m = Math.abs(E - (m >= E ? m + 1 : m)), G += m < c.length + 1 - m ? m : c.length + 1 - m);
for (l = 0; l < n.length; l++)m = k[n[l]], L = k[p[l]], m >= E && m++, L >= E && L++, m > L && (N = L, L = m, m = N), L - m < (c.length + 2) / 2 === (m < E && E <= L) && G++;
if (F < r || F === r && G < s)r = F, s = G, u = E
}
c.splice(u, 0, b);
for (q = 0; q < c.length; q++)k[c[q]] = q;
for (q = 0; q < a[b].length; q++)r = a[b][q], 0 <= c.indexOf(r) && (n.push(b), p.push(r))
}
h++
}
}
n = !1;
for (p = c.length; ;) {
n = !0;
for (k =
0; k < e.length; k++)if (b = e[k], q = a[b][0], m = c.indexOf(q), 0 <= m) {
for (h = s = 0; h < a[q].length; h++)r = a[q][h], r = c.indexOf(r), 0 > r || r === m || (u = r > m ? r - m : m - r, s += r < m !== u > p - u ? 1 : -1);
c.splice(0 > s ? m : m + 1, 0, b);
e.splice(k, 1);
k--
} else n = !1;
if (n)break; else c.push(e[0]), e.splice(0, 1)
}
for (b = 0; b < c.length; b++)m = c[b], g.add(d.ta(m));
return g;
default:
t.m("Invalid sorting type.")
}
return a
};
t.g(Rk, "radius", Rk.prototype.CE);
t.defineProperty(Rk, {CE: "radius"}, function () {
return this.mr
}, function (a) {
this.mr !== a && (0 < a || isNaN(a)) && (this.mr = a, this.J())
});
t.g(Rk, "aspectRatio", Rk.prototype.JC);
t.defineProperty(Rk, {JC: "aspectRatio"}, function () {
return this.Pp
}, function (a) {
this.Pp !== a && 0 < a && (this.Pp = a, this.J())
});
t.g(Rk, "startAngle", Rk.prototype.kg);
t.defineProperty(Rk, {kg: "startAngle"}, function () {
return this.re
}, function (a) {
this.re !== a && (this.re = a, this.J())
});
t.g(Rk, "sweepAngle", Rk.prototype.Dh);
t.defineProperty(Rk, {Dh: "sweepAngle"}, function () {
return this.se
}, function (a) {
this.se !== a && (this.se = 0 < a && 360 >= a ? a : 360, this.J())
});
t.g(Rk, "arrangement", Rk.prototype.Je);
t.defineProperty(Rk, {Je: "arrangement"}, function () {
return this.ad
}, function (a) {
this.ad !== a && (f && t.j(a, ca, Rk, "arrangement"), a === dl || a === cl || a === bl || a === al) && (this.ad = a, this.J())
});
t.g(Rk, "direction", Rk.prototype.direction);
t.defineProperty(Rk, {direction: "direction"}, function () {
return this.oa
}, function (a) {
this.oa !== a && (f && t.j(a, ca, Rk, "direction"), a === Zk || a === $k || a === Xk || a === Yk) && (this.oa = a, this.J())
});
t.g(Rk, "sorting", Rk.prototype.sorting);
t.defineProperty(Rk, {sorting: "sorting"}, function () {
return this.lh
}, function (a) {
this.lh !== a && (f && t.j(a, ca, Rk, "sorting"), a === Uk || a === Vk || a === Sk || Tk || a === Wk) && (this.lh = a, this.J())
});
t.g(Rk, "comparer", Rk.prototype.comparer);
t.defineProperty(Rk, {comparer: "comparer"}, function () {
return this.Ug
}, function (a) {
this.Ug !== a && (f && t.k(a, "function", Rk, "comparer"), this.Ug = a, this.J())
});
t.g(Rk, "spacing", Rk.prototype.spacing);
t.defineProperty(Rk, {spacing: "spacing"}, function () {
return this.mh
}, function (a) {
this.mh !== a && (this.mh = a, this.J())
});
t.g(Rk, "nodeDiameterFormula", Rk.prototype.Rs);
t.defineProperty(Rk, {Rs: "nodeDiameterFormula"}, function () {
return this.gr
}, function (a) {
this.gr !== a && (f && t.j(a, ca, Rk, "nodeDiameterFormula"), a === fl || a === el) && (this.gr = a, this.J())
});
t.A(Rk, {sG: "actualXRadius"}, function () {
return this.od
});
t.A(Rk, {tG: "actualYRadius"}, function () {
return this.Xf
});
t.A(Rk, {NI: "actualSpacing"}, function () {
return this.rk
});
t.A(Rk, {rG: "actualCenter"}, function () {
return isNaN(this.rd.x) || isNaN(this.rd.y) ? new v(0, 0) : new v(this.rd.x + this.sG, this.rd.y + this.tG)
});
var cl;
Rk.ConstantSpacing = cl = t.w(Rk, "ConstantSpacing", 0);
var bl;
Rk.ConstantDistance = bl = t.w(Rk, "ConstantDistance", 1);
var al;
Rk.ConstantAngle = al = t.w(Rk, "ConstantAngle", 2);
var dl;
Rk.Packed = dl = t.w(Rk, "Packed", 3);
var Zk;
Rk.Clockwise = Zk = t.w(Rk, "Clockwise", 4);
var $k;
Rk.Counterclockwise = $k = t.w(Rk, "Counterclockwise", 5);
var Xk;
Rk.BidirectionalLeft = Xk = t.w(Rk, "BidirectionalLeft", 6);
var Yk;
Rk.BidirectionalRight = Yk = t.w(Rk, "BidirectionalRight", 7);
var Uk;
Rk.Forwards = Uk = t.w(Rk, "Forwards", 8);
var Vk;
Rk.Reverse = Vk = t.w(Rk, "Reverse", 9);
var Sk;
Rk.Ascending = Sk = t.w(Rk, "Ascending", 10);
var Tk;
Rk.Descending = Tk = t.w(Rk, "Descending", 11);
var Wk;
Rk.Optimized = Wk = t.w(Rk, "Optimized", 12);
var fl;
Rk.Pythagorean = fl = t.w(Rk, "Pythagorean", 13);
var el;
Rk.Circular = el = t.w(Rk, "Circular", 14);
function wn() {
ra.call(this)
}
t.ea("CircularNetwork", wn);
t.Ja(wn, ra);
wn.prototype.createVertex = function () {
return new xn
};
wn.prototype.createEdge = function () {
return new Kn
};
function xn() {
sa.call(this);
this.actualAngle = this.diameter = NaN
}
t.ea("CircularVertex", xn);
t.Ja(xn, sa);
function yn(a, b) {
var c = a.network;
if (null === c)return NaN;
c = c.Vb;
if (null === c)return NaN;
if (c.Je === dl)if (c.Rs === el)a.diameter = Math.max(a.width, a.height); else {
var c = Math.abs(Math.sin(b)), d = Math.abs(Math.cos(b));
if (0 === c)return a.width;
if (0 === d)return a.height;
a.diameter = Math.min(a.height / c, a.width / d)
} else a.diameter = c.Rs === el ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height);
return a.diameter
}
function Kn() {
ta.call(this)
}
t.ea("CircularEdge", Kn);
t.Ja(Kn, ta);
function Ln() {
0 < arguments.length && t.m("ForceDirectedLayout constructor cannot take any arguments.");
fe.call(this);
this.Wf = null;
this.Gq = 0;
this.Kf = (new da(100, 100)).freeze();
this.Op = !1;
this.kh = !0;
this.Tg = !1;
this.Hn = 100;
this.kq = 1;
this.bh = 1E3;
this.fn = 0.05;
this.en = 50;
this.bn = 150;
this.dn = 0;
this.eq = 10;
this.dq = 5
}
t.ea("ForceDirectedLayout", Ln);
t.Ja(Ln, fe);
Ln.prototype.cloneProtected = function (a) {
fe.prototype.cloneProtected.call(this, a);
a.Kf.assign(this.Kf);
a.Op = this.Op;
a.kh = this.kh;
a.Tg = this.Tg;
a.Hn = this.Hn;
a.kq = this.kq;
a.bh = this.bh;
a.fn = this.fn;
a.en = this.en;
a.bn = this.bn;
a.dn = this.dn;
a.eq = this.eq;
a.dq = this.dq
};
Ln.prototype.createNetwork = function () {
var a = new Mn;
nn(a, this);
return a
};
Ln.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
null === this.network && (this.network = this.makeNetwork(a));
a = this.hw;
if (0 < this.network.vertexes.count) {
this.network.Gv();
for (var b = this.network.vertexes.l; b.next();) {
var c = b.value;
c.charge = this.electricalCharge(c);
c.mass = this.gravitationalMass(c)
}
for (b = this.network.edges.l; b.next();)c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c);
this.mz();
this.Gq = 0;
if (this.needsClusterLayout()) {
for (var b = this.network, d = b.CI().l; d.next();) {
var e = d.value;
this.network = e;
for (c = this.network.vertexes.l; c.next();) {
for (var e = c.value, g = 0, h = e.vertexes; h.next();)g++;
e.Ff = g;
e.Xj = 1;
e.mm = null;
e.Mg = null
}
Nn(this, 0, a)
}
this.network = b;
d.reset();
f && t.j(b, Mn, Ln, "arrangeConnectedGraphs:singletons");
for (var c = this.qv, k = d.count, l = !0, g = e = 0, h = t.yb(), m = 0; m < k + b.vertexes.count + 2; m++)h[m] = null;
k = 0;
d.reset();
for (m = t.rf(); d.next();) {
var n = d.value;
this.df(n, m);
if (l)l = !1,
e = m.x + m.width / 2, g = m.y + m.height / 2, h[0] = new v(m.x + m.width + c.width, m.y), h[1] = new v(m.x, m.y + m.height + c.height), k = 2; else {
var p = On(h, k, e, g, m.width, m.height, c), q = h[p], r = new v(q.x + m.width + c.width, q.y), s = new v(q.x, q.y + m.height + c.height);
p + 1 < k && h.splice(p + 1, 0, null);
h[p] = r;
h[p + 1] = s;
k++;
p = q.x - m.x;
q = q.y - m.y;
for (n = n.vertexes.l; n.next();) {
var u = n.value;
u.Aa += p;
u.Ma += q
}
}
}
t.Jc(m);
for (n = b.vertexes.l; n.next();)u = n.value, l = u.Q, 2 > k ? (e = l.x + l.width / 2, g = l.y + l.height / 2, h[0] = new v(l.x + l.width + c.width, l.y), h[1] = new v(l.x, l.y +
l.height + c.height), k = 2) : (p = On(h, k, e, g, l.width, l.height, c), q = h[p], r = new v(q.x + l.width + c.width, q.y), s = new v(q.x, q.y + l.height + c.height), p + 1 < k && h.splice(p + 1, 0, null), h[p] = r, h[p + 1] = s, k++, u.Aa = q.x + u.width / 2, u.Ma = q.y + u.height / 2);
t.xa(h);
for (d.reset(); d.next();) {
e = d.value;
for (g = e.vertexes.l; g.next();)c = g.value, b.Mk(c);
for (e = e.edges.l; e.next();)c = e.value, b.bo(c)
}
}
Pn(this, a);
this.updateParts()
}
this.Hn = a;
this.network = null;
this.hf = !0
};
Ln.prototype.needsClusterLayout = function () {
if (3 > this.network.vertexes.count)return!1;
var a = 0, b = 0, c = this.network.vertexes.l;
c.next();
for (var d = c.value.Q; c.next();) {
if (c.value.Q.Cf(d) && (a++, 1 < a))return!0;
if (10 < b)break;
b++
}
return!1
};
Ln.prototype.df = function (a, b) {
for (var c = !0, d = a.vertexes.l; d.next();) {
var e = d.value;
c ? (c = !1, b.set(e.Q)) : b.ak(e.Q)
}
return b
};
function Qn(a, b, c) {
f && (t.o(b, Ln, "computeClusterLayoutIterations:level"), t.o(c, Ln, "computeClusterLayoutIterations:maxiter"));
return Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10)
}
function Nn(a, b, c) {
f && (t.o(b, Ln, "layoutClusters:level"), t.o(c, Ln, "layoutClusters:maxiter"));
if (Rn(a, b)) {
var d = a.bh;
a.bh *= 1 + 1 / (b + 1);
var e = Sn(a, b), g = Math.max(0, Qn(a, b, c));
a.hw += g;
Nn(a, b + 1, c);
Pn(a, g);
Tn(a, e, b);
c = a.Wf;
null === c ? c = new A(Un) : c.clear();
c.He(e.vertexes);
c.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : b.Ff - a.Ff
});
for (e = c.l; e.next();)Vn(a, e.value, b);
a.bh = d
}
}
function Rn(a, b) {
f && t.o(b, Ln, "hasClusters:level");
if (10 < b || 3 > a.network.vertexes.count)return!1;
null === a.Wf ? a.Wf = new A(Un) : a.Wf.clear();
a.Wf.He(a.network.vertexes);
var c = a.Wf;
c.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : b.Ff - a.Ff
});
for (var d = c.count - 1; 0 <= d && 1 >= c.p[d].Ff;)d--;
return 1 < c.count - d
}
function Sn(a, b) {
f && t.o(b, Ln, "pushSubNetwork:level");
for (var c = a.network, d = new Mn, e = a.Wf.l; e.next();) {
var g = e.value;
if (1 < g.Ff) {
d.Mk(g);
var h = {YA: g.Ff, $A: g.width, XA: g.height, RF: g.N.x, SF: g.N.y};
null === g.Mg && (g.Mg = new A);
g.Mg.add(h);
g.yA = g.Mg.count - 1
} else break
}
for (var k = c.edges.l; k.next();) {
var l = k.value;
if (l.fromVertex.network === d && l.toVertex.network === d)d.bo(l); else if (l.fromVertex.network === d) {
var m = l.fromVertex.mm;
null === m && (m = new A(Un), l.fromVertex.mm = m);
m.add(l.toVertex);
l.fromVertex.Ff--;
l.fromVertex.Xj +=
l.toVertex.Xj
} else l.toVertex.network === d && (m = l.toVertex.mm, null === m && (m = new A(Un), l.toVertex.mm = m), m.add(l.fromVertex), l.toVertex.Ff--, l.toVertex.Xj += l.fromVertex.Xj)
}
for (k = d.edges.l; k.next();)l = k.value, l.length *= Math.max(1, D.sqrt((l.fromVertex.Xj + l.toVertex.Xj) / (4 * b + 1)));
for (e = d.vertexes.l; e.next();)if (g = e.value, m = g.mm, null !== m && 0 < m.count && (h = g.Mg.p[g.Mg.count - 1], h = h.YA - g.Ff, !(0 >= h))) {
for (var n = 0, p = 0, q = m.count - h; q < m.count; q++) {
for (var r = m.p[q], l = null, k = r.edges.l; k.next();) {
var s = k.value;
if (s.zH(r) ===
g) {
l = s;
break
}
}
null !== l && (p += l.length, n += r.width * r.height)
}
m = g.Aa;
k = g.Ma;
l = g.width;
q = g.height;
r = g.N;
s = l * q;
1 > s && (s = 1);
n = D.sqrt((n + s + p * p * 4 / (h * h)) / s);
h = (n - 1) * l / 2;
n = (n - 1) * q / 2;
g.Hb = new w(m - r.x - h, k - r.y - n, l + 2 * h, q + 2 * n);
g.focus = new v(r.x + h, r.y + n)
}
a.network = d;
return c
}
function Tn(a, b, c) {
f && (t.j(b, Mn, Ln, "popNetwork:oldnet"), t.o(c, Ln, "popNetwork:level"));
for (c = a.network.vertexes.l; c.next();) {
var d = c.value;
d.network = b;
if (null !== d.Mg) {
var e = d.Mg.p[d.yA];
d.Ff = e.YA;
var g = e.RF, h = e.SF;
d.Hb = new w(d.Aa - g, d.Ma - h, e.$A, e.XA);
d.focus = new v(g, h);
d.yA--
}
}
for (c = a.network.edges.l; c.next();)c.value.network = b;
a.network = b
}
function Vn(a, b, c) {
f && (t.j(b, Un, Ln, "surroundNode:oldnet"), t.o(c, Ln, "surroundNode:level"));
var d = b.mm;
if (null !== d && 0 !== d.count) {
c = b.Aa;
var e = b.Ma, g = b.width, h = b.height;
null !== b.Mg && 0 < b.Mg.count && (h = b.Mg.p[0], g = h.$A, h = h.XA);
for (var g = D.sqrt(g * g + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.l; n.next();) {
var p = n.value;
1 >= p.Ff ? l++ : (k = !0, m++, h += Math.atan2(b.Ma - p.Ma, b.Aa - p.Aa))
}
if (0 !== l)for (0 < m && (h /= m), m = b = 0, b = k ? 2 * Math.PI / (l + 1) : 2 * Math.PI / l, 0 === l % 2 && (m = b / 2), 1 < d.count && d.sort(function (a, b) {
return null === a || null === b ||
a === b ? 0 : b.width * b.height - a.width * a.height
}), k = 0 === l % 2 ? 0 : 1, n = d.l; n.next();)if (p = n.value, !(1 < p.Ff || a.isFixed(p))) {
d = null;
for (l = p.edges.l; l.next();) {
d = l.value;
break
}
var l = p.width, q = p.height, l = D.sqrt(l * l + q * q) / 2, d = g + d.length + l, l = h + (b * (k / 2 >> 1) + m) * (0 == k % 2 ? 1 : -1);
p.Aa = c + d * Math.cos(l);
p.Ma = e + d * Math.sin(l);
k++
}
}
}
function On(a, b, c, d, e, g, h) {
var k = 9E19, l = -1, m = 0;
a:for (; m < b; m++) {
var n = a[m], p = n.x - c, q = n.y - d, p = p * p + q * q;
if (p < k) {
for (q = m - 1; 0 <= q; q--)if (a[q].y > n.y && a[q].x - n.x < e + h.width)continue a;
for (q = m + 1; q < b; q++)if (a[q].x > n.x && a[q].y - n.y < g + h.height)continue a;
l = m;
k = p
}
}
return l
}
Ln.prototype.mz = function () {
if (this.comments)for (var a = this.network.vertexes.l; a.next();)this.addComments(a.value)
};
Ln.prototype.addComments = function (a) {
var b = a.Bc;
if (null !== b)for (b = b.sD(); b.next();) {
var c = b.value;
if ("Comment" === c.Ic && c.ub()) {
var d = this.network.vm(c);
null === d && (d = this.network.co(c));
d.charge = this.cD;
for (var c = null, e = d.Sb; e.next();)if (e.value.toVertex === a) {
c = e.value;
break
}
if (null === c)for (e = d.bc; e.next();)if (e.value.fromVertex === a) {
c = e.value;
break
}
null === c && (c = this.network.Cm(a, d, null));
c.length = this.dD
}
}
};
function Wn(a, b) {
f && (t.j(a, Un, Ln, "getNodeDistance:vertexA"), t.j(b, Un, Ln, "getNodeDistance:vertexB"));
var c = a.Q, d = c.x, e = c.y, g = c.width, c = c.height, h = b.Q, k = h.x, l = h.y, m = h.width, h = h.height;
return d + g < k ? e > l + h ? (d = d + g - k, e = e - l - h, D.sqrt(d * d + e * e)) : e + c < l ? (d = d + g - k, e = e + c - l, D.sqrt(d * d + e * e)) : k - (d + g) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, D.sqrt(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, D.sqrt(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : 0.1
}
function Pn(a, b) {
f && t.o(b, Ln, "performIterations:num");
a.Wf = null;
for (var c = a.Gq + b; a.Gq < c && (a.Gq++, Xn(a)););
a.Wf = null
}
function Xn(a) {
null === a.Wf && (a.Wf = new A(Un), a.Wf.He(a.network.vertexes));
var b = a.Wf.p;
if (0 >= b.length)return!1;
var c = b[0];
c.forceX = 0;
c.forceY = 0;
for (var d = c.Aa, e = d, g = c.Ma, h = g, c = 1; c < b.length; c++) {
var k = b[c];
k.forceX = 0;
k.forceY = 0;
var l = k.Aa, k = k.Ma, d = Math.min(d, l), e = Math.max(e, l), g = Math.min(g, k), h = Math.max(h, k)
}
(g = e - d > h - g) ? b.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : a.Aa - b.Aa
}) : b.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : a.Ma - b.Ma
});
for (var h = a.bh, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) {
var k =
b[c], l = k.Q, q = k.N, d = l.x + q.x, l = l.y + q.y, n = k.charge * a.electricalFieldX(d, l), p = k.charge * a.electricalFieldY(d, l), n = n + k.mass * a.gravitationalFieldX(d, l), p = p + k.mass * a.gravitationalFieldY(d, l);
k.forceX += n;
k.forceY += p;
for (q = c + 1; q < b.length; q++)if (e = b[q], e !== k) {
var n = e.Q, r = e.N, p = n.x + r.x, r = n.y + r.y;
if (d - p > h || p - d > h) {
if (g)break
} else if (l - r > h || r - l > h) {
if (!g)break
} else {
var s = Wn(k, e);
1 > s ? (d > p ? (n = Math.abs(e.Q.right - k.Q.x), n = (1 + n) * Math.random()) : d < p ? (n = Math.abs(e.Q.x - k.Q.right), n = -(1 + n) * Math.random()) : (n = Math.max(e.width,
k.width), n = (1 + n) * Math.random() - n / 2), l > r ? (p = Math.abs(e.Q.bottom - k.Q.y), p = (1 + p) * Math.random()) : d < p ? (p = Math.abs(e.Q.y - k.Q.bottom), p = -(1 + p) * Math.random()) : (p = Math.max(e.height, k.height), p = (1 + p) * Math.random() - p / 2)) : (m = -(k.charge * e.charge) / (s * s), n = (p - d) / s * m, p = (r - l) / s * m);
k.forceX += n;
k.forceY += p;
e.forceX -= n;
e.forceY -= p
}
}
}
for (c = a.network.edges.l; c.next();)g = c.value, k = g.fromVertex, e = g.toVertex, l = k.Q, q = k.N, d = l.x + q.x, l = l.y + q.y, n = e.Q, r = e.N, p = n.x + r.x, r = n.y + r.y, s = Wn(k, e), 1 > s ? (n = (d > p ? 1 : -1) * (1 + (e.width > k.width) ? e.width :
k.width) * Math.random(), p = (l > r ? 1 : -1) * (1 + (e.height > k.height) ? e.height : k.height) * Math.random()) : (m = g.stiffness * (s - g.length), n = (p - d) / s * m, p = (r - l) / s * m), k.forceX += n, k.forceY += p, e.forceX -= n, e.forceY -= p;
c = 0;
d = Math.max(a.bh / 20, 50);
for (e = 0; e < b.length; e++)k = b[e], a.isFixed(k) ? a.moveFixedVertex(k) : (g = k.forceX, h = k.forceY, g < -d ? g = -d : g > d && (g = d), h < -d ? h = -d : h > d && (h = d), k.Aa += g, k.Ma += h, c = Math.max(c, g * g + h * h));
return c > a.Cz * a.Cz
}
Ln.prototype.moveFixedVertex = function () {
};
Ln.prototype.commitLayout = function () {
this.FA();
this.commitNodes();
this.Gs && this.commitLinks()
};
Ln.prototype.FA = function () {
if (this.hl)for (var a = this.network.edges.l; a.next();) {
var b = a.value.link;
null !== b && (b.fb = xb, b.gb = xb)
}
};
Ln.prototype.commitNodes = function () {
var a = 0, b = 0;
if (this.HC) {
var c = t.rf();
this.df(this.network, c);
b = this.rd;
a = b.x - c.x;
b = b.y - c.y;
t.Jc(c)
}
for (var c = t.rf(), d = this.network.vertexes.l; d.next();) {
var e = d.value;
if (0 !== a || 0 !== b)c.assign(e.Q), c.x += a, c.y += b, e.Hb = c;
e.commit()
}
t.Jc(c)
};
Ln.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
Ln.prototype.springStiffness = function (a) {
a = a.stiffness;
return isNaN(a) ? this.fn : a
};
Ln.prototype.springLength = function (a) {
a = a.length;
return isNaN(a) ? this.en : a
};
Ln.prototype.electricalCharge = function (a) {
a = a.charge;
return isNaN(a) ? this.bn : a
};
Ln.prototype.electricalFieldX = function () {
return 0
};
Ln.prototype.electricalFieldY = function () {
return 0
};
Ln.prototype.gravitationalMass = function (a) {
a = a.mass;
return isNaN(a) ? this.dn : a
};
Ln.prototype.gravitationalFieldX = function () {
return 0
};
Ln.prototype.gravitationalFieldY = function () {
return 0
};
Ln.prototype.isFixed = function (a) {
return a.isFixed
};
t.A(Ln, {OI: "currentIteration"}, function () {
return this.Gq
});
t.g(Ln, "arrangementSpacing", Ln.prototype.qv);
t.defineProperty(Ln, {qv: "arrangementSpacing"}, function () {
return this.Kf
}, function (a) {
this.Kf.K(a) || (this.Kf.assign(a), this.J())
});
t.g(Ln, "arrangesToOrigin", Ln.prototype.HC);
t.defineProperty(Ln, {HC: "arrangesToOrigin"}, function () {
return this.Op
}, function (a) {
this.Op !== a && (this.Op = a, this.J())
});
t.g(Ln, "setsPortSpots", Ln.prototype.hl);
t.defineProperty(Ln, {hl: "setsPortSpots"}, function () {
return this.kh
}, function (a) {
this.kh !== a && (this.kh = a, this.J())
});
t.g(Ln, "comments", Ln.prototype.comments);
t.defineProperty(Ln, {comments: "comments"}, function () {
return this.Tg
}, function (a) {
this.Tg !== a && (this.Tg = a, this.J())
});
t.g(Ln, "maxIterations", Ln.prototype.hw);
t.defineProperty(Ln, {hw: "maxIterations"}, function () {
return this.Hn
}, function (a) {
this.Hn !== a && 0 <= a && (this.Hn = a, this.J())
});
t.g(Ln, "epsilonDistance", Ln.prototype.Cz);
t.defineProperty(Ln, {Cz: "epsilonDistance"}, function () {
return this.kq
}, function (a) {
this.kq !== a && 0 < a && (this.kq = a, this.J())
});
t.g(Ln, "infinityDistance", Ln.prototype.HH);
t.defineProperty(Ln, {HH: "infinityDistance"}, function () {
return this.bh
}, function (a) {
this.bh !== a && 1 < a && (this.bh = a, this.J())
});
t.g(Ln, "defaultSpringStiffness", Ln.prototype.lH);
t.defineProperty(Ln, {lH: "defaultSpringStiffness"}, function () {
return this.fn
}, function (a) {
this.fn !== a && (this.fn = a, this.J())
});
t.g(Ln, "defaultSpringLength", Ln.prototype.kH);
t.defineProperty(Ln, {kH: "defaultSpringLength"}, function () {
return this.en
}, function (a) {
this.en !== a && (this.en = a, this.J())
});
t.g(Ln, "defaultElectricalCharge", Ln.prototype.eH);
t.defineProperty(Ln, {eH: "defaultElectricalCharge"}, function () {
return this.bn
}, function (a) {
this.bn !== a && (this.bn = a, this.J())
});
t.g(Ln, "defaultGravitationalMass", Ln.prototype.fH);
t.defineProperty(Ln, {fH: "defaultGravitationalMass"}, function () {
return this.dn
}, function (a) {
this.dn !== a && (this.dn = a, this.J())
});
t.g(Ln, "defaultCommentSpringLength", Ln.prototype.dD);
t.defineProperty(Ln, {dD: "defaultCommentSpringLength"}, function () {
return this.eq
}, function (a) {
this.eq !== a && (this.eq = a, this.J())
});
t.g(Ln, "defaultCommentElectricalCharge", Ln.prototype.cD);
t.defineProperty(Ln, {cD: "defaultCommentElectricalCharge"}, function () {
return this.dq
}, function (a) {
this.dq !== a && (this.dq = a, this.J())
});
function Mn() {
ra.call(this)
}
t.ea("ForceDirectedNetwork", Mn);
t.Ja(Mn, ra);
Mn.prototype.createVertex = function () {
return new Un
};
Mn.prototype.createEdge = function () {
return new Yn
};
function Un() {
sa.call(this);
this.isFixed = !1;
this.mass = this.charge = NaN;
this.Xj = this.Ff = this.forceY = this.forceX = 0;
this.Mg = this.mm = null;
this.yA = 0
}
t.ea("ForceDirectedVertex", Un);
t.Ja(Un, sa);
function Yn() {
ta.call(this);
this.length = this.stiffness = NaN
}
t.ea("ForceDirectedEdge", Yn);
t.Ja(Yn, ta);
function Ik() {
0 < arguments.length && t.m("LayeredDigraphLayout constructor cannot take any arguments.");
fe.call(this);
this.wd = this.Dn = 25;
this.oa = 0;
this.an = Zn;
this.En = $n;
this.un = ao;
this.Il = 4;
this.Um = bo;
this.ci = co;
this.kh = !0;
this.gj = 4;
this.Cb = this.nu = this.hb = -1;
this.vf = this.Yq = 0;
this.zd = this.tf = this.vg = this.hh = this.xd = null;
this.dr = 0;
this.wu = this.Nl = null;
this.Sf = 0;
this.er = null;
this.xg = [];
this.xg.length = 100
}
t.ea("LayeredDigraphLayout", Ik);
t.Ja(Ik, fe);
Ik.prototype.cloneProtected = function (a) {
fe.prototype.cloneProtected.call(this, a);
a.Dn = this.Dn;
a.wd = this.wd;
a.oa = this.oa;
a.an = this.an;
a.En = this.En;
a.un = this.un;
a.Il = this.Il;
a.Um = this.Um;
a.ci = this.ci;
a.kh = this.kh;
a.gj = this.gj
};
Ik.prototype.createNetwork = function () {
var a = new eo;
nn(a, this);
return a
};
Ik.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
null === this.network && (this.network = this.makeNetwork(a));
this.rd = this.Pz(this.rd);
this.nu = -1;
this.vf = this.Yq = 0;
this.er = this.wu = this.Nl = null;
for (a = 0; a < this.xg.length; a++)this.xg[a] = null;
if (0 < this.network.vertexes.count) {
this.network.Gv();
for (a = this.network.edges.l; a.next();)a.value.rev = !1;
switch (this.an) {
default:
case fo:
var b = 0, c = this.network.vertexes.count -
1;
a = [];
a.length = c + 1;
for (var d = this.network.vertexes.l; d.next();)d.value.valid = !0;
for (; null !== ho(this.network);) {
for (d = io(this.network); null !== d;)a[c] = d, c--, d.valid = !1, d = io(this.network);
for (d = jo(this.network); null !== d;)a[b] = d, b++, d.valid = !1, d = jo(this.network);
for (var d = null, e = 0, g = this.network.vertexes.l; g.next();) {
var h = g.value;
if (h.valid) {
for (var k = 0, l = h.Sb; l.next();)l.value.toVertex.valid && k++;
for (var l = 0, m = h.bc; m.next();)m.value.fromVertex.valid && l++;
if (null === d || e < k - l)d = h, e = k - l
}
}
null !== d && (a[b] =
d, b++, d.valid = !1)
}
for (b = 0; b < this.network.vertexes.count; b++)a[b].index = b;
for (a = this.network.edges.l; a.next();)b = a.value, b.fromVertex.index > b.toVertex.index && (this.network.qw(b), b.rev = !0);
break;
case Zn:
for (b = this.network.vertexes.l; b.next();)b.value.vo = -1, b.value.finish = -1;
for (a = this.network.edges.l; a.next();)a.value.forest = !1;
this.dr = 0;
for (b.reset(); b.next();)0 === b.value.bc.count && to(this, b.value);
for (b.reset(); b.next();)-1 === b.value.vo && to(this, b.value);
for (a.reset(); a.next();)b = a.value, b.forest ||
(c = b.fromVertex, d = c.finish, e = b.toVertex, g = e.finish, e.vo < c.vo && d < g && (this.network.qw(b), b.rev = !0))
}
for (a = this.network.vertexes.l; a.next();)b = a.value, b.layer = -1;
this.hb = -1;
this.assignLayers();
for (a.reset(); a.next();)this.hb = Math.max(this.hb, a.value.layer);
c = this.network.edges.l;
for (b = []; c.next();)a = c.value, a.valid = !1, b.push(a);
for (c = 0; c < b.length; c++)if (a = b[c], !a.valid && (null !== a.fromVertex.dd && null !== a.toVertex.dd || a.fromVertex.layer !== a.toVertex.layer)) {
g = k = h = l = 0;
e = a.fromVertex;
d = a.toVertex;
if (null !==
a.link) {
k = a.link;
if (null === k)continue;
var n = e.dd, g = d.dd;
if (null === n || null === g)continue;
var p = k.ca, h = k.ga, q = k.Vc, l = k.Qd;
a.rev && (k = p, m = q, p = h, q = l, h = k, l = m);
var r = e.N, k = a.toVertex.N, s = a.rev ? d.Q : e.Q, m = t.M();
isNaN(s.x) ? m.assign(r) : em(p, q, Hb, m);
n !== p && !isNaN(s.x) && p.ub() && (n = e.Q, isNaN(n.x) || (m.x += s.x - n.x, m.y += s.y - n.y));
p = a.rev ? e.Q : d.Q;
n = t.M();
isNaN(p.x) ? n.assign(k) : em(h, l, Hb, n);
g !== h && !isNaN(p.x) && h.ub() && (g = d.Q, isNaN(g.x) || (n.x += p.x - g.x, n.y += p.y - g.y));
90 === this.oa || 270 === this.oa ? (g = Math.round((m.x - r.x) /
this.wd), h = m.x, k = Math.round((n.x - k.x) / this.wd), l = n.x) : (g = Math.round((m.y - r.y) / this.wd), h = m.y, k = Math.round((n.y - k.y) / this.wd), l = n.y);
t.B(m);
t.B(n);
a.portFromColOffset = g;
a.portFromPos = h;
a.portToColOffset = k;
a.portToPos = l
} else a.portFromColOffset = 0, a.portFromPos = 0, a.portToColOffset = 0, a.portToPos = 0;
m = e.layer;
r = d.layer;
n = a;
p = 0;
s = n.link;
if (null !== s) {
var u = s.Vc, x = s.Qd;
if (null !== u && null !== x) {
var E = s.ca, q = s.ga;
if (null !== E && null !== q) {
var F = u.fb, G = x.gb;
this.hl || (s.fb.Ac() || (F = s.fb), s.gb.Ac() || (G = s.gb));
if (F.Ac() ||
F === wb)F = zo(this, !0);
if (G.Ac() || G === wb)G = zo(this, !1);
var L = s.Ub, N = s.getLinkPoint(E, u, F, !0, L, q, x, t.M()), F = s.getLinkDirection(E, u, N, F, !0, L, q, x);
t.B(N);
F === Ao(this, n, !0) ? p += 1 : this.hl && null !== E && 1 === E.ports.count && n.rev && (p += 1);
N = s.getLinkPoint(q, x, G, !1, L, E, u, t.M());
s = s.getLinkDirection(q, x, N, G, !1, L, E, u);
t.B(N);
s === Ao(this, n, !1) ? p += 2 : this.hl && null !== q && 1 === q.ports.count && n.rev && (p += 2)
}
}
}
n = 1 === p || 3 === p ? !0 : !1;
if (p = 2 === p || 3 === p ? !0 : !1)q = this.network.createVertex(), q.dd = null, q.hm = 1, q.layer = m, q.near = e, this.network.Mk(q),
e = this.network.Cm(e, q, a.link), e.valid = !1, e.rev = a.rev, e.portFromColOffset = g, e.portToColOffset = 0, e.portFromPos = h, e.portToPos = 0, e = q;
s = 1;
n && s--;
if (m - r > s && 0 < m) {
a.valid = !1;
q = this.network.createVertex();
q.dd = null;
q.hm = 2;
q.layer = m - 1;
this.network.Mk(q);
e = this.network.Cm(e, q, a.link);
e.valid = !0;
e.rev = a.rev;
e.portFromColOffset = p ? 0 : g;
e.portToColOffset = 0;
e.portFromPos = p ? 0 : h;
e.portToPos = 0;
e = q;
for (m--; m - r > s && 0 < m;)q = this.network.createVertex(), q.dd = null, q.hm = 3, q.layer = m - 1, this.network.Mk(q), e = this.network.Cm(e, q,
a.link), e.valid = !0, e.rev = a.rev, e.portFromColOffset = 0, e.portToColOffset = 0, e.portFromPos = 0, e.portToPos = 0, e = q, m--;
e = this.network.Cm(q, d, a.link);
e.valid = !n;
n && (q.near = d);
e.rev = a.rev;
e.portFromColOffset = 0;
e.portToColOffset = k;
e.portFromPos = 0;
e.portToPos = l
} else a.valid = !0
}
b = this.xd = [];
for (c = 0; c <= this.hb; c++)b[c] = 0;
for (a = this.network.vertexes.l; a.next();)a.value.index = -1;
this.initializeIndices();
this.nu = -1;
for (c = this.vf = this.Yq = 0; c <= this.hb; c++)b[c] > b[this.vf] && (this.nu = b[c] - 1, this.vf = c), b[c] < b[this.Yq] &&
(this.Yq = c);
this.er = [];
for (c = 0; c < b.length; c++)this.er[c] = [];
for (a.reset(); a.next();)c = a.value, b = c.layer, this.er[b][c.index] = c;
this.Cb = -1;
for (a = 0; a <= this.hb; a++) {
b = Bo(this, a);
c = 0;
d = this.xd[a];
for (e = 0; e < d; e++)g = b[e], c += this.nodeMinColumnSpace(g, !0), g.column = c, c += 1, c += this.nodeMinColumnSpace(g, !1);
this.Cb = Math.max(this.Cb, c - 1);
Co(this, a, b)
}
this.reduceCrossings();
this.straightenAndPack();
this.updateParts()
}
this.network = null;
this.hf = !0
};
function Do(a) {
var b = a.toVertex, c = 0;
for (a = a.fromVertex.Sb; a.next();)a.value.toVertex === b && c++;
return 1 < c ? 2 : 1
}
function Eo(a) {
var b = a.fromVertex.dd;
a = a.toVertex.dd;
return null === b && null === a ? 8 : null === b || null === a ? 4 : 1
}
Ik.prototype.nodeMinLayerSpace = function (a, b) {
return null === a.dd ? 0 : 90 === this.oa || 270 === this.oa ? b ? a.N.y + 10 : a.Q.height - a.N.y + 10 : b ? a.N.x + 10 : a.Q.width - a.N.x + 10
};
Ik.prototype.nodeMinColumnSpace = function (a, b) {
if (null === a.dd)return 0;
var c = b ? a.hA : a.gA;
if (void 0 !== c)return c;
c = this.oa;
return 90 === c || 270 === c ? b ? a.hA = a.N.x / this.wd + 1 | 0 : a.gA = (a.Q.width - a.N.x) / this.wd + 1 | 0 : b ? a.hA = a.N.y / this.wd + 1 | 0 : a.gA = (a.Q.height - a.N.y) / this.wd + 1 | 0
};
function Fo(a) {
null === a.Nl && (a.Nl = []);
for (var b = 0, c = a.network.vertexes.l, d; c.next();)d = c.value, a.Nl[b] = d.layer, b++, a.Nl[b] = d.column, b++, a.Nl[b] = d.index, b++;
return a.Nl
}
function Go(a, b) {
for (var c = 0, d = a.network.vertexes.l, e; d.next();)e = d.value, e.layer = b[c], c++, e.column = b[c], c++, e.index = b[c], c++
}
function Ho(a, b, c) {
f && (t.o(b, Ik, "crossingMatrix:unfixedLayer"), t.o(c, Ik, "crossingMatrix:direction"));
var d = Bo(a, b), e = a.xd[b];
a.wu || (a.wu = []);
for (var g = a.wu, h, k = 0; k < e; k++) {
h = 0;
var l = d[k], m = l.near, n, p;
if (null !== m && m.layer === l.layer)if (l = m.index, l > k)for (p = k + 1; p < l; p++)n = d[p], n.near === m && n.hm === m.hm || h++; else for (p = k - 1; p > l; p--)n = d[p], n.near === m && n.hm === m.hm || h++;
var q, r, s, u, x, E;
if (0 <= c)for (l = d[k].Ue, m = 0; m < l.count; m++)if (q = l.p[m], q.valid && q.fromVertex.layer !== b)for (n = q.fromVertex.index, p = q.portToPos, q =
q.portFromPos, r = m + 1; r < l.count; r++)s = l.p[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, x = s.portToPos, s = s.portFromPos, p < x && (n > u || n === u && q > s) && h++, x < p && (u > n || u === n && s > q) && h++);
if (0 >= c)for (l = d[k].Me, m = 0; m < l.count; m++)if (q = l.p[m], q.valid && q.toVertex.layer !== b)for (n = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < l.count; r++)s = l.p[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, x = s.portToPos, s = s.portFromPos, q < s && (n > u || n === u && p > x) && h++, s < q && (u > n || u === n && x > p) && h++);
g[k * e + k] = h;
for (l =
k + 1; l < e; l++) {
var F = 0, G = 0;
if (0 <= c)for (h = d[k].Ue, E = d[l].Ue, m = 0; m < h.count; m++)if (q = h.p[m], q.valid && q.fromVertex.layer !== b)for (n = q.fromVertex.index, q = q.portFromPos, r = 0; r < E.count; r++)s = E.p[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, s = s.portFromPos, (n < u || n === u && q < s) && G++, (u < n || u === n && s < q) && F++);
if (0 >= c)for (h = d[k].Me, E = d[l].Me, m = 0; m < h.count; m++)if (q = h.p[m], q.valid && q.toVertex.layer !== b)for (n = q.toVertex.index, p = q.portToPos, r = 0; r < E.count; r++)s = E.p[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index,
x = s.portToPos, (n < u || n === u && p < x) && G++, (u < n || u === n && x < p) && F++);
g[k * e + l] = F;
g[l * e + k] = G
}
}
Co(a, b, d);
return g
}
Ik.prototype.countCrossings = function () {
var a, b = 0, c, d;
for (a = 0; a <= this.hb; a++) {
c = Ho(this, a, 1);
d = this.xd[a];
for (var e = 0; e < d; e++)for (var g = e; g < d; g++)b += c[e * d + g]
}
return b
};
function Io(a) {
for (var b = 0, c = 0; c <= a.hb; c++) {
for (var d = a, e = c, g = Bo(d, e), h = d.xd[e], k = 0, l = void 0, l = 0; l < h; l++) {
var m = g[l].Me, n, p, q;
if ("undefined" !== typeof m)for (var r = 0; r < m.count; r++)n = m.p[r], n.valid && n.toVertex.layer !== e && (p = n.fromVertex.column + n.portFromColOffset, q = n.toVertex.column + n.portToColOffset, k += (Math.abs(p - q) + 1) * Eo(n))
}
Co(d, e, g);
b += k
}
return b
}
Ik.prototype.normalize = function () {
var a = Infinity;
this.Cb = -1;
for (var b = this.network.vertexes.l, c; b.next();)c = b.value, a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0)), this.Cb = Math.max(this.Cb, c.column + this.nodeMinColumnSpace(c, !1));
for (b.reset(); b.next();)b.value.column -= a;
this.Cb -= a
};
function Jo(a, b, c) {
f && (t.o(b, Ik, "barycenters:unfixedLayer"), t.o(c, Ik, "barycenters:direction"));
var d = Bo(a, b), e = a.xd[b], g = [], h;
for (h = 0; h < e; h++) {
var k = d[h], l = null;
0 >= c && (l = k.Ue);
var m = null;
0 <= c && (m = k.Me);
var n = 0, p = 0, q = k.near;
null !== q && q.layer === k.layer && (n += q.column - 1, p++);
if (null !== l)for (q = 0; q < l.count; q++) {
var k = l.p[q], r = k.fromVertex;
k.valid && !k.rev && r.layer !== b && (n += r.column + k.portFromColOffset, p++)
}
if (null !== m)for (l = 0; l < m.count; l++)k = m.p[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column +
k.portToColOffset, p++);
g[h] = 0 === p ? -1 : n / p
}
Co(a, b, d);
return g
}
function Ko(a, b, c) {
f && (t.o(b, Ik, "medians:unfixedLayer"), t.o(c, Ik, "medians:direction"));
for (var d = Bo(a, b), e = a.xd[b], g = [], h = 0; h < e; h++) {
var k = d[h], l = null;
0 >= c && (l = k.Ue);
var m = null;
0 <= c && (m = k.Me);
var n = 0, p = [], q = k.near;
null !== q && q.layer === k.layer && (p[n] = q.column - 1, n++);
if (null !== l)for (q = 0; q < l.count; q++) {
var k = l.p[q], r = k.fromVertex;
k.valid && !k.rev && r.layer !== b && (p[n] = r.column + k.portFromColOffset, n++)
}
if (null !== m)for (l = 0; l < m.count; l++)k = m.p[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (p[n] = q.column + k.portToColOffset,
n++);
0 === n ? g[h] = -1 : (p.sort(function (a, b) {
return a - b
}), m = n >> 1, g[h] = n & 1 ? p[m] : p[m - 1] + p[m] >> 1)
}
Co(a, b, d);
return g
}
function Lo(a, b, c, d, e, g) {
if (b.component === d) {
b.component = c;
var h, k;
if (e)for (var l = b.Sb; l.next();) {
var m = l.value.toVertex;
h = b.layer - m.layer;
k = Do(l.value);
h === k && Lo(a, m, c, d, e, g)
}
if (g)for (l = b.bc; l.next();)m = l.value.fromVertex, h = m.layer - b.layer, k = Do(l.value), h === k && Lo(a, m, c, d, e, g)
}
}
function Mo(a, b, c, d, e, g) {
if (b.component === d) {
b.component = c;
if (e)for (var h = b.Sb, k; h.next();)k = h.value.toVertex, Mo(a, k, c, d, e, g);
if (g)for (b = b.bc; b.next();)h = b.value.fromVertex, Mo(a, h, c, d, e, g)
}
}
function ho(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid)return b
}
return null
}
function io(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid) {
for (var c = !0, d = b.Sb; d.next();)if (d.value.toVertex.valid) {
c = !1;
break
}
if (c)return b
}
}
return null
}
function jo(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid) {
for (var c = !0, d = b.bc; d.next();)if (d.value.fromVertex.valid) {
c = !1;
break
}
if (c)return b
}
}
return null
}
function to(a, b) {
b.vo = a.dr;
a.dr++;
for (var c = b.Sb; c.next();) {
var d = c.value, e = d.toVertex;
-1 === e.vo && (d.forest = !0, to(a, e))
}
b.finish = a.dr;
a.dr++
}
Ik.prototype.assignLayers = function () {
switch (this.En) {
case No:
Oo(this);
break;
case Po:
for (var a, b = this.network.vertexes.l; b.next();)a = Qo(this, b.value), this.hb = Math.max(a, this.hb);
for (b.reset(); b.next();)a = b.value, a.layer = this.hb - a.layer;
break;
default:
case $n:
Oo(this);
for (b = this.network.vertexes.l; b.next();)b.value.valid = !1;
for (b.reset(); b.next();)0 === b.value.bc.count && Ro(this, b.value);
a = Infinity;
for (b.reset(); b.next();)a = Math.min(a, b.value.layer);
this.hb = -1;
for (b.reset(); b.next();)b.value.layer -= a,
this.hb = Math.max(this.hb, b.value.layer)
}
};
function Oo(a) {
for (var b = a.network.vertexes.l; b.next();) {
var c = So(a, b.value);
a.hb = Math.max(c, a.hb)
}
}
function So(a, b) {
var c = 0;
if (-1 === b.layer) {
for (var d = b.Sb; d.next();)var e = d.value, g = Do(e), c = Math.max(c, So(a, e.toVertex) + g);
b.layer = c
} else c = b.layer;
return c
}
function Qo(a, b) {
var c = 0;
if (-1 === b.layer) {
for (var d, e, g = b.bc; g.next();)e = g.value, d = Do(e), c = Math.max(c, Qo(a, e.fromVertex) + d);
b.layer = c
} else c = b.layer;
return c
}
function Ro(a, b) {
if (!b.valid) {
b.valid = !0;
for (var c = b.Sb; c.next();)Ro(a, c.value.toVertex);
for (c = a.network.vertexes.l; c.next();)c.value.component = -1;
for (var d = b.Ue.p, e = d.length, g = 0; g < e; g++) {
var h = d[g], k = Do(h);
h.fromVertex.layer - h.toVertex.layer > k && Lo(a, h.fromVertex, 0, -1, !0, !1)
}
for (Lo(a, b, 1, -1, !0, !0); 0 !== b.component;) {
for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.l; n.next();) {
var p = n.value;
if (1 === p.component) {
for (var q = 0, r = !1, s = p.Ue.p, e = s.length, g = 0; g < e; g++) {
var h = s[g], u = h.fromVertex, q = q + 1;
1 !== u.component && (k += 1, u = u.layer - p.layer, h = Do(h), d = Math.min(d, u - h))
}
h = p.Me.p;
e = h.length;
for (g = 0; g < e; g++)s = h[g].toVertex, q -= 1, 1 !== s.component ? k -= 1 : r = !0;
(null === m || q < l) && !r && (m = p, l = q)
}
}
if (0 < k) {
for (c.reset(); c.next();)e = c.value, 1 === e.component && (e.layer += d);
b.component = 0
} else m.component = 0
}
for (c = a.network.vertexes.l; c.next();)c.value.component = -1;
for (Lo(a, b, 1, -1, !0, !1); 0 !== b.component;) {
g = 0;
e = Infinity;
d = 0;
k = null;
for (l = a.network.vertexes.l; l.next();)if (m = l.value, 1 === m.component) {
n = 0;
p = !1;
h = m.Ue.p;
q = h.length;
for (r = 0; r < q; r++)s = h[r].fromVertex, n += 1, 1 !== s.component ? g += 1 : p = !0;
h = m.Me.p;
q = h.length;
for (r = 0; r < q; r++)s = h[r], u = s.toVertex, n -= 1, 1 !== u.component && (g -= 1, u = m.layer - u.layer, s = Do(s), e = Math.min(e, u - s));
(null === k || n > d) && !p && (k = m, d = n)
}
if (0 > g) {
for (c.reset(); c.next();)g = c.value, 1 === g.component && (g.layer -= e);
b.component = 0
} else k.component = 0
}
}
}
function Ao(a, b, c) {
return 90 === a.oa ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.oa ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.oa ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0
}
Ik.prototype.initializeIndices = function () {
switch (this.un) {
default:
case To:
for (var a, b = this.network.vertexes.l; b.next();) {
var c = b.value;
a = c.layer;
c.index = this.xd[a];
this.xd[a]++
}
break;
case ao:
b = this.network.vertexes.l;
for (a = this.hb; 0 <= a; a--) {
for (; b.next();)b.value.layer === a && -1 === b.value.index && Uo(this, b.value);
b.reset()
}
break;
case Vo:
for (b = this.network.vertexes.l, a = 0; a <= this.hb; a++) {
for (; b.next();)b.value.layer === a && -1 === b.value.index && Wo(this, b.value);
b.reset()
}
}
};
function Uo(a, b) {
var c = b.layer;
b.index = a.xd[c];
a.xd[c]++;
for (var c = b.Me.Ve(), d = !0, e; d;)for (d = !1, e = 0; e < c.length - 1; e++) {
var g = c[e], h = c[e + 1];
g.portFromColOffset > h.portFromColOffset && (d = !0, c[e] = h, c[e + 1] = g)
}
for (e = 0; e < c.length; e++)d = c[e], d.valid && (d = d.toVertex, -1 === d.index && Uo(a, d))
}
function Wo(a, b) {
var c = b.layer;
b.index = a.xd[c];
a.xd[c]++;
for (var c = b.Ue.Ve(), d = !0, e; d;)for (d = !1, e = 0; e < c.length - 1; e++) {
var g = c[e], h = c[e + 1];
g.portToColOffset > h.portToColOffset && (d = !0, c[e] = h, c[e + 1] = g)
}
for (e = 0; e < c.length; e++)d = c[e], d.valid && (d = d.fromVertex, -1 === d.index && Wo(a, d))
}
Ik.prototype.reduceCrossings = function () {
var a = this.countCrossings(), b = Fo(this), c, d, e;
for (c = 0; c < this.Il; c++) {
for (d = 0; d <= this.hb; d++)Xo(this, d, 1), Yo(this, d, 1);
e = this.countCrossings();
e < a && (a = e, b = Fo(this));
for (d = this.hb; 0 <= d; d--)Xo(this, d, -1), Yo(this, d, -1);
e = this.countCrossings();
e < a && (a = e, b = Fo(this))
}
Go(this, b);
for (c = 0; c < this.Il; c++) {
for (d = 0; d <= this.hb; d++)Xo(this, d, 0), Yo(this, d, 0);
e = this.countCrossings();
e < a && (a = e, b = Fo(this));
for (d = this.hb; 0 <= d; d--)Xo(this, d, 0), Yo(this, d, 0);
e = this.countCrossings();
e < a && (a = e, b = Fo(this))
}
Go(this, b);
var g, h, k;
switch (this.Um) {
case Zo:
break;
case $o:
for (k = a + 1; (d = this.countCrossings()) < k;)for (k = d, c = this.hb; 0 <= c; c--)for (h = 0; h <= c; h++) {
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, -1) || g;
e = this.countCrossings();
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, 1) || g;
e = this.countCrossings();
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Yo(this, d, 1) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g =
Yo(this, d, -1) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, 0) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Yo(this, d, 0) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this))
}
break;
default:
case bo:
for (c = this.hb, h = 0, k = a + 1; (d = this.countCrossings()) < k;) {
k = d;
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, -1) || g;
e = this.countCrossings();
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, 1) || g;
e = this.countCrossings();
e >= a ? Go(this, b) :
(a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Yo(this, d, 1) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Yo(this, d, -1) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Yo(this, d, 0) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Yo(this, d, 0) || g;
e >= a ? Go(this, b) : (a = e, b = Fo(this))
}
}
Go(this, b)
};
function Xo(a, b, c) {
f && (t.o(b, Ik, "medianBarycenterCrossingReduction:unfixedLayer"), t.o(c, Ik, "medianBarycenterCrossingReduction:direction"));
var d = Bo(a, b), e = a.xd[b], g = Ko(a, b, c), h = Jo(a, b, c);
for (c = 0; c < e; c++)-1 === h[c] && (h[c] = d[c].column), -1 === g[c] && (g[c] = d[c].column);
for (var k = !0, l; k;)for (k = !1, c = 0; c < e - 1; c++)if (g[c + 1] < g[c] || g[c + 1] === g[c] && h[c + 1] < h[c])k = !0, l = g[c], g[c] = g[c + 1], g[c + 1] = l, l = h[c], h[c] = h[c + 1], h[c + 1] = l, l = d[c], d[c] = d[c + 1], d[c + 1] = l;
for (c = g = 0; c < e; c++)l = d[c], l.index = c, g += a.nodeMinColumnSpace(l, !0),
l.column = g, g += 1, g += a.nodeMinColumnSpace(l, !1);
Co(a, b, d)
}
function Yo(a, b, c) {
var d = Bo(a, b), e = a.xd[b];
c = Ho(a, b, c);
var g, h;
h = [];
for (g = 0; g < e; g++)h[g] = -1;
var k;
k = [];
for (g = 0; g < e; g++)k[g] = -1;
for (var l = !1, m = !0; m;)for (m = !1, g = 0; g < e - 1; g++) {
var n = c[d[g].index * e + d[g + 1].index], p = c[d[g + 1].index * e + d[g].index], q = 0, r = 0, s = d[g].column, u = d[g + 1].column, x = a.nodeMinColumnSpace(d[g], !0), E = a.nodeMinColumnSpace(d[g], !1), F = a.nodeMinColumnSpace(d[g + 1], !0), G = a.nodeMinColumnSpace(d[g + 1], !1), x = s - x + F, E = u - E + G, L = d[g].bc.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.fromVertex.layer ===
b) {
G = G.fromVertex;
for (F = 0; d[F] !== G;)F++;
F < g && (q += 2 * (g - F), r += 2 * (g + 1 - F));
F === g + 1 && (q += 1);
F > g + 1 && (q += 4 * (F - g), r += 4 * (F - (g + 1)))
}
L = d[g].Sb.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.toVertex.layer === b) {
G = G.toVertex;
for (F = 0; d[F] !== G;)F++;
F === g + 1 && (r += 1)
}
L = d[g + 1].bc.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.fromVertex.layer === b) {
G = G.fromVertex;
for (F = 0; d[F] !== G;)F++;
F < g && (q += 2 * (g + 1 - F), r += 2 * (g - F));
F === g && (r += 1);
F > g + 1 && (q += 4 * (F - (g + 1)), r += 4 * (F - g))
}
L = d[g + 1].Sb.l;
for (L.reset(); L.next();)if (G = L.value,
G.valid && G.toVertex.layer === b) {
G = G.toVertex;
for (F = 0; d[F] !== G;)F++;
F === g && (q += 1)
}
var F = G = 0, L = h[d[g].index], N = k[d[g].index], V = h[d[g + 1].index], T = k[d[g + 1].index];
-1 !== L && (G += Math.abs(L - s), F += Math.abs(L - E));
-1 !== N && (G += Math.abs(N - s), F += Math.abs(N - E));
-1 !== V && (G += Math.abs(V - u), F += Math.abs(V - x));
-1 !== T && (G += Math.abs(T - u), F += Math.abs(T - x));
if (r < q - 0.5 || r === q && p < n - 0.5 || r === q && p === n && F < G - 0.5)m = l = !0, d[g].column = E, d[g + 1].column = x, n = d[g], d[g] = d[g + 1], d[g + 1] = n
}
for (g = 0; g < e; g++)d[g].index = g;
Co(a, b, d);
return l
}
Ik.prototype.straightenAndPack = function () {
var a, b, c = 0 !== (this.ci & ap);
a = this.ci === co;
1E3 < this.network.edges.count && !a && (c = !1);
if (c) {
b = [];
for (a = 0; a <= this.hb; a++)b[a] = 0;
for (var d = this.network.vertexes.l, e, g; d.next();)e = d.value, a = e.layer, g = e.column, e = this.nodeMinColumnSpace(e, !1), b[a] = Math.max(b[a], g + e);
for (d.reset(); d.next();)e = d.value, a = e.layer, g = e.column, e.column = (8 * (this.Cb - b[a]) >> 1) + 8 * g;
this.Cb *= 8
}
if (0 !== (this.ci & bp))for (b = !0; b;) {
b = !1;
for (a = this.vf + 1; a <= this.hb; a++)b = cp(this, a, 1) || b;
for (a = this.vf -
1; 0 <= a; a--)b = cp(this, a, -1) || b;
b = cp(this, this.vf, 0) || b
}
if (0 !== (this.ci & dp)) {
for (a = this.vf + 1; a <= this.hb; a++)ep(this, a, 1);
for (a = this.vf - 1; 0 <= a; a--)ep(this, a, -1);
ep(this, this.vf, 0)
}
c && (fp(this, -1), fp(this, 1));
if (0 !== (this.ci & bp))for (b = !0; b;) {
b = !1;
b = cp(this, this.vf, 0) || b;
for (a = this.vf + 1; a <= this.hb; a++)b = cp(this, a, 0) || b;
for (a = this.vf - 1; 0 <= a; a--)b = cp(this, a, 0) || b
}
};
function cp(a, b, c) {
f && (t.o(b, Ik, "bendStraighten:unfixedLayer"), t.o(c, Ik, "bendStraighten:direction"));
for (var d = !1; gp(a, b, c);)d = !0;
return d
}
function gp(a, b, c) {
f && (t.o(b, Ik, "shiftbendStraighten:unfixedLayer"), t.o(c, Ik, "shiftbendStraighten:direction"));
var d, e = Bo(a, b), g = a.xd[b], h = Jo(a, b, -1);
if (0 < c)for (d = 0; d < g; d++)h[d] = -1;
var k = Jo(a, b, 1);
if (0 > c)for (d = 0; d < g; d++)k[d] = -1;
for (var l = !1, m = !0; m;)for (m = !1, d = 0; d < g; d++) {
var n = e[d].column, p = a.nodeMinColumnSpace(e[d], !0), q = a.nodeMinColumnSpace(e[d], !1), p = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n, q = d + 1 >= g || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n, r = 0, s = 0, u = 0, x,
E, F, G;
if (0 >= c)for (var L = e[d].bc.l; L.next();)x = L.value, x.valid && x.fromVertex.layer !== b && (E = Eo(x), F = x.portFromColOffset, G = x.portToColOffset, x = x.fromVertex.column, r += (Math.abs(n + G - (x + F)) + 1) * E, s += (Math.abs(p + G - (x + F)) + 1) * E, u += (Math.abs(q + G - (x + F)) + 1) * E);
if (0 <= c)for (L = e[d].Sb.l; L.next();)x = L.value, x.valid && x.toVertex.layer !== b && (E = Eo(x), F = x.portFromColOffset, G = x.portToColOffset, x = x.toVertex.column, r += (Math.abs(n + F - (x + G)) + 1) * E, s += (Math.abs(p + F - (x + G)) + 1) * E, u += (Math.abs(q + F - (x + G)) + 1) * E);
G = F = E = 0;
x = h[e[d].index];
L = k[e[d].index];
-1 !== x && (E += Math.abs(x - n), F += Math.abs(x - p), G += Math.abs(x - q));
-1 !== L && (E += Math.abs(L - n), F += Math.abs(L - p), G += Math.abs(L - q));
if (s < r || s === r && F < E)m = l = !0, e[d].column = p;
if (u < r || u === r && G < E)m = l = !0, e[d].column = q
}
Co(a, b, e);
a.normalize();
return l
}
function ep(a, b, c) {
f && (t.o(b, Ik, "medianStraighten:unfixedLayer"), t.o(c, Ik, "medianStraighten:direction"));
var d = Bo(a, b), e = a.xd[b], g = Ko(a, b, c), h = [];
for (c = 0; c < e; c++)h[c] = g[c];
for (g = !0; g;)for (g = !1, c = 0; c < e; c++) {
var k = d[c].column, l = a.nodeMinColumnSpace(d[c], !0), m = a.nodeMinColumnSpace(d[c], !1), n = 0, p;
-1 === h[c] ? 0 === c && c === e - 1 ? n = k : 0 === c ? (p = d[c + 1].column, n = p - k === m + a.nodeMinColumnSpace(d[c + 1], !0) ? k - 1 : k) : c === e - 1 ? (p = d[c - 1].column, n = k - p === l + a.nodeMinColumnSpace(d[c - 1], !1) ? k + 1 : k) : (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c -
1], !1) + l + 1, p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, n = (l + m) / 2 | 0) : 0 === c && c === e - 1 ? n = h[c] : 0 === c ? (p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, n = Math.min(h[c], m)) : c === e - 1 ? (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c - 1], !1) + l + 1, n = Math.max(h[c], l)) : (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c - 1], !1) + l + 1, p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, l < h[c] && h[c] < m ? n = h[c] : l >= h[c] ? n = l : m <= h[c] && (n = m));
n !== k && (g = !0, d[c].column = n)
}
Co(a, b, d);
a.normalize()
}
function hp(a, b) {
f && (t.o(b, Ik, "packAux:column"), t.o(1, Ik, "packAux:direction"));
for (var c = !0, d = a.network.vertexes.l, e; d.next();) {
e = d.value;
var g = a.nodeMinColumnSpace(e, !0), h = a.nodeMinColumnSpace(e, !1);
if (e.column - g <= b && e.column + h >= b) {
c = !1;
break
}
}
g = !1;
if (c)for (d.reset(); d.next();)e = d.value, e.column > b && (e.column -= 1, g = !0);
return g
}
function ip(a, b) {
f && (t.o(b, Ik, "tightPackAux:column"), t.o(1, Ik, "tightPackAux:direction"));
var c = b, c = b + 1, d, e = [], g = [];
for (d = 0; d <= a.hb; d++)e[d] = !1, g[d] = !1;
for (var h = a.network.vertexes.l; h.next();) {
d = h.value;
var k = d.column - a.nodeMinColumnSpace(d, !0), l = d.column + a.nodeMinColumnSpace(d, !1);
k <= b && l >= b && (e[d.layer] = !0);
k <= c && l >= c && (g[d.layer] = !0)
}
k = !0;
c = !1;
for (d = 0; d <= a.hb; d++)k = k && !(e[d] && g[d]);
if (k)for (h.reset(); h.next();)d = h.value, d.column > b && (d.column -= 1, c = !0);
return c
}
function fp(a, b) {
f && t.o(b, Ik, "componentPack:direction");
for (var c = 0; c <= a.Cb; c++)for (; hp(a, c););
a.normalize();
for (c = 0; c < a.Cb; c++)for (; ip(a, c););
a.normalize();
var d, e, g, h;
if (0 < b)for (c = 0; c <= a.Cb; c++)for (d = Fo(a), e = Io(a), g = e + 1; e < g;)g = e, jp(a, c, 1), h = Io(a), h > e ? Go(a, d) : h < e && (e = h, d = Fo(a));
if (0 > b)for (c = a.Cb; 0 <= c; c--)for (d = Fo(a), e = Io(a), g = e + 1; e < g;)g = e, jp(a, c, -1), h = Io(a), h > e ? Go(a, d) : h < e && (e = h, d = Fo(a));
a.normalize()
}
function jp(a, b, c) {
a.Sf = 0;
for (var d = a.network.vertexes.l, e; d.next();)d.value.component = -1;
if (0 < c)for (d.reset(); d.next();)e = d.value, e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.Sf);
if (0 > c)for (d.reset(); d.next();)e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.Sf);
a.Sf++;
for (d.reset(); d.next();)e = d.value, -1 === e.component && (Mo(a, e, a.Sf, -1, !0, !0), a.Sf++);
b = [];
for (e = 0; e < a.Sf * a.Sf; e++)b[e] = !1;
var g = [];
for (e = 0; e < (a.hb + 1) * (a.Cb + 1); e++)g[e] = -1;
for (d.reset(); d.next();) {
e = d.value;
for (var h = e.layer, k = Math.max(0, e.column - a.nodeMinColumnSpace(e, !0)), l = Math.min(a.Cb, e.column + a.nodeMinColumnSpace(e, !1)); k <= l; k++)g[h * (a.Cb + 1) + k] = e.component
}
for (e = 0; e <= a.hb; e++) {
if (0 < c)for (k = 0; k < a.Cb; k++)-1 !== g[e * (a.Cb + 1) + k] && -1 !== g[e * (a.Cb + 1) + k + 1] && g[e * (a.Cb + 1) + k] !== g[e * (a.Cb + 1) + k + 1] && (b[g[e * (a.Cb + 1) + k] * a.Sf + g[e * (a.Cb + 1) + k + 1]] = !0);
if (0 > c)for (k = a.Cb; 0 < k; k--)-1 !== g[e * (a.Cb + 1) + k] && -1 !== g[e * (a.Cb + 1) + k - 1] && g[e * (a.Cb + 1) + k] !== g[e * (a.Cb + 1) + k - 1] && (b[g[e * (a.Cb + 1) + k] * a.Sf + g[e * (a.Cb + 1) + k - 1]] = !0)
}
g = [];
for (e =
0; e < a.Sf; e++)g[e] = !0;
h = new A("number");
for (h.add(0); 0 !== h.count;)if (l = h.p[h.count - 1], h.ud(h.count - 1), g[l])for (g[l] = !1, e = 0; e < a.Sf; e++)b[l * a.Sf + e] && h.Fd(0, e);
if (0 < c)for (d.reset(); d.next();)e = d.value, g[e.component] && (e.column -= 1);
if (0 > c)for (d.reset(); d.next();)e = d.value, g[e.component] && (e.column += 1)
}
Ik.prototype.commitLayout = function () {
if (this.hl)for (var a = zo(this, !0), b = zo(this, !1), c = this.network.edges.l, d; c.next();)d = c.value.link, null !== d && (d.fb = a, d.gb = b);
this.commitNodes();
this.Gs && this.commitLinks()
};
function zo(a, b) {
return 270 === a.oa ? b ? Qb : Ub : 90 === a.oa ? b ? Ub : Qb : 180 === a.oa ? b ? Sb : Tb : b ? Tb : Sb
}
Ik.prototype.commitNodes = function () {
this.hh = [];
this.vg = [];
this.tf = [];
this.zd = [];
for (var a = 0; a <= this.hb; a++)this.hh[a] = 0, this.vg[a] = 0, this.tf[a] = 0, this.zd[a] = 0;
for (var a = this.network.vertexes.l, b, c; a.next();)b = a.value, c = b.layer, this.hh[c] = Math.max(this.hh[c], this.nodeMinLayerSpace(b, !0)), this.vg[c] = Math.max(this.vg[c], this.nodeMinLayerSpace(b, !1));
b = 0;
for (var d = this.Dn, e = 0; e <= this.hb; e++)c = d, 0 >= this.hh[e] + this.vg[e] && (c = 0), 0 < e && (b += c / 2), 90 === this.oa || 0 === this.oa ? (b += this.vg[e], this.tf[e] = b, b += this.hh[e]) :
(b += this.hh[e], this.tf[e] = b, b += this.vg[e]), e < this.hb && (b += c / 2), this.zd[e] = b;
d = this.rd;
for (e = 0; e <= this.hb; e++)270 === this.oa ? (this.tf[e] = d.y + this.tf[e], this.zd[e] = d.y + this.zd[e]) : 90 === this.oa ? (this.tf[e] = d.y + b - this.tf[e], this.zd[e] = d.y + b - this.zd[e]) : 180 === this.oa ? (this.tf[e] = d.x + this.tf[e], this.zd[e] = d.x + this.zd[e]) : (this.tf[e] = d.x + b - this.tf[e], this.zd[e] = d.x + b - this.zd[e]);
for (a.reset(); a.next();) {
b = a.value;
c = b.layer;
var g = b.column | 0;
270 === this.oa || 90 === this.oa ? (e = d.x + this.wd * g, c = this.tf[c]) : (e = this.tf[c],
c = d.y + this.wd * g);
b.Aa = e;
b.Ma = c;
b.commit()
}
};
Ik.prototype.commitLinks = function () {
for (var a = this.network.edges.l, b, c; a.next();)c = a.value.link, "undefined" !== typeof c && null !== c && (c.il(), c.po(), c.ri());
for (a.reset(); a.next();)c = a.value.link, "undefined" !== typeof c && null !== c && c.updateRoute();
for (a.reset(); a.next();)if (b = a.value, c = b.link) {
c.il();
var d = c, e = d.ca, g = d.ga, h = d.Vc, k = d.Qd;
if (b.valid) {
if (c.ye === Jg && 4 === c.ka) {
if (b.rev)var l = e, e = g, g = l, m = h, h = k, k = m;
if (b.fromVertex.column === b.toVertex.column) {
var n = c.getLinkPoint(e, h, c.computeSpot(!0), !0, !1, g, k),
p = c.getLinkPoint(g, k, c.computeSpot(!1), !1, !1, e, h);
c.po();
c.Lk(n.x, n.y);
c.Lk((2 * n.x + p.x) / 3, (2 * n.y + p.y) / 3);
c.Lk((n.x + 2 * p.x) / 3, (n.y + 2 * p.y) / 3);
c.Lk(p.x, p.y)
} else {
var q = !1, r = !1;
null !== h && c.computeSpot(!0) === wb && (q = !0);
null !== k && c.computeSpot(!1) === wb && (r = !0);
if (q || r) {
var s = c.n(0).x, u = c.n(0).y, x = c.n(1).x, E = c.n(1).y, F = c.n(2).x, G = c.n(2).y, L = c.n(3).x, N = c.n(3).y;
if (q) {
90 === this.oa || 270 === this.oa ? (x = s, E = (u + N) / 2) : (x = (s + L) / 2, E = u);
c.U(1, x, E);
var V = c.getLinkPoint(e, h, c.computeSpot(!0), !0, !1, g, k);
c.U(0, V.x, V.y)
}
r &&
(90 === this.oa || 270 === this.oa ? (F = L, G = (u + N) / 2) : (F = (s + L) / 2, G = N), c.U(2, F, G), V = c.getLinkPoint(g, k, c.computeSpot(!1), !1, !1, e, h), c.U(3, V.x, V.y))
}
}
}
c.ri()
} else if (b.fromVertex.layer === b.toVertex.layer)c.ri(); else {
var T = !1, W = !1, ea, R = c.vs + 1;
if (c.Ub)W = !0, ea = c.ka, 4 < ea && c.points.removeRange(2, ea - 3); else if (c.ye === Jg)T = !0, ea = c.ka, 4 < ea && c.points.removeRange(2, ea - 3), R = 2; else {
ea = c.ka;
var wa = c.computeSpot(!0) === wb, Ja = c.computeSpot(!1) === wb;
2 < ea && wa && Ja ? c.points.removeRange(1, ea - 2) : 3 < ea && wa && !Ja ? c.points.removeRange(1,
ea - 3) : 3 < ea && !wa && Ja ? c.points.removeRange(2, ea - 2) : 4 < ea && !wa && !Ja && c.points.removeRange(2, ea - 3)
}
var Ma = b.fromVertex, Na = b.toVertex, xa, Ra;
if (b.rev) {
for (var Ba; null !== Na && Ma !== Na;) {
Ra = xa = null;
for (var ob = Na.bc.l; ob.next() && (ic = ob.value, ic.link !== b.link || (xa = ic.fromVertex, Ra = ic.toVertex, null !== xa.dd)););
xa !== Ma && (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = xa.Aa, Ka = xa.Ma, W ? 180 === this.oa || 0 === this.oa ? 2 === R ? (c.C(R++, hb, ib), c.C(R++, hb, Ka)) : (Hf = null !== Ra ? Ra.Ma : ib, Hf !== Ka && (bb = this.zd[xa.layer - 1], c.C(R++, bb, ib), c.C(R++, bb,
Ka))) : 2 === R ? (c.C(R++, hb, ib), c.C(R++, Ga, ib)) : (dd = null !== Ra ? Ra.Aa : hb, dd !== Ga && (bb = this.zd[xa.layer - 1], c.C(R++, hb, bb), c.C(R++, Ga, bb))) : 2 === R ? T ? (tb = Math.max(10, this.hh[Na.layer]), Ya = Math.max(10, this.vg[Na.layer]), 180 === this.oa ? (Ba = Na.Q.x, c.C(R++, Ba - tb, Ka), c.C(R++, Ba, Ka), c.C(R++, Ba + Ya, Ka)) : 90 === this.oa ? (Ba = Na.Q.y + Na.Q.height, c.C(R++, Ga, Ba + Ya), c.C(R++, Ga, Ba), c.C(R++, Ga, Ba - tb)) : 270 === this.oa ? (Ba = Na.Q.y, c.C(R++, Ga, Ba - tb), c.C(R++, Ga, Ba), c.C(R++, Ga, Ba + Ya)) : (Ba = Na.Q.x + Na.Q.width, c.C(R++, Ba + Ya, Ka), c.C(R++, Ba,
Ka), c.C(R++, Ba - tb, Ka))) : (c.C(R++, hb, ib), 180 === this.oa || 0 === this.oa ? c.C(R++, hb, Ka) : c.C(R++, Ga, ib), c.C(R++, Ga, Ka)) : (tb = Math.max(10, this.hh[xa.layer]), Ya = Math.max(10, this.vg[xa.layer]), 180 === this.oa ? (T && c.C(R++, Ga - tb, Ka), c.C(R++, Ga, Ka), T && c.C(R++, Ga + Ya, Ka)) : 90 === this.oa ? (T && c.C(R++, Ga, Ka + Ya), c.C(R++, Ga, Ka), T && c.C(R++, Ga, Ka - tb)) : 270 === this.oa ? (T && c.C(R++, Ga, Ka - tb), c.C(R++, Ga, Ka), T && c.C(R++, Ga, Ka + Ya)) : (T && c.C(R++, Ga + Ya, Ka), c.C(R++, Ga, Ka), T && c.C(R++, Ga - tb, Ka))));
Na = xa
}
if (null === k || c.computeSpot(!1) !== wb)if (hb =
c.n(R - 1).x, ib = c.n(R - 1).y, Ga = c.n(R).x, Ka = c.n(R).y, W) {
var jf = this.vg[Ma.layer], hc;
180 === this.oa || 0 === this.oa ? (hc = ib, hc >= Ma.Q.y && hc <= Ma.Q.bottom && (Ba = Ma.Aa + jf, hc = hc < Ma.Q.y + Ma.Q.height / 2 ? Ma.Q.y - this.wd / 2 : Ma.Q.bottom + this.wd / 2, c.C(R++, Ba, ib), c.C(R++, Ba, hc)), c.C(R++, Ga, hc)) : (hc = hb, hc >= Ma.Q.x && hc <= Ma.Q.right && (Ba = Ma.Ma + jf, hc = hc < Ma.Q.x + Ma.Q.width / 2 ? Ma.Q.x - this.wd / 2 : Ma.Q.right + this.wd / 2, c.C(R++, hb, Ba), c.C(R++, hc, Ba)), c.C(R++, hc, Ka));
c.C(R++, Ga, Ka)
} else T ? (tb = Math.max(10, this.hh[Ma.layer]), Ya = Math.max(10, this.vg[Ma.layer]),
180 === this.oa ? (Ba = Ma.Q.x + Ma.Q.width, c.U(R - 2, Ba, ib), c.U(R - 1, Ba + Ya, ib)) : 90 === this.oa ? (Ba = Ma.Q.y, c.U(R - 2, hb, Ba), c.U(R - 1, hb, Ba - tb)) : 270 === this.oa ? (Ba = Ma.Q.y + Ma.Q.height, c.U(R - 2, hb, Ba), c.U(R - 1, hb, Ba + Ya)) : (Ba = Ma.Q.x, c.U(R - 2, Ba, ib), c.U(R - 1, Ba - tb, ib))) : (180 === this.oa || 0 === this.oa ? c.C(R++, Ga, ib) : c.C(R++, hb, Ka), c.C(R++, Ga, Ka))
} else {
for (; null !== Ma && Ma !== Na;) {
Ra = xa = null;
for (var kf = Ma.Sb.l, ic; kf.next() && (ic = kf.value, ic.link !== b.link || (xa = ic.toVertex, Ra = ic.fromVertex, null !== Ra.dd && (Ra = null), null !== xa.dd)););
var hb,
ib, Ga, Ka, bb, tb, Ya;
if (xa !== Na)if (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = xa.Aa, Ka = xa.Ma, W)if (180 === this.oa || 0 === this.oa) {
var Hf = null !== Ra ? Ra.Ma : ib;
Hf !== Ka && (bb = this.zd[xa.layer], 2 === R && (bb = 0 === this.oa ? Math.max(bb, hb) : Math.min(bb, hb)), c.C(R++, bb, ib), c.C(R++, bb, Ka))
} else {
var dd = null !== Ra ? Ra.Aa : hb;
dd !== Ga && (bb = this.zd[xa.layer], 2 === R && (bb = 90 === this.oa ? Math.max(bb, ib) : Math.min(bb, ib)), c.C(R++, hb, bb), c.C(R++, Ga, bb))
} else tb = Math.max(10, this.hh[xa.layer]), Ya = Math.max(10, this.vg[xa.layer]), 180 === this.oa ? (c.C(R++,
Ga + Ya, Ka), T && c.C(R++, Ga, Ka), c.C(R++, Ga - tb, Ka)) : 90 === this.oa ? (c.C(R++, Ga, Ka - tb), T && c.C(R++, Ga, Ka), c.C(R++, Ga, Ka + Ya)) : 270 === this.oa ? (c.C(R++, Ga, Ka + Ya), T && c.C(R++, Ga, Ka), c.C(R++, Ga, Ka - tb)) : (c.C(R++, Ga - tb, Ka), T && c.C(R++, Ga, Ka), c.C(R++, Ga + Ya, Ka));
Ma = xa
}
W && (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = c.n(R).x, Ka = c.n(R).y, 180 === this.oa || 0 === this.oa ? ib !== Ka && (bb = 0 === this.oa ? Math.min(Math.max((Ga + hb) / 2, this.zd[Na.layer]), Ga) : Math.max(Math.min((Ga + hb) / 2, this.zd[Na.layer]), Ga), c.C(R++, bb, ib), c.C(R++, bb, Ka)) : hb !== Ga && (bb =
90 === this.oa ? Math.min(Math.max((Ka + ib) / 2, this.zd[Na.layer]), Ka) : Math.max(Math.min((Ka + ib) / 2, this.zd[Na.layer]), Ka), c.C(R++, hb, bb), c.C(R++, Ga, bb)))
}
if (null !== d && T) {
if (null !== h) {
if (c.computeSpot(!0).hd()) {
var vd = c.n(0), Ed = c.n(2);
vd.K(Ed) || c.U(1, (vd.x + Ed.x) / 2, (vd.y + Ed.y) / 2)
}
V = c.getLinkPoint(e, h, wb, !0, !1, g, k);
c.U(0, V.x, V.y)
}
null !== k && (c.computeSpot(!1).hd() && (vd = c.n(c.ka - 1), Ed = c.n(c.ka - 3), vd.K(Ed) || c.U(c.ka - 2, (vd.x + Ed.x) / 2, (vd.y + Ed.y) / 2)), V = c.getLinkPoint(g, k, wb, !1, !1, e, h), c.U(c.ka - 1, V.x, V.y))
}
c.ri();
b.commit()
}
}
for (var Ud = new A(X), wd = this.network.edges.l, Vd; wd.next();)Vd = wd.value.link, null !== Vd && Vd.Ub && !Ud.contains(Vd) && Ud.add(Vd);
if (0 < Ud.count)if (90 === this.oa || 270 === this.oa) {
for (var Cg = 0, Cb = new A(kp), lf = Ud.l, Ib, dc, Lb; lf.next();)if (Ib = lf.value, null !== Ib && Ib.Ub)for (var Sa = 2; Sa < Ib.ka - 3; Sa++)if (dc = Ib.n(Sa), Lb = Ib.n(Sa + 1), this.I(dc.y, Lb.y) && !this.I(dc.x, Lb.x)) {
var jc = new kp;
jc.layer = Math.floor(dc.y / 2);
var Ie = Ib.n(0), If = Ib.n(Ib.ka - 1);
jc.Ya = Ie.x * Ie.x + Ie.y;
jc.Ld = If.x * If.x + If.y;
jc.we = Math.min(dc.x, Lb.x);
jc.Ed = Math.max(dc.x, Lb.x);
jc.index = Sa;
jc.link = Ib;
if (Sa + 2 < Ib.ka) {
var dg = Ib.n(Sa - 1), Fb = Ib.n(Sa + 2), ed = 0;
dg.y < dc.y ? ed = Fb.y < dc.y ? 3 : dc.x < Lb.x ? 2 : 1 : dg.y > dc.y && (ed = Fb.y > dc.y ? 0 : Lb.x < dc.x ? 2 : 1);
jc.Eh = ed
}
Cb.add(jc)
}
if (1 < Cb.count) {
Cb.sort(this.XE);
for (var qc = 0; qc < Cb.count;) {
for (var fd = Cb.p[qc].layer, Za = qc + 1; Za < Cb.count && Cb.p[Za].layer === fd;)Za++;
if (1 < Za - qc)for (var fb = qc; fb < Za;) {
for (var Xb = Cb.p[fb].Ed, ub = qc + 1; ub < Za && Cb.p[ub].we < Xb;)Xb = Math.max(Xb, Cb.p[ub].Ed), ub++;
var kc = ub - fb;
if (1 < kc) {
Cb.sp(this.sw, fb, fb + kc);
for (var mf =
1, rc = Cb.p[fb].Ld, zb, Sa = fb; Sa < ub; Sa++)zb = Cb.p[Sa], zb.Ld !== rc && (mf++, rc = zb.Ld);
Cb.sp(this.WE, fb, fb + kc);
for (var Wd = 1, rc = Cb.p[fb].Ya, Sa = fb; Sa < ub; Sa++)zb = Cb.p[Sa], zb.Ya !== rc && (Wd++, rc = zb.Ya);
var Je, Ab;
mf < Wd ? (Je = !1, Ab = mf, rc = Cb.p[fb].Ld, Cb.sp(this.sw, fb, fb + kc)) : (Je = !0, Ab = Wd, rc = Cb.p[fb].Ya);
for (var Fd = 0, Sa = fb; Sa < ub; Sa++) {
zb = Cb.p[Sa];
(Je ? zb.Ya : zb.Ld) !== rc && (Fd++, rc = Je ? zb.Ya : zb.Ld);
Ib = zb.link;
dc = Ib.n(zb.index);
Lb = Ib.n(zb.index + 1);
var Ke = this.Vo * (Fd - (Ab - 1) / 2);
if (!Ib.Bi || lp(dc.x, dc.y + Ke, Lb.x, Lb.y + Ke))Cg++, Ib.il(),
Ib.U(zb.index, dc.x, dc.y + Ke), Ib.U(zb.index + 1, Lb.x, Lb.y + Ke), Ib.ri()
}
}
fb = ub
}
qc = Za
}
}
} else {
for (var me = 0, gb = new A(kp), nf = Ud.l, Bb, $a, Oc; nf.next();)if (Bb = nf.value, null !== Bb && Bb.Ub)for (var Mb = 2; Mb < Bb.ka - 3; Mb++)if ($a = Bb.n(Mb), Oc = Bb.n(Mb + 1), this.I($a.x, Oc.x) && !this.I($a.y, Oc.y)) {
var Gd = new kp;
Gd.layer = Math.floor($a.x / 2);
var Xd = Bb.n(0), Yd = Bb.n(Bb.ka - 1);
Gd.Ya = Xd.x + Xd.y * Xd.y;
Gd.Ld = Yd.x + Yd.y * Yd.y;
Gd.we = Math.min($a.y, Oc.y);
Gd.Ed = Math.max($a.y, Oc.y);
Gd.index = Mb;
Gd.link = Bb;
if (Mb + 2 < Bb.ka) {
var ne = Bb.n(Mb - 1), Pc = Bb.n(Mb +
2), xd = 0;
ne.x < $a.x ? xd = Pc.x < $a.x ? 3 : $a.y < Oc.y ? 2 : 1 : ne.x > $a.x && (xd = Pc.x > $a.x ? 0 : Oc.y < $a.y ? 2 : 1);
Gd.Eh = xd
}
gb.add(Gd)
}
if (1 < gb.count) {
gb.sort(this.XE);
for (var jb = 0; jb < gb.count;) {
for (var Le = gb.p[jb].layer, Me = jb + 1; Me < gb.count && gb.p[Me].layer === Le;)Me++;
if (1 < Me - jb)for (var mb = jb; mb < Me;) {
for (var oe = gb.p[mb].Ed, Db = jb + 1; Db < Me && gb.p[Db].we < oe;)oe = Math.max(oe, gb.p[Db].Ed), Db++;
var lc = Db - mb;
if (1 < lc) {
gb.sp(this.sw, mb, mb + lc);
for (var yd = 1, sc = gb.p[mb].Ld, Nb, Mb = mb; Mb < Db; Mb++)Nb = gb.p[Mb], Nb.Ld !== sc && (yd++, sc = Nb.Ld);
gb.sp(this.WE,
mb, mb + lc);
for (var Ne = 1, sc = gb.p[mb].Ya, Mb = mb; Mb < Db; Mb++)Nb = gb.p[Mb], Nb.Ya !== sc && (Ne++, sc = Nb.Ya);
var kb, cb;
yd < Ne ? (kb = !1, cb = yd, sc = gb.p[mb].Ld, gb.sp(this.sw, mb, mb + lc)) : (kb = !0, cb = Ne, sc = gb.p[mb].Ya);
for (var Jf = 0, Mb = mb; Mb < Db; Mb++) {
Nb = gb.p[Mb];
(kb ? Nb.Ya : Nb.Ld) !== sc && (Jf++, sc = kb ? Nb.Ya : Nb.Ld);
Bb = Nb.link;
$a = Bb.n(Nb.index);
Oc = Bb.n(Nb.index + 1);
var Dc = this.Vo * (Jf - (cb - 1) / 2);
if (!Bb.Bi || lp($a.x + Dc, $a.y, Oc.x + Dc, Oc.y))me++, Bb.il(), Bb.U(Nb.index, $a.x + Dc, $a.y), Bb.U(Nb.index + 1, Oc.x + Dc, Oc.y), Bb.ri()
}
}
mb = Db
}
jb = Me
}
}
}
};
function kp() {
this.index = this.Ed = this.we = this.Ld = this.Ya = this.layer = 0;
this.link = null;
this.Eh = 0
}
t.ce(kp, {layer: !0, Ya: !0, Ld: !0, we: !0, Ed: !0, index: !0, link: !0, Eh: !0});
Ik.prototype.XE = function (a, b) {
return a instanceof kp && b instanceof kp && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.we < b.we ? -1 : a.we > b.we ? 1 : a.Ed < b.Ed ? -1 : a.Ed > b.Ed ? 1 : 0 : 0
};
Ik.prototype.WE = function (a, b) {
return a instanceof kp && b instanceof kp && a !== b ? a.Ya < b.Ya ? -1 : a.Ya > b.Ya || a.Eh < b.Eh ? 1 : a.Eh > b.Eh || a.we < b.we ? -1 : a.we > b.we ? 1 : a.Ed < b.Ed ? -1 : a.Ed > b.Ed ? 1 : 0 : 0
};
Ik.prototype.sw = function (a, b) {
return a instanceof kp && b instanceof kp && a !== b ? a.Ld < b.Ld ? -1 : a.Ld > b.Ld || a.Eh < b.Eh ? 1 : a.Eh > b.Eh || a.we < b.we ? -1 : a.we > b.we ? 1 : a.Ed < b.Ed ? -1 : a.Ed > b.Ed ? 1 : 0 : 0
};
Ik.prototype.I = function (a, b) {
f && (t.o(a, Ik, "isApprox:a"), t.o(b, Ik, "isApprox:b"));
var c = a - b;
return-1 < c && 1 > c
};
function lp(a, b, c, d) {
f && (t.o(a, Ik, "isUnoccupied2:px"), t.o(b, Ik, "isUnoccupied2:py"), t.o(c, Ik, "isUnoccupied2:qx"), t.o(d, Ik, "isUnoccupied2:qy"));
return!0
}
function Bo(a, b) {
var c, d = a.xd[b];
if (d >= a.xg.length) {
c = [];
var e;
for (e = 0; e < a.xg.length; e++)c[e] = a.xg[e];
a.xg = c
}
"undefined" === typeof a.xg[d] || null === a.xg[d] ? c = [] : (c = a.xg[d], a.xg[d] = null);
var d = a.er[b], g;
for (e = 0; e < d.length; e++)g = d[e], g instanceof mp && (c[g.index] = g);
return c
}
function Co(a, b, c) {
a.xg[a.xd[b]] = c
}
t.g(Ik, "layerSpacing", Ik.prototype.layerSpacing);
t.defineProperty(Ik, {layerSpacing: "layerSpacing"}, function () {
return this.Dn
}, function (a) {
this.Dn !== a && "number" === typeof a && 0 <= a && (this.Dn = a, this.J())
});
t.g(Ik, "columnSpacing", Ik.prototype.WG);
t.defineProperty(Ik, {WG: "columnSpacing"}, function () {
return this.wd
}, function (a) {
this.wd !== a && "number" === typeof a && 0 <= a && (this.wd = a, this.J())
});
t.g(Ik, "direction", Ik.prototype.direction);
t.defineProperty(Ik, {direction: "direction"}, function () {
return this.oa
}, function (a) {
this.oa !== a && "number" === typeof a && (this.oa = a, this.J())
});
t.g(Ik, "cycleRemoveOption", Ik.prototype.bD);
t.defineProperty(Ik, {bD: "cycleRemoveOption"}, function () {
return this.an
}, function (a) {
this.an !== a && (f && t.j(a, ca, eo, "cycleRemoveOption"), a === fo || a === Zn) && (this.an = a, this.J())
});
t.g(Ik, "layeringOption", Ik.prototype.dE);
t.defineProperty(Ik, {dE: "layeringOption"}, function () {
return this.En
}, function (a) {
this.En !== a && (f && t.j(a, ca, eo, "layeringOption"), a === $n || a === No || a === Po) && (this.En = a, this.J())
});
t.g(Ik, "initializeOption", Ik.prototype.UD);
t.defineProperty(Ik, {UD: "initializeOption"}, function () {
return this.un
}, function (a) {
this.un !== a && (f && t.j(a, ca, eo, "initializeOption"), a === ao || a === Vo || a === To) && (this.un = a, this.J())
});
t.g(Ik, "iterations", Ik.prototype.VH);
t.defineProperty(Ik, {VH: "iterations"}, function () {
return this.Il
}, function (a) {
f && t.o(a, eo, "iterations");
this.Il !== a && "number" === typeof a && 0 <= a && (this.Il = a, this.J())
});
t.g(Ik, "aggressiveOption", Ik.prototype.FC);
t.defineProperty(Ik, {FC: "aggressiveOption"}, function () {
return this.Um
}, function (a) {
this.Um !== a && (f && t.j(a, ca, eo, "cycleRemoveOption"), a === Zo || a === bo || a === $o) && (this.Um = a, this.J())
});
t.g(Ik, "packOption", Ik.prototype.pI);
t.defineProperty(Ik, {pI: "packOption"}, function () {
return this.ci
}, function (a) {
this.ci !== a && "number" === typeof a && 0 <= a && 8 > a && (this.ci = a, this.J())
});
t.g(Ik, "setsPortSpots", Ik.prototype.hl);
t.defineProperty(Ik, {hl: "setsPortSpots"}, function () {
return this.kh
}, function (a) {
this.kh !== a && "boolean" === typeof a && (this.kh = a, this.J())
});
t.g(Ik, "linkSpacing", Ik.prototype.Vo);
t.defineProperty(Ik, {Vo: "linkSpacing"}, function () {
return this.gj
}, function (a) {
this.gj !== a && (this.gj = a, this.J())
});
t.A(Ik, {lJ: "maxLayer"}, function () {
return this.hb
});
t.A(Ik, {jJ: "maxIndex"}, function () {
return this.nu
});
t.A(Ik, {iJ: "maxColumn"}, function () {
return this.Cb
});
t.A(Ik, {mJ: "minIndexLayer"}, function () {
return this.Yq
});
t.A(Ik, {kJ: "maxIndexLayer"}, function () {
return this.vf
});
var Zn;
Ik.CycleDepthFirst = Zn = t.w(Ik, "CycleDepthFirst", 0);
var fo;
Ik.CycleGreedy = fo = t.w(Ik, "CycleGreedy", 1);
var $n;
Ik.LayerOptimalLinkLength = $n = t.w(Ik, "LayerOptimalLinkLength", 0);
var No;
Ik.LayerLongestPathSink = No = t.w(Ik, "LayerLongestPathSink", 1);
var Po;
Ik.LayerLongestPathSource = Po = t.w(Ik, "LayerLongestPathSource", 2);
var ao;
Ik.InitDepthFirstOut = ao = t.w(Ik, "InitDepthFirstOut", 0);
var Vo;
Ik.InitDepthFirstIn = Vo = t.w(Ik, "InitDepthFirstIn", 1);
var To;
Ik.InitNaive = To = t.w(Ik, "InitNaive", 2);
var Zo;
Ik.AggressiveNone = Zo = t.w(Ik, "AggressiveNone", 0);
var bo;
Ik.AggressiveLess = bo = t.w(Ik, "AggressiveLess", 1);
var $o;
Ik.AggressiveMore = $o = t.w(Ik, "AggressiveMore", 2);
Ik.PackNone = 0;
var ap;
Ik.PackExpand = ap = 1;
var bp;
Ik.PackStraighten = bp = 2;
var dp;
Ik.PackMedian = dp = 4;
var co;
Ik.PackAll = co = 7;
function eo() {
ra.call(this)
}
t.ea("LayeredDigraphNetwork", eo);
t.Ja(eo, ra);
eo.prototype.createVertex = function () {
return new mp
};
eo.prototype.createEdge = function () {
return new np
};
function mp() {
sa.call(this);
this.index = this.column = this.layer = -1;
this.component = NaN;
this.near = null;
this.valid = !1;
this.finish = this.vo = NaN;
this.hm = 0;
this.gA = this.hA = void 0
}
t.ea("LayeredDigraphVertex", mp);
t.Ja(mp, sa);
function np() {
ta.call(this);
this.forest = this.rev = this.valid = !1;
this.portToPos = this.portFromPos = NaN;
this.portToColOffset = this.portFromColOffset = 0
}
t.ea("LayeredDigraphEdge", np);
t.Ja(np, ta);
function Z() {
0 < arguments.length && t.m("TreeLayout constructor cannot take any arguments.");
fe.call(this);
this.Gc = new ka(Object);
this.ei = op;
this.sf = pp;
this.Wr = qp;
this.Tg = !0;
this.ad = rp;
this.Kf = (new da(10, 10)).freeze();
this.qa = new sp;
this.pa = new sp
}
t.ea("TreeLayout", Z);
t.Ja(Z, fe);
Z.prototype.cloneProtected = function (a) {
fe.prototype.cloneProtected.call(this, a);
a.ei = this.ei;
a.Wr = this.Wr;
a.Tg = this.Tg;
a.ad = this.ad;
a.Kf.assign(this.Kf);
a.qa.copyInheritedPropertiesFrom(this.qa);
a.pa.copyInheritedPropertiesFrom(this.pa)
};
Z.prototype.createNetwork = function () {
var a = new tp;
nn(a, this);
return a
};
Z.prototype.makeNetwork = function (a) {
var b = this.createNetwork();
a instanceof z ? (up(this, b, a.Ji, !0), up(this, b, a.links, !0)) : a instanceof U ? up(this, b, a.Lc, !1) : up(this, b, a.l, !1);
return b
};
function up(a, b, c, d) {
for (c = c.l; c.next();) {
var e = c.value;
e instanceof S && e.canLayout() && "Comment" !== e.Ic && (!d || e.Oo) && (e.vh || (e instanceof U && null === e.Vb ? up(a, b, e.Lc, !1) : b.co(e)))
}
for (c.reset(); c.next();)if (e = c.value, e instanceof X && e.canLayout() && "Comment" !== e.Ic && (!d || e.Oo)) {
var g = e.ca;
a = e.ga;
null !== g && null !== a && g !== a && "Comment" !== g.Ic && "Comment" !== a.Ic && (g = b.Lv(g), a = b.Lv(a), null !== g && null !== a && b.Cm(g, a, e))
}
}
Z.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
null === this.network && (this.network = this.makeNetwork(a));
this.Je !== vp && (this.rd = this.Pz(this.rd));
var b = this.h;
null === b && a instanceof z && (b = a);
this.sf = this.path === op && null !== b ? b.Xc ? pp : wp : this.path === op ? pp : this.path;
if (0 < this.network.vertexes.count) {
this.network.Gv();
for (b = this.network.vertexes.l; b.next();)a = b.value, a.initialized = !1, a.level = 0, a.parent = null,
a.children = [];
if (0 < this.Gc.count)for (b = this.Gc.l, this.Gc = new ka(sp); b.next();)a = b.value, a instanceof S ? (a = this.network.vm(a), null !== a && this.Gc.add(a)) : a instanceof sp && this.Gc.add(a);
if (0 === this.Gc.count) {
for (a = this.network.vertexes.l; a.next();)switch (b = a.value, this.sf) {
case pp:
0 === b.bc.count && this.Gc.add(b);
break;
case wp:
0 === b.Sb.count && this.Gc.add(b);
break;
default:
t.m("Unhandled path value " + this.sf.toString())
}
if (0 === this.Gc.count) {
a = 999999;
for (var b = null, c = this.network.vertexes.l; c.next();) {
var d =
c.value;
switch (this.sf) {
case pp:
d.bc.count < a && (a = d.bc.count, b = d);
break;
case wp:
d.Sb.count < a && (a = d.Sb.count, b = d);
break;
default:
t.m("Unhandled path value " + this.sf.toString())
}
}
null !== b && this.Gc.add(b)
}
}
for (b = this.Gc.l; b.next();)a = b.value, a.initialized || (a.initialized = !0, xp(this, a));
for (a = this.Gc.l; a.next();)yp(this, a.value);
for (a = this.Gc.l; a.next();)zp(this, a.value);
for (a = this.Gc.l; a.next();)Ap(this, a.value);
this.mz();
for (a = this.Gc.l; a.next();)Bp(this, a.value);
this.arrangeTrees();
this.updateParts()
}
this.network =
null;
this.Gc = new ka(Object);
this.hf = !0
};
function xp(a, b) {
f && t.j(b, sp, Z, "walkTree:v");
if (null !== b) {
switch (a.sf) {
case pp:
if (0 < b.Sb.count) {
for (var c = new A(sp), d = b.mH; d.next();) {
var e = d.value;
Cp(a, b, e) && c.add(e)
}
0 < c.count && (b.children = c.Ve())
}
break;
case wp:
if (0 < b.bc.count) {
c = new A(sp);
for (d = b.BI; d.next();)e = d.value, Cp(a, b, e) && c.add(e);
0 < c.count && (b.children = c.Ve())
}
break;
default:
t.m("Unhandled path value" + a.sf.toString())
}
for (var c = b.children, d = c.length, g = 0; g < d; g++)e = c[g], e.initialized = !0, e.level = b.level + 1, e.parent = b, a.Gc.remove(e);
for (g = 0; g <
d; g++)e = c[g], xp(a, e)
}
}
function Cp(a, b, c) {
f && t.j(b, sp, Z, "walkOK:v");
f && t.j(c, sp, Z, "walkOK:c");
if (c.initialized) {
var d;
f && t.j(c, sp, Z, "isAncestor:a");
f && t.j(b, sp, Z, "isAncestor:b");
if (null === b)d = !1; else {
for (d = b.parent; null !== d && d !== c;)d = d.parent;
d = d === c
}
if (d || c.level > b.level)return!1;
a.removeChild(c.parent, c)
}
return!0
}
Z.prototype.removeChild = function (a, b) {
f && t.j(a, sp, Z, "removeChild:p");
f && t.j(b, sp, Z, "removeChild:c");
if (null !== a && null !== b) {
for (var c = a.children, d = 0, e = 0; e < c.length; e++)c[e] === b && d++;
if (0 < d) {
for (var d = Array(c.length - d), g = 0, e = 0; e < c.length; e++)c[e] !== b && (d[g++] = c[e]);
a.children = d
}
}
};
function yp(a, b) {
f && t.j(b, sp, Z, "initializeTree:v");
if (null !== b) {
a.initializeTreeVertexValues(b);
b.alignment === Dp && a.sortTreeVertexChildren(b);
for (var c = 0, d = b.lm, e = 0, g = b.children, h = g.length, k = 0; k < h; k++) {
var l = g[k];
yp(a, l);
c += l.descendantCount + 1;
d = Math.max(d, l.maxChildrenCount);
e = Math.max(e, l.maxGenerationCount)
}
b.descendantCount = c;
b.maxChildrenCount = d;
b.maxGenerationCount = 0 < d ? e + 1 : 0
}
}
function Ep(a, b) {
f && t.j(b, sp, Z, "mom:v");
switch (a.Wr) {
default:
case qp:
return null !== b.parent ? b.parent : a.qa;
case Fp:
return null === b.parent ? a.qa : null === b.parent.parent ? a.pa : b.parent;
case Gp:
if (null !== b.parent)return null !== b.parent.parent ? b.parent.parent : a.pa;
case Hp:
var c = !0;
if (0 === b.lm)c = !1; else for (var d = b.children, e = d.length, g = 0; g < e; g++)if (0 < d[g].lm) {
c = !1;
break
}
return c && null !== b.parent ? a.pa : null !== b.parent ? b.parent : a.qa
}
}
Z.prototype.initializeTreeVertexValues = function (a) {
f && t.j(a, sp, Z, "initializeTreeVertexValues:v");
var b = Ep(this, a);
a.copyInheritedPropertiesFrom(b);
if (null !== a.parent && a.parent.alignment === Dp) {
for (var b = a.angle, c = a.parent.children, d = 0; d < c.length && a !== c[d];)d++;
0 === d % 2 ? d !== c.length - 1 && (b = 90 === b ? 180 : 180 === b ? 270 : 270 === b ? 180 : 270) : b = 90 === b ? 0 : 180 === b ? 90 : 270 === b ? 0 : 90;
a.angle = b
}
a.initialized = !0
};
function zp(a, b) {
f && t.j(b, sp, Z, "assignTree:v");
if (null !== b) {
a.assignTreeVertexValues(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)zp(a, c[e])
}
}
Z.prototype.assignTreeVertexValues = function () {
};
function Ap(a, b) {
f && t.j(b, sp, Z, "sortTree:v");
if (null !== b) {
b.alignment !== Dp && a.sortTreeVertexChildren(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)Ap(a, c[e])
}
}
Z.prototype.sortTreeVertexChildren = function (a) {
f && t.j(a, sp, Z, "sortTreeVertexChildren:v");
switch (a.sorting) {
case Ip:
break;
case Jp:
a.children.reverse();
break;
case Kp:
a.children.sort(a.comparer);
break;
case Lp:
a.children.sort(a.comparer);
a.children.reverse();
break;
default:
t.m("Unhandled sorting value " + a.sorting.toString())
}
};
Z.prototype.mz = function () {
if (this.comments)for (var a = this.network.vertexes.l; a.next();)this.addComments(a.value)
};
Z.prototype.addComments = function (a) {
f && t.j(a, sp, Z, "addComments:v");
var b = a.angle, c = a.parent, d = 0, e = Mp, e = !1;
null !== c && (d = c.angle, e = c.alignment, e = Np(e));
var b = 90 === b || 270 === b, d = 90 === d || 270 === d, c = 0 === a.lm, g = 0, h = 0, k = 0, l = a.commentSpacing;
if (null !== a.Bc)for (var m = a.Bc.sD(); m.next();) {
var n = m.value;
"Comment" === n.Ic && n.ub() && (null === a.comments && (a.comments = []), a.comments.push(n), n.zf(), n = n.Ba, b && !c || !e && !d && c || e && d && c ? (g = Math.max(g, n.width), h += n.height + Math.abs(k)) : (g += n.width + Math.abs(k), h = Math.max(h, n.height)),
k = l)
}
null !== a.comments && (b && !c || !e && !d && c || e && d && c ? (g += Math.abs(a.commentMargin), h = Math.max(0, h - a.height)) : (h += Math.abs(a.commentMargin), g = Math.max(0, g - a.width)), e = t.Zj(0, 0, a.Q.width + g, a.Q.height + h), a.Hb = e, t.Jc(e))
};
function Np(a) {
return a === Op || a === Dp || a === Pp || a === Qp
}
function Rp(a) {
return a === Op || a === Dp
}
function Sp(a) {
f && t.j(a, sp, Z, "isLeftSideBus:v");
var b = a.parent;
if (null !== b) {
var c = b.alignment;
if (Np(c)) {
if (Rp(c)) {
b = b.children;
for (c = 0; c < b.length && a !== b[c];)c++;
return 0 === c % 2
}
if (c === Pp)return!0
}
}
return!1
}
Z.prototype.layoutComments = function (a) {
f && t.j(a, sp, Z, "layoutComments:v");
if (null !== a.comments) {
var b = a.Bc.Ba, c = a.parent, d = a.angle, e = 0, g = Mp, g = !1;
null !== c && (e = c.angle, g = c.alignment, g = Np(g));
for (var d = 90 === d || 270 === d, h = 90 === e || 270 === e, k = 0 === a.lm, l = Sp(a), m = 0, n = a.comments, p = n.length, q = t.M(), r = 0; r < p; r++) {
var c = n[r], s = c.Ba;
if (d && !k || !g && !h && k || g && h && k) {
if (135 < e && !g || h && l)if (0 <= a.commentMargin) {
q.q(a.Q.x - a.commentMargin - s.width, a.Q.y + m);
c.location = q;
for (var u = c.Zf(); u.next();)c = u.value, c.fb = Sb, c.gb = Tb
} else for (q.q(a.Q.x +
2 * a.N.x - a.commentMargin, a.Q.y + m), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Tb, c.gb = Sb; else if (0 <= a.commentMargin)for (q.q(a.Q.x + 2 * a.N.x + a.commentMargin, a.Q.y + m), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Tb, c.gb = Sb; else for (q.q(a.Q.x + a.commentMargin - s.width, a.Q.y + m), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Sb, c.gb = Tb;
m = 0 <= a.commentSpacing ? m + (s.height + a.commentSpacing) : m + (a.commentSpacing - s.height)
} else {
if (135 < e && !g || !h && l)if (0 <= a.commentMargin)for (q.q(a.Q.x + m, a.Q.y - a.commentMargin - s.height),
c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Qb, c.gb = Ub; else for (q.q(a.Q.x + m, a.Q.y + 2 * a.N.y - a.commentMargin), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Ub, c.gb = Qb; else if (0 <= a.commentMargin)for (q.q(a.Q.x + m, a.Q.y + 2 * a.N.y + a.commentMargin), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Ub, c.gb = Qb; else for (q.q(a.Q.x + m, a.Q.y + a.commentMargin - s.height), c.location = q, u = c.Zf(); u.next();)c = u.value, c.fb = Qb, c.gb = Ub;
m = 0 <= a.commentSpacing ? m + (s.width + a.commentSpacing) : m + (a.commentSpacing - s.width)
}
}
t.B(q);
b =
m - a.commentSpacing - (d ? b.height : b.width);
if (this.sf === pp)for (a = a.Sb; a.next();)e = a.value, (c = e.link) && !c.Bi && (c.Sj = 0 < b ? b : NaN); else for (a = a.bc; a.next();)e = a.value, (c = e.link) && !c.Bi && (c.$j = 0 < b ? b : NaN)
}
};
function Bp(a, b) {
f && t.j(b, sp, Z, "layoutTree:v");
if (null !== b) {
for (var c = b.children, d = c.length, e = 0; e < d; e++)Bp(a, c[e]);
switch (b.compaction) {
case Tp:
Up(a, b);
break;
case Vp:
if (b.alignment === Dp)Up(a, b); else if (f && t.j(b, sp, Z, "layoutTreeBlock:v"), 0 === b.lm) {
var e = b.parent, c = !1, d = 0, g = Mp;
null !== e && (d = e.angle, g = e.alignment, c = Np(g));
e = Sp(b);
b.ja.q(0, 0);
b.Wa.q(b.width, b.height);
null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Ha.q(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Ha.q(b.width - 2 * b.N.x, 0) : b.Ha.q(0,
b.height - 2 * b.N.y);
b.Is = null;
b.Zs = null
} else {
for (var h = Wp(b), c = 90 === h || 270 === h, k = 0, l = b.children, m = l.length, n = 0; n < m; n++)var p = l[n], k = Math.max(k, c ? p.Wa.width : p.Wa.height);
var q = b.alignment, e = q === Xp, r = q === Yp, s = Np(q), u = Math.max(0, b.breadthLimit), d = Zp(b), x = b.nodeSpacing, E = $p(b), F = b.rowSpacing, G = 0;
if (e || r || b.lp || b.mp && 1 === b.maxGenerationCount)G = Math.max(0, b.rowIndent);
var e = b.width, g = b.height, L = 0, N = 0, V = 0, T = null, W = null, ea = 0, R = 0, wa = 0, Ja = 0, Ma = 0, Na = 0, xa = 0, Ra = 0, p = 0;
s && !Rp(q) && 135 < h && l.reverse();
if (Rp(q))if (1 <
m)for (n = 0; n < m; n++)0 === n % 2 && n !== m - 1 ? Ra = Math.max(Ra, c ? l[n].Wa.width : l[n].Wa.height) : 0 !== n % 2 && (p = Math.max(p, c ? l[n].Wa.width : l[n].Wa.height)); else 1 === m && (Ra = c ? l[0].Wa.width : l[0].Wa.height);
if (s) {
switch (q) {
case Op:
R = 135 > h ? aq(b, l, Ra, L, N) : bq(b, l, Ra, L, N);
Ra = R[0];
L = R[1];
N = R[2];
break;
case Pp:
for (n = 0; n < m; n++) {
var p = l[n], Ba = p.Wa, T = 0 === Na ? 0 : F;
c ? (p.ja.q(k - Ba.width, Ja + T), L = Math.max(L, Ba.width), N = Math.max(N, Ja + T + Ba.height), Ja += T + Ba.height) : (p.ja.q(wa + T, k - Ba.height), L = Math.max(L, wa + T + Ba.width), N = Math.max(N, Ba.height),
wa += T + Ba.width);
Na++
}
break;
case Qp:
for (n = 0; n < m; n++)p = l[n], Ba = p.Wa, T = 0 === Na ? 0 : F, c ? (p.ja.q(x / 2 + b.N.x, Ja + T), L = Math.max(L, Ba.width), N = Math.max(N, Ja + T + Ba.height), Ja += T + Ba.height) : (p.ja.q(wa + T, x / 2 + b.N.y), L = Math.max(L, wa + T + Ba.width), N = Math.max(N, Ba.height), wa += T + Ba.width), Na++
}
T = cq(a, 2);
W = cq(a, 2);
c ? (T[0].q(0, 0), T[1].q(0, N), W[0].q(L, 0)) : (T[0].q(0, 0), T[1].q(L, 0), W[0].q(0, N));
W[1].q(L, N)
} else for (n = 0; n < m; n++) {
p = l[n];
Ba = p.Wa;
if (c) {
0 < u && 0 < Na && wa + x + Ba.width > u && (wa < k && dq(b, q, k - wa, 0, xa, n - 1), Ma++, Na = 0, xa = n, V = N, wa =
0, Ja = 135 < h ? -N - F : N + F);
eq(a, p, 0, Ja);
var ob = 0;
if (0 === Na) {
if (T = p.Is, W = p.Zs, ea = Ba.width, R = Ba.height, null === T || null === W || h !== Wp(p))T = cq(a, 2), W = cq(a, 2), T[0].q(0, 0), T[1].q(0, R), W[0].q(ea, 0), W[1].q(ea, R)
} else R = fq(a, b, p, T, W, ea, R), ob = R[0], T = R[1], W = R[2], ea = R[3], R = R[4], wa < Ba.width && 0 > ob && (gq(b, -ob, 0, xa, n - 1), hq(T, -ob, 0), hq(W, -ob, 0), ob = 0);
p.ja.q(ob, Ja);
L = Math.max(L, ea);
N = Math.max(N, V + (0 === Ma ? 0 : F) + Ba.height);
wa = ea
} else {
0 < u && 0 < Na && Ja + x + Ba.height > u && (Ja < k && dq(b, q, 0, k - Ja, xa, n - 1), Ma++, Na = 0, xa = n, V = L, Ja = 0, wa = 135 < h ? -L -
F : L + F);
eq(a, p, wa, 0);
ob = 0;
if (0 === Na) {
if (T = p.Is, W = p.Zs, ea = Ba.width, R = Ba.height, null === T || null === W || h !== Wp(p))T = cq(a, 2), W = cq(a, 2), T[0].q(0, 0), T[1].q(ea, 0), W[0].q(0, R), W[1].q(ea, R)
} else R = fq(a, b, p, T, W, ea, R), ob = R[0], T = R[1], W = R[2], ea = R[3], R = R[4], Ja < Ba.height && 0 > ob && (gq(b, 0, -ob, xa, n - 1), hq(T, 0, -ob), hq(W, 0, -ob), ob = 0);
p.ja.q(wa, ob);
N = Math.max(N, R);
L = Math.max(L, V + (0 === Ma ? 0 : F) + Ba.width);
Ja = R
}
Na++
}
0 < Ma && (c ? (N += Math.max(0, d), wa < L && dq(b, q, L - wa, 0, xa, m - 1), 0 < G && (r || gq(b, G, 0, 0, m - 1), L += G)) : (L += Math.max(0, d), Ja < N && dq(b,
q, 0, N - Ja, xa, m - 1), 0 < G && (r || gq(b, 0, G, 0, m - 1), N += G)));
r = k = 0;
switch (q) {
case iq:
c ? k += L / 2 - b.N.x - E / 2 : r += N / 2 - b.N.y - E / 2;
break;
case Mp:
0 < Ma ? c ? k += L / 2 - b.N.x - E / 2 : r += N / 2 - b.N.y - E / 2 : c ? (n = l[0].ja.x + l[0].Ha.x, Ra = l[m - 1].ja.x + l[m - 1].Ha.x + 2 * l[m - 1].N.x, k += n + (Ra - n) / 2 - b.N.x - E / 2) : (n = l[0].ja.y + l[0].Ha.y, Ra = l[m - 1].ja.y + l[m - 1].Ha.y + 2 * l[m - 1].N.y, r += n + (Ra - n) / 2 - b.N.y - E / 2);
break;
case Xp:
c ? (k -= E, L += E) : (r -= E, N += E);
break;
case Yp:
c ? (k += L - b.width + E, L += E) : (r += N - b.height + E, N += E);
break;
case Op:
c ? k = 1 < m ? k + (Ra + x / 2 - b.N.x) : k + (l[0].N.x - b.N.x +
l[0].Ha.x) : r = 1 < m ? r + (Ra + x / 2 - b.N.y) : r + (l[0].N.y - b.N.y + l[0].Ha.y);
break;
case Pp:
c ? k += L + x / 2 - b.N.x : r += N + x / 2 - b.N.y;
break;
case Qp:
break;
default:
t.m("Unhandled alignment value " + q.toString())
}
for (n = 0; n < m; n++)p = l[n], c ? p.ja.q(p.ja.x + p.Ha.x - k, p.ja.y + (135 < h ? (s ? -N : -p.Wa.height) + p.Ha.y - d : g + d + p.Ha.y)) : p.ja.q(p.ja.x + (135 < h ? (s ? -L : -p.Wa.width) + p.Ha.x - d : e + d + p.Ha.x), p.ja.y + p.Ha.y - r);
m = l = 0;
s ? c ? (L = jq(b, L, k), 0 > k && (k = 0), 135 < h && (r += N + d), N += g + d, q === Qp && (l += x / 2 + b.N.x), m += g + d) : (135 < h && (k += L + d), L += e + d, N = kq(b, N, r), 0 > r && (r = 0),
q === Qp && (m += x / 2 + b.N.y), l += e + d) : c ? (null === b.comments ? e > L && (q = lq(q, e - L, 0), l = q[0], m = q[1], L = e, k = 0) : L = jq(b, L, k), 0 > k && (l -= k, k = 0), 135 < h && (r += N + d), N = Math.max(Math.max(N, g), N + g + d), m += g + d) : (135 < h && (k += L + d), L = Math.max(Math.max(L, e), L + e + d), null === b.comments ? g > N && (q = lq(q, 0, g - N), l = q[0], m = q[1], N = g, r = 0) : N = kq(b, N, r), 0 > r && (m -= r, r = 0), l += e + d);
if (0 < Ma)h = cq(a, 4), q = cq(a, 4), c ? (h[2].q(0, g + d), h[3].q(h[2].x, N), q[2].q(L, h[2].y), q[3].q(q[2].x, h[3].y)) : (h[2].q(e + d, 0), h[3].q(L, h[2].y), q[2].q(h[2].x, N), q[3].q(h[3].x, q[2].y)); else {
h =
cq(a, T.length + 2);
q = cq(a, W.length + 2);
for (n = 0; n < T.length; n++)s = T[n], h[n + 2].q(s.x + l, s.y + m);
for (n = 0; n < W.length; n++)s = W[n], q[n + 2].q(s.x + l, s.y + m)
}
c ? (h[0].q(k, 0), h[1].q(h[0].x, g), h[2].y < h[1].y && (h[2].x > h[0].x ? h[2].assign(h[1]) : h[1].assign(h[2])), h[3].y < h[2].y && (h[3].x > h[0].x ? h[3].assign(h[2]) : h[2].assign(h[3])), q[0].q(k + e, 0), q[1].q(q[0].x, g), q[2].y < q[1].y && (q[2].x < q[0].x ? q[2].assign(q[1]) : q[1].assign(q[2])), q[3].y < q[2].y && (q[3].x < q[0].x ? q[3].assign(q[2]) : q[2].assign(q[3])), h[2].y -= d / 2, q[2].y -= d / 2) : (h[0].q(0,
r), h[1].q(e, h[0].y), h[2].x < h[1].x && (h[2].y > h[0].y ? h[2].assign(h[1]) : h[1].assign(h[2])), h[3].x < h[2].x && (h[3].y > h[0].y ? h[3].assign(h[2]) : h[2].assign(h[3])), q[0].q(0, r + g), q[1].q(e, q[0].y), q[2].x < q[1].x && (q[2].y < q[0].y ? q[2].assign(q[1]) : q[1].assign(q[2])), q[3].x < q[2].x && (q[3].y < q[0].y ? q[3].assign(q[2]) : q[2].assign(q[3])), h[2].x -= d / 2, q[2].x -= d / 2);
mq(a, T);
mq(a, W);
b.Is = h;
b.Zs = q;
b.Ha.q(k, r);
b.Wa.q(L, N)
}
break;
default:
t.m("Unhandled compaction value " + b.compaction.toString())
}
}
}
function Up(a, b) {
f && t.j(b, sp, Z, "layoutTreeNone:v");
if (0 === b.lm) {
var c = !1, d = 0, e = Mp;
null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Np(e));
e = Sp(b);
b.ja.q(0, 0);
b.Wa.q(b.width, b.height);
null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Ha.q(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Ha.q(b.width - 2 * b.N.x, 0) : b.Ha.q(0, b.height - 2 * b.N.y)
} else {
for (var c = Wp(b), d = 90 === c || 270 === c, g = 0, e = b.children, h = e.length, k = 0; k < h; k++)var l = e[k], g = Math.max(g, d ? l.Wa.width : l.Wa.height);
var m = b.alignment, n =
m === Xp, p = m === Yp, q = Np(m), r = Math.max(0, b.breadthLimit), s = Zp(b), u = b.nodeSpacing, x = $p(b), E = n || p ? 0 : x / 2, F = b.rowSpacing, G = 0;
if (n || p || b.lp || b.mp && 1 === b.maxGenerationCount)G = Math.max(0, b.rowIndent);
var n = b.width, L = b.height, N = 0, V = 0, T = 0, W = 0, ea = 0, R = 0, wa = 0, Ja = 0, Ma = 0, Na = 0;
q && !Rp(m) && 135 < c && e.reverse();
if (Rp(m))if (1 < h)for (k = 0; k < h; k++) {
var l = e[k], xa = l.Wa;
0 === k % 2 && k !== h - 1 ? Ma = Math.max(Ma, (d ? xa.width : xa.height) + nq(l) - u) : 0 !== k % 2 && (Na = Math.max(Na, (d ? xa.width : xa.height) + nq(l) - u))
} else 1 === h && (Ma = d ? e[0].Wa.width : e[0].Wa.height);
if (q)switch (m) {
case Op:
case Dp:
V = 135 > c ? aq(b, e, Ma, N, V) : bq(b, e, Ma, N, V);
Ma = V[0];
N = V[1];
V = V[2];
break;
case Pp:
for (k = 0; k < h; k++)l = e[k], xa = l.Wa, r = 0 === wa ? 0 : F, d ? (l.ja.q(g - xa.width, ea + r), N = Math.max(N, xa.width), V = Math.max(V, ea + r + xa.height), ea += r + xa.height) : (l.ja.q(W + r, g - xa.height), N = Math.max(N, W + r + xa.width), V = Math.max(V, xa.height), W += r + xa.width), wa++;
break;
case Qp:
for (g = 0; g < h; g++)l = e[g], xa = l.Wa, r = 0 === wa ? 0 : F, d ? (l.ja.q(u / 2 + b.N.x, ea + r), N = Math.max(N, xa.width), V = Math.max(V, ea + r + xa.height), ea += r + xa.height) : (l.ja.q(W +
r, u / 2 + b.N.y), N = Math.max(N, W + r + xa.width), V = Math.max(V, xa.height), W += r + xa.width), wa++
} else for (k = 0; k < h; k++)l = e[k], xa = l.Wa, d ? (0 < r && 0 < wa && W + u + xa.width > r && (W < g && dq(b, m, g - W, 0, Ja, k - 1), R++, wa = 0, Ja = k, T = V, W = 0, ea = 135 < c ? -V - F : V + F), Na = 0 === wa ? E : u, eq(a, l, 0, ea), l.ja.q(W + Na, ea), N = Math.max(N, W + Na + xa.width), V = Math.max(V, T + (0 === R ? 0 : F) + xa.height), W += Na + xa.width) : (0 < r && 0 < wa && ea + u + xa.height > r && (ea < g && dq(b, m, 0, g - ea, Ja, k - 1), R++, wa = 0, Ja = k, T = N, ea = 0, W = 135 < c ? -N - F : N + F), Na = 0 === wa ? E : u, eq(a, l, W, 0), l.ja.q(W, ea + Na), V = Math.max(V, ea +
Na + xa.height), N = Math.max(N, T + (0 === R ? 0 : F) + xa.width), ea += Na + xa.height), wa++;
0 < R && (d ? (V += Math.max(0, s), W < N && dq(b, m, N - W, 0, Ja, h - 1), 0 < G && (p || gq(b, G, 0, 0, h - 1), N += G)) : (N += Math.max(0, s), ea < V && dq(b, m, 0, V - ea, Ja, h - 1), 0 < G && (p || gq(b, 0, G, 0, h - 1), V += G)));
G = p = 0;
switch (m) {
case iq:
d ? p += N / 2 - b.N.x - x / 2 : G += V / 2 - b.N.y - x / 2;
break;
case Mp:
0 < R ? d ? p += N / 2 - b.N.x - x / 2 : G += V / 2 - b.N.y - x / 2 : d ? (m = e[0].ja.x + e[0].Ha.x, u = e[h - 1].ja.x + e[h - 1].Ha.x + 2 * e[h - 1].N.x, p += m + (u - m) / 2 - b.N.x - x / 2) : (m = e[0].ja.y + e[0].Ha.y, u = e[h - 1].ja.y + e[h - 1].Ha.y + 2 * e[h - 1].N.y,
G += m + (u - m) / 2 - b.N.y - x / 2);
break;
case Xp:
d ? (p -= x, N += x) : (G -= x, V += x);
break;
case Yp:
d ? (p += N - b.width + x, N += x) : (G += V - b.height + x, V += x);
break;
case Op:
case Dp:
d ? p = 1 < h ? p + (Ma + u / 2 - b.N.x) : p + (e[0].N.x - b.N.x + e[0].Ha.x) : G = 1 < h ? G + (Ma + u / 2 - b.N.y) : G + (e[0].N.y - b.N.y + e[0].Ha.y);
break;
case Pp:
d ? p += N + u / 2 - b.N.x : G += V + u / 2 - b.N.y;
break;
case Qp:
break;
default:
t.m("Unhandled alignment value " + m.toString())
}
for (k = 0; k < h; k++)l = e[k], d ? l.ja.q(l.ja.x + l.Ha.x - p, l.ja.y + (135 < c ? (q ? -V : -l.Wa.height) + l.Ha.y - s : L + s + l.Ha.y)) : l.ja.q(l.ja.x + (135 < c ? (q ?
-N : -l.Wa.width) + l.Ha.x - s : n + s + l.Ha.x), l.ja.y + l.Ha.y - G);
d ? (N = jq(b, N, p), 0 > p && (p = 0), 135 < c && (G += V + s), V += L + s) : (135 < c && (p += N + s), N += n + s, V = kq(b, V, G), 0 > G && (G = 0));
b.Ha.q(p, G);
b.Wa.q(N, V)
}
}
function aq(a, b, c, d, e) {
f && t.j(a, sp, Z, "layoutBusChildrenPosDir:v");
var g = b.length;
if (0 === g)return a = [], a[0] = c, a[1] = d, a[2] = e, a;
if (1 === g) {
var h = b[0];
d = h.Wa.width;
e = h.Wa.height;
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === Wp(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
var h = b[r], s = h.Wa, u = 0 === n ? 0 : l;
if (m) {
var x = nq(h) - k;
h.ja.q(c - (s.width + x), q + u);
d = Math.max(d, s.width + x);
e = Math.max(e, q + u + s.height);
q += u + s.height
} else x = nq(h) - k, h.ja.q(p + u, c - (s.height + x)), e = Math.max(e,
s.height + x), d = Math.max(d, p + u + s.width), p += u + s.width;
n++
}
var n = 0, E = p, F = q;
m ? (p = c + k, q = 0) : (p = 0, q = c + k);
for (r = 0; r < g; r++)0 !== r % 2 && (h = b[r], s = h.Wa, u = 0 === n ? 0 : l, m ? (x = nq(h) - k, h.ja.q(p + x, q + u), d = Math.max(d, p + s.width + x), e = Math.max(e, q + u + s.height), q += u + s.height) : (x = nq(h) - k, h.ja.q(p + u, q + x), d = Math.max(d, p + u + s.width), e = Math.max(e, q + s.height + x), p += u + s.width), n++);
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.Wa, b = oq(h, m ? Math.max(Math.abs(F), Math.abs(q)) : Math.max(Math.abs(E), Math.abs(p))), m ? (h.ja.q(c + k / 2 - h.N.x - h.Ha.x, e + b), m = c + k / 2 - h.N.x -
h.Ha.x, d = Math.max(d, m + s.width), 0 > m && (d -= m), e = Math.max(e, Math.max(F, q) + b + s.height), 0 > h.ja.x && (c = uq(a, h.ja.x, !1, c, k))) : (h.ja.q(d + b, c + k / 2 - h.N.y - h.Ha.y), d = Math.max(d, Math.max(E, p) + b + s.width), m = c + k / 2 - h.N.y - h.Ha.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.ja.y && (c = uq(a, h.ja.y, !0, c, k))));
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
function bq(a, b, c, d, e) {
f && t.j(a, sp, Z, "layoutBusChildrenNegDir:v");
var g = b.length;
if (0 === g)return a = [], a[0] = c, a[1] = d, a[2] = e, a;
if (1 === g) {
var h = b[0];
d = h.Wa.width;
e = h.Wa.height;
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === Wp(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
var h = b[r], s = h.Wa, u = 0 === n ? 0 : l;
if (m) {
var x = nq(h) - k, q = q - (u + s.height);
h.ja.q(c - (s.width + x), q);
d = Math.max(d, s.width + x);
e = Math.max(e, Math.abs(q))
} else x = nq(h) - k, p -= u + s.width, h.ja.q(p, c - (s.height +
x)), e = Math.max(e, s.height + x), d = Math.max(d, Math.abs(p));
n++
}
var n = 0, E = p, F = q;
m ? (p = c + k, q = 0) : (p = 0, q = c + k);
for (r = 0; r < g; r++)0 !== r % 2 && (h = b[r], s = h.Wa, u = 0 === n ? 0 : l, m ? (x = nq(h) - k, q -= u + s.height, h.ja.q(p + x, q), d = Math.max(d, p + s.width + x), e = Math.max(e, Math.abs(q))) : (x = nq(h) - k, p -= u + s.width, h.ja.q(p, q + x), e = Math.max(e, q + s.height + x), d = Math.max(d, Math.abs(p))), n++);
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.Wa, l = oq(h, m ? Math.max(Math.abs(F), Math.abs(q)) : Math.max(Math.abs(E), Math.abs(p))), m ? (h.ja.q(c + k / 2 - h.N.x - h.Ha.x, -e - s.height - l), p = c +
k / 2 - h.N.x - h.Ha.x, d = Math.max(d, p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(F, q)) + l + s.height), 0 > h.ja.x && (c = uq(a, h.ja.x, !1, c, k))) : (h.ja.q(-d - s.width - l, c + k / 2 - h.N.y - h.Ha.y), d = Math.max(d, Math.abs(Math.min(E, p)) + l + s.width), p = c + k / 2 - h.N.y - h.Ha.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.ja.y && (c = uq(a, h.ja.y, !0, c, k))));
for (r = 0; r < g; r++)h = b[r], m ? h.ja.q(h.ja.x, h.ja.y + e) : h.ja.q(h.ja.x + d, h.ja.y);
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
function nq(a) {
f && t.j(a, sp, Z, "fixRelativePostions:child");
return null === a.parent ? 0 : a.parent.nodeSpacing
}
function oq(a) {
f && t.j(a, sp, Z, "fixRelativePostions:lastchild");
return null === a.parent ? 0 : a.parent.rowSpacing
}
function uq(a, b, c, d, e) {
f && t.j(a, sp, Z, "fixRelativePostions:v");
a = a.children;
for (var g = a.length, h = 0; h < g; h++)c ? a[h].ja.q(a[h].ja.x, a[h].ja.y - b) : a[h].ja.q(a[h].ja.x - b, a[h].ja.y);
b = a[g - 1];
return Math.max(d, c ? b.Ha.y + b.N.y - e / 2 : b.Ha.x + b.N.x - e / 2)
}
function jq(a, b, c) {
f && t.j(a, sp, Z, "calculateSubwidth:v");
switch (a.alignment) {
case Mp:
case iq:
var d = b;
c + a.width > d && (d = c + a.width);
0 > c && (d -= c);
return d;
case Xp:
return a.width > b ? a.width : b;
case Yp:
return 2 * a.N.x > b ? a.width : b + a.width - 2 * a.N.x;
case Op:
case Dp:
return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d);
case Pp:
return a.width - a.N.x + a.nodeSpacing / 2 + b;
case Qp:
return Math.max(a.width, a.N.x + a.nodeSpacing / 2 + b);
default:
return b
}
}
function kq(a, b, c) {
f && t.j(a, sp, Z, "calculateSubheight:v");
switch (a.alignment) {
case Mp:
case iq:
var d = b;
c + a.height > d && (d = c + a.height);
0 > c && (d -= c);
return d;
case Xp:
return a.height > b ? a.height : b;
case Yp:
return 2 * a.N.y > b ? a.height : b + a.height - 2 * a.N.y;
case Op:
case Dp:
return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d);
case Pp:
return a.height - a.N.y + a.nodeSpacing / 2 + b;
case Qp:
return Math.max(a.height, a.N.y + a.nodeSpacing / 2 + b);
default:
return b
}
}
function lq(a, b, c) {
f && t.j(a, ca, Z, "alignOffset:align");
switch (a) {
case iq:
b /= 2;
c /= 2;
break;
case Mp:
b /= 2;
c /= 2;
break;
case Xp:
c = b = 0;
break;
case Yp:
break;
default:
t.m("Unhandled alignment value " + a.toString())
}
a = [];
a[0] = b;
a[1] = c;
return a
}
function dq(a, b, c, d, e, g) {
f && t.j(a, sp, Z, "shiftRelPosAlign:v");
f && t.j(b, ca, Z, "shiftRelPosAlign:align");
b = lq(b, c, d);
gq(a, b[0], b[1], e, g)
}
function gq(a, b, c, d, e) {
f && t.j(a, sp, Z, "shiftRelPos:v");
if (0 !== b || 0 !== c)for (a = a.children; d <= e; d++) {
var g = a[d].ja;
g.x += b;
g.y += c
}
}
function eq(a, b, c, d) {
f && (t.j(b, sp, Z, "recordMidPoints:v"), t.k(c, "number", Z, "recordMidPoints:x"), t.k(d, "number", Z, "recordMidPoints:y"));
var e = b.parent;
switch (a.sf) {
case pp:
for (a = b.bc; a.next();)b = a.value, b.fromVertex === e && b.nr.q(c, d);
break;
case wp:
for (a = b.Sb; a.next();)b = a.value, b.toVertex === e && b.nr.q(c, d);
break;
default:
t.m("Unhandled path value " + a.sf.toString())
}
}
function hq(a, b, c) {
for (var d = 0; d < a.length; d++) {
var e = a[d];
e.x += b;
e.y += c
}
}
function fq(a, b, c, d, e, g, h) {
f && t.j(b, sp, Z, "mergeFringes:parent");
f && t.j(c, sp, Z, "mergeFringes:child");
var k = Wp(b), l = 90 === k || 270 === k, m = b.nodeSpacing;
b = d;
var n = e;
d = g;
e = h;
var p = c.Is, q = c.Zs;
h = c.Wa;
var r = l ? Math.max(e, h.height) : Math.max(d, h.width);
if (null === p || k !== Wp(c))p = cq(a, 2), q = cq(a, 2), l ? (p[0].q(0, 0), p[1].q(0, h.height), q[0].q(h.width, 0), q[1].q(q[0].x, p[1].y)) : (p[0].q(0, 0), p[1].q(h.width, 0), q[0].q(0, h.height), q[1].q(p[1].x, q[0].y));
if (l) {
c = d;
d = 9999999;
if (!(null === n || 2 > n.length || null === p || 2 > p.length))for (g =
e = 0; e < n.length && g < p.length;) {
var k = n[e], s = p[g], l = s.x, u = s.y, l = l + c, x = k;
e + 1 < n.length && (x = n[e + 1]);
var E = s, s = E.x, E = E.y;
g + 1 < p.length && (E = p[g + 1], s = E.x, E = E.y, s += c);
var F = d;
k.y === u ? F = l - k.x : k.y > u && k.y < E ? F = l + (k.y - u) / (E - u) * (s - l) - k.x : u > k.y && u < x.y && (F = l - (k.x + (u - k.y) / (x.y - k.y) * (x.x - k.x)));
F < d && (d = F);
x.y <= k.y ? e++ : E <= u ? g++ : (x.y <= E && e++, E <= x.y && g++)
}
c -= d;
c += m;
e = p;
g = c;
if (null === b || 2 > b.length || null === e || 2 > e.length)d = null; else {
m = cq(a, b.length + e.length);
for (d = l = k = 0; l < e.length && e[l].y < b[0].y;)u = e[l++], m[d++].q(u.x + g, u.y);
for (; k < b.length;)u = b[k++], m[d++].q(u.x, u.y);
for (k = b[b.length - 1].y; l < e.length && e[l].y <= k;)l++;
for (; l < e.length && e[l].y > k;)u = e[l++], m[d++].q(u.x + g, u.y);
e = cq(a, d);
for (k = 0; k < d; k++)e[k].assign(m[k]);
mq(a, m);
d = e
}
l = q;
u = c;
if (null === n || 2 > n.length || null === l || 2 > l.length)e = null; else {
m = cq(a, n.length + l.length);
for (g = x = e = 0; e < n.length && n[e].y < l[0].y;)k = n[e++], m[g++].q(k.x, k.y);
for (; x < l.length;)k = l[x++], m[g++].q(k.x + u, k.y);
for (l = l[l.length - 1].y; e < n.length && n[e].y <= l;)e++;
for (; e < n.length && n[e].y > l;)k = n[e++], m[g++].q(k.x,
k.y);
k = cq(a, g);
for (e = 0; e < g; e++)k[e].assign(m[e]);
mq(a, m);
e = k
}
g = Math.max(0, c) + h.width;
h = r
} else {
c = e;
d = 9999999;
if (!(null === n || 2 > n.length || null === p || 2 > p.length))for (g = e = 0; e < n.length && g < p.length;)k = n[e], s = p[g], l = s.x, u = s.y, u += c, x = k, e + 1 < n.length && (x = n[e + 1]), E = s, s = E.x, E = E.y, g + 1 < p.length && (E = p[g + 1], s = E.x, E = E.y, E += c), F = d, k.x === l ? F = u - k.y : k.x > l && k.x < s ? F = u + (k.x - l) / (s - l) * (E - u) - k.y : l > k.x && l < x.x && (F = u - (k.y + (l - k.x) / (x.x - k.x) * (x.y - k.y))), F < d && (d = F), x.x <= k.x ? e++ : s <= l ? g++ : (x.x <= s && e++, s <= x.x && g++);
c -= d;
c += m;
e = p;
g = c;
if (null === b || 2 > b.length || null === e || 2 > e.length)d = null; else {
m = cq(a, b.length + e.length);
for (d = l = k = 0; l < e.length && e[l].x < b[0].x;)u = e[l++], m[d++].q(u.x, u.y + g);
for (; k < b.length;)u = b[k++], m[d++].q(u.x, u.y);
for (k = b[b.length - 1].x; l < e.length && e[l].x <= k;)l++;
for (; l < e.length && e[l].x > k;)u = e[l++], m[d++].q(u.x, u.y + g);
e = cq(a, d);
for (k = 0; k < d; k++)e[k].assign(m[k]);
mq(a, m);
d = e
}
l = q;
u = c;
if (null === n || 2 > n.length || null === l || 2 > l.length)e = null; else {
m = cq(a, n.length + l.length);
for (g = x = e = 0; e < n.length && n[e].x < l[0].x;)k = n[e++], m[g++].q(k.x,
k.y);
for (; x < l.length;)k = l[x++], m[g++].q(k.x, k.y + u);
for (l = l[l.length - 1].x; e < n.length && n[e].x <= l;)e++;
for (; e < n.length && n[e].x > l;)k = n[e++], m[g++].q(k.x, k.y);
k = cq(a, g);
for (e = 0; e < g; e++)k[e].assign(m[e]);
mq(a, m);
e = k
}
g = r;
h = Math.max(0, c) + h.height
}
mq(a, b);
mq(a, p);
mq(a, n);
mq(a, q);
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
a[3] = g;
a[4] = h;
return a
}
function cq(a, b) {
a.Qr || (a.Qr = []);
var c = a.Qr[b];
if (void 0 !== c && (c = c.pop(), void 0 !== c))return c;
for (var c = [], d = 0; d < b; d++)c[d] = new v;
return c
}
function mq(a, b) {
if (a.Qr) {
var c = b.length, d = a.Qr[c];
void 0 === d && (d = [], a.Qr[c] = d);
d.push(b)
}
}
Z.prototype.arrangeTrees = function () {
if (this.ad === vp)for (var a = this.Gc.l; a.next();) {
var b = a.value, c = b.Bc;
if (null !== c) {
var d = c.position, c = d.x, d = d.y;
isFinite(c) || (c = 0);
isFinite(d) || (d = 0);
vq(this, b, c, d)
}
} else for (a = this.rd, c = a.x, d = a.y, a = this.Gc.l; a.next();)switch (b = a.value, vq(this, b, c + b.Ha.x, d + b.Ha.y), this.ad) {
case rp:
d += b.Wa.height + this.Kf.height;
break;
case wq:
c += b.Wa.width + this.Kf.width;
break;
default:
t.m("Unhandled arrangement value " + this.ad.toString())
}
};
function vq(a, b, c, d) {
if (null !== b) {
f && t.j(b, sp, Z, "assignAbsolutePositions:v");
b.x = c;
b.y = d;
b = b.children;
for (var e = b.length, g = 0; g < e; g++) {
var h = b[g];
vq(a, h, c + h.ja.x, d + h.ja.y)
}
}
}
Z.prototype.commitLayout = function () {
this.FA();
this.commitNodes();
this.Gs && this.commitLinks()
};
Z.prototype.commitNodes = function () {
for (var a = this.network.vertexes.l, b; a.next();)b = a.value, b.commit();
for (a.reset(); a.next();)b = a.value, this.layoutComments(b)
};
Z.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
Z.prototype.FA = function () {
for (var a = this.Gc.l; a.next();)xq(this, a.value)
};
function xq(a, b) {
if (null !== b) {
f && t.j(b, sp, Z, "setPortSpotsTree:v");
a.setPortSpots(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)xq(a, c[e])
}
}
Z.prototype.setPortSpots = function (a) {
f && t.j(a, sp, Z, "setPortSpots:v");
var b = a.alignment;
if (Np(b)) {
f && t.j(a, sp, Z, "setPortSpotsBus:v");
f && t.j(b, ca, Z, "setPortSpots:align");
var c = this.sf === pp, d = Wp(a), e;
switch (d) {
case 0:
e = Tb;
break;
case 90:
e = Ub;
break;
case 180:
e = Sb;
break;
default:
e = Qb
}
var g = a.children, h = g.length;
switch (b) {
case Op:
case Dp:
for (b = 0; b < h; b++) {
var k = g[b], k = c ? k.bc : k.Sb;
if (k.next()) {
var l = k.value, l = l.link;
if (null !== l) {
var m = 90 === d || 270 === d ? Sb : Qb;
if (1 === h || b === h - 1 && 1 === h % 2)switch (d) {
case 0:
m = Sb;
break;
case 90:
m = Qb;
break;
case 180:
m = Tb;
break;
default:
m = Ub
} else 0 === b % 2 && (m = 90 === d || 270 === d ? Tb : Ub);
c ? (a.setsPortSpot && (l.fb = e), a.setsChildPortSpot && (l.gb = m)) : (a.setsPortSpot && (l.fb = m), a.setsChildPortSpot && (l.gb = e))
}
}
}
break;
case Pp:
m = 90 === d || 270 === d ? Tb : Ub;
for (k = c ? a.Sb : a.bc; k.next();)l = k.value, l = l.link, null !== l && (c ? (a.setsPortSpot && (l.fb = e), a.setsChildPortSpot && (l.gb = m)) : (a.setsPortSpot && (l.fb = m), a.setsChildPortSpot && (l.gb = e)));
break;
case Qp:
for (m = 90 === d || 270 === d ? Sb : Qb, k = c ? a.Sb : a.bc; k.next();)l = k.value, l =
l.link, null !== l && (c ? (a.setsPortSpot && (l.fb = e), a.setsChildPortSpot && (l.gb = m)) : (a.setsPortSpot && (l.fb = m), a.setsChildPortSpot && (l.gb = e)))
}
} else if (c = Wp(a), this.sf === pp)for (d = a.Sb; d.next();) {
if (e = d.value, e = e.link, null !== e) {
if (a.setsPortSpot)if (a.portSpot.Ac())switch (c) {
case 0:
e.fb = Tb;
break;
case 90:
e.fb = Ub;
break;
case 180:
e.fb = Sb;
break;
default:
e.fb = Qb
} else e.fb = a.portSpot;
if (a.setsChildPortSpot)if (a.childPortSpot.Ac())switch (c) {
case 0:
e.gb = Sb;
break;
case 90:
e.gb = Qb;
break;
case 180:
e.gb = Tb;
break;
default:
e.gb =
Ub
} else e.gb = a.childPortSpot
}
} else for (d = a.bc; d.next();)if (e = d.value, e = e.link, null !== e) {
if (a.setsPortSpot)if (a.portSpot.Ac())switch (c) {
case 0:
e.gb = Tb;
break;
case 90:
e.gb = Ub;
break;
case 180:
e.gb = Sb;
break;
default:
e.gb = Qb
} else e.gb = a.portSpot;
if (a.setsChildPortSpot)if (a.childPortSpot.Ac())switch (c) {
case 0:
e.fb = Sb;
break;
case 90:
e.fb = Qb;
break;
case 180:
e.fb = Tb;
break;
default:
e.fb = Ub
} else e.fb = a.childPortSpot
}
};
function Wp(a) {
a = a.angle;
return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0
}
function Zp(a) {
f && t.j(a, sp, Z, "computeLayerSpacing:v");
var b = Wp(a), b = 90 === b || 270 === b, c = a.layerSpacing;
if (0 < a.layerSpacingParentOverlap)var d = Math.min(1, a.layerSpacingParentOverlap), c = c - (b ? a.height * d : a.width * d);
c < (b ? -a.height : -a.width) && (c = b ? -a.height : -a.width);
return c
}
function $p(a) {
f && t.j(a, sp, Z, "computeNodeIndent:v");
var b = Wp(a), b = 90 === b || 270 === b, c = a.nodeIndent;
if (0 < a.nodeIndentPastParent)var d = Math.min(1, a.nodeIndentPastParent), c = c + (b ? a.width * d : a.height * d);
return c = Math.max(0, c)
}
t.g(Z, "roots", Z.prototype.yI);
t.defineProperty(Z, {yI: "roots"}, function () {
return this.Gc
}, function (a) {
this.Gc !== a && (t.j(a, ka, Z, "roots"), this.Gc = a, this.J())
});
t.g(Z, "path", Z.prototype.path);
t.defineProperty(Z, {path: "path"}, function () {
return this.ei
}, function (a) {
this.ei !== a && (t.j(a, ca, Z, "path"), this.ei = a, this.J())
});
t.g(Z, "treeStyle", Z.prototype.CF);
t.defineProperty(Z, {CF: "treeStyle"}, function () {
return this.Wr
}, function (a) {
this.ad !== a && (f && t.j(a, ca, Z, "treeStyle"), a === qp || a === Gp || a === Hp || a === Fp) && (this.Wr = a, this.J())
});
t.g(Z, "comments", Z.prototype.comments);
t.defineProperty(Z, {comments: "comments"}, function () {
return this.Tg
}, function (a) {
this.Tg !== a && (this.Tg = a, this.J())
});
t.g(Z, "arrangement", Z.prototype.Je);
t.defineProperty(Z, {Je: "arrangement"}, function () {
return this.ad
}, function (a) {
this.ad !== a && (f && t.j(a, ca, Z, "arrangement"), a === rp || a === wq || a === vp) && (this.ad = a, this.J())
});
t.g(Z, "arrangementSpacing", Z.prototype.qv);
t.defineProperty(Z, {qv: "arrangementSpacing"}, function () {
return this.Kf
}, function (a) {
this.Kf.K(a) || (this.Kf.assign(a), this.J())
});
t.g(Z, "rootDefaults", Z.prototype.xI);
t.defineProperty(Z, {xI: "rootDefaults"}, function () {
return this.qa
}, function (a) {
this.qa !== a && (f && t.j(a, sp, Z, "rootDefaults"), this.qa = a, this.J())
});
t.g(Z, "alternateDefaults", Z.prototype.EG);
t.defineProperty(Z, {EG: "alternateDefaults"}, function () {
return this.pa
}, function (a) {
this.pa !== a && (f && t.j(a, sp, Z, "alternateDefaults"), this.pa = a, this.J())
});
t.g(Z, "sorting", Z.prototype.sorting);
t.defineProperty(Z, {sorting: "sorting"}, function () {
return this.qa.sorting
}, function (a) {
this.qa.sorting !== a && (f && t.j(a, ca, Z, "sorting"), a === Ip || a === Jp || a === Kp || Lp) && (this.qa.sorting = a, this.J())
});
t.g(Z, "comparer", Z.prototype.comparer);
t.defineProperty(Z, {comparer: "comparer"}, function () {
return this.qa.comparer
}, function (a) {
this.qa.comparer !== a && (f && t.k(a, "function", Z, "comparer"), this.qa.comparer = a, this.J())
});
t.g(Z, "angle", Z.prototype.angle);
t.defineProperty(Z, {angle: "angle"}, function () {
return this.qa.angle
}, function (a) {
this.qa.angle === a || 0 !== a && 90 !== a && 180 !== a && 270 !== a || (this.qa.angle = a, this.J())
});
t.g(Z, "alignment", Z.prototype.alignment);
t.defineProperty(Z, {alignment: "alignment"}, function () {
return this.qa.alignment
}, function (a) {
this.qa.alignment !== a && (f && t.nb(a, Z, Z, "alignment"), this.qa.alignment = a, this.J())
});
t.g(Z, "nodeIndent", Z.prototype.nodeIndent);
t.defineProperty(Z, {nodeIndent: "nodeIndent"}, function () {
return this.qa.nodeIndent
}, function (a) {
this.qa.nodeIndent !== a && 0 <= a && (this.qa.nodeIndent = a, this.J())
});
t.g(Z, "nodeIndentPastParent", Z.prototype.nodeIndentPastParent);
t.defineProperty(Z, {nodeIndentPastParent: "nodeIndentPastParent"}, function () {
return this.qa.nodeIndentPastParent
}, function (a) {
this.qa.nodeIndentPastParent !== a && 0 <= a && 1 >= a && (this.qa.nodeIndentPastParent = a, this.J())
});
t.g(Z, "nodeSpacing", Z.prototype.nodeSpacing);
t.defineProperty(Z, {nodeSpacing: "nodeSpacing"}, function () {
return this.qa.nodeSpacing
}, function (a) {
this.qa.nodeSpacing !== a && (this.qa.nodeSpacing = a, this.J())
});
t.g(Z, "layerSpacing", Z.prototype.layerSpacing);
t.defineProperty(Z, {layerSpacing: "layerSpacing"}, function () {
return this.qa.layerSpacing
}, function (a) {
this.qa.layerSpacing !== a && (this.qa.layerSpacing = a, this.J())
});
t.g(Z, "layerSpacingParentOverlap", Z.prototype.layerSpacingParentOverlap);
t.defineProperty(Z, {layerSpacingParentOverlap: "layerSpacingParentOverlap"}, function () {
return this.qa.layerSpacingParentOverlap
}, function (a) {
this.qa.layerSpacingParentOverlap !== a && 0 <= a && 1 >= a && (this.qa.layerSpacingParentOverlap = a, this.J())
});
t.g(Z, "compaction", Z.prototype.compaction);
t.defineProperty(Z, {compaction: "compaction"}, function () {
return this.qa.compaction
}, function (a) {
this.qa.compaction !== a && (f && t.j(a, ca, Z, "compaction"), a === Tp || a === Vp) && (this.qa.compaction = a, this.J())
});
t.g(Z, "breadthLimit", Z.prototype.breadthLimit);
t.defineProperty(Z, {breadthLimit: "breadthLimit"}, function () {
return this.qa.breadthLimit
}, function (a) {
this.qa.breadthLimit !== a && 0 <= a && (this.qa.breadthLimit = a, this.J())
});
t.g(Z, "rowSpacing", Z.prototype.rowSpacing);
t.defineProperty(Z, {rowSpacing: "rowSpacing"}, function () {
return this.qa.rowSpacing
}, function (a) {
this.qa.rowSpacing !== a && (this.qa.rowSpacing = a, this.J())
});
t.g(Z, "rowIndent", Z.prototype.rowIndent);
t.defineProperty(Z, {rowIndent: "rowIndent"}, function () {
return this.qa.rowIndent
}, function (a) {
this.qa.rowIndent !== a && 0 <= a && (this.qa.rowIndent = a, this.J())
});
t.g(Z, "commentSpacing", Z.prototype.commentSpacing);
t.defineProperty(Z, {commentSpacing: "commentSpacing"}, function () {
return this.qa.commentSpacing
}, function (a) {
this.qa.commentSpacing !== a && (this.qa.commentSpacing = a, this.J())
});
t.g(Z, "commentMargin", Z.prototype.commentMargin);
t.defineProperty(Z, {commentMargin: "commentMargin"}, function () {
return this.qa.commentMargin
}, function (a) {
this.qa.commentMargin !== a && (this.qa.commentMargin = a, this.J())
});
t.g(Z, "setsPortSpot", Z.prototype.setsPortSpot);
t.defineProperty(Z, {setsPortSpot: "setsPortSpot"}, function () {
return this.qa.setsPortSpot
}, function (a) {
this.qa.setsPortSpot !== a && (this.qa.setsPortSpot = a, this.J())
});
t.g(Z, "portSpot", Z.prototype.portSpot);
t.defineProperty(Z, {portSpot: "portSpot"}, function () {
return this.qa.portSpot
}, function (a) {
this.qa.portSpot.K(a) || (this.qa.portSpot = a, this.J())
});
t.g(Z, "setsChildPortSpot", Z.prototype.setsChildPortSpot);
t.defineProperty(Z, {setsChildPortSpot: "setsChildPortSpot"}, function () {
return this.qa.setsChildPortSpot
}, function (a) {
this.qa.setsChildPortSpot !== a && (this.qa.setsChildPortSpot = a, this.J())
});
t.g(Z, "childPortSpot", Z.prototype.childPortSpot);
t.defineProperty(Z, {childPortSpot: "childPortSpot"}, function () {
return this.qa.childPortSpot
}, function (a) {
this.qa.childPortSpot.K(a) || (this.qa.childPortSpot = a, this.J())
});
t.g(Z, "alternateSorting", Z.prototype.PG);
t.defineProperty(Z, {PG: "alternateSorting"}, function () {
return this.pa.sorting
}, function (a) {
this.pa.sorting !== a && (f && t.j(a, ca, Z, "alternateSorting"), a === Ip || a === Jp || a === Kp || Lp) && (this.pa.sorting = a, this.J())
});
t.g(Z, "alternateComparer", Z.prototype.DG);
t.defineProperty(Z, {DG: "alternateComparer"}, function () {
return this.pa.comparer
}, function (a) {
this.pa.comparer !== a && (f && t.k(a, "function", Z, "alternateComparer"), this.pa.comparer = a, this.J())
});
t.g(Z, "alternateAngle", Z.prototype.xG);
t.defineProperty(Z, {xG: "alternateAngle"}, function () {
return this.pa.angle
}, function (a) {
this.pa.angle === a || 0 !== a && 90 !== a && 180 !== a && 270 !== a || (this.pa.angle = a, this.J())
});
t.g(Z, "alternateAlignment", Z.prototype.wG);
t.defineProperty(Z, {wG: "alternateAlignment"}, function () {
return this.pa.alignment
}, function (a) {
this.pa.alignment !== a && (f && t.nb(a, Z, Z, "alternateAlignment"), this.pa.alignment = a, this.J())
});
t.g(Z, "alternateNodeIndent", Z.prototype.HG);
t.defineProperty(Z, {HG: "alternateNodeIndent"}, function () {
return this.pa.nodeIndent
}, function (a) {
this.pa.nodeIndent !== a && 0 <= a && (this.pa.nodeIndent = a, this.J())
});
t.g(Z, "alternateNodeIndentPastParent", Z.prototype.IG);
t.defineProperty(Z, {IG: "alternateNodeIndentPastParent"}, function () {
return this.pa.nodeIndentPastParent
}, function (a) {
this.pa.nodeIndentPastParent !== a && 0 <= a && 1 >= a && (this.pa.nodeIndentPastParent = a, this.J())
});
t.g(Z, "alternateNodeSpacing", Z.prototype.JG);
t.defineProperty(Z, {JG: "alternateNodeSpacing"}, function () {
return this.pa.nodeSpacing
}, function (a) {
this.pa.nodeSpacing !== a && (this.pa.nodeSpacing = a, this.J())
});
t.g(Z, "alternateLayerSpacing", Z.prototype.FG);
t.defineProperty(Z, {FG: "alternateLayerSpacing"}, function () {
return this.pa.layerSpacing
}, function (a) {
this.pa.layerSpacing !== a && (this.pa.layerSpacing = a, this.J())
});
t.g(Z, "alternateLayerSpacingParentOverlap", Z.prototype.GG);
t.defineProperty(Z, {GG: "alternateLayerSpacingParentOverlap"}, function () {
return this.pa.layerSpacingParentOverlap
}, function (a) {
this.pa.layerSpacingParentOverlap !== a && 0 <= a && 1 >= a && (this.pa.layerSpacingParentOverlap = a, this.J())
});
t.g(Z, "alternateCompaction", Z.prototype.CG);
t.defineProperty(Z, {CG: "alternateCompaction"}, function () {
return this.pa.compaction
}, function (a) {
this.pa.compaction !== a && (f && t.j(a, ca, Z, "alternateCompaction"), a === Tp || a === Vp) && (this.pa.compaction = a, this.J())
});
t.g(Z, "alternateBreadthLimit", Z.prototype.yG);
t.defineProperty(Z, {yG: "alternateBreadthLimit"}, function () {
return this.pa.breadthLimit
}, function (a) {
this.pa.breadthLimit !== a && 0 <= a && (this.pa.breadthLimit = a, this.J())
});
t.g(Z, "alternateRowSpacing", Z.prototype.MG);
t.defineProperty(Z, {MG: "alternateRowSpacing"}, function () {
return this.pa.rowSpacing
}, function (a) {
this.pa.rowSpacing !== a && (this.pa.rowSpacing = a, this.J())
});
t.g(Z, "alternateRowIndent", Z.prototype.LG);
t.defineProperty(Z, {LG: "alternateRowIndent"}, function () {
return this.pa.rowIndent
}, function (a) {
this.pa.rowIndent !== a && 0 <= a && (this.pa.rowIndent = a, this.J())
});
t.g(Z, "alternateCommentSpacing", Z.prototype.BG);
t.defineProperty(Z, {BG: "alternateCommentSpacing"}, function () {
return this.pa.commentSpacing
}, function (a) {
this.pa.commentSpacing !== a && (this.pa.commentSpacing = a, this.J())
});
t.g(Z, "alternateCommentMargin", Z.prototype.AG);
t.defineProperty(Z, {AG: "alternateCommentMargin"}, function () {
return this.pa.commentMargin
}, function (a) {
this.pa.commentMargin !== a && (this.pa.commentMargin = a, this.J())
});
t.g(Z, "alternateSetsPortSpot", Z.prototype.OG);
t.defineProperty(Z, {OG: "alternateSetsPortSpot"}, function () {
return this.pa.setsPortSpot
}, function (a) {
this.pa.setsPortSpot !== a && (this.pa.setsPortSpot = a, this.J())
});
t.g(Z, "alternatePortSpot", Z.prototype.KG);
t.defineProperty(Z, {KG: "alternatePortSpot"}, function () {
return this.pa.portSpot
}, function (a) {
this.pa.portSpot.K(a) || (this.pa.portSpot = a, this.J())
});
t.g(Z, "alternateSetsChildPortSpot", Z.prototype.NG);
t.defineProperty(Z, {NG: "alternateSetsChildPortSpot"}, function () {
return this.pa.setsChildPortSpot
}, function (a) {
this.pa.setsChildPortSpot !== a && (this.pa.setsChildPortSpot = a, this.J())
});
t.g(Z, "alternateChildPortSpot", Z.prototype.zG);
t.defineProperty(Z, {zG: "alternateChildPortSpot"}, function () {
return this.pa.childPortSpot
}, function (a) {
this.pa.childPortSpot.K(a) || (this.pa.childPortSpot = a, this.J())
});
var op;
Z.PathDefault = op = t.w(Z, "PathDefault", -1);
var pp;
Z.PathDestination = pp = t.w(Z, "PathDestination", 0);
var wp;
Z.PathSource = wp = t.w(Z, "PathSource", 1);
var Ip;
Z.SortingForwards = Ip = t.w(Z, "SortingForwards", 10);
var Jp;
Z.SortingReverse = Jp = t.w(Z, "SortingReverse", 11);
var Kp;
Z.SortingAscending = Kp = t.w(Z, "SortingAscending", 12);
var Lp;
Z.SortingDescending = Lp = t.w(Z, "SortingDescending", 13);
var iq;
Z.AlignmentCenterSubtrees = iq = t.w(Z, "AlignmentCenterSubtrees", 20);
var Mp;
Z.AlignmentCenterChildren = Mp = t.w(Z, "AlignmentCenterChildren", 21);
var Xp;
Z.AlignmentStart = Xp = t.w(Z, "AlignmentStart", 22);
var Yp;
Z.AlignmentEnd = Yp = t.w(Z, "AlignmentEnd", 23);
var Op;
Z.AlignmentBus = Op = t.w(Z, "AlignmentBus", 24);
var Dp;
Z.AlignmentBusBranching = Dp = t.w(Z, "AlignmentBusBranching", 25);
var Pp;
Z.AlignmentTopLeftBus = Pp = t.w(Z, "AlignmentTopLeftBus", 26);
var Qp;
Z.AlignmentBottomRightBus = Qp = t.w(Z, "AlignmentBottomRightBus", 27);
var Tp;
Z.CompactionNone = Tp = t.w(Z, "CompactionNone", 30);
var Vp;
Z.CompactionBlock = Vp = t.w(Z, "CompactionBlock", 31);
var qp;
Z.StyleLayered = qp = t.w(Z, "StyleLayered", 40);
var Hp;
Z.StyleLastParents = Hp = t.w(Z, "StyleLastParents", 41);
var Gp;
Z.StyleAlternating = Gp = t.w(Z, "StyleAlternating", 42);
var Fp;
Z.StyleRootOnly = Fp = t.w(Z, "StyleRootOnly", 43);
var rp;
Z.ArrangementVertical = rp = t.w(Z, "ArrangementVertical", 50);
var wq;
Z.ArrangementHorizontal = wq = t.w(Z, "ArrangementHorizontal", 51);
var vp;
Z.ArrangementFixedRoots = vp = t.w(Z, "ArrangementFixedRoots", 52);
function tp() {
ra.call(this)
}
t.ea("TreeNetwork", tp);
t.Ja(tp, ra);
tp.prototype.createVertex = function () {
return new sp
};
tp.prototype.createEdge = function () {
return new yq
};
function sp() {
sa.call(this);
this.initialized = !1;
this.parent = null;
this.children = [];
this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0;
this.comments = null;
this.ja = new v(0, 0);
this.Wa = new da(0, 0);
this.Ha = new v(0, 0);
this.mp = this.lp = this.zI = !1;
this.Zs = this.Is = null;
this.sorting = Ip;
this.comparer = tn;
this.angle = 0;
this.alignment = Mp;
this.nodeIndentPastParent = this.nodeIndent = 0;
this.nodeSpacing = 20;
this.layerSpacing = 50;
this.layerSpacingParentOverlap = 0;
this.compaction = Vp;
this.breadthLimit =
0;
this.rowSpacing = 25;
this.commentSpacing = this.rowIndent = 10;
this.commentMargin = 20;
this.setsPortSpot = !0;
this.portSpot = xb;
this.setsChildPortSpot = !0;
this.childPortSpot = xb
}
t.ea("TreeVertex", sp);
t.Ja(sp, sa);
sp.prototype.copyInheritedPropertiesFrom = function (a) {
null !== a && (this.sorting = a.sorting, this.comparer = a.comparer, this.angle = a.angle, this.alignment = a.alignment, this.nodeIndent = a.nodeIndent, this.nodeIndentPastParent = a.nodeIndentPastParent, this.nodeSpacing = a.nodeSpacing, this.layerSpacing = a.layerSpacing, this.layerSpacingParentOverlap = a.layerSpacingParentOverlap, this.compaction = a.compaction, this.breadthLimit = a.breadthLimit, this.rowSpacing = a.rowSpacing, this.rowIndent = a.rowIndent, this.commentSpacing = a.commentSpacing,
this.commentMargin = a.commentMargin, this.setsPortSpot = a.setsPortSpot, this.portSpot = a.portSpot, this.setsChildPortSpot = a.setsChildPortSpot, this.childPortSpot = a.childPortSpot)
};
t.A(sp, {lm: "childrenCount"}, function () {
return this.children.length
});
t.g(sp, "relativePosition", sp.prototype.tI);
t.defineProperty(sp, {tI: "relativePosition"}, function () {
return this.ja
}, function (a) {
t.j(a, v, sp, "relativePosition");
this.ja.set(a)
});
t.g(sp, "subtreeSize", sp.prototype.HI);
t.defineProperty(sp, {HI: "subtreeSize"}, function () {
return this.Wa
}, function (a) {
t.j(a, da, sp, "subtreeSize");
this.Wa.set(a)
});
t.g(sp, "subtreeOffset", sp.prototype.GI);
t.defineProperty(sp, {GI: "subtreeOffset"}, function () {
return this.Ha
}, function (a) {
t.j(a, v, sp, "subtreeOffset");
this.Ha.set(a)
});
function yq() {
ta.call(this);
this.nr = new v(0, 0)
}
t.ea("TreeEdge", yq);
t.Ja(yq, ta);
yq.prototype.commit = function () {
var a = this.link;
if (null !== a && !a.Bi) {
var b = this.network.Vb, c = null, d = null;
switch (b.sf) {
case pp:
c = this.fromVertex;
d = this.toVertex;
break;
case wp:
c = this.toVertex;
d = this.fromVertex;
break;
default:
t.m("Unhandled path value " + b.sf.toString())
}
if (null !== c && null !== d)if (b = this.nr, 0 !== b.x || 0 !== b.y || c.zI) {
var d = c.Hb, e = Wp(c), g = Zp(c), h = c.rowSpacing;
a.updateRoute();
var k = a.ye === Jg, l = a.Ub, m, n, p, q;
a.il();
if (l || k) {
for (m = 2; 4 < a.ka;)a.HE(2);
n = a.n(1);
p = a.n(2)
} else {
for (m = 1; 3 < a.ka;)a.HE(1);
n =
a.n(0);
p = a.n(a.ka - 1)
}
q = a.n(a.ka - 1);
0 === e ? (c.alignment === Yp ? (e = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (e = Math.min(e, Math.max(n.y, e - $p(c))))) : c.alignment === Xp ? (e = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (e = Math.max(e, Math.min(n.y, e + $p(c))))) : e = c.lp || c.mp && 1 === c.maxGenerationCount ? d.top - c.Ha.y + b.y : d.y + d.height / 2 + b.y, k ? (a.C(m, n.x, e), m++, a.C(m, d.right + g, e), m++, a.C(m, d.right + g + (b.x - h) / 3, e), m++, a.C(m, d.right + g + 2 * (b.x - h) / 3, e), m++, a.C(m, d.right + g + (b.x - h), e), m++, a.C(m, p.x, e)) : (l && (a.C(m, d.right + g / 2, n.y),
m++), a.C(m, d.right + g / 2, e), m++, a.C(m, d.right + g + b.x - (l ? h / 2 : h), e), m++, l && a.C(m, a.n(m - 1).x, p.y))) : 90 === e ? (c.alignment === Yp ? (e = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (e = Math.min(e, Math.max(n.x, e - $p(c))))) : c.alignment === Xp ? (e = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (e = Math.max(e, Math.min(n.x, e + $p(c))))) : e = c.lp || c.mp && 1 === c.maxGenerationCount ? d.left - c.Ha.x + b.x : d.x + d.width / 2 + b.x, k ? (a.C(m, e, n.y), m++, a.C(m, e, d.bottom + g), m++, a.C(m, e, d.bottom + g + (b.y - h) / 3), m++, a.C(m, e, d.bottom + g + 2 * (b.y - h) / 3), m++, a.C(m, e, d.bottom +
g + (b.y - h)), m++, a.C(m, e, p.y)) : (l && (a.C(m, n.x, d.bottom + g / 2), m++), a.C(m, e, d.bottom + g / 2), m++, a.C(m, e, d.bottom + g + b.y - (l ? h / 2 : h)), m++, l && a.C(m, p.x, a.n(m - 1).y))) : 180 === e ? (c.alignment === Yp ? (e = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (e = Math.min(e, Math.max(n.y, e - $p(c))))) : c.alignment === Xp ? (e = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (e = Math.max(e, Math.min(n.y, e + $p(c))))) : e = c.lp || c.mp && 1 === c.maxGenerationCount ? d.top - c.Ha.y + b.y : d.y + d.height / 2 + b.y, k ? (a.C(m, n.x, e), m++, a.C(m, d.left - g, e), m++, a.C(m, d.left - g + (b.x +
h) / 3, e), m++, a.C(m, d.left - g + 2 * (b.x + h) / 3, e), m++, a.C(m, d.left - g + (b.x + h), e), m++, a.C(m, p.x, e)) : (l && (a.C(m, d.left - g / 2, n.y), m++), a.C(m, d.left - g / 2, e), m++, a.C(m, d.left - g + b.x + (l ? h / 2 : h), e), m++, l && a.C(m, a.n(m - 1).x, p.y))) : 270 === e ? (c.alignment === Yp ? (e = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (e = Math.min(e, Math.max(n.x, e - $p(c))))) : c.alignment === Xp ? (e = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (e = Math.max(e, Math.min(n.x, e + $p(c))))) : e = c.lp || c.mp && 1 === c.maxGenerationCount ? d.left - c.Ha.x + b.x : d.x + d.width / 2 + b.x, k ? (a.C(m,
e, n.y), m++, a.C(m, e, d.top - g), m++, a.C(m, e, d.top - g + (b.y + h) / 3), m++, a.C(m, e, d.top - g + 2 * (b.y + h) / 3), m++, a.C(m, e, d.top - g + (b.y + h)), m++, a.C(m, e, p.y)) : (l && (a.C(m, n.x, d.top - g / 2), m++), a.C(m, e, d.top - g / 2), m++, a.C(m, e, d.top - g + b.y + (l ? h / 2 : h)), m++, l && a.C(m, p.x, a.n(m - 1).y))) : t.m("Invalid angle " + e);
a.ri()
} else g = c, h = d, f && t.j(g, sp, yq, "adjustRouteForAngleChange:parent"), f && t.j(h, sp, yq, "adjustRouteForAngleChange:child"), a = this.link, c = Wp(g), c !== Wp(h) && (b = Zp(g), d = g.Hb, g = h.Hb, 0 === c && g.left - d.right < b + 1 || 90 === c && g.top - d.bottom <
b + 1 || 180 === c && d.left - g.right < b + 1 || 270 === c && d.top - g.bottom < b + 1 || (a.updateRoute(), g = a.ye === Jg, h = a.Ub, k = Np(this.fromVertex.alignment), a.il(), 0 === c ? (c = d.right + b / 2, g ? 4 === a.ka && (b = a.n(3).y, a.U(1, c - 20, a.n(1).y), a.C(2, c - 20, b), a.C(3, c, b), a.C(4, c + 20, b), a.U(5, a.n(5).x, b)) : h ? k ? a.U(3, a.n(2).x, a.n(4).y) : 6 === a.ka && (a.U(2, c, a.n(2).y), a.U(3, c, a.n(3).y)) : 4 === a.ka ? a.C(2, c, a.n(2).y) : 3 === a.ka ? a.U(1, c, a.n(2).y) : 2 === a.ka && a.C(1, c, a.n(1).y)) : 90 === c ? (b = d.bottom + b / 2, g ? 4 === a.ka && (c = a.n(3).x, a.U(1, a.n(1).x, b - 20), a.C(2, c, b - 20),
a.C(3, c, b), a.C(4, c, b + 20), a.U(5, c, a.n(5).y)) : h ? k ? a.U(3, a.n(2).x, a.n(4).y) : 6 === a.ka && (a.U(2, a.n(2).x, b), a.U(3, a.n(3).x, b)) : 4 === a.ka ? a.C(2, a.n(2).x, b) : 3 === a.ka ? a.U(1, a.n(2).x, b) : 2 === a.ka && a.C(1, a.n(1).x, b)) : 180 === c ? (c = d.left - b / 2, g ? 4 === a.ka && (b = a.n(3).y, a.U(1, c + 20, a.n(1).y), a.C(2, c + 20, b), a.C(3, c, b), a.C(4, c - 20, b), a.U(5, a.n(5).x, b)) : h ? k ? a.U(3, a.n(2).x, a.n(4).y) : 6 === a.ka && (a.U(2, c, a.n(2).y), a.U(3, c, a.n(3).y)) : 4 === a.ka ? a.C(2, c, a.n(2).y) : 3 === a.ka ? a.U(1, c, a.n(2).y) : 2 === a.ka && a.C(1, c, a.n(1).y)) : 270 === c && (b =
d.top - b / 2, g ? 4 === a.ka && (c = a.n(3).x, a.U(1, a.n(1).x, b + 20), a.C(2, c, b + 20), a.C(3, c, b), a.C(4, c, b - 20), a.U(5, c, a.n(5).y)) : h ? k ? a.U(3, a.n(2).x, a.n(4).y) : 6 === a.ka && (a.U(2, a.n(2).x, b), a.U(3, a.n(3).x, b)) : 4 === a.ka ? a.C(2, a.n(2).x, b) : 3 === a.ka ? a.U(1, a.n(2).x, b) : 2 === a.ka && a.C(1, a.n(1).x, b)), a.ri()))
}
};
t.g(yq, "relativePoint", yq.prototype.sI);
t.defineProperty(yq, {sI: "relativePoint"}, function () {
return this.nr
}, function (a) {
this.nr.set(a)
});
function zq() {
this.rn = []
}
function yk(a) {
var b = new zq, c;
if ("string" === typeof a)c = (new DOMParser).parseFromString(a, "text/xml"); else if (a instanceof Document)c = a.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null), c.appendChild(c.importNode(a.documentElement, !0)); else return null;
a = c.getElementsByTagName("svg");
if (0 === a.length)return null;
var d = a[0], e = c.getElementsByTagName("linearGradient"), g = c.getElementsByTagName("radialGradient");
for (a = 0; a < e.length; a++) {
for (var h = e[a], k = zk(Nd, Qd, {start: Vb, end: Wb}), l =
h.childNodes, m = 0; m < l.length; m++)if ("stop" === l[m].tagName) {
var n = Aq(b, l[m], "stop-color");
if (n) {
var p = Aq(b, l[m], "offset");
p || (p = "0");
var q = parseFloat(p);
isNaN(q) && (q = 0);
k.addColorStop((-1 !== p.indexOf("%") ? 0.01 : 1) * q, n)
}
}
h = h.getAttribute("id");
"string" === typeof h && (b["_brush" + h] = k)
}
for (a = 0; a < g.length; a++) {
h = g[a];
k = zk(Nd, Rd, {start: Hb, end: Hb});
l = h.childNodes;
for (m = 0; m < l.length; m++)"stop" === l[m].tagName && (n = Aq(b, l[m], "stop-color")) && ((p = Aq(b, l[m], "offset")) || (p = "0"), q = parseFloat(p), isNaN(q) && (q = 0), k.addColorStop((-1 !==
p.indexOf("%") ? 0.01 : 1) * q, n));
h = h.getAttribute("id");
"string" === typeof h && (b["_brush" + h] = k)
}
for (e = !0; e;)for (e = !1, g = c.getElementsByTagName("use"), a = 0; a < g.length; a++)k = g[a], 0 === k.childNodes.length && (h = k.href, void 0 !== h && (h = c.getElementById(h.baseVal.substring(1)), null !== h && (h = h.cloneNode(!0), h.removeAttribute("id"), l = parseFloat(k.getAttribute("x")), isNaN(l) && (l = 0), m = parseFloat(k.getAttribute("y")), isNaN(m) && (m = 0), n = k.getAttribute("transform"), null === n && (n = ""), k.setAttribute("transform", n + " translate(" +
l + "," + m + ")"), k.appendChild(h), "use" === h.tagName && (e = !0))));
Bq(b, d, null);
c = new y;
if (0 === b.rn.length)return c;
if (1 === b.rn.length)return b.rn[0];
for (a = 0; a < b.rn.length; a++)c.add(b.rn[a]);
return c
}
function Cq(a, b) {
var c = a.getAttribute(b);
"string" !== typeof c && a.style && (c = a.style[b]);
return"string" !== typeof c ? null : c
}
function Aq(a, b, c) {
var d = b.getAttribute(c);
"string" !== typeof d && b.style && (d = b.style[c]);
return"string" !== typeof d || "" === d || "inherit" === d ? (b = b.parentNode, "g" === b.tagName || "use" === b.tagName ? Aq(a, b, c) : null) : d
}
function Bq(a, b, c) {
var d = b.tagName;
if (("g" === d || "svg" === d || "use" === d || "symbol" === d) && "none" !== Aq(a, b, "display")) {
for (var d = b.childNodes, e = 0; e < d.length; e++) {
var g = d[e], h = null;
if (void 0 !== g.getAttribute) {
var k = g.getAttribute("transform");
switch (g.tagName) {
case "g":
null === k ? Bq(a, g, null) : (h = new y, Bq(a, g, h));
break;
case "use":
null === k ? Bq(a, g, null) : (h = new y, Bq(a, g, h));
break;
case "symbol":
if ("use" !== b.tagName)break;
h = new y;
Bq(a, g, h);
var l = h, m = a, n = g;
Aq(m, n, "preserveAspectRatio");
Aq(m, n, "viewBox");
l.scale =
1;
break;
case "path":
l = g;
h = new Y;
l = l.getAttribute("d");
"string" === typeof l && (h.CD = Mc(l));
break;
case "line":
var p = g, h = new Y, l = parseFloat(p.getAttribute("x1"));
isNaN(l) && (l = 0);
m = parseFloat(p.getAttribute("y1"));
isNaN(m) && (m = 0);
n = parseFloat(p.getAttribute("x2"));
isNaN(n) && (n = 0);
p = parseFloat(p.getAttribute("y2"));
isNaN(p) && (p = 0);
var q = new I(Gc);
h.position = new v(Math.min(l, n), Math.min(m, p));
0 < (n - l) / (p - m) ? (q.la = 0, q.ma = 0, q.D = Math.abs(n - l), q.F = Math.abs(p - m)) : (q.la = 0, q.ma = Math.abs(p - m), q.D = Math.abs(n - l), q.F =
0);
h.Wc = q;
break;
case "circle":
n = g;
h = new Y;
l = parseFloat(n.getAttribute("r"));
isNaN(l) || 0 > l ? h = null : (m = parseFloat(n.getAttribute("cx")), isNaN(m) && (m = 0), n = parseFloat(n.getAttribute("cy")), isNaN(n) && (n = 0), p = new I(Ic), p.la = 0, p.ma = 0, p.D = 2 * l, p.F = 2 * l, h.position = new v(m - l, n - l), h.Wc = p);
break;
case "ellipse":
p = g;
h = new Y;
l = parseFloat(p.getAttribute("rx"));
isNaN(l) || 0 > l ? h = null : (m = parseFloat(p.getAttribute("ry")), isNaN(m) || 0 > m ? h = null : (n = parseFloat(p.getAttribute("cx")), isNaN(n) && (n = 0), p = parseFloat(p.getAttribute("cy")),
isNaN(p) && (p = 0), q = new I(Ic), q.la = 0, q.ma = 0, q.D = 2 * l, q.F = 2 * m, h.position = new v(n - l, p - m), h.Wc = q));
break;
case "rect":
q = g;
h = new Y;
l = parseFloat(q.getAttribute("width"));
if (isNaN(l) || 0 > l)h = null; else if (m = parseFloat(q.getAttribute("height")), isNaN(m) || 0 > m)h = null; else {
n = parseFloat(q.getAttribute("x"));
isNaN(n) && (n = 0);
p = parseFloat(q.getAttribute("y"));
isNaN(p) && (p = 0);
var r = q.getAttribute("rx"), s = q.getAttribute("ry"), q = parseFloat(r);
if (isNaN(q) || 0 > q)q = 0;
var u = parseFloat(s);
if (isNaN(u) || 0 > u)u = 0;
!r && s ? q = u : r && !s &&
(u = q);
q = Math.min(q, l / 2);
u = Math.min(u, m / 2);
s = void 0;
0 === q && 0 === u ? (s = new I(Hc), s.la = 0, s.ma = 0, s.D = l, s.F = m) : (s = D.sa / 2, r = t.u(), J(r, q, 0, !0), r.lineTo(l - q, 0), K(r, l - q * s, 0, l, u * s, l, u), r.lineTo(l, m - u), K(r, l, m - u * s, l - q * s, m, l - q, m), r.lineTo(q, m), K(r, q * s, m, 0, m - u * s, 0, m - u), r.lineTo(0, u), K(r, 0, u * s, q * s, 0, q, 0), M(r), s = r.s, t.v(r));
h.position = new v(n, p);
h.Wc = s
}
break;
case "polygon":
h = Dq(g);
break;
case "polyline":
h = Dq(g)
}
if (null !== h) {
if (h instanceof Y) {
l = Aq(a, g, "fill");
null !== l && -1 !== l.indexOf("url") ? (l = l.substring(l.indexOf("#") +
1, l.length - 1), l = a["_brush" + l], h.fill = l instanceof Nd ? l : "black") : h.fill = null === l ? "black" : "none" === l ? null : l;
l = Aq(a, g, "stroke");
null !== l && -1 !== l.indexOf("url") ? (l = l.substring(l.indexOf("#") + 1, l.length - 1), l = a["_brush" + l], h.stroke = l instanceof Nd ? l : "black") : h.stroke = "none" === l ? null : l;
l = parseFloat(Aq(a, g, "stroke-width"));
isNaN(l) || (h.bb = l);
l = Aq(a, g, "stroke-linecap");
null !== l && (h.mF = l);
if (l = Aq(a, g, "stroke-dasharray")) {
m = l.split(",");
n = [];
for (l = 0; l < m.length; l++)p = parseFloat(m[l]), !isNaN(p) && 0 < p && n.push(p);
h.zw = n
}
if (g = Aq(a, g, "stroke-dashoffset"))g = parseFloat(g), isNaN(g) || (h.nF = g);
h.Rz = !0
}
if (null !== k) {
k = k.split(")");
g = !0;
for (l = 0; l < k.length; l++)/\(.*[^0-9\.,\s-]/.test(k[l]) && (g = !1), /\(.*[0-9]-[0-9]/.test(k[l]) && (g = !1);
if (g)for (l = k.length - 1; 0 <= l; l--)if (m = k[l], "" !== m)switch (n = m.indexOf("("), g = m.substring(0, n).replace(/\s*/, ""), n = m.substring(n + 1).split(/\s*[\s,]\s*/), g) {
case "rotate":
Eq(a, h, n);
break;
case "translate":
g = h;
m = parseFloat(n[0]);
isNaN(m) && (m = 0);
n = parseFloat(n[1]);
isNaN(n) && (n = 0);
if (0 !== m || 0 !==
n)p = g.position.copy(), isNaN(p.x) && (p.x = 0), isNaN(p.y) && (p.y = 0), g.position = new v(m + p.x, n + p.y);
break;
case "scale":
Fq(a, h, n);
break;
case "skewX":
Gq(a, h, n);
break;
case "skewY":
Hq(a, h, n);
break;
case "matrix":
Iq(a, h, n)
}
}
if (h instanceof y) {
k = h.elements.l;
l = g = 0;
m = h.position.copy();
isNaN(m.x) && (m.x = 0);
isNaN(m.y) && (m.y = 0);
for (; k.next();)n = k.value.position.copy(), isNaN(n.x) && (n.x = 0), isNaN(n.y) && (n.y = 0), n.x < g && (g = n.x), n.y < l && (l = n.y);
m.x += g;
m.y += l;
h.position = m
}
null === c ? a.rn.push(h) : c.add(h)
}
}
}
if (null !== h) {
a = Cq(b,
"visibility");
if ("hidden" === a || "collapse" === a)h.visible = !1;
if (b = Cq(b, "opacity"))b = parseFloat(b), isNaN(b) || (h.opacity = b)
}
}
}
function Iq(a, b, c) {
var d = parseFloat(c[0]), e = parseFloat(c[1]), g = parseFloat(c[2]), h = parseFloat(c[3]), k = parseFloat(c[4]), l = parseFloat(c[5]);
if (!isNaN(d + e + g + h + k + l)) {
var m = b.position.copy();
isNaN(m.x) && (m.x = 0);
isNaN(m.y) && (m.y = 0);
if (b instanceof Y) {
c = b.Wc.copy();
if (c.type === Hc)c = a.Xr(c); else if (c.type === Ic)c = Jq(c); else if (c.type === Gc) {
c.type = Bc;
a = new Cc(c.la, c.ma);
var n = new O(Kc, c.D, c.F);
a.Ca.add(n);
c.ob.add(a)
}
c.offset(m.x, m.y);
c.transform(d, e, g, h, k - m.x, l - m.y);
a = c.normalize();
b.Wc = c;
m.x -= a.x;
m.y -= a.y;
b.position = m
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += m.x, d.y += m.y, b.value.position = d;
for (b.reset(); b.next();)Iq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= m.x, d.y -= m.y, b.value.position = d
}
}
}
function Eq(a, b, c) {
var d = parseFloat(c[0]);
isNaN(d) && (d = 0);
var e = parseFloat(c[1]);
isNaN(e) && (e = 0);
var g = parseFloat(c[2]);
isNaN(g) && (g = 0);
if (0 !== d) {
var h = d * Math.PI / 180, k = b.position.copy();
isNaN(k.x) && (k.x = 0);
isNaN(k.y) && (k.y = 0);
if (b instanceof Y) {
c = b.Wc.copy();
c.type === Ic ? c = Jq(c) : c.type === Hc && (c = a.Xr(c));
if (c.type === Bc)c.rotate(d, e - k.x, g - k.y), g = c.normalize(), b.Wc = c, k.x -= g.x, k.y -= g.y, b.position = k; else {
var d = c.la - e + k.x, l = c.ma - g + k.y, m = c.D - e + k.x, n = c.F - g + k.y;
a = d * Math.cos(h) - l * Math.sin(h) + e - k.x;
d = l * Math.cos(h) +
d * Math.sin(h) + g - k.y;
e = m * Math.cos(h) - n * Math.sin(h) + e - k.x;
g = n * Math.cos(h) + m * Math.sin(h) + g - k.y;
m = Math.min(a, e);
n = Math.min(d, g);
c.la = a - m;
c.ma = d - n;
c.D = e - m;
c.F = g - n;
k.x += m;
k.y += n;
b.position = k;
b.Wc = c
}
b.fill instanceof Nd && (k = b.fill.copy(), c = Math.atan((0.5 - k.start.y) / (0.5 - k.start.x)), isNaN(c) || (c += h, k.start = new H((1 - Math.cos(c)) / 2, (1 - Math.sin(c)) / 2), k.end = new H((1 + Math.cos(c)) / 2, (1 + Math.sin(c)) / 2)), b.fill = k);
b.stroke instanceof Nd && (k = b.stroke.copy(), c = Math.atan((0.5 - k.start.y) / (0.5 - k.start.x)), isNaN(c) ||
(c += h, k.start = new H((1 - Math.cos(c)) / 2, (1 - Math.sin(c)) / 2), k.end = new H((1 + Math.cos(c)) / 2, (1 + Math.sin(c)) / 2)), b.stroke = k)
} else {
for (b = b.elements.l; b.next();)h = b.value.position.copy(), h.x += k.x, h.y += k.y, b.value.position = h;
for (b.reset(); b.next();)Eq(a, b.value, c);
for (b.reset(); b.next();)h = b.value.position.copy(), h.x -= k.x, h.y -= k.y, b.value.position = h
}
}
}
function Fq(a, b, c) {
var d = parseFloat(c[0]);
isNaN(d) && (d = 1);
var e = parseFloat(c[1]);
isNaN(e) && (e = d);
if (1 !== d || 1 !== e) {
var g = b.position.copy();
isNaN(g.x) && (g.x = 0);
isNaN(g.y) && (g.y = 0);
if (b instanceof Y)a = b.Wc.copy(), g.x *= d, g.y *= e, b.position = g, a.scale(d, e), b.Wc = a; else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += g.x, d.y += g.y, b.value.position = d;
for (b.reset(); b.next();)Fq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= g.x, d.y -= g.y, b.value.position = d
}
}
}
function Gq(a, b, c) {
var d = parseFloat(c[0]);
if (!isNaN(d)) {
var d = d * Math.PI / 180, e = b.position.copy();
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
if (b instanceof Y) {
c = b.Wc.copy();
if (c.type === Hc)c = a.Xr(c); else if (c.type === Ic)c = Jq(c); else if (c.type === Gc) {
c.type = Bc;
a = new Cc(c.la, c.ma);
var g = new O(Kc, c.D, c.F);
a.Ca.add(g);
c.ob.add(a)
}
c.offset(e.x, e.y);
c.transform(1, 0, Math.tan(d), 1, -e.x, -e.y);
a = c.normalize();
b.Wc = c;
e.x -= a.x;
e.y -= a.y;
b.position = e
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += e.x,
d.y += e.y, b.value.position = d;
for (b.reset(); b.next();)Gq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= e.x, d.y -= e.y, b.value.position = d
}
}
}
function Hq(a, b, c) {
var d = parseFloat(c[0]);
if (!isNaN(d)) {
var d = d * Math.PI / 180, e = b.position.copy();
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
if (b instanceof Y) {
c = b.Wc.copy();
if (c.type === Hc)c = a.Xr(c); else if (c.type === Ic)c = Jq(c); else if (c.type === Gc) {
c.type = Bc;
a = new Cc(c.la, c.ma);
var g = new O(Kc, c.D, c.F);
a.Ca.add(g);
c.ob.add(a)
}
c.offset(e.x, e.y);
c.transform(1, Math.tan(d), 0, 1, -e.x, -e.y);
a = c.normalize();
b.Wc = c;
e.x -= a.x;
e.y -= a.y;
b.position = e
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += e.x,
d.y += e.y, b.value.position = d;
for (b.reset(); b.next();)Hq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= e.x, d.y -= e.y, b.value.position = d
}
}
}
function Dq(a) {
var b = !1;
if ("polygon" === a.tagName)b = !0; else if ("polyline" !== a.tagName)return null;
var c = new Y, d = a.getAttribute("points");
a = new I;
var e = new A(Cc), g = d.split(/\s*[\s,]\s*/);
if (4 > g.length)return null;
for (var h, d = new A(O), k, l, m = 1; m < g.length; m += 2) {
k = eval(g[m - 1]);
l = eval(g[m]);
if ("number" !== typeof k || isNaN(k) || "number" !== typeof l || isNaN(l))return null;
1 === m ? h = new Cc(k, l) : d.add(new O(Kc, k, l))
}
b && (b = new O(Kc, h.la, h.ma), b.close(), d.add(b));
h.Ca = d;
e.add(h);
a.ob = e;
h = a.normalize();
c.position = new v(-h.x,
-h.y);
c.Wc = a;
return c
}
function Jq(a) {
var b = a.la, c = a.ma, d = a.D, e = a.F, g = Math.abs(d - b) / 2, h = Math.abs(e - c) / 2, b = Math.min(b, d) + g, c = Math.min(c, e) + h;
new v;
e = new Cc(b, c - h);
d = new O(Zc);
d.pb = b + D.sa * g;
d.Gb = c - h;
d.je = b + g;
d.ke = c - D.sa * h;
d.D = b + g;
d.F = c;
e.Ca.add(d);
d = new O(Zc);
d.pb = b + g;
d.Gb = c + D.sa * h;
d.je = b + D.sa * g;
d.ke = c + h;
d.D = b;
d.F = c + h;
e.Ca.add(d);
d = new O(Zc);
d.pb = b - D.sa * g;
d.Gb = c + h;
d.je = b - g;
d.ke = c + D.sa * h;
d.D = b - g;
d.F = c;
e.Ca.add(d);
d = new O(Zc);
d.pb = b - g;
d.Gb = c - D.sa * h;
d.je = b - D.sa * g;
d.ke = c - h;
d.D = b;
d.F = c - h;
e.Ca.add(d);
a.type = Bc;
a.ob.add(e);
return a
}
zq.prototype.Xr = function (a) {
var b = a.la, c = a.ma, d = a.D, e = a.F, g = Math.min(b, d), h = Math.min(c, e), b = Math.abs(d - b), c = Math.abs(e - c), e = new Cc(g, h);
e.Ca.add(new O(Kc, g + b, h));
e.Ca.add(new O(Kc, g + b, h + c));
e.Ca.add((new O(Kc, g, h + c)).close());
a.type = Bc;
a.ob.add(e);
return a
};
ba.version = "1.3.6";
window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = ba : window.define && "function" === typeof window.define && window.define.amd ? (window.go = ba, window.define(ba)) : window.go = ba);
})(window);