@camunda8/cli 3.4.0-alpha.3 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN-HELP.md +25 -0
- package/dist/core/runtime.d.ts +55 -1
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +10 -0
- package/dist/core/runtime.js.map +1 -1
- package/dist/default-plugins/bpmn/c8ctl-plugin.js +7 -2
- package/dist/default-plugins/element-template/c8ctl-plugin.js +12 -3
- package/dist/default-plugins/element-template/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/templates/AGENTS.md +10 -0
- package/dist/utils/shared/npm-exec.d.ts +18 -2
- package/dist/utils/shared/npm-exec.d.ts.map +1 -1
- package/dist/utils/shared/npm-exec.js +150 -6
- package/dist/utils/shared/npm-exec.js.map +1 -1
- package/dist/vendor/bpmn-element-templates.cjs +870 -776
- package/dist/vendor/bpmnlint.cjs +581 -572
- package/package.json +3 -3
|
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
|
|
8
|
+
var __esm = (fn, res, err) => function __init() {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
} catch (e2) {
|
|
13
|
+
throw err = [e2], e2;
|
|
14
|
+
}
|
|
10
15
|
};
|
|
11
16
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
|
|
17
|
+
try {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
} catch (e2) {
|
|
20
|
+
throw mod = 0, e2;
|
|
21
|
+
}
|
|
13
22
|
};
|
|
14
23
|
var __export = (target, all) => {
|
|
15
24
|
for (var name2 in all)
|
|
@@ -27564,7 +27573,7 @@ function isDefined(obj) {
|
|
|
27564
27573
|
function isNil(obj) {
|
|
27565
27574
|
return obj == null;
|
|
27566
27575
|
}
|
|
27567
|
-
function isArray$
|
|
27576
|
+
function isArray$2(obj) {
|
|
27568
27577
|
return nativeToString$1.call(obj) === "[object Array]";
|
|
27569
27578
|
}
|
|
27570
27579
|
function isObject(obj) {
|
|
@@ -27581,7 +27590,7 @@ function isString(obj) {
|
|
|
27581
27590
|
return nativeToString$1.call(obj) === "[object String]";
|
|
27582
27591
|
}
|
|
27583
27592
|
function ensureArray(obj) {
|
|
27584
|
-
if (isArray$
|
|
27593
|
+
if (isArray$2(obj)) {
|
|
27585
27594
|
return;
|
|
27586
27595
|
}
|
|
27587
27596
|
throw new Error("must supply array");
|
|
@@ -27602,7 +27611,7 @@ function find(collection2, matcher) {
|
|
|
27602
27611
|
}
|
|
27603
27612
|
function findIndex(collection2, matcher) {
|
|
27604
27613
|
const matchFn = toMatcher(matcher);
|
|
27605
|
-
let idx = isArray$
|
|
27614
|
+
let idx = isArray$2(collection2) ? -1 : void 0;
|
|
27606
27615
|
forEach$1(collection2, function(val, key) {
|
|
27607
27616
|
if (matchFn(val, key)) {
|
|
27608
27617
|
idx = key;
|
|
@@ -27626,7 +27635,7 @@ function forEach$1(collection2, iterator) {
|
|
|
27626
27635
|
if (isUndefined$2(collection2)) {
|
|
27627
27636
|
return;
|
|
27628
27637
|
}
|
|
27629
|
-
const convertKey = isArray$
|
|
27638
|
+
const convertKey = isArray$2(collection2) ? toNum$1 : identity$1;
|
|
27630
27639
|
for (let key in collection2) {
|
|
27631
27640
|
if (has$1(collection2, key)) {
|
|
27632
27641
|
val = collection2[key];
|
|
@@ -27786,7 +27795,7 @@ function bind$2(fn, target) {
|
|
|
27786
27795
|
function assign$1(target, ...others) {
|
|
27787
27796
|
return Object.assign(target, ...others);
|
|
27788
27797
|
}
|
|
27789
|
-
function set$
|
|
27798
|
+
function set$1(target, path, value) {
|
|
27790
27799
|
let currentTarget = target;
|
|
27791
27800
|
forEach$1(path, function(key, idx) {
|
|
27792
27801
|
if (typeof key !== "number" && typeof key !== "string") {
|
|
@@ -27835,7 +27844,7 @@ function omit(target, properties) {
|
|
|
27835
27844
|
});
|
|
27836
27845
|
return result;
|
|
27837
27846
|
}
|
|
27838
|
-
function _mergeNamespaces(n, m) {
|
|
27847
|
+
function _mergeNamespaces$1(n, m) {
|
|
27839
27848
|
m.forEach(function(e2) {
|
|
27840
27849
|
e2 && typeof e2 !== "string" && !Array.isArray(e2) && Object.keys(e2).forEach(function(k) {
|
|
27841
27850
|
if (k !== "default" && !(k in n)) {
|
|
@@ -27856,7 +27865,7 @@ var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
27856
27865
|
function isUndefined$1(obj) {
|
|
27857
27866
|
return obj === void 0;
|
|
27858
27867
|
}
|
|
27859
|
-
function isArray$
|
|
27868
|
+
function isArray$1(obj) {
|
|
27860
27869
|
return nativeToString.call(obj) === "[object Array]";
|
|
27861
27870
|
}
|
|
27862
27871
|
function has(target, key) {
|
|
@@ -27867,7 +27876,7 @@ function forEach(collection2, iterator) {
|
|
|
27867
27876
|
if (isUndefined$1(collection2)) {
|
|
27868
27877
|
return;
|
|
27869
27878
|
}
|
|
27870
|
-
const convertKey = isArray$
|
|
27879
|
+
const convertKey = isArray$1(collection2) ? toNum : identity;
|
|
27871
27880
|
for (let key in collection2) {
|
|
27872
27881
|
if (has(collection2, key)) {
|
|
27873
27882
|
val = collection2[key];
|
|
@@ -27943,7 +27952,7 @@ ClassList$1.prototype.array = function() {
|
|
|
27943
27952
|
ClassList$1.prototype.has = ClassList$1.prototype.contains = function(name2) {
|
|
27944
27953
|
return this.list.contains(name2);
|
|
27945
27954
|
};
|
|
27946
|
-
function clear
|
|
27955
|
+
function clear(el) {
|
|
27947
27956
|
var c;
|
|
27948
27957
|
while (el.childNodes.length) {
|
|
27949
27958
|
c = el.childNodes[0];
|
|
@@ -27983,7 +27992,7 @@ var unbind_1 = componentEvent.unbind = function(el, type, fn, capture) {
|
|
|
27983
27992
|
el[unbind$1](prefix$6 + type, fn, capture || false);
|
|
27984
27993
|
return fn;
|
|
27985
27994
|
};
|
|
27986
|
-
var event = /* @__PURE__ */ _mergeNamespaces({
|
|
27995
|
+
var event = /* @__PURE__ */ _mergeNamespaces$1({
|
|
27987
27996
|
__proto__: null,
|
|
27988
27997
|
bind: bind_1,
|
|
27989
27998
|
unbind: unbind_1,
|
|
@@ -28240,14 +28249,7 @@ function remove$1(element) {
|
|
|
28240
28249
|
}
|
|
28241
28250
|
return element;
|
|
28242
28251
|
}
|
|
28243
|
-
function
|
|
28244
|
-
var child;
|
|
28245
|
-
while (child = element.firstChild) {
|
|
28246
|
-
remove$1(child);
|
|
28247
|
-
}
|
|
28248
|
-
return element;
|
|
28249
|
-
}
|
|
28250
|
-
function clone$1(element) {
|
|
28252
|
+
function clone(element) {
|
|
28251
28253
|
return element.cloneNode(true);
|
|
28252
28254
|
}
|
|
28253
28255
|
var ns = {
|
|
@@ -28301,7 +28303,7 @@ function getNode() {
|
|
|
28301
28303
|
}
|
|
28302
28304
|
return node;
|
|
28303
28305
|
}
|
|
28304
|
-
function extend
|
|
28306
|
+
function extend(object, props) {
|
|
28305
28307
|
var i, k, keys3 = Object.keys(props);
|
|
28306
28308
|
for (i = 0; k = keys3[i]; i++) {
|
|
28307
28309
|
object[k] = props[k];
|
|
@@ -28314,9 +28316,9 @@ function createMatrix(a, b, c, d, e2, f) {
|
|
|
28314
28316
|
case 0:
|
|
28315
28317
|
return matrix;
|
|
28316
28318
|
case 1:
|
|
28317
|
-
return extend
|
|
28319
|
+
return extend(matrix, a);
|
|
28318
28320
|
case 6:
|
|
28319
|
-
return extend
|
|
28321
|
+
return extend(matrix, {
|
|
28320
28322
|
a,
|
|
28321
28323
|
b,
|
|
28322
28324
|
c,
|
|
@@ -28327,9 +28329,7 @@ function createMatrix(a, b, c, d, e2, f) {
|
|
|
28327
28329
|
}
|
|
28328
28330
|
}
|
|
28329
28331
|
function createTransform(matrix) {
|
|
28330
|
-
|
|
28331
|
-
return getNode().createSVGTransformFromMatrix(matrix);
|
|
28332
|
-
} else {
|
|
28332
|
+
{
|
|
28333
28333
|
return getNode().createSVGTransform();
|
|
28334
28334
|
}
|
|
28335
28335
|
}
|
|
@@ -28388,20 +28388,6 @@ function serialize(node2, output) {
|
|
|
28388
28388
|
}
|
|
28389
28389
|
return output;
|
|
28390
28390
|
}
|
|
28391
|
-
function set$1(element, svg) {
|
|
28392
|
-
var parsed = parse(svg);
|
|
28393
|
-
clear(element);
|
|
28394
|
-
if (!svg) {
|
|
28395
|
-
return;
|
|
28396
|
-
}
|
|
28397
|
-
if (!isFragment(parsed)) {
|
|
28398
|
-
parsed = parsed.documentElement;
|
|
28399
|
-
}
|
|
28400
|
-
var nodes = slice$1(parsed.childNodes);
|
|
28401
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
28402
|
-
appendTo(nodes[i], element);
|
|
28403
|
-
}
|
|
28404
|
-
}
|
|
28405
28391
|
function get(element) {
|
|
28406
28392
|
var child = element.firstChild, output = [];
|
|
28407
28393
|
while (child) {
|
|
@@ -28410,24 +28396,11 @@ function get(element) {
|
|
|
28410
28396
|
}
|
|
28411
28397
|
return output.join("");
|
|
28412
28398
|
}
|
|
28413
|
-
function isFragment(node2) {
|
|
28414
|
-
return node2.nodeName === "#document-fragment";
|
|
28415
|
-
}
|
|
28416
28399
|
function innerSVG(element, svg) {
|
|
28417
|
-
|
|
28418
|
-
try {
|
|
28419
|
-
set$1(element, svg);
|
|
28420
|
-
} catch (e2) {
|
|
28421
|
-
throw new Error("error parsing SVG: " + e2.message);
|
|
28422
|
-
}
|
|
28423
|
-
return element;
|
|
28424
|
-
} else {
|
|
28400
|
+
{
|
|
28425
28401
|
return get(element);
|
|
28426
28402
|
}
|
|
28427
28403
|
}
|
|
28428
|
-
function slice$1(arr) {
|
|
28429
|
-
return Array.prototype.slice.call(arr);
|
|
28430
|
-
}
|
|
28431
28404
|
function wrapMatrix(transformList, transform2) {
|
|
28432
28405
|
if (transform2 instanceof SVGMatrix) {
|
|
28433
28406
|
return transformList.createSVGTransformFromMatrix(transform2);
|
|
@@ -28455,14 +28428,14 @@ var CLASS_PATTERN = /^class[ {]/;
|
|
|
28455
28428
|
function isClass(fn) {
|
|
28456
28429
|
return CLASS_PATTERN.test(fn.toString());
|
|
28457
28430
|
}
|
|
28458
|
-
function isArray
|
|
28431
|
+
function isArray(obj) {
|
|
28459
28432
|
return Array.isArray(obj);
|
|
28460
28433
|
}
|
|
28461
28434
|
function hasOwnProp(obj, prop) {
|
|
28462
28435
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
28463
28436
|
}
|
|
28464
28437
|
function annotate(...args) {
|
|
28465
|
-
if (args.length === 1 && isArray
|
|
28438
|
+
if (args.length === 1 && isArray(args[0])) {
|
|
28466
28439
|
args = args[0];
|
|
28467
28440
|
}
|
|
28468
28441
|
args = [...args];
|
|
@@ -28536,7 +28509,7 @@ function Injector(modules, parent) {
|
|
|
28536
28509
|
locals = {};
|
|
28537
28510
|
}
|
|
28538
28511
|
if (typeof fn !== "function") {
|
|
28539
|
-
if (isArray
|
|
28512
|
+
if (isArray(fn)) {
|
|
28540
28513
|
fn = annotate(fn.slice());
|
|
28541
28514
|
} else {
|
|
28542
28515
|
throw error2(`Cannot invoke "${fn}". Expected a function!`);
|
|
@@ -28710,7 +28683,7 @@ function Injector(modules, parent) {
|
|
|
28710
28683
|
this.init = bootstrap2(modules);
|
|
28711
28684
|
}
|
|
28712
28685
|
function arrayUnwrap(type, value) {
|
|
28713
|
-
if (type !== "value" && isArray
|
|
28686
|
+
if (type !== "value" && isArray(value)) {
|
|
28714
28687
|
value = annotate(value.slice());
|
|
28715
28688
|
}
|
|
28716
28689
|
return value;
|
|
@@ -28852,12 +28825,12 @@ function add$1(elements, element, unique) {
|
|
|
28852
28825
|
}
|
|
28853
28826
|
function eachElement(elements, fn, depth) {
|
|
28854
28827
|
depth = depth || 0;
|
|
28855
|
-
if (!isArray$
|
|
28828
|
+
if (!isArray$2(elements)) {
|
|
28856
28829
|
elements = [elements];
|
|
28857
28830
|
}
|
|
28858
28831
|
forEach$1(elements, function(s, i) {
|
|
28859
28832
|
var filter3 = fn(s, i, depth);
|
|
28860
|
-
if (isArray$
|
|
28833
|
+
if (isArray$2(filter3) && filter3.length) {
|
|
28861
28834
|
eachElement(filter3, fn, depth + 1);
|
|
28862
28835
|
}
|
|
28863
28836
|
});
|
|
@@ -28867,7 +28840,7 @@ function selfAndChildren(elements, unique, maxDepth) {
|
|
|
28867
28840
|
eachElement(elements, function(element, i, depth) {
|
|
28868
28841
|
add$1(result, element, unique);
|
|
28869
28842
|
var children = element.children;
|
|
28870
|
-
|
|
28843
|
+
{
|
|
28871
28844
|
if (children && add$1(processedChildren, children, unique)) {
|
|
28872
28845
|
return children;
|
|
28873
28846
|
}
|
|
@@ -28876,7 +28849,7 @@ function selfAndChildren(elements, unique, maxDepth) {
|
|
|
28876
28849
|
return result;
|
|
28877
28850
|
}
|
|
28878
28851
|
function selfAndAllChildren(elements, allowDuplicates) {
|
|
28879
|
-
return selfAndChildren(elements, !allowDuplicates
|
|
28852
|
+
return selfAndChildren(elements, !allowDuplicates);
|
|
28880
28853
|
}
|
|
28881
28854
|
function getClosure(elements, isTopLevel, closure) {
|
|
28882
28855
|
if (isUndefined$2(isTopLevel)) {
|
|
@@ -28925,7 +28898,7 @@ function getClosure(elements, isTopLevel, closure) {
|
|
|
28925
28898
|
}
|
|
28926
28899
|
function getBBox(elements, stopRecursion) {
|
|
28927
28900
|
stopRecursion = !!stopRecursion;
|
|
28928
|
-
if (!isArray$
|
|
28901
|
+
if (!isArray$2(elements)) {
|
|
28929
28902
|
elements = [elements];
|
|
28930
28903
|
}
|
|
28931
28904
|
var minX, minY, maxX, maxY;
|
|
@@ -29041,7 +29014,7 @@ function Styles() {
|
|
|
29041
29014
|
return assign$1(attrs, { "class": className });
|
|
29042
29015
|
};
|
|
29043
29016
|
this.style = function(traits, additionalAttrs) {
|
|
29044
|
-
if (!isArray$
|
|
29017
|
+
if (!isArray$2(traits) && !additionalAttrs) {
|
|
29045
29018
|
additionalAttrs = traits;
|
|
29046
29019
|
traits = [];
|
|
29047
29020
|
}
|
|
@@ -29051,7 +29024,7 @@ function Styles() {
|
|
|
29051
29024
|
return additionalAttrs ? assign$1(attrs, additionalAttrs) : attrs;
|
|
29052
29025
|
};
|
|
29053
29026
|
this.computeStyle = function(custom, traits, defaultStyles) {
|
|
29054
|
-
if (!isArray$
|
|
29027
|
+
if (!isArray$2(traits)) {
|
|
29055
29028
|
defaultStyles = traits;
|
|
29056
29029
|
traits = [];
|
|
29057
29030
|
}
|
|
@@ -29113,9 +29086,6 @@ function pointDistance(a, b) {
|
|
|
29113
29086
|
);
|
|
29114
29087
|
}
|
|
29115
29088
|
function pointsOnLine(p, q, r, accuracy) {
|
|
29116
|
-
if (typeof accuracy === "undefined") {
|
|
29117
|
-
accuracy = 5;
|
|
29118
|
-
}
|
|
29119
29089
|
if (!p || !q || !r) {
|
|
29120
29090
|
return false;
|
|
29121
29091
|
}
|
|
@@ -29149,588 +29119,587 @@ function pointInRect(p, rect, tolerance) {
|
|
|
29149
29119
|
function getDefaultExportFromCjs(x) {
|
|
29150
29120
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
29151
29121
|
}
|
|
29152
|
-
var
|
|
29153
|
-
var
|
|
29154
|
-
|
|
29155
|
-
|
|
29156
|
-
|
|
29157
|
-
var mmax = math.max;
|
|
29158
|
-
var
|
|
29159
|
-
|
|
29160
|
-
|
|
29161
|
-
|
|
29162
|
-
|
|
29163
|
-
return o instanceof Array;
|
|
29164
|
-
};
|
|
29165
|
-
function hasProperty(obj, property) {
|
|
29166
|
-
return Object.prototype.hasOwnProperty.call(obj, property);
|
|
29167
|
-
}
|
|
29168
|
-
function clone(obj) {
|
|
29169
|
-
if (typeof obj == "function" || Object(obj) !== obj) {
|
|
29170
|
-
return obj;
|
|
29122
|
+
var intersect;
|
|
29123
|
+
var hasRequiredIntersect;
|
|
29124
|
+
function requireIntersect() {
|
|
29125
|
+
if (hasRequiredIntersect) return intersect;
|
|
29126
|
+
hasRequiredIntersect = 1;
|
|
29127
|
+
var p2s = /,?([a-z]),?/gi, toFloat = parseFloat, math = Math, PI = math.PI, mmin = math.min, mmax = math.max, pow = math.pow, abs2 = math.abs, pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig, pathValues = /(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig;
|
|
29128
|
+
var isArray3 = Array.isArray || function(o) {
|
|
29129
|
+
return o instanceof Array;
|
|
29130
|
+
};
|
|
29131
|
+
function hasProperty2(obj, property) {
|
|
29132
|
+
return Object.prototype.hasOwnProperty.call(obj, property);
|
|
29171
29133
|
}
|
|
29172
|
-
|
|
29173
|
-
|
|
29174
|
-
|
|
29175
|
-
|
|
29134
|
+
function clone2(obj) {
|
|
29135
|
+
if (typeof obj == "function" || Object(obj) !== obj) {
|
|
29136
|
+
return obj;
|
|
29137
|
+
}
|
|
29138
|
+
var res = new obj.constructor();
|
|
29139
|
+
for (var key in obj) {
|
|
29140
|
+
if (hasProperty2(obj, key)) {
|
|
29141
|
+
res[key] = clone2(obj[key]);
|
|
29142
|
+
}
|
|
29176
29143
|
}
|
|
29144
|
+
return res;
|
|
29177
29145
|
}
|
|
29178
|
-
|
|
29179
|
-
|
|
29180
|
-
|
|
29181
|
-
|
|
29182
|
-
return array.push(array.splice(i, 1)[0]);
|
|
29146
|
+
function repush(array, item) {
|
|
29147
|
+
for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
|
|
29148
|
+
return array.push(array.splice(i, 1)[0]);
|
|
29149
|
+
}
|
|
29183
29150
|
}
|
|
29184
|
-
|
|
29185
|
-
function
|
|
29186
|
-
|
|
29187
|
-
|
|
29188
|
-
|
|
29189
|
-
|
|
29151
|
+
function cacher(f) {
|
|
29152
|
+
function newf() {
|
|
29153
|
+
var arg = Array.prototype.slice.call(arguments, 0), args = arg.join("\u2400"), cache = newf.cache = newf.cache || {}, count = newf.count = newf.count || [];
|
|
29154
|
+
if (hasProperty2(cache, args)) {
|
|
29155
|
+
repush(count, args);
|
|
29156
|
+
return cache[args];
|
|
29157
|
+
}
|
|
29158
|
+
count.length >= 1e3 && delete cache[count.shift()];
|
|
29159
|
+
count.push(args);
|
|
29160
|
+
cache[args] = f.apply(0, arg);
|
|
29190
29161
|
return cache[args];
|
|
29191
29162
|
}
|
|
29192
|
-
|
|
29193
|
-
count.push(args);
|
|
29194
|
-
cache[args] = f.apply(0, arg);
|
|
29195
|
-
return cache[args];
|
|
29196
|
-
}
|
|
29197
|
-
return newf;
|
|
29198
|
-
}
|
|
29199
|
-
function parsePathString(pathString) {
|
|
29200
|
-
if (!pathString) {
|
|
29201
|
-
return null;
|
|
29202
|
-
}
|
|
29203
|
-
var pth = paths(pathString);
|
|
29204
|
-
if (pth.arr) {
|
|
29205
|
-
return clone(pth.arr);
|
|
29163
|
+
return newf;
|
|
29206
29164
|
}
|
|
29207
|
-
|
|
29208
|
-
|
|
29209
|
-
|
|
29210
|
-
|
|
29211
|
-
|
|
29212
|
-
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29165
|
+
function parsePathString(pathString) {
|
|
29166
|
+
if (!pathString) {
|
|
29167
|
+
return null;
|
|
29168
|
+
}
|
|
29169
|
+
var pth = paths(pathString);
|
|
29170
|
+
if (pth.arr) {
|
|
29171
|
+
return clone2(pth.arr);
|
|
29172
|
+
}
|
|
29173
|
+
var paramCounts = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, data = [];
|
|
29174
|
+
if (isArray3(pathString) && isArray3(pathString[0])) {
|
|
29175
|
+
data = clone2(pathString);
|
|
29176
|
+
}
|
|
29177
|
+
if (!data.length) {
|
|
29178
|
+
String(pathString).replace(pathCommand, function(a, b, c) {
|
|
29179
|
+
var params = [], name2 = b.toLowerCase();
|
|
29180
|
+
c.replace(pathValues, function(a2, b2) {
|
|
29181
|
+
b2 && params.push(+b2);
|
|
29182
|
+
});
|
|
29183
|
+
if (name2 == "m" && params.length > 2) {
|
|
29184
|
+
data.push([b].concat(params.splice(0, 2)));
|
|
29185
|
+
name2 = "l";
|
|
29186
|
+
b = b == "m" ? "l" : "L";
|
|
29187
|
+
}
|
|
29188
|
+
while (params.length >= paramCounts[name2]) {
|
|
29189
|
+
data.push([b].concat(params.splice(0, paramCounts[name2])));
|
|
29190
|
+
if (!paramCounts[name2]) {
|
|
29191
|
+
break;
|
|
29192
|
+
}
|
|
29193
|
+
}
|
|
29216
29194
|
});
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
|
|
29223
|
-
|
|
29224
|
-
|
|
29225
|
-
|
|
29195
|
+
}
|
|
29196
|
+
data.toString = paths.toString;
|
|
29197
|
+
pth.arr = clone2(data);
|
|
29198
|
+
return data;
|
|
29199
|
+
}
|
|
29200
|
+
function paths(ps) {
|
|
29201
|
+
var p = paths.ps = paths.ps || {};
|
|
29202
|
+
if (p[ps]) {
|
|
29203
|
+
p[ps].sleep = 100;
|
|
29204
|
+
} else {
|
|
29205
|
+
p[ps] = {
|
|
29206
|
+
sleep: 100
|
|
29207
|
+
};
|
|
29208
|
+
}
|
|
29209
|
+
setTimeout(function() {
|
|
29210
|
+
for (var key in p) {
|
|
29211
|
+
if (hasProperty2(p, key) && key != ps) {
|
|
29212
|
+
p[key].sleep--;
|
|
29213
|
+
!p[key].sleep && delete p[key];
|
|
29226
29214
|
}
|
|
29227
29215
|
}
|
|
29228
29216
|
});
|
|
29217
|
+
return p[ps];
|
|
29229
29218
|
}
|
|
29230
|
-
|
|
29231
|
-
|
|
29232
|
-
|
|
29233
|
-
|
|
29234
|
-
|
|
29235
|
-
|
|
29236
|
-
|
|
29237
|
-
|
|
29238
|
-
|
|
29239
|
-
|
|
29240
|
-
|
|
29219
|
+
function rectBBox(x, y, width, height) {
|
|
29220
|
+
if (arguments.length === 1) {
|
|
29221
|
+
y = x.y;
|
|
29222
|
+
width = x.width;
|
|
29223
|
+
height = x.height;
|
|
29224
|
+
x = x.x;
|
|
29225
|
+
}
|
|
29226
|
+
return {
|
|
29227
|
+
x,
|
|
29228
|
+
y,
|
|
29229
|
+
width,
|
|
29230
|
+
height,
|
|
29231
|
+
x2: x + width,
|
|
29232
|
+
y2: y + height
|
|
29241
29233
|
};
|
|
29242
29234
|
}
|
|
29243
|
-
|
|
29244
|
-
|
|
29245
|
-
if (hasProperty(p, key) && key != ps) {
|
|
29246
|
-
p[key].sleep--;
|
|
29247
|
-
!p[key].sleep && delete p[key];
|
|
29248
|
-
}
|
|
29249
|
-
}
|
|
29250
|
-
});
|
|
29251
|
-
return p[ps];
|
|
29252
|
-
}
|
|
29253
|
-
function rectBBox(x, y, width, height) {
|
|
29254
|
-
if (arguments.length === 1) {
|
|
29255
|
-
y = x.y;
|
|
29256
|
-
width = x.width;
|
|
29257
|
-
height = x.height;
|
|
29258
|
-
x = x.x;
|
|
29235
|
+
function pathToString() {
|
|
29236
|
+
return this.join(",").replace(p2s, "$1");
|
|
29259
29237
|
}
|
|
29260
|
-
|
|
29261
|
-
|
|
29262
|
-
|
|
29263
|
-
|
|
29264
|
-
height,
|
|
29265
|
-
x2: x + width,
|
|
29266
|
-
y2: y + height
|
|
29267
|
-
};
|
|
29268
|
-
}
|
|
29269
|
-
function pathToString() {
|
|
29270
|
-
return this.join(",").replace(p2s, "$1");
|
|
29271
|
-
}
|
|
29272
|
-
function pathClone(pathArray) {
|
|
29273
|
-
var res = clone(pathArray);
|
|
29274
|
-
res.toString = pathToString;
|
|
29275
|
-
return res;
|
|
29276
|
-
}
|
|
29277
|
-
function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
|
|
29278
|
-
var t1 = 1 - t, t13 = pow(t1, 3), t12 = pow(t1, 2), t2 = t * t, t3 = t2 * t, x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x, y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;
|
|
29279
|
-
return {
|
|
29280
|
-
x: fixError(x),
|
|
29281
|
-
y: fixError(y)
|
|
29282
|
-
};
|
|
29283
|
-
}
|
|
29284
|
-
function bezierBBox(points) {
|
|
29285
|
-
var bbox = curveBBox.apply(null, points);
|
|
29286
|
-
return rectBBox(
|
|
29287
|
-
bbox.x0,
|
|
29288
|
-
bbox.y0,
|
|
29289
|
-
bbox.x1 - bbox.x0,
|
|
29290
|
-
bbox.y1 - bbox.y0
|
|
29291
|
-
);
|
|
29292
|
-
}
|
|
29293
|
-
function isPointInsideBBox$2(bbox, x, y) {
|
|
29294
|
-
return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height;
|
|
29295
|
-
}
|
|
29296
|
-
function isBBoxIntersect(bbox1, bbox2) {
|
|
29297
|
-
bbox1 = rectBBox(bbox1);
|
|
29298
|
-
bbox2 = rectBBox(bbox2);
|
|
29299
|
-
return isPointInsideBBox$2(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox$2(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox$2(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox$2(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox$2(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox$2(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox$2(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox$2(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
|
|
29300
|
-
}
|
|
29301
|
-
function base3(t, p1, p2, p3, p4) {
|
|
29302
|
-
var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
|
|
29303
|
-
return t * t2 - 3 * p1 + 3 * p2;
|
|
29304
|
-
}
|
|
29305
|
-
function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
|
|
29306
|
-
if (z == null) {
|
|
29307
|
-
z = 1;
|
|
29238
|
+
function pathClone(pathArray) {
|
|
29239
|
+
var res = clone2(pathArray);
|
|
29240
|
+
res.toString = pathToString;
|
|
29241
|
+
return res;
|
|
29308
29242
|
}
|
|
29309
|
-
|
|
29310
|
-
|
|
29311
|
-
|
|
29312
|
-
|
|
29313
|
-
|
|
29243
|
+
function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
|
|
29244
|
+
var t1 = 1 - t, t13 = pow(t1, 3), t12 = pow(t1, 2), t2 = t * t, t3 = t2 * t, x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x, y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;
|
|
29245
|
+
return {
|
|
29246
|
+
x: fixError(x),
|
|
29247
|
+
y: fixError(y)
|
|
29248
|
+
};
|
|
29314
29249
|
}
|
|
29315
|
-
|
|
29316
|
-
|
|
29317
|
-
|
|
29318
|
-
|
|
29319
|
-
|
|
29250
|
+
function bezierBBox(points) {
|
|
29251
|
+
var bbox = curveBBox.apply(null, points);
|
|
29252
|
+
return rectBBox(
|
|
29253
|
+
bbox.x0,
|
|
29254
|
+
bbox.y0,
|
|
29255
|
+
bbox.x1 - bbox.x0,
|
|
29256
|
+
bbox.y1 - bbox.y0
|
|
29257
|
+
);
|
|
29320
29258
|
}
|
|
29321
|
-
|
|
29322
|
-
|
|
29323
|
-
return;
|
|
29259
|
+
function isPointInsideBBox2(bbox, x, y) {
|
|
29260
|
+
return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height;
|
|
29324
29261
|
}
|
|
29325
|
-
|
|
29326
|
-
|
|
29327
|
-
|
|
29262
|
+
function isBBoxIntersect(bbox1, bbox2) {
|
|
29263
|
+
bbox1 = rectBBox(bbox1);
|
|
29264
|
+
bbox2 = rectBBox(bbox2);
|
|
29265
|
+
return isPointInsideBBox2(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox2(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox2(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox2(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox2(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox2(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox2(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox2(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
|
|
29328
29266
|
}
|
|
29329
|
-
|
|
29330
|
-
|
|
29331
|
-
|
|
29332
|
-
return Math.round(number * 1e11) / 1e11;
|
|
29333
|
-
}
|
|
29334
|
-
function findBezierIntersections(bez1, bez2, justCount) {
|
|
29335
|
-
var bbox1 = bezierBBox(bez1), bbox2 = bezierBBox(bez2);
|
|
29336
|
-
if (!isBBoxIntersect(bbox1, bbox2)) {
|
|
29337
|
-
return justCount ? 0 : [];
|
|
29267
|
+
function base3(t, p1, p2, p3, p4) {
|
|
29268
|
+
var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
|
|
29269
|
+
return t * t2 - 3 * p1 + 3 * p2;
|
|
29338
29270
|
}
|
|
29339
|
-
|
|
29340
|
-
|
|
29341
|
-
|
|
29342
|
-
|
|
29271
|
+
function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
|
|
29272
|
+
if (z == null) {
|
|
29273
|
+
z = 1;
|
|
29274
|
+
}
|
|
29275
|
+
z = z > 1 ? 1 : z < 0 ? 0 : z;
|
|
29276
|
+
var z2 = z / 2, n = 12, Tvalues = [-0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816], Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472], sum = 0;
|
|
29277
|
+
for (var i = 0; i < n; i++) {
|
|
29278
|
+
var ct = z2 * Tvalues[i] + z2, xbase = base3(ct, x1, x2, x3, x4), ybase = base3(ct, y1, y2, y3, y4), comb = xbase * xbase + ybase * ybase;
|
|
29279
|
+
sum += Cvalues[i] * math.sqrt(comb);
|
|
29280
|
+
}
|
|
29281
|
+
return z2 * sum;
|
|
29343
29282
|
}
|
|
29344
|
-
|
|
29345
|
-
|
|
29346
|
-
|
|
29283
|
+
function intersectLines(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
29284
|
+
if (mmax(x1, x2) < mmin(x3, x4) || mmin(x1, x2) > mmax(x3, x4) || mmax(y1, y2) < mmin(y3, y4) || mmin(y1, y2) > mmax(y3, y4)) {
|
|
29285
|
+
return;
|
|
29286
|
+
}
|
|
29287
|
+
var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4), ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4), denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
29288
|
+
if (!denominator) {
|
|
29289
|
+
return;
|
|
29290
|
+
}
|
|
29291
|
+
var px = fixError(nx / denominator), py = fixError(ny / denominator), px2 = +px.toFixed(2), py2 = +py.toFixed(2);
|
|
29292
|
+
if (px2 < +mmin(x1, x2).toFixed(2) || px2 > +mmax(x1, x2).toFixed(2) || px2 < +mmin(x3, x4).toFixed(2) || px2 > +mmax(x3, x4).toFixed(2) || py2 < +mmin(y1, y2).toFixed(2) || py2 > +mmax(y1, y2).toFixed(2) || py2 < +mmin(y3, y4).toFixed(2) || py2 > +mmax(y3, y4).toFixed(2)) {
|
|
29293
|
+
return;
|
|
29294
|
+
}
|
|
29295
|
+
return { x: px, y: py };
|
|
29347
29296
|
}
|
|
29348
|
-
|
|
29349
|
-
|
|
29350
|
-
|
|
29351
|
-
|
|
29352
|
-
|
|
29353
|
-
|
|
29354
|
-
|
|
29355
|
-
|
|
29356
|
-
|
|
29357
|
-
|
|
29358
|
-
|
|
29359
|
-
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
|
|
29363
|
-
|
|
29364
|
-
|
|
29365
|
-
|
|
29366
|
-
|
|
29367
|
-
|
|
29297
|
+
function fixError(number) {
|
|
29298
|
+
return Math.round(number * 1e11) / 1e11;
|
|
29299
|
+
}
|
|
29300
|
+
function findBezierIntersections(bez1, bez2, justCount) {
|
|
29301
|
+
var bbox1 = bezierBBox(bez1), bbox2 = bezierBBox(bez2);
|
|
29302
|
+
if (!isBBoxIntersect(bbox1, bbox2)) {
|
|
29303
|
+
return justCount ? 0 : [];
|
|
29304
|
+
}
|
|
29305
|
+
var l1 = bezlen.apply(0, bez1), l2 = bezlen.apply(0, bez2), n1 = isLine(bez1) ? 1 : ~~(l1 / 5) || 1, n2 = isLine(bez2) ? 1 : ~~(l2 / 5) || 1, dots1 = [], dots2 = [], xy = {}, res = justCount ? 0 : [];
|
|
29306
|
+
for (var i = 0; i < n1 + 1; i++) {
|
|
29307
|
+
var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
|
|
29308
|
+
dots1.push({ x: p.x, y: p.y, t: i / n1 });
|
|
29309
|
+
}
|
|
29310
|
+
for (i = 0; i < n2 + 1; i++) {
|
|
29311
|
+
p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
|
|
29312
|
+
dots2.push({ x: p.x, y: p.y, t: i / n2 });
|
|
29313
|
+
}
|
|
29314
|
+
for (i = 0; i < n1; i++) {
|
|
29315
|
+
for (var j = 0; j < n2; j++) {
|
|
29316
|
+
var di = dots1[i], di1 = dots1[i + 1], dj = dots2[j], dj1 = dots2[j + 1], ci = abs2(di1.x - di.x) < 0.01 ? "y" : "x", cj = abs2(dj1.x - dj.x) < 0.01 ? "y" : "x", is3 = intersectLines(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y), key;
|
|
29317
|
+
if (is3) {
|
|
29318
|
+
key = is3.x.toFixed(9) + "#" + is3.y.toFixed(9);
|
|
29319
|
+
if (xy[key]) {
|
|
29320
|
+
continue;
|
|
29321
|
+
}
|
|
29322
|
+
xy[key] = true;
|
|
29323
|
+
var t1 = di.t + abs2((is3[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t), t2 = dj.t + abs2((is3[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
|
|
29324
|
+
if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
|
|
29325
|
+
if (justCount) {
|
|
29326
|
+
res++;
|
|
29327
|
+
} else {
|
|
29328
|
+
res.push({
|
|
29329
|
+
x: is3.x,
|
|
29330
|
+
y: is3.y,
|
|
29331
|
+
t1,
|
|
29332
|
+
t2
|
|
29333
|
+
});
|
|
29334
|
+
}
|
|
29368
29335
|
}
|
|
29369
29336
|
}
|
|
29370
29337
|
}
|
|
29371
29338
|
}
|
|
29339
|
+
return res;
|
|
29372
29340
|
}
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
29376
|
-
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
x1 = x1m = pi[1];
|
|
29383
|
-
y1 = y1m = pi[2];
|
|
29384
|
-
} else {
|
|
29385
|
-
if (pi[0] == "C") {
|
|
29386
|
-
bez1 = [x1, y1].concat(pi.slice(1));
|
|
29387
|
-
x1 = bez1[6];
|
|
29388
|
-
y1 = bez1[7];
|
|
29341
|
+
function findPathIntersections(path1, path2, justCount) {
|
|
29342
|
+
path1 = pathToCurve(path1);
|
|
29343
|
+
path2 = pathToCurve(path2);
|
|
29344
|
+
var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2, res = justCount ? 0 : [];
|
|
29345
|
+
for (var i = 0, ii = path1.length; i < ii; i++) {
|
|
29346
|
+
var pi = path1[i];
|
|
29347
|
+
if (pi[0] == "M") {
|
|
29348
|
+
x1 = x1m = pi[1];
|
|
29349
|
+
y1 = y1m = pi[2];
|
|
29389
29350
|
} else {
|
|
29390
|
-
|
|
29391
|
-
|
|
29392
|
-
|
|
29393
|
-
|
|
29394
|
-
for (var j = 0, jj = path2.length; j < jj; j++) {
|
|
29395
|
-
var pj = path2[j];
|
|
29396
|
-
if (pj[0] == "M") {
|
|
29397
|
-
x2 = x2m = pj[1];
|
|
29398
|
-
y2 = y2m = pj[2];
|
|
29351
|
+
if (pi[0] == "C") {
|
|
29352
|
+
bez1 = [x1, y1].concat(pi.slice(1));
|
|
29353
|
+
x1 = bez1[6];
|
|
29354
|
+
y1 = bez1[7];
|
|
29399
29355
|
} else {
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29409
|
-
var intr = findBezierIntersections(bez1, bez2, justCount);
|
|
29410
|
-
if (justCount) {
|
|
29411
|
-
res += intr;
|
|
29356
|
+
bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
|
|
29357
|
+
x1 = x1m;
|
|
29358
|
+
y1 = y1m;
|
|
29359
|
+
}
|
|
29360
|
+
for (var j = 0, jj = path2.length; j < jj; j++) {
|
|
29361
|
+
var pj = path2[j];
|
|
29362
|
+
if (pj[0] == "M") {
|
|
29363
|
+
x2 = x2m = pj[1];
|
|
29364
|
+
y2 = y2m = pj[2];
|
|
29412
29365
|
} else {
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29366
|
+
if (pj[0] == "C") {
|
|
29367
|
+
bez2 = [x2, y2].concat(pj.slice(1));
|
|
29368
|
+
x2 = bez2[6];
|
|
29369
|
+
y2 = bez2[7];
|
|
29370
|
+
} else {
|
|
29371
|
+
bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
|
|
29372
|
+
x2 = x2m;
|
|
29373
|
+
y2 = y2m;
|
|
29374
|
+
}
|
|
29375
|
+
var intr = findBezierIntersections(bez1, bez2, justCount);
|
|
29376
|
+
if (justCount) {
|
|
29377
|
+
res += intr;
|
|
29378
|
+
} else {
|
|
29379
|
+
for (var k = 0, kk = intr.length; k < kk; k++) {
|
|
29380
|
+
intr[k].segment1 = i;
|
|
29381
|
+
intr[k].segment2 = j;
|
|
29382
|
+
intr[k].bez1 = bez1;
|
|
29383
|
+
intr[k].bez2 = bez2;
|
|
29384
|
+
}
|
|
29385
|
+
res = res.concat(intr);
|
|
29386
|
+
}
|
|
29387
|
+
}
|
|
29388
|
+
}
|
|
29389
|
+
}
|
|
29390
|
+
}
|
|
29391
|
+
return res;
|
|
29392
|
+
}
|
|
29393
|
+
function pathToAbsolute(pathArray) {
|
|
29394
|
+
var pth = paths(pathArray);
|
|
29395
|
+
if (pth.abs) {
|
|
29396
|
+
return pathClone(pth.abs);
|
|
29397
|
+
}
|
|
29398
|
+
if (!isArray3(pathArray) || !isArray3(pathArray && pathArray[0])) {
|
|
29399
|
+
pathArray = parsePathString(pathArray);
|
|
29400
|
+
}
|
|
29401
|
+
if (!pathArray || !pathArray.length) {
|
|
29402
|
+
return [["M", 0, 0]];
|
|
29403
|
+
}
|
|
29404
|
+
var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0, pa0;
|
|
29405
|
+
if (pathArray[0][0] == "M") {
|
|
29406
|
+
x = +pathArray[0][1];
|
|
29407
|
+
y = +pathArray[0][2];
|
|
29408
|
+
mx = x;
|
|
29409
|
+
my = y;
|
|
29410
|
+
start++;
|
|
29411
|
+
res[0] = ["M", x, y];
|
|
29412
|
+
}
|
|
29413
|
+
for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
|
|
29414
|
+
res.push(r = []);
|
|
29415
|
+
pa = pathArray[i];
|
|
29416
|
+
pa0 = pa[0];
|
|
29417
|
+
if (pa0 != pa0.toUpperCase()) {
|
|
29418
|
+
r[0] = pa0.toUpperCase();
|
|
29419
|
+
switch (r[0]) {
|
|
29420
|
+
case "A":
|
|
29421
|
+
r[1] = pa[1];
|
|
29422
|
+
r[2] = pa[2];
|
|
29423
|
+
r[3] = pa[3];
|
|
29424
|
+
r[4] = pa[4];
|
|
29425
|
+
r[5] = pa[5];
|
|
29426
|
+
r[6] = +pa[6] + x;
|
|
29427
|
+
r[7] = +pa[7] + y;
|
|
29428
|
+
break;
|
|
29429
|
+
case "V":
|
|
29430
|
+
r[1] = +pa[1] + y;
|
|
29431
|
+
break;
|
|
29432
|
+
case "H":
|
|
29433
|
+
r[1] = +pa[1] + x;
|
|
29434
|
+
break;
|
|
29435
|
+
case "M":
|
|
29436
|
+
mx = +pa[1] + x;
|
|
29437
|
+
my = +pa[2] + y;
|
|
29438
|
+
default:
|
|
29439
|
+
for (var j = 1, jj = pa.length; j < jj; j++) {
|
|
29440
|
+
r[j] = +pa[j] + (j % 2 ? x : y);
|
|
29418
29441
|
}
|
|
29419
|
-
|
|
29420
|
-
|
|
29442
|
+
}
|
|
29443
|
+
} else {
|
|
29444
|
+
for (var k = 0, kk = pa.length; k < kk; k++) {
|
|
29445
|
+
r[k] = pa[k];
|
|
29421
29446
|
}
|
|
29422
29447
|
}
|
|
29423
|
-
|
|
29424
|
-
}
|
|
29425
|
-
return res;
|
|
29426
|
-
}
|
|
29427
|
-
function pathToAbsolute(pathArray) {
|
|
29428
|
-
var pth = paths(pathArray);
|
|
29429
|
-
if (pth.abs) {
|
|
29430
|
-
return pathClone(pth.abs);
|
|
29431
|
-
}
|
|
29432
|
-
if (!isArray(pathArray) || !isArray(pathArray && pathArray[0])) {
|
|
29433
|
-
pathArray = parsePathString(pathArray);
|
|
29434
|
-
}
|
|
29435
|
-
if (!pathArray || !pathArray.length) {
|
|
29436
|
-
return [["M", 0, 0]];
|
|
29437
|
-
}
|
|
29438
|
-
var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0, pa0;
|
|
29439
|
-
if (pathArray[0][0] == "M") {
|
|
29440
|
-
x = +pathArray[0][1];
|
|
29441
|
-
y = +pathArray[0][2];
|
|
29442
|
-
mx = x;
|
|
29443
|
-
my = y;
|
|
29444
|
-
start++;
|
|
29445
|
-
res[0] = ["M", x, y];
|
|
29446
|
-
}
|
|
29447
|
-
for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
|
|
29448
|
-
res.push(r = []);
|
|
29449
|
-
pa = pathArray[i];
|
|
29450
|
-
pa0 = pa[0];
|
|
29451
|
-
if (pa0 != pa0.toUpperCase()) {
|
|
29452
|
-
r[0] = pa0.toUpperCase();
|
|
29448
|
+
pa0 = pa0.toUpperCase();
|
|
29453
29449
|
switch (r[0]) {
|
|
29454
|
-
case "
|
|
29455
|
-
|
|
29456
|
-
|
|
29457
|
-
r[3] = pa[3];
|
|
29458
|
-
r[4] = pa[4];
|
|
29459
|
-
r[5] = pa[5];
|
|
29460
|
-
r[6] = +pa[6] + x;
|
|
29461
|
-
r[7] = +pa[7] + y;
|
|
29462
|
-
break;
|
|
29463
|
-
case "V":
|
|
29464
|
-
r[1] = +pa[1] + y;
|
|
29450
|
+
case "Z":
|
|
29451
|
+
x = +mx;
|
|
29452
|
+
y = +my;
|
|
29465
29453
|
break;
|
|
29466
29454
|
case "H":
|
|
29467
|
-
|
|
29455
|
+
x = r[1];
|
|
29456
|
+
break;
|
|
29457
|
+
case "V":
|
|
29458
|
+
y = r[1];
|
|
29468
29459
|
break;
|
|
29469
29460
|
case "M":
|
|
29470
|
-
mx =
|
|
29471
|
-
my =
|
|
29461
|
+
mx = r[r.length - 2];
|
|
29462
|
+
my = r[r.length - 1];
|
|
29472
29463
|
default:
|
|
29473
|
-
|
|
29474
|
-
|
|
29475
|
-
}
|
|
29476
|
-
}
|
|
29477
|
-
} else {
|
|
29478
|
-
for (var k = 0, kk = pa.length; k < kk; k++) {
|
|
29479
|
-
r[k] = pa[k];
|
|
29464
|
+
x = r[r.length - 2];
|
|
29465
|
+
y = r[r.length - 1];
|
|
29480
29466
|
}
|
|
29481
29467
|
}
|
|
29482
|
-
|
|
29483
|
-
|
|
29484
|
-
|
|
29485
|
-
x = +mx;
|
|
29486
|
-
y = +my;
|
|
29487
|
-
break;
|
|
29488
|
-
case "H":
|
|
29489
|
-
x = r[1];
|
|
29490
|
-
break;
|
|
29491
|
-
case "V":
|
|
29492
|
-
y = r[1];
|
|
29493
|
-
break;
|
|
29494
|
-
case "M":
|
|
29495
|
-
mx = r[r.length - 2];
|
|
29496
|
-
my = r[r.length - 1];
|
|
29497
|
-
default:
|
|
29498
|
-
x = r[r.length - 2];
|
|
29499
|
-
y = r[r.length - 1];
|
|
29500
|
-
}
|
|
29468
|
+
res.toString = pathToString;
|
|
29469
|
+
pth.abs = pathClone(res);
|
|
29470
|
+
return res;
|
|
29501
29471
|
}
|
|
29502
|
-
|
|
29503
|
-
|
|
29504
|
-
return res;
|
|
29505
|
-
}
|
|
29506
|
-
function isLine(bez) {
|
|
29507
|
-
return bez[0] === bez[2] && bez[1] === bez[3] && bez[4] === bez[6] && bez[5] === bez[7];
|
|
29508
|
-
}
|
|
29509
|
-
function lineToCurve(x1, y1, x2, y2) {
|
|
29510
|
-
return [
|
|
29511
|
-
x1,
|
|
29512
|
-
y1,
|
|
29513
|
-
x2,
|
|
29514
|
-
y2,
|
|
29515
|
-
x2,
|
|
29516
|
-
y2
|
|
29517
|
-
];
|
|
29518
|
-
}
|
|
29519
|
-
function qubicToCurve(x1, y1, ax, ay, x2, y2) {
|
|
29520
|
-
var _13 = 1 / 3, _23 = 2 / 3;
|
|
29521
|
-
return [
|
|
29522
|
-
_13 * x1 + _23 * ax,
|
|
29523
|
-
_13 * y1 + _23 * ay,
|
|
29524
|
-
_13 * x2 + _23 * ax,
|
|
29525
|
-
_13 * y2 + _23 * ay,
|
|
29526
|
-
x2,
|
|
29527
|
-
y2
|
|
29528
|
-
];
|
|
29529
|
-
}
|
|
29530
|
-
function arcToCurve(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
|
|
29531
|
-
var _120 = PI * 120 / 180, rad = PI / 180 * (+angle || 0), res = [], xy, rotate2 = cacher(function(x3, y3, rad2) {
|
|
29532
|
-
var X = x3 * math.cos(rad2) - y3 * math.sin(rad2), Y = x3 * math.sin(rad2) + y3 * math.cos(rad2);
|
|
29533
|
-
return { x: X, y: Y };
|
|
29534
|
-
});
|
|
29535
|
-
if (!recursive) {
|
|
29536
|
-
xy = rotate2(x1, y1, -rad);
|
|
29537
|
-
x1 = xy.x;
|
|
29538
|
-
y1 = xy.y;
|
|
29539
|
-
xy = rotate2(x2, y2, -rad);
|
|
29540
|
-
x2 = xy.x;
|
|
29541
|
-
y2 = xy.y;
|
|
29542
|
-
var x = (x1 - x2) / 2, y = (y1 - y2) / 2;
|
|
29543
|
-
var h = x * x / (rx * rx) + y * y / (ry * ry);
|
|
29544
|
-
if (h > 1) {
|
|
29545
|
-
h = math.sqrt(h);
|
|
29546
|
-
rx = h * rx;
|
|
29547
|
-
ry = h * ry;
|
|
29548
|
-
}
|
|
29549
|
-
var rx2 = rx * rx, ry2 = ry * ry, k = (large_arc_flag == sweep_flag ? -1 : 1) * math.sqrt(abs$4((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))), cx = k * rx * y / ry + (x1 + x2) / 2, cy = k * -ry * x / rx + (y1 + y2) / 2, f1 = math.asin(((y1 - cy) / ry).toFixed(9)), f2 = math.asin(((y2 - cy) / ry).toFixed(9));
|
|
29550
|
-
f1 = x1 < cx ? PI - f1 : f1;
|
|
29551
|
-
f2 = x2 < cx ? PI - f2 : f2;
|
|
29552
|
-
f1 < 0 && (f1 = PI * 2 + f1);
|
|
29553
|
-
f2 < 0 && (f2 = PI * 2 + f2);
|
|
29554
|
-
if (sweep_flag && f1 > f2) {
|
|
29555
|
-
f1 = f1 - PI * 2;
|
|
29556
|
-
}
|
|
29557
|
-
if (!sweep_flag && f2 > f1) {
|
|
29558
|
-
f2 = f2 - PI * 2;
|
|
29559
|
-
}
|
|
29560
|
-
} else {
|
|
29561
|
-
f1 = recursive[0];
|
|
29562
|
-
f2 = recursive[1];
|
|
29563
|
-
cx = recursive[2];
|
|
29564
|
-
cy = recursive[3];
|
|
29565
|
-
}
|
|
29566
|
-
var df = f2 - f1;
|
|
29567
|
-
if (abs$4(df) > _120) {
|
|
29568
|
-
var f2old = f2, x2old = x2, y2old = y2;
|
|
29569
|
-
f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
|
|
29570
|
-
x2 = cx + rx * math.cos(f2);
|
|
29571
|
-
y2 = cy + ry * math.sin(f2);
|
|
29572
|
-
res = arcToCurve(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
|
|
29573
|
-
}
|
|
29574
|
-
df = f2 - f1;
|
|
29575
|
-
var c1 = math.cos(f1), s1 = math.sin(f1), c2 = math.cos(f2), s2 = math.sin(f2), t = math.tan(df / 4), hx = 4 / 3 * rx * t, hy = 4 / 3 * ry * t, m1 = [x1, y1], m2 = [x1 + hx * s1, y1 - hy * c1], m3 = [x2 + hx * s2, y2 - hy * c2], m4 = [x2, y2];
|
|
29576
|
-
m2[0] = 2 * m1[0] - m2[0];
|
|
29577
|
-
m2[1] = 2 * m1[1] - m2[1];
|
|
29578
|
-
if (recursive) {
|
|
29579
|
-
return [m2, m3, m4].concat(res);
|
|
29580
|
-
} else {
|
|
29581
|
-
res = [m2, m3, m4].concat(res).join().split(",");
|
|
29582
|
-
var newres = [];
|
|
29583
|
-
for (var i = 0, ii = res.length; i < ii; i++) {
|
|
29584
|
-
newres[i] = i % 2 ? rotate2(res[i - 1], res[i], rad).y : rotate2(res[i], res[i + 1], rad).x;
|
|
29585
|
-
}
|
|
29586
|
-
return newres;
|
|
29472
|
+
function isLine(bez) {
|
|
29473
|
+
return bez[0] === bez[2] && bez[1] === bez[3] && bez[4] === bez[6] && bez[5] === bez[7];
|
|
29587
29474
|
}
|
|
29588
|
-
|
|
29589
|
-
|
|
29590
|
-
|
|
29591
|
-
|
|
29592
|
-
|
|
29593
|
-
|
|
29594
|
-
|
|
29595
|
-
|
|
29475
|
+
function lineToCurve(x1, y1, x2, y2) {
|
|
29476
|
+
return [
|
|
29477
|
+
x1,
|
|
29478
|
+
y1,
|
|
29479
|
+
x2,
|
|
29480
|
+
y2,
|
|
29481
|
+
x2,
|
|
29482
|
+
y2
|
|
29483
|
+
];
|
|
29484
|
+
}
|
|
29485
|
+
function qubicToCurve(x1, y1, ax, ay, x2, y2) {
|
|
29486
|
+
var _13 = 1 / 3, _23 = 2 / 3;
|
|
29487
|
+
return [
|
|
29488
|
+
_13 * x1 + _23 * ax,
|
|
29489
|
+
_13 * y1 + _23 * ay,
|
|
29490
|
+
_13 * x2 + _23 * ax,
|
|
29491
|
+
_13 * y2 + _23 * ay,
|
|
29492
|
+
x2,
|
|
29493
|
+
y2
|
|
29494
|
+
];
|
|
29495
|
+
}
|
|
29496
|
+
function arcToCurve(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
|
|
29497
|
+
var _120 = PI * 120 / 180, rad = PI / 180 * (+angle || 0), res = [], xy, rotate2 = cacher(function(x3, y3, rad2) {
|
|
29498
|
+
var X = x3 * math.cos(rad2) - y3 * math.sin(rad2), Y = x3 * math.sin(rad2) + y3 * math.cos(rad2);
|
|
29499
|
+
return { x: X, y: Y };
|
|
29500
|
+
});
|
|
29501
|
+
if (!recursive) {
|
|
29502
|
+
xy = rotate2(x1, y1, -rad);
|
|
29503
|
+
x1 = xy.x;
|
|
29504
|
+
y1 = xy.y;
|
|
29505
|
+
xy = rotate2(x2, y2, -rad);
|
|
29506
|
+
x2 = xy.x;
|
|
29507
|
+
y2 = xy.y;
|
|
29508
|
+
var x = (x1 - x2) / 2, y = (y1 - y2) / 2;
|
|
29509
|
+
var h = x * x / (rx * rx) + y * y / (ry * ry);
|
|
29510
|
+
if (h > 1) {
|
|
29511
|
+
h = math.sqrt(h);
|
|
29512
|
+
rx = h * rx;
|
|
29513
|
+
ry = h * ry;
|
|
29514
|
+
}
|
|
29515
|
+
var rx2 = rx * rx, ry2 = ry * ry, k = (large_arc_flag == sweep_flag ? -1 : 1) * math.sqrt(abs2((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))), cx = k * rx * y / ry + (x1 + x2) / 2, cy = k * -ry * x / rx + (y1 + y2) / 2, f1 = math.asin(((y1 - cy) / ry).toFixed(9)), f2 = math.asin(((y2 - cy) / ry).toFixed(9));
|
|
29516
|
+
f1 = x1 < cx ? PI - f1 : f1;
|
|
29517
|
+
f2 = x2 < cx ? PI - f2 : f2;
|
|
29518
|
+
f1 < 0 && (f1 = PI * 2 + f1);
|
|
29519
|
+
f2 < 0 && (f2 = PI * 2 + f2);
|
|
29520
|
+
if (sweep_flag && f1 > f2) {
|
|
29521
|
+
f1 = f1 - PI * 2;
|
|
29522
|
+
}
|
|
29523
|
+
if (!sweep_flag && f2 > f1) {
|
|
29524
|
+
f2 = f2 - PI * 2;
|
|
29525
|
+
}
|
|
29526
|
+
} else {
|
|
29527
|
+
f1 = recursive[0];
|
|
29528
|
+
f2 = recursive[1];
|
|
29529
|
+
cx = recursive[2];
|
|
29530
|
+
cy = recursive[3];
|
|
29531
|
+
}
|
|
29532
|
+
var df = f2 - f1;
|
|
29533
|
+
if (abs2(df) > _120) {
|
|
29534
|
+
var f2old = f2, x2old = x2, y2old = y2;
|
|
29535
|
+
f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
|
|
29536
|
+
x2 = cx + rx * math.cos(f2);
|
|
29537
|
+
y2 = cy + ry * math.sin(f2);
|
|
29538
|
+
res = arcToCurve(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
|
|
29539
|
+
}
|
|
29540
|
+
df = f2 - f1;
|
|
29541
|
+
var c1 = math.cos(f1), s1 = math.sin(f1), c2 = math.cos(f2), s2 = math.sin(f2), t = math.tan(df / 4), hx = 4 / 3 * rx * t, hy = 4 / 3 * ry * t, m1 = [x1, y1], m2 = [x1 + hx * s1, y1 - hy * c1], m3 = [x2 + hx * s2, y2 - hy * c2], m4 = [x2, y2];
|
|
29542
|
+
m2[0] = 2 * m1[0] - m2[0];
|
|
29543
|
+
m2[1] = 2 * m1[1] - m2[1];
|
|
29544
|
+
if (recursive) {
|
|
29545
|
+
return [m2, m3, m4].concat(res);
|
|
29596
29546
|
} else {
|
|
29597
|
-
|
|
29598
|
-
|
|
29599
|
-
|
|
29547
|
+
res = [m2, m3, m4].concat(res).join().split(",");
|
|
29548
|
+
var newres = [];
|
|
29549
|
+
for (var i = 0, ii = res.length; i < ii; i++) {
|
|
29550
|
+
newres[i] = i % 2 ? rotate2(res[i - 1], res[i], rad).y : rotate2(res[i], res[i + 1], rad).x;
|
|
29551
|
+
}
|
|
29552
|
+
return newres;
|
|
29600
29553
|
}
|
|
29601
|
-
|
|
29602
|
-
|
|
29554
|
+
}
|
|
29555
|
+
function curveBBox(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
29556
|
+
var tvalues = [], bounds = [[], []], a, b, c, t, t1, t2, b2ac, sqrtb2ac;
|
|
29557
|
+
for (var i = 0; i < 2; ++i) {
|
|
29558
|
+
if (i == 0) {
|
|
29559
|
+
b = 6 * x0 - 12 * x1 + 6 * x2;
|
|
29560
|
+
a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
|
|
29561
|
+
c = 3 * x1 - 3 * x0;
|
|
29562
|
+
} else {
|
|
29563
|
+
b = 6 * y0 - 12 * y1 + 6 * y2;
|
|
29564
|
+
a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
|
|
29565
|
+
c = 3 * y1 - 3 * y0;
|
|
29566
|
+
}
|
|
29567
|
+
if (abs2(a) < 1e-12) {
|
|
29568
|
+
if (abs2(b) < 1e-12) {
|
|
29569
|
+
continue;
|
|
29570
|
+
}
|
|
29571
|
+
t = -c / b;
|
|
29572
|
+
if (0 < t && t < 1) {
|
|
29573
|
+
tvalues.push(t);
|
|
29574
|
+
}
|
|
29603
29575
|
continue;
|
|
29604
29576
|
}
|
|
29605
|
-
|
|
29606
|
-
|
|
29607
|
-
|
|
29577
|
+
b2ac = b * b - 4 * c * a;
|
|
29578
|
+
sqrtb2ac = math.sqrt(b2ac);
|
|
29579
|
+
if (b2ac < 0) {
|
|
29580
|
+
continue;
|
|
29581
|
+
}
|
|
29582
|
+
t1 = (-b + sqrtb2ac) / (2 * a);
|
|
29583
|
+
if (0 < t1 && t1 < 1) {
|
|
29584
|
+
tvalues.push(t1);
|
|
29585
|
+
}
|
|
29586
|
+
t2 = (-b - sqrtb2ac) / (2 * a);
|
|
29587
|
+
if (0 < t2 && t2 < 1) {
|
|
29588
|
+
tvalues.push(t2);
|
|
29608
29589
|
}
|
|
29609
|
-
continue;
|
|
29610
|
-
}
|
|
29611
|
-
b2ac = b * b - 4 * c * a;
|
|
29612
|
-
sqrtb2ac = math.sqrt(b2ac);
|
|
29613
|
-
if (b2ac < 0) {
|
|
29614
|
-
continue;
|
|
29615
|
-
}
|
|
29616
|
-
t1 = (-b + sqrtb2ac) / (2 * a);
|
|
29617
|
-
if (0 < t1 && t1 < 1) {
|
|
29618
|
-
tvalues.push(t1);
|
|
29619
29590
|
}
|
|
29620
|
-
|
|
29621
|
-
|
|
29622
|
-
tvalues
|
|
29591
|
+
var j = tvalues.length, jlen = j, mt;
|
|
29592
|
+
while (j--) {
|
|
29593
|
+
t = tvalues[j];
|
|
29594
|
+
mt = 1 - t;
|
|
29595
|
+
bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
|
|
29596
|
+
bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
|
|
29623
29597
|
}
|
|
29598
|
+
bounds[0][jlen] = x0;
|
|
29599
|
+
bounds[1][jlen] = y0;
|
|
29600
|
+
bounds[0][jlen + 1] = x3;
|
|
29601
|
+
bounds[1][jlen + 1] = y3;
|
|
29602
|
+
bounds[0].length = bounds[1].length = jlen + 2;
|
|
29603
|
+
return {
|
|
29604
|
+
x0: mmin.apply(0, bounds[0]),
|
|
29605
|
+
y0: mmin.apply(0, bounds[1]),
|
|
29606
|
+
x1: mmax.apply(0, bounds[0]),
|
|
29607
|
+
y1: mmax.apply(0, bounds[1])
|
|
29608
|
+
};
|
|
29624
29609
|
}
|
|
29625
|
-
|
|
29626
|
-
|
|
29627
|
-
|
|
29628
|
-
|
|
29629
|
-
bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
|
|
29630
|
-
bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
|
|
29631
|
-
}
|
|
29632
|
-
bounds[0][jlen] = x0;
|
|
29633
|
-
bounds[1][jlen] = y0;
|
|
29634
|
-
bounds[0][jlen + 1] = x3;
|
|
29635
|
-
bounds[1][jlen + 1] = y3;
|
|
29636
|
-
bounds[0].length = bounds[1].length = jlen + 2;
|
|
29637
|
-
return {
|
|
29638
|
-
x0: mmin.apply(0, bounds[0]),
|
|
29639
|
-
y0: mmin.apply(0, bounds[1]),
|
|
29640
|
-
x1: mmax.apply(0, bounds[0]),
|
|
29641
|
-
y1: mmax.apply(0, bounds[1])
|
|
29642
|
-
};
|
|
29643
|
-
}
|
|
29644
|
-
function pathToCurve(path) {
|
|
29645
|
-
var pth = paths(path);
|
|
29646
|
-
if (pth.curve) {
|
|
29647
|
-
return pathClone(pth.curve);
|
|
29648
|
-
}
|
|
29649
|
-
var curvedPath = pathToAbsolute(path), attrs = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, processPath = function(path2, d, pathCommand3) {
|
|
29650
|
-
var nx, ny;
|
|
29651
|
-
if (!path2) {
|
|
29652
|
-
return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
|
|
29653
|
-
}
|
|
29654
|
-
!(path2[0] in { T: 1, Q: 1 }) && (d.qx = d.qy = null);
|
|
29655
|
-
switch (path2[0]) {
|
|
29656
|
-
case "M":
|
|
29657
|
-
d.X = path2[1];
|
|
29658
|
-
d.Y = path2[2];
|
|
29659
|
-
break;
|
|
29660
|
-
case "A":
|
|
29661
|
-
path2 = ["C"].concat(arcToCurve.apply(0, [d.x, d.y].concat(path2.slice(1))));
|
|
29662
|
-
break;
|
|
29663
|
-
case "S":
|
|
29664
|
-
if (pathCommand3 == "C" || pathCommand3 == "S") {
|
|
29665
|
-
nx = d.x * 2 - d.bx;
|
|
29666
|
-
ny = d.y * 2 - d.by;
|
|
29667
|
-
} else {
|
|
29668
|
-
nx = d.x;
|
|
29669
|
-
ny = d.y;
|
|
29670
|
-
}
|
|
29671
|
-
path2 = ["C", nx, ny].concat(path2.slice(1));
|
|
29672
|
-
break;
|
|
29673
|
-
case "T":
|
|
29674
|
-
if (pathCommand3 == "Q" || pathCommand3 == "T") {
|
|
29675
|
-
d.qx = d.x * 2 - d.qx;
|
|
29676
|
-
d.qy = d.y * 2 - d.qy;
|
|
29677
|
-
} else {
|
|
29678
|
-
d.qx = d.x;
|
|
29679
|
-
d.qy = d.y;
|
|
29680
|
-
}
|
|
29681
|
-
path2 = ["C"].concat(qubicToCurve(d.x, d.y, d.qx, d.qy, path2[1], path2[2]));
|
|
29682
|
-
break;
|
|
29683
|
-
case "Q":
|
|
29684
|
-
d.qx = path2[1];
|
|
29685
|
-
d.qy = path2[2];
|
|
29686
|
-
path2 = ["C"].concat(qubicToCurve(d.x, d.y, path2[1], path2[2], path2[3], path2[4]));
|
|
29687
|
-
break;
|
|
29688
|
-
case "L":
|
|
29689
|
-
path2 = ["C"].concat(lineToCurve(d.x, d.y, path2[1], path2[2]));
|
|
29690
|
-
break;
|
|
29691
|
-
case "H":
|
|
29692
|
-
path2 = ["C"].concat(lineToCurve(d.x, d.y, path2[1], d.y));
|
|
29693
|
-
break;
|
|
29694
|
-
case "V":
|
|
29695
|
-
path2 = ["C"].concat(lineToCurve(d.x, d.y, d.x, path2[1]));
|
|
29696
|
-
break;
|
|
29697
|
-
case "Z":
|
|
29698
|
-
path2 = ["C"].concat(lineToCurve(d.x, d.y, d.X, d.Y));
|
|
29699
|
-
break;
|
|
29610
|
+
function pathToCurve(path) {
|
|
29611
|
+
var pth = paths(path);
|
|
29612
|
+
if (pth.curve) {
|
|
29613
|
+
return pathClone(pth.curve);
|
|
29700
29614
|
}
|
|
29701
|
-
|
|
29702
|
-
|
|
29703
|
-
|
|
29704
|
-
|
|
29705
|
-
|
|
29706
|
-
|
|
29707
|
-
|
|
29708
|
-
|
|
29709
|
-
|
|
29710
|
-
|
|
29711
|
-
|
|
29712
|
-
|
|
29713
|
-
|
|
29714
|
-
|
|
29715
|
-
|
|
29716
|
-
|
|
29717
|
-
|
|
29718
|
-
|
|
29719
|
-
|
|
29720
|
-
|
|
29721
|
-
|
|
29722
|
-
|
|
29723
|
-
|
|
29724
|
-
|
|
29725
|
-
|
|
29726
|
-
|
|
29727
|
-
|
|
29728
|
-
|
|
29729
|
-
|
|
29730
|
-
|
|
29731
|
-
|
|
29732
|
-
|
|
29733
|
-
|
|
29615
|
+
var curvedPath = pathToAbsolute(path), attrs = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, processPath = function(path2, d, pathCommand3) {
|
|
29616
|
+
var nx, ny;
|
|
29617
|
+
if (!path2) {
|
|
29618
|
+
return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
|
|
29619
|
+
}
|
|
29620
|
+
!(path2[0] in { T: 1, Q: 1 }) && (d.qx = d.qy = null);
|
|
29621
|
+
switch (path2[0]) {
|
|
29622
|
+
case "M":
|
|
29623
|
+
d.X = path2[1];
|
|
29624
|
+
d.Y = path2[2];
|
|
29625
|
+
break;
|
|
29626
|
+
case "A":
|
|
29627
|
+
path2 = ["C"].concat(arcToCurve.apply(0, [d.x, d.y].concat(path2.slice(1))));
|
|
29628
|
+
break;
|
|
29629
|
+
case "S":
|
|
29630
|
+
if (pathCommand3 == "C" || pathCommand3 == "S") {
|
|
29631
|
+
nx = d.x * 2 - d.bx;
|
|
29632
|
+
ny = d.y * 2 - d.by;
|
|
29633
|
+
} else {
|
|
29634
|
+
nx = d.x;
|
|
29635
|
+
ny = d.y;
|
|
29636
|
+
}
|
|
29637
|
+
path2 = ["C", nx, ny].concat(path2.slice(1));
|
|
29638
|
+
break;
|
|
29639
|
+
case "T":
|
|
29640
|
+
if (pathCommand3 == "Q" || pathCommand3 == "T") {
|
|
29641
|
+
d.qx = d.x * 2 - d.qx;
|
|
29642
|
+
d.qy = d.y * 2 - d.qy;
|
|
29643
|
+
} else {
|
|
29644
|
+
d.qx = d.x;
|
|
29645
|
+
d.qy = d.y;
|
|
29646
|
+
}
|
|
29647
|
+
path2 = ["C"].concat(qubicToCurve(d.x, d.y, d.qx, d.qy, path2[1], path2[2]));
|
|
29648
|
+
break;
|
|
29649
|
+
case "Q":
|
|
29650
|
+
d.qx = path2[1];
|
|
29651
|
+
d.qy = path2[2];
|
|
29652
|
+
path2 = ["C"].concat(qubicToCurve(d.x, d.y, path2[1], path2[2], path2[3], path2[4]));
|
|
29653
|
+
break;
|
|
29654
|
+
case "L":
|
|
29655
|
+
path2 = ["C"].concat(lineToCurve(d.x, d.y, path2[1], path2[2]));
|
|
29656
|
+
break;
|
|
29657
|
+
case "H":
|
|
29658
|
+
path2 = ["C"].concat(lineToCurve(d.x, d.y, path2[1], d.y));
|
|
29659
|
+
break;
|
|
29660
|
+
case "V":
|
|
29661
|
+
path2 = ["C"].concat(lineToCurve(d.x, d.y, d.x, path2[1]));
|
|
29662
|
+
break;
|
|
29663
|
+
case "Z":
|
|
29664
|
+
path2 = ["C"].concat(lineToCurve(d.x, d.y, d.X, d.Y));
|
|
29665
|
+
break;
|
|
29666
|
+
}
|
|
29667
|
+
return path2;
|
|
29668
|
+
}, fixArc = function(pp, i2) {
|
|
29669
|
+
if (pp[i2].length > 7) {
|
|
29670
|
+
pp[i2].shift();
|
|
29671
|
+
var pi = pp[i2];
|
|
29672
|
+
while (pi.length) {
|
|
29673
|
+
pathCommands[i2] = "A";
|
|
29674
|
+
pp.splice(i2++, 0, ["C"].concat(pi.splice(0, 6)));
|
|
29675
|
+
}
|
|
29676
|
+
pp.splice(i2, 1);
|
|
29677
|
+
ii = curvedPath.length;
|
|
29678
|
+
}
|
|
29679
|
+
}, pathCommands = [], pfirst = "", pathCommand2 = "";
|
|
29680
|
+
for (var i = 0, ii = curvedPath.length; i < ii; i++) {
|
|
29681
|
+
curvedPath[i] && (pfirst = curvedPath[i][0]);
|
|
29682
|
+
if (pfirst != "C") {
|
|
29683
|
+
pathCommands[i] = pfirst;
|
|
29684
|
+
i && (pathCommand2 = pathCommands[i - 1]);
|
|
29685
|
+
}
|
|
29686
|
+
curvedPath[i] = processPath(curvedPath[i], attrs, pathCommand2);
|
|
29687
|
+
if (pathCommands[i] != "A" && pfirst == "C") pathCommands[i] = "C";
|
|
29688
|
+
fixArc(curvedPath, i);
|
|
29689
|
+
var seg = curvedPath[i], seglen = seg.length;
|
|
29690
|
+
attrs.x = seg[seglen - 2];
|
|
29691
|
+
attrs.y = seg[seglen - 1];
|
|
29692
|
+
attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
|
|
29693
|
+
attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
|
|
29694
|
+
}
|
|
29695
|
+
pth.curve = pathClone(curvedPath);
|
|
29696
|
+
return curvedPath;
|
|
29697
|
+
}
|
|
29698
|
+
intersect = findPathIntersections;
|
|
29699
|
+
return intersect;
|
|
29700
|
+
}
|
|
29701
|
+
var intersectExports = requireIntersect();
|
|
29702
|
+
var intersectPaths = /* @__PURE__ */ getDefaultExportFromCjs(intersectExports);
|
|
29734
29703
|
function isConnection(value) {
|
|
29735
29704
|
return isObject(value) && has$1(value, "waypoints");
|
|
29736
29705
|
}
|
|
@@ -30563,149 +30532,168 @@ ElementRegistry$1.prototype._validateId = function(id) {
|
|
|
30563
30532
|
};
|
|
30564
30533
|
var objectRefs = { exports: {} };
|
|
30565
30534
|
var collection = {};
|
|
30566
|
-
|
|
30567
|
-
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
|
|
30572
|
-
|
|
30573
|
-
|
|
30574
|
-
|
|
30575
|
-
|
|
30576
|
-
|
|
30577
|
-
|
|
30578
|
-
Object.defineProperty(collection2, "contains", {
|
|
30579
|
-
value: function(element) {
|
|
30580
|
-
return this.indexOf(element) !== -1;
|
|
30581
|
-
}
|
|
30582
|
-
});
|
|
30583
|
-
Object.defineProperty(collection2, "add", {
|
|
30584
|
-
value: function(element, idx) {
|
|
30585
|
-
var currentIdx = this.indexOf(element);
|
|
30586
|
-
if (typeof idx === "undefined") {
|
|
30587
|
-
if (currentIdx !== -1) {
|
|
30588
|
-
return;
|
|
30535
|
+
var hasRequiredCollection;
|
|
30536
|
+
function requireCollection() {
|
|
30537
|
+
if (hasRequiredCollection) return collection;
|
|
30538
|
+
hasRequiredCollection = 1;
|
|
30539
|
+
function extend2(collection2, refs2, property, target) {
|
|
30540
|
+
var inverseProperty = property.inverse;
|
|
30541
|
+
Object.defineProperty(collection2, "remove", {
|
|
30542
|
+
value: function(element) {
|
|
30543
|
+
var idx = this.indexOf(element);
|
|
30544
|
+
if (idx !== -1) {
|
|
30545
|
+
this.splice(idx, 1);
|
|
30546
|
+
refs2.unset(element, inverseProperty, target);
|
|
30589
30547
|
}
|
|
30590
|
-
|
|
30548
|
+
return element;
|
|
30591
30549
|
}
|
|
30592
|
-
|
|
30593
|
-
|
|
30550
|
+
});
|
|
30551
|
+
Object.defineProperty(collection2, "contains", {
|
|
30552
|
+
value: function(element) {
|
|
30553
|
+
return this.indexOf(element) !== -1;
|
|
30594
30554
|
}
|
|
30595
|
-
|
|
30596
|
-
|
|
30597
|
-
|
|
30555
|
+
});
|
|
30556
|
+
Object.defineProperty(collection2, "add", {
|
|
30557
|
+
value: function(element, idx) {
|
|
30558
|
+
var currentIdx = this.indexOf(element);
|
|
30559
|
+
if (typeof idx === "undefined") {
|
|
30560
|
+
if (currentIdx !== -1) {
|
|
30561
|
+
return;
|
|
30562
|
+
}
|
|
30563
|
+
idx = this.length;
|
|
30564
|
+
}
|
|
30565
|
+
if (currentIdx !== -1) {
|
|
30566
|
+
this.splice(currentIdx, 1);
|
|
30567
|
+
}
|
|
30568
|
+
this.splice(idx, 0, element);
|
|
30569
|
+
if (currentIdx === -1) {
|
|
30570
|
+
refs2.set(element, inverseProperty, target);
|
|
30571
|
+
}
|
|
30598
30572
|
}
|
|
30599
|
-
}
|
|
30600
|
-
});
|
|
30601
|
-
Object.defineProperty(collection2, "__refs_collection", {
|
|
30602
|
-
value: true
|
|
30603
|
-
});
|
|
30604
|
-
return collection2;
|
|
30605
|
-
}
|
|
30606
|
-
function isExtended(collection2) {
|
|
30607
|
-
return collection2.__refs_collection === true;
|
|
30608
|
-
}
|
|
30609
|
-
collection.extend = extend;
|
|
30610
|
-
collection.isExtended = isExtended;
|
|
30611
|
-
var Collection = collection;
|
|
30612
|
-
function hasOwnProperty$1(e2, property) {
|
|
30613
|
-
return Object.prototype.hasOwnProperty.call(e2, property.name || property);
|
|
30614
|
-
}
|
|
30615
|
-
function defineCollectionProperty(ref, property, target) {
|
|
30616
|
-
var collection2 = Collection.extend(target[property.name] || [], ref, property, target);
|
|
30617
|
-
Object.defineProperty(target, property.name, {
|
|
30618
|
-
enumerable: property.enumerable,
|
|
30619
|
-
value: collection2
|
|
30620
|
-
});
|
|
30621
|
-
if (collection2.length) {
|
|
30622
|
-
collection2.forEach(function(o) {
|
|
30623
|
-
ref.set(o, property.inverse, target);
|
|
30624
30573
|
});
|
|
30574
|
+
Object.defineProperty(collection2, "__refs_collection", {
|
|
30575
|
+
value: true
|
|
30576
|
+
});
|
|
30577
|
+
return collection2;
|
|
30625
30578
|
}
|
|
30626
|
-
|
|
30627
|
-
|
|
30628
|
-
var inverseProperty = property.inverse;
|
|
30629
|
-
var _value = target[property.name];
|
|
30630
|
-
Object.defineProperty(target, property.name, {
|
|
30631
|
-
configurable: property.configurable,
|
|
30632
|
-
enumerable: property.enumerable,
|
|
30633
|
-
get: function() {
|
|
30634
|
-
return _value;
|
|
30635
|
-
},
|
|
30636
|
-
set: function(value) {
|
|
30637
|
-
if (value === _value) {
|
|
30638
|
-
return;
|
|
30639
|
-
}
|
|
30640
|
-
var old = _value;
|
|
30641
|
-
_value = null;
|
|
30642
|
-
if (old) {
|
|
30643
|
-
ref.unset(old, inverseProperty, target);
|
|
30644
|
-
}
|
|
30645
|
-
_value = value;
|
|
30646
|
-
ref.set(_value, inverseProperty, target);
|
|
30647
|
-
}
|
|
30648
|
-
});
|
|
30649
|
-
}
|
|
30650
|
-
function Refs$1(a, b) {
|
|
30651
|
-
if (!(this instanceof Refs$1)) {
|
|
30652
|
-
return new Refs$1(a, b);
|
|
30579
|
+
function isExtended(collection2) {
|
|
30580
|
+
return collection2.__refs_collection === true;
|
|
30653
30581
|
}
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
this.props[a.name] = a;
|
|
30658
|
-
this.props[b.name] = b;
|
|
30582
|
+
collection.extend = extend2;
|
|
30583
|
+
collection.isExtended = isExtended;
|
|
30584
|
+
return collection;
|
|
30659
30585
|
}
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
defineCollectionProperty(this, property, target);
|
|
30669
|
-
} else {
|
|
30670
|
-
defineProperty$1(this, property, target);
|
|
30586
|
+
var refs;
|
|
30587
|
+
var hasRequiredRefs;
|
|
30588
|
+
function requireRefs() {
|
|
30589
|
+
if (hasRequiredRefs) return refs;
|
|
30590
|
+
hasRequiredRefs = 1;
|
|
30591
|
+
var Collection = requireCollection();
|
|
30592
|
+
function hasOwnProperty2(e2, property) {
|
|
30593
|
+
return Object.prototype.hasOwnProperty.call(e2, property.name || property);
|
|
30671
30594
|
}
|
|
30672
|
-
|
|
30673
|
-
|
|
30674
|
-
|
|
30675
|
-
|
|
30676
|
-
|
|
30595
|
+
function defineCollectionProperty(ref, property, target) {
|
|
30596
|
+
var collection2 = Collection.extend(target[property.name] || [], ref, property, target);
|
|
30597
|
+
Object.defineProperty(target, property.name, {
|
|
30598
|
+
enumerable: property.enumerable,
|
|
30599
|
+
value: collection2
|
|
30600
|
+
});
|
|
30601
|
+
if (collection2.length) {
|
|
30602
|
+
collection2.forEach(function(o) {
|
|
30603
|
+
ref.set(o, property.inverse, target);
|
|
30604
|
+
});
|
|
30605
|
+
}
|
|
30677
30606
|
}
|
|
30678
|
-
|
|
30679
|
-
|
|
30680
|
-
|
|
30681
|
-
|
|
30682
|
-
|
|
30607
|
+
function defineProperty2(ref, property, target) {
|
|
30608
|
+
var inverseProperty = property.inverse;
|
|
30609
|
+
var _value = target[property.name];
|
|
30610
|
+
Object.defineProperty(target, property.name, {
|
|
30611
|
+
configurable: property.configurable,
|
|
30612
|
+
enumerable: property.enumerable,
|
|
30613
|
+
get: function() {
|
|
30614
|
+
return _value;
|
|
30615
|
+
},
|
|
30616
|
+
set: function(value) {
|
|
30617
|
+
if (value === _value) {
|
|
30618
|
+
return;
|
|
30619
|
+
}
|
|
30620
|
+
var old = _value;
|
|
30621
|
+
_value = null;
|
|
30622
|
+
if (old) {
|
|
30623
|
+
ref.unset(old, inverseProperty, target);
|
|
30624
|
+
}
|
|
30625
|
+
_value = value;
|
|
30626
|
+
ref.set(_value, inverseProperty, target);
|
|
30627
|
+
}
|
|
30628
|
+
});
|
|
30683
30629
|
}
|
|
30684
|
-
|
|
30685
|
-
|
|
30686
|
-
|
|
30687
|
-
this.ensureBound(target, property);
|
|
30688
|
-
if (property.collection) {
|
|
30689
|
-
this.ensureRefsCollection(target, property).remove(value);
|
|
30690
|
-
} else {
|
|
30691
|
-
target[property.name] = void 0;
|
|
30630
|
+
function Refs2(a, b) {
|
|
30631
|
+
if (!(this instanceof Refs2)) {
|
|
30632
|
+
return new Refs2(a, b);
|
|
30692
30633
|
}
|
|
30634
|
+
a.inverse = b;
|
|
30635
|
+
b.inverse = a;
|
|
30636
|
+
this.props = {};
|
|
30637
|
+
this.props[a.name] = a;
|
|
30638
|
+
this.props[b.name] = b;
|
|
30693
30639
|
}
|
|
30694
|
-
|
|
30695
|
-
|
|
30696
|
-
|
|
30697
|
-
|
|
30640
|
+
Refs2.prototype.bind = function(target, property) {
|
|
30641
|
+
if (typeof property === "string") {
|
|
30642
|
+
if (!this.props[property]) {
|
|
30643
|
+
throw new Error("no property <" + property + "> in ref");
|
|
30644
|
+
}
|
|
30645
|
+
property = this.props[property];
|
|
30646
|
+
}
|
|
30698
30647
|
if (property.collection) {
|
|
30699
|
-
this
|
|
30648
|
+
defineCollectionProperty(this, property, target);
|
|
30700
30649
|
} else {
|
|
30701
|
-
|
|
30650
|
+
defineProperty2(this, property, target);
|
|
30702
30651
|
}
|
|
30703
|
-
}
|
|
30704
|
-
|
|
30705
|
-
var
|
|
30706
|
-
|
|
30707
|
-
|
|
30708
|
-
|
|
30652
|
+
};
|
|
30653
|
+
Refs2.prototype.ensureRefsCollection = function(target, property) {
|
|
30654
|
+
var collection2 = target[property.name];
|
|
30655
|
+
if (!Collection.isExtended(collection2)) {
|
|
30656
|
+
defineCollectionProperty(this, property, target);
|
|
30657
|
+
}
|
|
30658
|
+
return collection2;
|
|
30659
|
+
};
|
|
30660
|
+
Refs2.prototype.ensureBound = function(target, property) {
|
|
30661
|
+
if (!hasOwnProperty2(target, property)) {
|
|
30662
|
+
this.bind(target, property);
|
|
30663
|
+
}
|
|
30664
|
+
};
|
|
30665
|
+
Refs2.prototype.unset = function(target, property, value) {
|
|
30666
|
+
if (target) {
|
|
30667
|
+
this.ensureBound(target, property);
|
|
30668
|
+
if (property.collection) {
|
|
30669
|
+
this.ensureRefsCollection(target, property).remove(value);
|
|
30670
|
+
} else {
|
|
30671
|
+
target[property.name] = void 0;
|
|
30672
|
+
}
|
|
30673
|
+
}
|
|
30674
|
+
};
|
|
30675
|
+
Refs2.prototype.set = function(target, property, value) {
|
|
30676
|
+
if (target) {
|
|
30677
|
+
this.ensureBound(target, property);
|
|
30678
|
+
if (property.collection) {
|
|
30679
|
+
this.ensureRefsCollection(target, property).add(value);
|
|
30680
|
+
} else {
|
|
30681
|
+
target[property.name] = value;
|
|
30682
|
+
}
|
|
30683
|
+
}
|
|
30684
|
+
};
|
|
30685
|
+
refs = Refs2;
|
|
30686
|
+
return refs;
|
|
30687
|
+
}
|
|
30688
|
+
var hasRequiredObjectRefs;
|
|
30689
|
+
function requireObjectRefs() {
|
|
30690
|
+
if (hasRequiredObjectRefs) return objectRefs.exports;
|
|
30691
|
+
hasRequiredObjectRefs = 1;
|
|
30692
|
+
objectRefs.exports = requireRefs();
|
|
30693
|
+
objectRefs.exports.Collection = requireCollection();
|
|
30694
|
+
return objectRefs.exports;
|
|
30695
|
+
}
|
|
30696
|
+
var objectRefsExports = requireObjectRefs();
|
|
30709
30697
|
var Refs = /* @__PURE__ */ getDefaultExportFromCjs(objectRefsExports);
|
|
30710
30698
|
var parentRefs = new Refs({ name: "children", enumerable: true, collection: true }, { name: "parent" });
|
|
30711
30699
|
var labelRefs = new Refs({ name: "labels", enumerable: true, collection: true }, { name: "labelTarget" });
|
|
@@ -30803,7 +30791,7 @@ function EventBus() {
|
|
|
30803
30791
|
this.on("diagram.destroy", 1, this._destroy, this);
|
|
30804
30792
|
}
|
|
30805
30793
|
EventBus.prototype.on = function(events, priority, callback, that) {
|
|
30806
|
-
events = isArray$
|
|
30794
|
+
events = isArray$2(events) ? events : [events];
|
|
30807
30795
|
if (isFunction(priority)) {
|
|
30808
30796
|
that = callback;
|
|
30809
30797
|
callback = priority;
|
|
@@ -30846,7 +30834,7 @@ EventBus.prototype.once = function(events, priority, callback, that) {
|
|
|
30846
30834
|
this.on(events, priority, wrappedCallback);
|
|
30847
30835
|
};
|
|
30848
30836
|
EventBus.prototype.off = function(events, callback) {
|
|
30849
|
-
events = isArray$
|
|
30837
|
+
events = isArray$2(events) ? events : [events];
|
|
30850
30838
|
var self = this;
|
|
30851
30839
|
events.forEach(function(event2) {
|
|
30852
30840
|
self._removeListener(event2, callback);
|
|
@@ -31005,7 +30993,7 @@ function transform(gfx, x, y, angle, amount) {
|
|
|
31005
30993
|
var rotate2 = createTransform();
|
|
31006
30994
|
rotate2.setRotate(angle || 0, 0, 0);
|
|
31007
30995
|
var scale = createTransform();
|
|
31008
|
-
scale.setScale(
|
|
30996
|
+
scale.setScale(1, 1);
|
|
31009
30997
|
transform$1(gfx, [translate2, rotate2, scale]);
|
|
31010
30998
|
}
|
|
31011
30999
|
function translate$1(gfx, x, y) {
|
|
@@ -31040,7 +31028,7 @@ GraphicsFactory$1.prototype._getChildrenContainer = function(element) {
|
|
|
31040
31028
|
};
|
|
31041
31029
|
GraphicsFactory$1.prototype._clear = function(gfx) {
|
|
31042
31030
|
var visual = getVisual(gfx);
|
|
31043
|
-
clear
|
|
31031
|
+
clear(visual);
|
|
31044
31032
|
return visual;
|
|
31045
31033
|
};
|
|
31046
31034
|
GraphicsFactory$1.prototype._createContainer = function(type, childrenGfx, parentIndex, isFrame) {
|
|
@@ -31632,7 +31620,7 @@ Moddle.prototype.createAny = function(name2, nsUri, properties) {
|
|
|
31632
31620
|
return this[key];
|
|
31633
31621
|
},
|
|
31634
31622
|
set: function(key, value) {
|
|
31635
|
-
set$
|
|
31623
|
+
set$1(this, [key], value);
|
|
31636
31624
|
}
|
|
31637
31625
|
};
|
|
31638
31626
|
var descriptor = {
|
|
@@ -39700,15 +39688,15 @@ function getLineHeight(style) {
|
|
|
39700
39688
|
return style.lineHeight * parseInt(style.fontSize, 10);
|
|
39701
39689
|
}
|
|
39702
39690
|
}
|
|
39703
|
-
var DEFAULT_FONT_SIZE = 12;
|
|
39704
|
-
var LINE_HEIGHT_RATIO = 1.2;
|
|
39705
|
-
var MIN_TEXT_ANNOTATION_HEIGHT = 30;
|
|
39706
|
-
function TextRenderer(config) {
|
|
39691
|
+
var DEFAULT_FONT_SIZE$1 = 12;
|
|
39692
|
+
var LINE_HEIGHT_RATIO$1 = 1.2;
|
|
39693
|
+
var MIN_TEXT_ANNOTATION_HEIGHT$1 = 30;
|
|
39694
|
+
function TextRenderer$1(config) {
|
|
39707
39695
|
var defaultStyle = assign$1({
|
|
39708
39696
|
fontFamily: "Arial, sans-serif",
|
|
39709
|
-
fontSize: DEFAULT_FONT_SIZE,
|
|
39697
|
+
fontSize: DEFAULT_FONT_SIZE$1,
|
|
39710
39698
|
fontWeight: "normal",
|
|
39711
|
-
lineHeight: LINE_HEIGHT_RATIO
|
|
39699
|
+
lineHeight: LINE_HEIGHT_RATIO$1
|
|
39712
39700
|
}, config && config.defaultStyle || {});
|
|
39713
39701
|
var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
|
|
39714
39702
|
var externalStyle = assign$1({}, defaultStyle, {
|
|
@@ -39743,7 +39731,7 @@ function TextRenderer(config) {
|
|
|
39743
39731
|
x: bounds.x,
|
|
39744
39732
|
y: bounds.y,
|
|
39745
39733
|
width: bounds.width,
|
|
39746
|
-
height: Math.max(MIN_TEXT_ANNOTATION_HEIGHT, Math.round(layoutedDimensions.height))
|
|
39734
|
+
height: Math.max(MIN_TEXT_ANNOTATION_HEIGHT$1, Math.round(layoutedDimensions.height))
|
|
39747
39735
|
};
|
|
39748
39736
|
};
|
|
39749
39737
|
this.createText = function(text, options) {
|
|
@@ -39756,7 +39744,7 @@ function TextRenderer(config) {
|
|
|
39756
39744
|
return externalStyle;
|
|
39757
39745
|
};
|
|
39758
39746
|
}
|
|
39759
|
-
TextRenderer.$inject = [
|
|
39747
|
+
TextRenderer$1.$inject = [
|
|
39760
39748
|
"config.textRenderer"
|
|
39761
39749
|
];
|
|
39762
39750
|
function PathMap() {
|
|
@@ -40054,7 +40042,7 @@ function format(str, obj) {
|
|
|
40054
40042
|
var DrawModule = {
|
|
40055
40043
|
__init__: ["bpmnRenderer"],
|
|
40056
40044
|
bpmnRenderer: ["type", BpmnRenderer],
|
|
40057
|
-
textRenderer: ["type", TextRenderer],
|
|
40045
|
+
textRenderer: ["type", TextRenderer$1],
|
|
40058
40046
|
pathMap: ["type", PathMap]
|
|
40059
40047
|
};
|
|
40060
40048
|
function translate(template, replacements) {
|
|
@@ -40283,7 +40271,7 @@ Selection.prototype.isSelected = function(element) {
|
|
|
40283
40271
|
};
|
|
40284
40272
|
Selection.prototype.select = function(elements, add2) {
|
|
40285
40273
|
var selectedElements = this._selectedElements, oldSelection = selectedElements.slice();
|
|
40286
|
-
if (!isArray$
|
|
40274
|
+
if (!isArray$2(elements)) {
|
|
40287
40275
|
elements = elements ? [elements] : [];
|
|
40288
40276
|
}
|
|
40289
40277
|
var canvas = this._canvas;
|
|
@@ -40361,7 +40349,7 @@ function SelectionBehavior(eventBus, selection, canvas, elementRegistry) {
|
|
|
40361
40349
|
if (autoSelect === false) {
|
|
40362
40350
|
return;
|
|
40363
40351
|
}
|
|
40364
|
-
if (isArray$
|
|
40352
|
+
if (isArray$2(autoSelect)) {
|
|
40365
40353
|
selection.select(autoSelect);
|
|
40366
40354
|
} else {
|
|
40367
40355
|
selection.select(elements.filter(isShown));
|
|
@@ -40779,7 +40767,7 @@ CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, un
|
|
|
40779
40767
|
if (!isFunction(handlerFn)) {
|
|
40780
40768
|
throw new Error("handlerFn must be a function");
|
|
40781
40769
|
}
|
|
40782
|
-
if (!isArray$
|
|
40770
|
+
if (!isArray$2(events)) {
|
|
40783
40771
|
events = [events];
|
|
40784
40772
|
}
|
|
40785
40773
|
var eventBus = this._eventBus;
|
|
@@ -40835,7 +40823,7 @@ function AutoResize(eventBus, elementRegistry, modeling, rules) {
|
|
|
40835
40823
|
return element.parent.id;
|
|
40836
40824
|
});
|
|
40837
40825
|
forEach$1(expandings, function(elements2, parentId) {
|
|
40838
|
-
if (isArray$
|
|
40826
|
+
if (isArray$2(autoResize)) {
|
|
40839
40827
|
elements2 = elements2.filter(function(element) {
|
|
40840
40828
|
return find(autoResize, matchPattern({ id: element.id }));
|
|
40841
40829
|
});
|
|
@@ -41114,7 +41102,7 @@ CopyPaste.$inject = [
|
|
|
41114
41102
|
];
|
|
41115
41103
|
CopyPaste.prototype.copy = function(elements) {
|
|
41116
41104
|
var allowed, tree;
|
|
41117
|
-
if (!isArray$
|
|
41105
|
+
if (!isArray$2(elements)) {
|
|
41118
41106
|
elements = elements ? [elements] : [];
|
|
41119
41107
|
}
|
|
41120
41108
|
allowed = this._eventBus.fire("copyPaste.canCopyElements", {
|
|
@@ -41123,7 +41111,7 @@ CopyPaste.prototype.copy = function(elements) {
|
|
|
41123
41111
|
if (allowed === false) {
|
|
41124
41112
|
tree = {};
|
|
41125
41113
|
} else {
|
|
41126
|
-
tree = this.createTree(isArray$
|
|
41114
|
+
tree = this.createTree(isArray$2(allowed) ? allowed : elements);
|
|
41127
41115
|
}
|
|
41128
41116
|
this._clipboard.set(tree);
|
|
41129
41117
|
this._eventBus.fire("copyPaste.elementsCopied", {
|
|
@@ -41375,7 +41363,7 @@ var CopyPasteModule$1 = {
|
|
|
41375
41363
|
copyPaste: ["type", CopyPaste]
|
|
41376
41364
|
};
|
|
41377
41365
|
function copyProperties$1(source, target, properties) {
|
|
41378
|
-
if (!isArray$
|
|
41366
|
+
if (!isArray$2(properties)) {
|
|
41379
41367
|
properties = [properties];
|
|
41380
41368
|
}
|
|
41381
41369
|
forEach$1(properties, function(property) {
|
|
@@ -41523,7 +41511,7 @@ ModdleCopy.$inject = [
|
|
|
41523
41511
|
];
|
|
41524
41512
|
ModdleCopy.prototype.copyElement = function(sourceElement, targetElement, propertyNames, clone2 = false) {
|
|
41525
41513
|
var self = this;
|
|
41526
|
-
if (propertyNames && !isArray$
|
|
41514
|
+
if (propertyNames && !isArray$2(propertyNames)) {
|
|
41527
41515
|
propertyNames = [propertyNames];
|
|
41528
41516
|
}
|
|
41529
41517
|
propertyNames = propertyNames || getPropertyNames(sourceElement.$descriptor);
|
|
@@ -41536,7 +41524,7 @@ ModdleCopy.prototype.copyElement = function(sourceElement, targetElement, proper
|
|
|
41536
41524
|
if (canCopyProperties === false) {
|
|
41537
41525
|
return targetElement;
|
|
41538
41526
|
}
|
|
41539
|
-
if (isArray$
|
|
41527
|
+
if (isArray$2(canCopyProperties)) {
|
|
41540
41528
|
propertyNames = canCopyProperties;
|
|
41541
41529
|
}
|
|
41542
41530
|
forEach$1(propertyNames, function(propertyName) {
|
|
@@ -41584,7 +41572,7 @@ ModdleCopy.prototype.copyProperty = function(property, parent, propertyName, clo
|
|
|
41584
41572
|
if (propertyDescriptor.isId) {
|
|
41585
41573
|
return property && this._copyId(property, parent, clone2);
|
|
41586
41574
|
}
|
|
41587
|
-
if (isArray$
|
|
41575
|
+
if (isArray$2(property)) {
|
|
41588
41576
|
return reduce(property, function(childProperties, childProperty) {
|
|
41589
41577
|
copiedProperty = self.copyProperty(childProperty, parent, propertyName, clone2);
|
|
41590
41578
|
if (copiedProperty) {
|
|
@@ -41700,7 +41688,7 @@ EditorActions.prototype._registerDefaultActions = function(injector) {
|
|
|
41700
41688
|
var allowed = rules.allowed("elements.delete", { elements: selectedElements }), removableElements;
|
|
41701
41689
|
if (allowed === false) {
|
|
41702
41690
|
return;
|
|
41703
|
-
} else if (isArray$
|
|
41691
|
+
} else if (isArray$2(allowed)) {
|
|
41704
41692
|
removableElements = allowed;
|
|
41705
41693
|
} else {
|
|
41706
41694
|
removableElements = selectedElements;
|
|
@@ -42530,21 +42518,14 @@ function resizeTRBL(bounds, resize) {
|
|
|
42530
42518
|
};
|
|
42531
42519
|
}
|
|
42532
42520
|
function asPadding(mayBePadding, defaultValue) {
|
|
42533
|
-
|
|
42534
|
-
return mayBePadding;
|
|
42535
|
-
} else {
|
|
42521
|
+
{
|
|
42536
42522
|
return DEFAULT_CHILD_BOX_PADDING;
|
|
42537
42523
|
}
|
|
42538
42524
|
}
|
|
42539
42525
|
function addPadding$1(bbox, padding) {
|
|
42540
42526
|
var left, right, top, bottom;
|
|
42541
|
-
|
|
42542
|
-
left = asPadding(
|
|
42543
|
-
right = asPadding(padding.right);
|
|
42544
|
-
top = asPadding(padding.top);
|
|
42545
|
-
bottom = asPadding(padding.bottom);
|
|
42546
|
-
} else {
|
|
42547
|
-
left = right = top = bottom = asPadding(padding);
|
|
42527
|
+
{
|
|
42528
|
+
left = right = top = bottom = asPadding();
|
|
42548
42529
|
}
|
|
42549
42530
|
return {
|
|
42550
42531
|
x: bbox.x - left,
|
|
@@ -42570,7 +42551,7 @@ function computeChildrenBBox(shapeOrChildren, padding) {
|
|
|
42570
42551
|
elements = shapeOrChildren;
|
|
42571
42552
|
}
|
|
42572
42553
|
if (elements.length) {
|
|
42573
|
-
return addPadding$1(getBBox(elements)
|
|
42554
|
+
return addPadding$1(getBBox(elements));
|
|
42574
42555
|
}
|
|
42575
42556
|
}
|
|
42576
42557
|
var abs$3 = Math.abs;
|
|
@@ -43997,7 +43978,7 @@ function ModelingFeedback(eventBus, translate2, injector) {
|
|
|
43997
43978
|
y: position.y + 5
|
|
43998
43979
|
},
|
|
43999
43980
|
type: "error",
|
|
44000
|
-
timeout:
|
|
43981
|
+
timeout: 2e3,
|
|
44001
43982
|
html: "<div>" + message + "</div>"
|
|
44002
43983
|
});
|
|
44003
43984
|
}
|
|
@@ -44478,7 +44459,7 @@ RootElementReferenceBehavior.$inject = [
|
|
|
44478
44459
|
];
|
|
44479
44460
|
e(RootElementReferenceBehavior, CommandInterceptor);
|
|
44480
44461
|
function hasAnyEventDefinition(element, types2) {
|
|
44481
|
-
if (!isArray$
|
|
44462
|
+
if (!isArray$2(types2)) {
|
|
44482
44463
|
types2 = [types2];
|
|
44483
44464
|
}
|
|
44484
44465
|
return some(types2, function(type) {
|
|
@@ -46002,7 +45983,7 @@ var ReplaceModule$1 = {
|
|
|
46002
45983
|
replace: ["type", Replace]
|
|
46003
45984
|
};
|
|
46004
45985
|
function copyProperties(source, target, properties) {
|
|
46005
|
-
if (!isArray$
|
|
45986
|
+
if (!isArray$2(properties)) {
|
|
46006
45987
|
properties = [properties];
|
|
46007
45988
|
}
|
|
46008
45989
|
forEach$1(properties, function(property) {
|
|
@@ -46261,7 +46242,7 @@ function install(eventBus, eventName) {
|
|
|
46261
46242
|
};
|
|
46262
46243
|
}
|
|
46263
46244
|
function isKey(keys3, event2) {
|
|
46264
|
-
keys3 = isArray$
|
|
46245
|
+
keys3 = isArray$2(keys3) ? keys3 : [keys3];
|
|
46265
46246
|
return keys3.indexOf(event2.key) !== -1 || keys3.indexOf(event2.code) !== -1;
|
|
46266
46247
|
}
|
|
46267
46248
|
var round$4 = Math.round;
|
|
@@ -46629,7 +46610,7 @@ PreviewSupport.prototype.getGfx = function(element) {
|
|
|
46629
46610
|
};
|
|
46630
46611
|
PreviewSupport.prototype.addDragger = function(element, group, gfx) {
|
|
46631
46612
|
gfx = gfx || this.getGfx(element);
|
|
46632
|
-
var dragger = clone
|
|
46613
|
+
var dragger = clone(gfx);
|
|
46633
46614
|
var bbox = gfx.getBoundingClientRect();
|
|
46634
46615
|
this._cloneMarkers(getVisual(dragger));
|
|
46635
46616
|
attr(dragger, this._styles.cls("djs-dragger", [], {
|
|
@@ -46671,7 +46652,7 @@ PreviewSupport.prototype._cloneMarker = function(gfx, marker, markerType) {
|
|
|
46671
46652
|
var markerId = marker.id;
|
|
46672
46653
|
var clonedMarker = this._clonedMarkers[markerId];
|
|
46673
46654
|
if (!clonedMarker) {
|
|
46674
|
-
clonedMarker = clone
|
|
46655
|
+
clonedMarker = clone(marker);
|
|
46675
46656
|
var clonedMarkerId = markerId + "-clone";
|
|
46676
46657
|
clonedMarker.id = clonedMarkerId;
|
|
46677
46658
|
classes(clonedMarker).add("djs-dragger").add("djs-dragger-marker");
|
|
@@ -47534,7 +47515,7 @@ CommandStack.prototype._markDirty = function(elements) {
|
|
|
47534
47515
|
if (!elements) {
|
|
47535
47516
|
return;
|
|
47536
47517
|
}
|
|
47537
|
-
elements = isArray$
|
|
47518
|
+
elements = isArray$2(elements) ? elements : [elements];
|
|
47538
47519
|
execution.dirty = execution.dirty.concat(elements);
|
|
47539
47520
|
};
|
|
47540
47521
|
CommandStack.prototype._executedAction = function(action, redo) {
|
|
@@ -49162,7 +49143,7 @@ ReconnectConnectionHandler.prototype.execute = function(context) {
|
|
|
49162
49143
|
if (!newSource && !newTarget) {
|
|
49163
49144
|
throw new Error("newSource or newTarget required");
|
|
49164
49145
|
}
|
|
49165
|
-
if (isArray$
|
|
49146
|
+
if (isArray$2(dockingOrPoints)) {
|
|
49166
49147
|
context.oldWaypoints = connection.waypoints;
|
|
49167
49148
|
connection.waypoints = dockingOrPoints;
|
|
49168
49149
|
}
|
|
@@ -49189,10 +49170,10 @@ ReconnectConnectionHandler.prototype.postExecute = function(context) {
|
|
|
49189
49170
|
return;
|
|
49190
49171
|
}
|
|
49191
49172
|
if (newSource && (!newTarget || hints.docking === "source")) {
|
|
49192
|
-
layoutConnectionHints.connectionStart = layoutConnectionHints.connectionStart || getDocking(isArray$
|
|
49173
|
+
layoutConnectionHints.connectionStart = layoutConnectionHints.connectionStart || getDocking(isArray$2(dockingOrPoints) ? dockingOrPoints[0] : dockingOrPoints);
|
|
49193
49174
|
}
|
|
49194
49175
|
if (newTarget && (!newSource || hints.docking === "target")) {
|
|
49195
|
-
layoutConnectionHints.connectionEnd = layoutConnectionHints.connectionEnd || getDocking(isArray$
|
|
49176
|
+
layoutConnectionHints.connectionEnd = layoutConnectionHints.connectionEnd || getDocking(isArray$2(dockingOrPoints) ? dockingOrPoints[dockingOrPoints.length - 1] : dockingOrPoints);
|
|
49196
49177
|
}
|
|
49197
49178
|
if (hints.newWaypoints) {
|
|
49198
49179
|
layoutConnectionHints.waypoints = hints.newWaypoints;
|
|
@@ -49714,7 +49695,7 @@ Modeling$1.prototype.createShape = function(shape, position, target, parentIndex
|
|
|
49714
49695
|
return context.shape;
|
|
49715
49696
|
};
|
|
49716
49697
|
Modeling$1.prototype.createElements = function(elements, position, parent, parentIndex, hints) {
|
|
49717
|
-
if (!isArray$
|
|
49698
|
+
if (!isArray$2(elements)) {
|
|
49718
49699
|
elements = [elements];
|
|
49719
49700
|
}
|
|
49720
49701
|
if (typeof parentIndex !== "number") {
|
|
@@ -50772,7 +50753,7 @@ function connectRectangles(source, target, start, end, hints) {
|
|
|
50772
50753
|
return connectPoints(startDocking, endDocking, directions);
|
|
50773
50754
|
}
|
|
50774
50755
|
function repairConnection(source, target, start, end, waypoints, hints) {
|
|
50775
|
-
if (isArray$
|
|
50756
|
+
if (isArray$2(start)) {
|
|
50776
50757
|
waypoints = start;
|
|
50777
50758
|
hints = end;
|
|
50778
50759
|
start = getMid(source);
|
|
@@ -51776,6 +51757,118 @@ var CoreOverrideModule = {
|
|
|
51776
51757
|
graphicsFactory: ["type", GraphicsFactory],
|
|
51777
51758
|
elementRegistry: ["type", ElementRegistry]
|
|
51778
51759
|
};
|
|
51760
|
+
var DEFAULT_FONT_SIZE = 12;
|
|
51761
|
+
var LINE_HEIGHT_RATIO = 1.2;
|
|
51762
|
+
var MIN_TEXT_ANNOTATION_HEIGHT = 30;
|
|
51763
|
+
var CHAR_WIDTH_RATIO = 0.6;
|
|
51764
|
+
function estimateTextDimensions(text, options) {
|
|
51765
|
+
var box = options.box, style = options.style, padding = options.padding || 0;
|
|
51766
|
+
var fontSize = parseInt(style.fontSize, 10) || DEFAULT_FONT_SIZE;
|
|
51767
|
+
var lineHeight = (style.lineHeight || LINE_HEIGHT_RATIO) * fontSize;
|
|
51768
|
+
var charWidth = fontSize * CHAR_WIDTH_RATIO;
|
|
51769
|
+
var maxWidth = box.width - (typeof padding === "number" ? padding * 2 : 0);
|
|
51770
|
+
var wrapped = text.split(/\r?\n/).map(function(line) {
|
|
51771
|
+
return wrapLine(line, maxWidth, charWidth);
|
|
51772
|
+
});
|
|
51773
|
+
var totalLines = reduce(wrapped, function(sum, line) {
|
|
51774
|
+
return sum + line.lineCount;
|
|
51775
|
+
}, 0);
|
|
51776
|
+
var maxLineWidth = reduce(wrapped, function(max2, line) {
|
|
51777
|
+
return Math.max(max2, line.width);
|
|
51778
|
+
}, 0);
|
|
51779
|
+
return {
|
|
51780
|
+
width: maxLineWidth,
|
|
51781
|
+
height: totalLines * lineHeight
|
|
51782
|
+
};
|
|
51783
|
+
}
|
|
51784
|
+
function wrapLine(line, maxWidth, charWidth) {
|
|
51785
|
+
var words = splitWords(line);
|
|
51786
|
+
if (words.length === 0) {
|
|
51787
|
+
return { lineCount: 1, width: 0 };
|
|
51788
|
+
}
|
|
51789
|
+
var lineCount = 1;
|
|
51790
|
+
var currentLineWidth = 0;
|
|
51791
|
+
var maxLineWidth = 0;
|
|
51792
|
+
for (var i = 0; i < words.length; i++) {
|
|
51793
|
+
var wordWidth = estimateWordWidth(words[i], charWidth);
|
|
51794
|
+
if (currentLineWidth === 0) {
|
|
51795
|
+
currentLineWidth = wordWidth;
|
|
51796
|
+
} else if (currentLineWidth + charWidth + wordWidth <= maxWidth) {
|
|
51797
|
+
currentLineWidth += charWidth + wordWidth;
|
|
51798
|
+
} else {
|
|
51799
|
+
maxLineWidth = Math.max(maxLineWidth, currentLineWidth);
|
|
51800
|
+
lineCount++;
|
|
51801
|
+
currentLineWidth = wordWidth;
|
|
51802
|
+
}
|
|
51803
|
+
}
|
|
51804
|
+
maxLineWidth = Math.max(maxLineWidth, currentLineWidth);
|
|
51805
|
+
return {
|
|
51806
|
+
lineCount,
|
|
51807
|
+
width: maxLineWidth
|
|
51808
|
+
};
|
|
51809
|
+
}
|
|
51810
|
+
function splitWords(line) {
|
|
51811
|
+
return line.split(/\s+/).filter(Boolean);
|
|
51812
|
+
}
|
|
51813
|
+
function estimateWordWidth(word, charWidth) {
|
|
51814
|
+
return word.length * charWidth;
|
|
51815
|
+
}
|
|
51816
|
+
function TextRenderer(config) {
|
|
51817
|
+
var defaultStyle = assign$1({
|
|
51818
|
+
fontFamily: "Arial, sans-serif",
|
|
51819
|
+
fontSize: DEFAULT_FONT_SIZE,
|
|
51820
|
+
fontWeight: "normal",
|
|
51821
|
+
lineHeight: LINE_HEIGHT_RATIO
|
|
51822
|
+
}, config && config.defaultStyle || {});
|
|
51823
|
+
var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
|
|
51824
|
+
var externalStyle = assign$1({}, defaultStyle, {
|
|
51825
|
+
fontSize
|
|
51826
|
+
}, config && config.externalStyle || {});
|
|
51827
|
+
this.getExternalLabelBounds = function(bounds, text) {
|
|
51828
|
+
var layoutedDimensions = estimateTextDimensions(text, {
|
|
51829
|
+
box: {
|
|
51830
|
+
width: 90,
|
|
51831
|
+
height: 30
|
|
51832
|
+
},
|
|
51833
|
+
style: externalStyle
|
|
51834
|
+
});
|
|
51835
|
+
return {
|
|
51836
|
+
x: Math.round(bounds.x + bounds.width / 2 - layoutedDimensions.width / 2),
|
|
51837
|
+
y: Math.round(bounds.y),
|
|
51838
|
+
width: Math.ceil(layoutedDimensions.width),
|
|
51839
|
+
height: Math.ceil(layoutedDimensions.height)
|
|
51840
|
+
};
|
|
51841
|
+
};
|
|
51842
|
+
this.getTextAnnotationBounds = function(bounds, text) {
|
|
51843
|
+
var layoutedDimensions = estimateTextDimensions(text, {
|
|
51844
|
+
box: bounds,
|
|
51845
|
+
style: defaultStyle,
|
|
51846
|
+
padding: 5
|
|
51847
|
+
});
|
|
51848
|
+
return {
|
|
51849
|
+
x: bounds.x,
|
|
51850
|
+
y: bounds.y,
|
|
51851
|
+
width: bounds.width,
|
|
51852
|
+
height: Math.max(MIN_TEXT_ANNOTATION_HEIGHT, Math.round(layoutedDimensions.height))
|
|
51853
|
+
};
|
|
51854
|
+
};
|
|
51855
|
+
this.createText = function(text, options) {
|
|
51856
|
+
throw new Error("not implemented in headless bpmn-js");
|
|
51857
|
+
};
|
|
51858
|
+
this.getDefaultStyle = function() {
|
|
51859
|
+
return defaultStyle;
|
|
51860
|
+
};
|
|
51861
|
+
this.getExternalStyle = function() {
|
|
51862
|
+
return externalStyle;
|
|
51863
|
+
};
|
|
51864
|
+
}
|
|
51865
|
+
TextRenderer.$inject = [
|
|
51866
|
+
"config.textRenderer"
|
|
51867
|
+
];
|
|
51868
|
+
var DrawOverrideModule = {
|
|
51869
|
+
__depends__: [DrawModule],
|
|
51870
|
+
textRenderer: ["type", TextRenderer]
|
|
51871
|
+
};
|
|
51779
51872
|
function Modeler(options) {
|
|
51780
51873
|
options = { ...options };
|
|
51781
51874
|
this._moddle = this._createModdle(options);
|
|
@@ -51811,7 +51904,8 @@ Modeler.prototype._baseModules = [
|
|
|
51811
51904
|
SelectionModule
|
|
51812
51905
|
];
|
|
51813
51906
|
Modeler.prototype._overrideModules = [
|
|
51814
|
-
CoreOverrideModule
|
|
51907
|
+
CoreOverrideModule,
|
|
51908
|
+
DrawOverrideModule
|
|
51815
51909
|
];
|
|
51816
51910
|
Modeler.prototype._modules = [].concat(
|
|
51817
51911
|
Modeler.prototype._baseModules,
|
|
@@ -56655,7 +56749,7 @@ function isSimpleConditionMet(element, properties, condition) {
|
|
|
56655
56749
|
if (!property) {
|
|
56656
56750
|
return false;
|
|
56657
56751
|
}
|
|
56658
|
-
if (
|
|
56752
|
+
if (hasProperty(condition, "equals")) {
|
|
56659
56753
|
return compare(element, property, equals2);
|
|
56660
56754
|
}
|
|
56661
56755
|
if (oneOf) {
|
|
@@ -56684,7 +56778,7 @@ function compare(element, property, equals2) {
|
|
|
56684
56778
|
}
|
|
56685
56779
|
return value === equals2;
|
|
56686
56780
|
}
|
|
56687
|
-
function
|
|
56781
|
+
function hasProperty(obj, key) {
|
|
56688
56782
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
56689
56783
|
}
|
|
56690
56784
|
var TemplateElementFactory = class {
|