camunda-bpmn-js 0.16.0 → 0.17.1

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.
@@ -71,6 +71,26 @@
71
71
  });
72
72
  return match;
73
73
  }
74
+ /**
75
+ * Find element index in collection.
76
+ *
77
+ * @param {Array|Object} collection
78
+ * @param {Function} matcher
79
+ *
80
+ * @return {Object}
81
+ */
82
+
83
+ function findIndex(collection, matcher) {
84
+ matcher = toMatcher(matcher);
85
+ var idx = isArray(collection) ? -1 : undefined;
86
+ forEach(collection, function (val, key) {
87
+ if (matcher(val, key)) {
88
+ idx = key;
89
+ return false;
90
+ }
91
+ });
92
+ return idx;
93
+ }
74
94
  /**
75
95
  * Find element in collection.
76
96
  *
@@ -1133,149 +1153,6 @@
1133
1153
  }
1134
1154
  }
1135
1155
 
1136
- /**
1137
- * Serialization util
1138
- */
1139
-
1140
- var TEXT_ENTITIES = /([&<>]{1})/g;
1141
- var ATTR_ENTITIES = /([\n\r"]{1})/g;
1142
-
1143
- var ENTITY_REPLACEMENT = {
1144
- '&': '&amp;',
1145
- '<': '&lt;',
1146
- '>': '&gt;',
1147
- '"': '\''
1148
- };
1149
-
1150
- function escape(str, pattern) {
1151
-
1152
- function replaceFn(match, entity) {
1153
- return ENTITY_REPLACEMENT[entity] || entity;
1154
- }
1155
-
1156
- return str.replace(pattern, replaceFn);
1157
- }
1158
-
1159
- function serialize(node, output) {
1160
-
1161
- var i, len, attrMap, attrNode, childNodes;
1162
-
1163
- switch (node.nodeType) {
1164
- // TEXT
1165
- case 3:
1166
- // replace special XML characters
1167
- output.push(escape(node.textContent, TEXT_ENTITIES));
1168
- break;
1169
-
1170
- // ELEMENT
1171
- case 1:
1172
- output.push('<', node.tagName);
1173
-
1174
- if (node.hasAttributes()) {
1175
- attrMap = node.attributes;
1176
- for (i = 0, len = attrMap.length; i < len; ++i) {
1177
- attrNode = attrMap.item(i);
1178
- output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
1179
- }
1180
- }
1181
-
1182
- if (node.hasChildNodes()) {
1183
- output.push('>');
1184
- childNodes = node.childNodes;
1185
- for (i = 0, len = childNodes.length; i < len; ++i) {
1186
- serialize(childNodes.item(i), output);
1187
- }
1188
- output.push('</', node.tagName, '>');
1189
- } else {
1190
- output.push('/>');
1191
- }
1192
- break;
1193
-
1194
- // COMMENT
1195
- case 8:
1196
- output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
1197
- break;
1198
-
1199
- // CDATA
1200
- case 4:
1201
- output.push('<![CDATA[', node.nodeValue, ']]>');
1202
- break;
1203
-
1204
- default:
1205
- throw new Error('unable to handle node ' + node.nodeType);
1206
- }
1207
-
1208
- return output;
1209
- }
1210
-
1211
- /**
1212
- * innerHTML like functionality for SVG elements.
1213
- * based on innerSVG (https://code.google.com/p/innersvg)
1214
- */
1215
-
1216
-
1217
- function set(element, svg) {
1218
-
1219
- var parsed = parse(svg);
1220
-
1221
- // clear element contents
1222
- clear(element);
1223
-
1224
- if (!svg) {
1225
- return;
1226
- }
1227
-
1228
- if (!isFragment(parsed)) {
1229
- // extract <svg> from parsed document
1230
- parsed = parsed.documentElement;
1231
- }
1232
-
1233
- var nodes = slice(parsed.childNodes);
1234
-
1235
- // import + append each node
1236
- for (var i = 0; i < nodes.length; i++) {
1237
- appendTo(nodes[i], element);
1238
- }
1239
-
1240
- }
1241
-
1242
- function get(element) {
1243
- var child = element.firstChild,
1244
- output = [];
1245
-
1246
- while (child) {
1247
- serialize(child, output);
1248
- child = child.nextSibling;
1249
- }
1250
-
1251
- return output.join('');
1252
- }
1253
-
1254
- function isFragment(node) {
1255
- return node.nodeName === '#document-fragment';
1256
- }
1257
-
1258
- function innerSVG(element, svg) {
1259
-
1260
- if (svg !== undefined) {
1261
-
1262
- try {
1263
- set(element, svg);
1264
- } catch (e) {
1265
- throw new Error('error parsing SVG: ' + e.message);
1266
- }
1267
-
1268
- return element;
1269
- } else {
1270
- return get(element);
1271
- }
1272
- }
1273
-
1274
-
1275
- function slice(arr) {
1276
- return Array.prototype.slice.call(arr);
1277
- }
1278
-
1279
1156
  /**
1280
1157
  * transform accessor utility
1281
1158
  */
@@ -1426,11 +1303,11 @@
1426
1303
  radius = shape.width / 2;
1427
1304
 
1428
1305
  var circlePath = [
1429
- ['M', cx, cy],
1430
- ['m', 0, -radius],
1431
- ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
1432
- ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
1433
- ['z']
1306
+ [ 'M', cx, cy ],
1307
+ [ 'm', 0, -radius ],
1308
+ [ 'a', radius, radius, 0, 1, 1, 0, 2 * radius ],
1309
+ [ 'a', radius, radius, 0, 1, 1, 0, -2 * radius ],
1310
+ [ 'z' ]
1434
1311
  ];
1435
1312
 
1436
1313
  return componentsToPath(circlePath);
@@ -1444,16 +1321,16 @@
1444
1321
  height = shape.height;
1445
1322
 
1446
1323
  var roundRectPath = [
1447
- ['M', x + borderRadius, y],
1448
- ['l', width - borderRadius * 2, 0],
1449
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius],
1450
- ['l', 0, height - borderRadius * 2],
1451
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius],
1452
- ['l', borderRadius * 2 - width, 0],
1453
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius],
1454
- ['l', 0, borderRadius * 2 - height],
1455
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius],
1456
- ['z']
1324
+ [ 'M', x + borderRadius, y ],
1325
+ [ 'l', width - borderRadius * 2, 0 ],
1326
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius ],
1327
+ [ 'l', 0, height - borderRadius * 2 ],
1328
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius ],
1329
+ [ 'l', borderRadius * 2 - width, 0 ],
1330
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius ],
1331
+ [ 'l', 0, borderRadius * 2 - height ],
1332
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius ],
1333
+ [ 'z' ]
1457
1334
  ];
1458
1335
 
1459
1336
  return componentsToPath(roundRectPath);
@@ -1469,11 +1346,11 @@
1469
1346
  halfHeight = height / 2;
1470
1347
 
1471
1348
  var diamondPath = [
1472
- ['M', x + halfWidth, y],
1473
- ['l', halfWidth, halfHeight],
1474
- ['l', -halfWidth, halfHeight],
1475
- ['l', -halfWidth, -halfHeight],
1476
- ['z']
1349
+ [ 'M', x + halfWidth, y ],
1350
+ [ 'l', halfWidth, halfHeight ],
1351
+ [ 'l', -halfWidth, halfHeight ],
1352
+ [ 'l', -halfWidth, -halfHeight ],
1353
+ [ 'z' ]
1477
1354
  ];
1478
1355
 
1479
1356
  return componentsToPath(diamondPath);
@@ -1486,11 +1363,11 @@
1486
1363
  height = shape.height;
1487
1364
 
1488
1365
  var rectPath = [
1489
- ['M', x, y],
1490
- ['l', width, 0],
1491
- ['l', 0, height],
1492
- ['l', -width, 0],
1493
- ['z']
1366
+ [ 'M', x, y ],
1367
+ [ 'l', width, 0 ],
1368
+ [ 'l', 0, height ],
1369
+ [ 'l', -width, 0 ],
1370
+ [ 'z' ]
1494
1371
  ];
1495
1372
 
1496
1373
  return componentsToPath(rectPath);
@@ -2011,97 +1888,733 @@
2011
1888
  _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
2012
1889
  };
2013
1890
 
2014
- map$1.td =
2015
- map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1891
+ map$1.td =
1892
+ map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1893
+
1894
+ map$1.option =
1895
+ map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
1896
+
1897
+ map$1.thead =
1898
+ map$1.tbody =
1899
+ map$1.colgroup =
1900
+ map$1.caption =
1901
+ map$1.tfoot = [1, '<table>', '</table>'];
1902
+
1903
+ map$1.polyline =
1904
+ map$1.ellipse =
1905
+ map$1.polygon =
1906
+ map$1.circle =
1907
+ map$1.text =
1908
+ map$1.line =
1909
+ map$1.path =
1910
+ map$1.rect =
1911
+ map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
1912
+
1913
+ /**
1914
+ * Parse `html` and return a DOM Node instance, which could be a TextNode,
1915
+ * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
1916
+ * instance, depending on the contents of the `html` string.
1917
+ *
1918
+ * @param {String} html - HTML string to "domify"
1919
+ * @param {Document} doc - The `document` instance to create the Node for
1920
+ * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
1921
+ * @api private
1922
+ */
1923
+
1924
+ function parse$1(html, doc) {
1925
+ if ('string' != typeof html) throw new TypeError('String expected');
1926
+
1927
+ // default to the global `document` object
1928
+ if (!doc) doc = document;
1929
+
1930
+ // tag name
1931
+ var m = /<([\w:]+)/.exec(html);
1932
+ if (!m) return doc.createTextNode(html);
1933
+
1934
+ html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
1935
+
1936
+ var tag = m[1];
1937
+
1938
+ // body support
1939
+ if (tag == 'body') {
1940
+ var el = doc.createElement('html');
1941
+ el.innerHTML = html;
1942
+ return el.removeChild(el.lastChild);
1943
+ }
1944
+
1945
+ // wrap map
1946
+ var wrap = map$1[tag] || map$1._default;
1947
+ var depth = wrap[0];
1948
+ var prefix = wrap[1];
1949
+ var suffix = wrap[2];
1950
+ var el = doc.createElement('div');
1951
+ el.innerHTML = prefix + html + suffix;
1952
+ while (depth--) el = el.lastChild;
1953
+
1954
+ // one element
1955
+ if (el.firstChild == el.lastChild) {
1956
+ return el.removeChild(el.firstChild);
1957
+ }
1958
+
1959
+ // several elements
1960
+ var fragment = doc.createDocumentFragment();
1961
+ while (el.firstChild) {
1962
+ fragment.appendChild(el.removeChild(el.firstChild));
1963
+ }
1964
+
1965
+ return fragment;
1966
+ }
1967
+
1968
+ function query(selector, el) {
1969
+ el = el || document;
1970
+
1971
+ return el.querySelector(selector);
1972
+ }
1973
+
1974
+ function all(selector, el) {
1975
+ el = el || document;
1976
+
1977
+ return el.querySelectorAll(selector);
1978
+ }
1979
+
1980
+ function remove$1(el) {
1981
+ el.parentNode && el.parentNode.removeChild(el);
1982
+ }
1983
+
1984
+ function ensureImported$1(element, target) {
1985
+
1986
+ if (element.ownerDocument !== target.ownerDocument) {
1987
+ try {
1988
+ // may fail on webkit
1989
+ return target.ownerDocument.importNode(element, true);
1990
+ } catch (e) {
1991
+ // ignore
1992
+ }
1993
+ }
1994
+
1995
+ return element;
1996
+ }
1997
+
1998
+ /**
1999
+ * appendTo utility
2000
+ */
2001
+
2002
+ /**
2003
+ * Append a node to a target element and return the appended node.
2004
+ *
2005
+ * @param {SVGElement} element
2006
+ * @param {SVGElement} target
2007
+ *
2008
+ * @return {SVGElement} the appended node
2009
+ */
2010
+ function appendTo$1(element, target) {
2011
+ return target.appendChild(ensureImported$1(element, target));
2012
+ }
2013
+
2014
+ /**
2015
+ * append utility
2016
+ */
2017
+
2018
+ /**
2019
+ * Append a node to an element
2020
+ *
2021
+ * @param {SVGElement} element
2022
+ * @param {SVGElement} node
2023
+ *
2024
+ * @return {SVGElement} the element
2025
+ */
2026
+ function append$1(target, node) {
2027
+ appendTo$1(node, target);
2028
+ return target;
2029
+ }
2030
+
2031
+ /**
2032
+ * attribute accessor utility
2033
+ */
2034
+
2035
+ var LENGTH_ATTR$1 = 2;
2036
+
2037
+ var CSS_PROPERTIES$1 = {
2038
+ 'alignment-baseline': 1,
2039
+ 'baseline-shift': 1,
2040
+ 'clip': 1,
2041
+ 'clip-path': 1,
2042
+ 'clip-rule': 1,
2043
+ 'color': 1,
2044
+ 'color-interpolation': 1,
2045
+ 'color-interpolation-filters': 1,
2046
+ 'color-profile': 1,
2047
+ 'color-rendering': 1,
2048
+ 'cursor': 1,
2049
+ 'direction': 1,
2050
+ 'display': 1,
2051
+ 'dominant-baseline': 1,
2052
+ 'enable-background': 1,
2053
+ 'fill': 1,
2054
+ 'fill-opacity': 1,
2055
+ 'fill-rule': 1,
2056
+ 'filter': 1,
2057
+ 'flood-color': 1,
2058
+ 'flood-opacity': 1,
2059
+ 'font': 1,
2060
+ 'font-family': 1,
2061
+ 'font-size': LENGTH_ATTR$1,
2062
+ 'font-size-adjust': 1,
2063
+ 'font-stretch': 1,
2064
+ 'font-style': 1,
2065
+ 'font-variant': 1,
2066
+ 'font-weight': 1,
2067
+ 'glyph-orientation-horizontal': 1,
2068
+ 'glyph-orientation-vertical': 1,
2069
+ 'image-rendering': 1,
2070
+ 'kerning': 1,
2071
+ 'letter-spacing': 1,
2072
+ 'lighting-color': 1,
2073
+ 'marker': 1,
2074
+ 'marker-end': 1,
2075
+ 'marker-mid': 1,
2076
+ 'marker-start': 1,
2077
+ 'mask': 1,
2078
+ 'opacity': 1,
2079
+ 'overflow': 1,
2080
+ 'pointer-events': 1,
2081
+ 'shape-rendering': 1,
2082
+ 'stop-color': 1,
2083
+ 'stop-opacity': 1,
2084
+ 'stroke': 1,
2085
+ 'stroke-dasharray': 1,
2086
+ 'stroke-dashoffset': 1,
2087
+ 'stroke-linecap': 1,
2088
+ 'stroke-linejoin': 1,
2089
+ 'stroke-miterlimit': 1,
2090
+ 'stroke-opacity': 1,
2091
+ 'stroke-width': LENGTH_ATTR$1,
2092
+ 'text-anchor': 1,
2093
+ 'text-decoration': 1,
2094
+ 'text-rendering': 1,
2095
+ 'unicode-bidi': 1,
2096
+ 'visibility': 1,
2097
+ 'word-spacing': 1,
2098
+ 'writing-mode': 1
2099
+ };
2100
+
2101
+
2102
+ function getAttribute$1(node, name) {
2103
+ if (CSS_PROPERTIES$1[name]) {
2104
+ return node.style[name];
2105
+ } else {
2106
+ return node.getAttributeNS(null, name);
2107
+ }
2108
+ }
2109
+
2110
+ function setAttribute$1(node, name, value) {
2111
+ var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
2112
+
2113
+ var type = CSS_PROPERTIES$1[hyphenated];
2114
+
2115
+ if (type) {
2116
+ // append pixel unit, unless present
2117
+ if (type === LENGTH_ATTR$1 && typeof value === 'number') {
2118
+ value = String(value) + 'px';
2119
+ }
2120
+
2121
+ node.style[hyphenated] = value;
2122
+ } else {
2123
+ node.setAttributeNS(null, name, value);
2124
+ }
2125
+ }
2126
+
2127
+ function setAttributes$1(node, attrs) {
2128
+
2129
+ var names = Object.keys(attrs), i, name;
2130
+
2131
+ for (i = 0, name; (name = names[i]); i++) {
2132
+ setAttribute$1(node, name, attrs[name]);
2133
+ }
2134
+ }
2135
+
2136
+ /**
2137
+ * Gets or sets raw attributes on a node.
2138
+ *
2139
+ * @param {SVGElement} node
2140
+ * @param {Object} [attrs]
2141
+ * @param {String} [name]
2142
+ * @param {String} [value]
2143
+ *
2144
+ * @return {String}
2145
+ */
2146
+ function attr$2(node, name, value) {
2147
+ if (typeof name === 'string') {
2148
+ if (value !== undefined) {
2149
+ setAttribute$1(node, name, value);
2150
+ } else {
2151
+ return getAttribute$1(node, name);
2152
+ }
2153
+ } else {
2154
+ setAttributes$1(node, name);
2155
+ }
2156
+
2157
+ return node;
2158
+ }
2159
+
2160
+ /**
2161
+ * Clear utility
2162
+ */
2163
+ function index$1(arr, obj) {
2164
+ if (arr.indexOf) {
2165
+ return arr.indexOf(obj);
2166
+ }
2167
+
2168
+
2169
+ for (var i = 0; i < arr.length; ++i) {
2170
+ if (arr[i] === obj) {
2171
+ return i;
2172
+ }
2173
+ }
2174
+
2175
+ return -1;
2176
+ }
2177
+
2178
+ var re$2 = /\s+/;
2179
+
2180
+ var toString$2 = Object.prototype.toString;
2181
+
2182
+ function defined$1(o) {
2183
+ return typeof o !== 'undefined';
2184
+ }
2185
+
2186
+ /**
2187
+ * Wrap `el` in a `ClassList`.
2188
+ *
2189
+ * @param {Element} el
2190
+ * @return {ClassList}
2191
+ * @api public
2192
+ */
2193
+
2194
+ function classes$2(el) {
2195
+ return new ClassList$2(el);
2196
+ }
2197
+
2198
+ function ClassList$2(el) {
2199
+ if (!el || !el.nodeType) {
2200
+ throw new Error('A DOM element reference is required');
2201
+ }
2202
+ this.el = el;
2203
+ this.list = el.classList;
2204
+ }
2205
+
2206
+ /**
2207
+ * Add class `name` if not already present.
2208
+ *
2209
+ * @param {String} name
2210
+ * @return {ClassList}
2211
+ * @api public
2212
+ */
2213
+
2214
+ ClassList$2.prototype.add = function(name) {
2215
+
2216
+ // classList
2217
+ if (this.list) {
2218
+ this.list.add(name);
2219
+ return this;
2220
+ }
2221
+
2222
+ // fallback
2223
+ var arr = this.array();
2224
+ var i = index$1(arr, name);
2225
+ if (!~i) {
2226
+ arr.push(name);
2227
+ }
2228
+
2229
+ if (defined$1(this.el.className.baseVal)) {
2230
+ this.el.className.baseVal = arr.join(' ');
2231
+ } else {
2232
+ this.el.className = arr.join(' ');
2233
+ }
2234
+
2235
+ return this;
2236
+ };
2237
+
2238
+ /**
2239
+ * Remove class `name` when present, or
2240
+ * pass a regular expression to remove
2241
+ * any which match.
2242
+ *
2243
+ * @param {String|RegExp} name
2244
+ * @return {ClassList}
2245
+ * @api public
2246
+ */
2247
+
2248
+ ClassList$2.prototype.remove = function(name) {
2249
+ if ('[object RegExp]' === toString$2.call(name)) {
2250
+ return this.removeMatching(name);
2251
+ }
2252
+
2253
+ // classList
2254
+ if (this.list) {
2255
+ this.list.remove(name);
2256
+ return this;
2257
+ }
2258
+
2259
+ // fallback
2260
+ var arr = this.array();
2261
+ var i = index$1(arr, name);
2262
+ if (~i) {
2263
+ arr.splice(i, 1);
2264
+ }
2265
+ this.el.className.baseVal = arr.join(' ');
2266
+ return this;
2267
+ };
2268
+
2269
+ /**
2270
+ * Remove all classes matching `re`.
2271
+ *
2272
+ * @param {RegExp} re
2273
+ * @return {ClassList}
2274
+ * @api private
2275
+ */
2276
+
2277
+ ClassList$2.prototype.removeMatching = function(re) {
2278
+ var arr = this.array();
2279
+ for (var i = 0; i < arr.length; i++) {
2280
+ if (re.test(arr[i])) {
2281
+ this.remove(arr[i]);
2282
+ }
2283
+ }
2284
+ return this;
2285
+ };
2286
+
2287
+ /**
2288
+ * Toggle class `name`, can force state via `force`.
2289
+ *
2290
+ * For browsers that support classList, but do not support `force` yet,
2291
+ * the mistake will be detected and corrected.
2292
+ *
2293
+ * @param {String} name
2294
+ * @param {Boolean} force
2295
+ * @return {ClassList}
2296
+ * @api public
2297
+ */
2298
+
2299
+ ClassList$2.prototype.toggle = function(name, force) {
2300
+ // classList
2301
+ if (this.list) {
2302
+ if (defined$1(force)) {
2303
+ if (force !== this.list.toggle(name, force)) {
2304
+ this.list.toggle(name); // toggle again to correct
2305
+ }
2306
+ } else {
2307
+ this.list.toggle(name);
2308
+ }
2309
+ return this;
2310
+ }
2311
+
2312
+ // fallback
2313
+ if (defined$1(force)) {
2314
+ if (!force) {
2315
+ this.remove(name);
2316
+ } else {
2317
+ this.add(name);
2318
+ }
2319
+ } else {
2320
+ if (this.has(name)) {
2321
+ this.remove(name);
2322
+ } else {
2323
+ this.add(name);
2324
+ }
2325
+ }
2326
+
2327
+ return this;
2328
+ };
2329
+
2330
+ /**
2331
+ * Return an array of classes.
2332
+ *
2333
+ * @return {Array}
2334
+ * @api public
2335
+ */
2336
+
2337
+ ClassList$2.prototype.array = function() {
2338
+ var className = this.el.getAttribute('class') || '';
2339
+ var str = className.replace(/^\s+|\s+$/g, '');
2340
+ var arr = str.split(re$2);
2341
+ if ('' === arr[0]) {
2342
+ arr.shift();
2343
+ }
2344
+ return arr;
2345
+ };
2346
+
2347
+ /**
2348
+ * Check if class `name` is present.
2349
+ *
2350
+ * @param {String} name
2351
+ * @return {ClassList}
2352
+ * @api public
2353
+ */
2354
+
2355
+ ClassList$2.prototype.has =
2356
+ ClassList$2.prototype.contains = function(name) {
2357
+ return (
2358
+ this.list ?
2359
+ this.list.contains(name) :
2360
+ !! ~index$1(this.array(), name)
2361
+ );
2362
+ };
2363
+
2364
+ function remove$2(element) {
2365
+ var parent = element.parentNode;
2366
+
2367
+ if (parent) {
2368
+ parent.removeChild(element);
2369
+ }
2370
+
2371
+ return element;
2372
+ }
2373
+
2374
+ /**
2375
+ * Clear utility
2376
+ */
2377
+
2378
+ /**
2379
+ * Removes all children from the given element
2380
+ *
2381
+ * @param {DOMElement} element
2382
+ * @return {DOMElement} the element (for chaining)
2383
+ */
2384
+ function clear$2(element) {
2385
+ var child;
2386
+
2387
+ while ((child = element.firstChild)) {
2388
+ remove$2(child);
2389
+ }
2390
+
2391
+ return element;
2392
+ }
2393
+
2394
+ var ns$1 = {
2395
+ svg: 'http://www.w3.org/2000/svg'
2396
+ };
2397
+
2398
+ /**
2399
+ * DOM parsing utility
2400
+ */
2401
+
2402
+ var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
2403
+
2404
+ function parse$2(svg) {
2405
+
2406
+ var unwrap = false;
2407
+
2408
+ // ensure we import a valid svg document
2409
+ if (svg.substring(0, 4) === '<svg') {
2410
+ if (svg.indexOf(ns$1.svg) === -1) {
2411
+ svg = SVG_START$1 + svg.substring(4);
2412
+ }
2413
+ } else {
2414
+ // namespace svg
2415
+ svg = SVG_START$1 + '>' + svg + '</svg>';
2416
+ unwrap = true;
2417
+ }
2418
+
2419
+ var parsed = parseDocument$1(svg);
2420
+
2421
+ if (!unwrap) {
2422
+ return parsed;
2423
+ }
2424
+
2425
+ var fragment = document.createDocumentFragment();
2426
+
2427
+ var parent = parsed.firstChild;
2428
+
2429
+ while (parent.firstChild) {
2430
+ fragment.appendChild(parent.firstChild);
2431
+ }
2432
+
2433
+ return fragment;
2434
+ }
2435
+
2436
+ function parseDocument$1(svg) {
2437
+
2438
+ var parser;
2439
+
2440
+ // parse
2441
+ parser = new DOMParser();
2442
+ parser.async = false;
2443
+
2444
+ return parser.parseFromString(svg, 'text/xml');
2445
+ }
2446
+
2447
+ /**
2448
+ * Create utility for SVG elements
2449
+ */
2450
+
2451
+
2452
+ /**
2453
+ * Create a specific type from name or SVG markup.
2454
+ *
2455
+ * @param {String} name the name or markup of the element
2456
+ * @param {Object} [attrs] attributes to set on the element
2457
+ *
2458
+ * @returns {SVGElement}
2459
+ */
2460
+ function create$1(name, attrs) {
2461
+ var element;
2462
+
2463
+ if (name.charAt(0) === '<') {
2464
+ element = parse$2(name).firstChild;
2465
+ element = document.importNode(element, true);
2466
+ } else {
2467
+ element = document.createElementNS(ns$1.svg, name);
2468
+ }
2469
+
2470
+ if (attrs) {
2471
+ attr$2(element, attrs);
2472
+ }
2473
+
2474
+ return element;
2475
+ }
2476
+
2477
+ /**
2478
+ * Serialization util
2479
+ */
2480
+
2481
+ var TEXT_ENTITIES = /([&<>]{1})/g;
2482
+ var ATTR_ENTITIES = /([\n\r"]{1})/g;
2483
+
2484
+ var ENTITY_REPLACEMENT = {
2485
+ '&': '&amp;',
2486
+ '<': '&lt;',
2487
+ '>': '&gt;',
2488
+ '"': '\''
2489
+ };
2490
+
2491
+ function escape(str, pattern) {
2492
+
2493
+ function replaceFn(match, entity) {
2494
+ return ENTITY_REPLACEMENT[entity] || entity;
2495
+ }
2496
+
2497
+ return str.replace(pattern, replaceFn);
2498
+ }
2499
+
2500
+ function serialize(node, output) {
2501
+
2502
+ var i, len, attrMap, attrNode, childNodes;
2503
+
2504
+ switch (node.nodeType) {
2505
+ // TEXT
2506
+ case 3:
2507
+ // replace special XML characters
2508
+ output.push(escape(node.textContent, TEXT_ENTITIES));
2509
+ break;
2510
+
2511
+ // ELEMENT
2512
+ case 1:
2513
+ output.push('<', node.tagName);
2514
+
2515
+ if (node.hasAttributes()) {
2516
+ attrMap = node.attributes;
2517
+ for (i = 0, len = attrMap.length; i < len; ++i) {
2518
+ attrNode = attrMap.item(i);
2519
+ output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
2520
+ }
2521
+ }
2522
+
2523
+ if (node.hasChildNodes()) {
2524
+ output.push('>');
2525
+ childNodes = node.childNodes;
2526
+ for (i = 0, len = childNodes.length; i < len; ++i) {
2527
+ serialize(childNodes.item(i), output);
2528
+ }
2529
+ output.push('</', node.tagName, '>');
2530
+ } else {
2531
+ output.push('/>');
2532
+ }
2533
+ break;
2016
2534
 
2017
- map$1.option =
2018
- map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
2535
+ // COMMENT
2536
+ case 8:
2537
+ output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
2538
+ break;
2019
2539
 
2020
- map$1.thead =
2021
- map$1.tbody =
2022
- map$1.colgroup =
2023
- map$1.caption =
2024
- map$1.tfoot = [1, '<table>', '</table>'];
2540
+ // CDATA
2541
+ case 4:
2542
+ output.push('<![CDATA[', node.nodeValue, ']]>');
2543
+ break;
2025
2544
 
2026
- map$1.polyline =
2027
- map$1.ellipse =
2028
- map$1.polygon =
2029
- map$1.circle =
2030
- map$1.text =
2031
- map$1.line =
2032
- map$1.path =
2033
- map$1.rect =
2034
- map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
2545
+ default:
2546
+ throw new Error('unable to handle node ' + node.nodeType);
2547
+ }
2548
+
2549
+ return output;
2550
+ }
2035
2551
 
2036
2552
  /**
2037
- * Parse `html` and return a DOM Node instance, which could be a TextNode,
2038
- * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
2039
- * instance, depending on the contents of the `html` string.
2040
- *
2041
- * @param {String} html - HTML string to "domify"
2042
- * @param {Document} doc - The `document` instance to create the Node for
2043
- * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
2044
- * @api private
2553
+ * innerHTML like functionality for SVG elements.
2554
+ * based on innerSVG (https://code.google.com/p/innersvg)
2045
2555
  */
2046
2556
 
2047
- function parse$1(html, doc) {
2048
- if ('string' != typeof html) throw new TypeError('String expected');
2049
2557
 
2050
- // default to the global `document` object
2051
- if (!doc) doc = document;
2558
+ function set(element, svg) {
2052
2559
 
2053
- // tag name
2054
- var m = /<([\w:]+)/.exec(html);
2055
- if (!m) return doc.createTextNode(html);
2560
+ var parsed = parse$2(svg);
2056
2561
 
2057
- html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
2562
+ // clear element contents
2563
+ clear$2(element);
2058
2564
 
2059
- var tag = m[1];
2565
+ if (!svg) {
2566
+ return;
2567
+ }
2060
2568
 
2061
- // body support
2062
- if (tag == 'body') {
2063
- var el = doc.createElement('html');
2064
- el.innerHTML = html;
2065
- return el.removeChild(el.lastChild);
2569
+ if (!isFragment(parsed)) {
2570
+ // extract <svg> from parsed document
2571
+ parsed = parsed.documentElement;
2066
2572
  }
2067
2573
 
2068
- // wrap map
2069
- var wrap = map$1[tag] || map$1._default;
2070
- var depth = wrap[0];
2071
- var prefix = wrap[1];
2072
- var suffix = wrap[2];
2073
- var el = doc.createElement('div');
2074
- el.innerHTML = prefix + html + suffix;
2075
- while (depth--) el = el.lastChild;
2574
+ var nodes = slice(parsed.childNodes);
2076
2575
 
2077
- // one element
2078
- if (el.firstChild == el.lastChild) {
2079
- return el.removeChild(el.firstChild);
2576
+ // import + append each node
2577
+ for (var i = 0; i < nodes.length; i++) {
2578
+ appendTo$1(nodes[i], element);
2080
2579
  }
2081
2580
 
2082
- // several elements
2083
- var fragment = doc.createDocumentFragment();
2084
- while (el.firstChild) {
2085
- fragment.appendChild(el.removeChild(el.firstChild));
2581
+ }
2582
+
2583
+ function get(element) {
2584
+ var child = element.firstChild,
2585
+ output = [];
2586
+
2587
+ while (child) {
2588
+ serialize(child, output);
2589
+ child = child.nextSibling;
2086
2590
  }
2087
2591
 
2088
- return fragment;
2592
+ return output.join('');
2089
2593
  }
2090
2594
 
2091
- function query(selector, el) {
2092
- el = el || document;
2093
-
2094
- return el.querySelector(selector);
2595
+ function isFragment(node) {
2596
+ return node.nodeName === '#document-fragment';
2095
2597
  }
2096
2598
 
2097
- function all(selector, el) {
2098
- el = el || document;
2599
+ function innerSVG(element, svg) {
2099
2600
 
2100
- return el.querySelectorAll(selector);
2601
+ if (svg !== undefined) {
2602
+
2603
+ try {
2604
+ set(element, svg);
2605
+ } catch (e) {
2606
+ throw new Error('error parsing SVG: ' + e.message);
2607
+ }
2608
+
2609
+ return element;
2610
+ } else {
2611
+ return get(element);
2612
+ }
2101
2613
  }
2102
2614
 
2103
- function remove$1(el) {
2104
- el.parentNode && el.parentNode.removeChild(el);
2615
+
2616
+ function slice(arr) {
2617
+ return Array.prototype.slice.call(arr);
2105
2618
  }
2106
2619
 
2107
2620
  /**
@@ -2353,16 +2866,16 @@
2353
2866
  // fix for safari / chrome / firefox bug not correctly
2354
2867
  // resetting stroke dash array
2355
2868
  if (attrs.strokeDasharray === 'none') {
2356
- attrs.strokeDasharray = [10000, 1];
2869
+ attrs.strokeDasharray = [ 10000, 1 ];
2357
2870
  }
2358
2871
 
2359
- var marker = create('marker');
2872
+ var marker = create$1('marker');
2360
2873
 
2361
- attr(options.element, attrs);
2874
+ attr$2(options.element, attrs);
2362
2875
 
2363
- append(marker, options.element);
2876
+ append$1(marker, options.element);
2364
2877
 
2365
- attr(marker, {
2878
+ attr$2(marker, {
2366
2879
  id: id,
2367
2880
  viewBox: '0 0 20 20',
2368
2881
  refX: ref.x,
@@ -2375,12 +2888,12 @@
2375
2888
  var defs = query('defs', canvas._svg);
2376
2889
 
2377
2890
  if (!defs) {
2378
- defs = create('defs');
2891
+ defs = create$1('defs');
2379
2892
 
2380
- append(canvas._svg, defs);
2893
+ append$1(canvas._svg, defs);
2381
2894
  }
2382
2895
 
2383
- append(defs, marker);
2896
+ append$1(defs, marker);
2384
2897
 
2385
2898
  markers[id] = marker;
2386
2899
  }
@@ -2404,8 +2917,8 @@
2404
2917
  function createMarker(id, type, fill, stroke) {
2405
2918
 
2406
2919
  if (type === 'sequenceflow-end') {
2407
- var sequenceflowEnd = create('path');
2408
- attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2920
+ var sequenceflowEnd = create$1('path');
2921
+ attr$2(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2409
2922
 
2410
2923
  addMarker(id, {
2411
2924
  element: sequenceflowEnd,
@@ -2419,8 +2932,8 @@
2419
2932
  }
2420
2933
 
2421
2934
  if (type === 'messageflow-start') {
2422
- var messageflowStart = create('circle');
2423
- attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2935
+ var messageflowStart = create$1('circle');
2936
+ attr$2(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2424
2937
 
2425
2938
  addMarker(id, {
2426
2939
  element: messageflowStart,
@@ -2433,8 +2946,8 @@
2433
2946
  }
2434
2947
 
2435
2948
  if (type === 'messageflow-end') {
2436
- var messageflowEnd = create('path');
2437
- attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2949
+ var messageflowEnd = create$1('path');
2950
+ attr$2(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2438
2951
 
2439
2952
  addMarker(id, {
2440
2953
  element: messageflowEnd,
@@ -2448,8 +2961,8 @@
2448
2961
  }
2449
2962
 
2450
2963
  if (type === 'association-start') {
2451
- var associationStart = create('path');
2452
- attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
2964
+ var associationStart = create$1('path');
2965
+ attr$2(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
2453
2966
 
2454
2967
  addMarker(id, {
2455
2968
  element: associationStart,
@@ -2464,8 +2977,8 @@
2464
2977
  }
2465
2978
 
2466
2979
  if (type === 'association-end') {
2467
- var associationEnd = create('path');
2468
- attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
2980
+ var associationEnd = create$1('path');
2981
+ attr$2(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
2469
2982
 
2470
2983
  addMarker(id, {
2471
2984
  element: associationEnd,
@@ -2480,8 +2993,8 @@
2480
2993
  }
2481
2994
 
2482
2995
  if (type === 'conditional-flow-marker') {
2483
- var conditionalflowMarker = create('path');
2484
- attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
2996
+ var conditionalflowMarker = create$1('path');
2997
+ attr$2(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
2485
2998
 
2486
2999
  addMarker(id, {
2487
3000
  element: conditionalflowMarker,
@@ -2495,8 +3008,8 @@
2495
3008
  }
2496
3009
 
2497
3010
  if (type === 'conditional-default-flow-marker') {
2498
- var conditionaldefaultflowMarker = create('path');
2499
- attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
3011
+ var conditionaldefaultflowMarker = create$1('path');
3012
+ attr$2(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
2500
3013
 
2501
3014
  addMarker(id, {
2502
3015
  element: conditionaldefaultflowMarker,
@@ -2531,15 +3044,15 @@
2531
3044
  var cx = width / 2,
2532
3045
  cy = height / 2;
2533
3046
 
2534
- var circle = create('circle');
2535
- attr(circle, {
3047
+ var circle = create$1('circle');
3048
+ attr$2(circle, {
2536
3049
  cx: cx,
2537
3050
  cy: cy,
2538
3051
  r: Math.round((width + height) / 4 - offset)
2539
3052
  });
2540
- attr(circle, attrs);
3053
+ attr$2(circle, attrs);
2541
3054
 
2542
- append(parentGfx, circle);
3055
+ append$1(parentGfx, circle);
2543
3056
 
2544
3057
  return circle;
2545
3058
  }
@@ -2559,8 +3072,8 @@
2559
3072
  fill: 'white'
2560
3073
  });
2561
3074
 
2562
- var rect = create('rect');
2563
- attr(rect, {
3075
+ var rect = create$1('rect');
3076
+ attr$2(rect, {
2564
3077
  x: offset,
2565
3078
  y: offset,
2566
3079
  width: width - offset * 2,
@@ -2568,9 +3081,9 @@
2568
3081
  rx: r,
2569
3082
  ry: r
2570
3083
  });
2571
- attr(rect, attrs);
3084
+ attr$2(rect, attrs);
2572
3085
 
2573
- append(parentGfx, rect);
3086
+ append$1(parentGfx, rect);
2574
3087
 
2575
3088
  return rect;
2576
3089
  }
@@ -2580,7 +3093,7 @@
2580
3093
  var x_2 = width / 2;
2581
3094
  var y_2 = height / 2;
2582
3095
 
2583
- var points = [{ x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 }];
3096
+ var points = [ { x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 } ];
2584
3097
 
2585
3098
  var pointsString = points.map(function(point) {
2586
3099
  return point.x + ',' + point.y;
@@ -2592,13 +3105,13 @@
2592
3105
  fill: 'white'
2593
3106
  });
2594
3107
 
2595
- var polygon = create('polygon');
2596
- attr(polygon, {
3108
+ var polygon = create$1('polygon');
3109
+ attr$2(polygon, {
2597
3110
  points: pointsString
2598
3111
  });
2599
- attr(polygon, attrs);
3112
+ attr$2(polygon, attrs);
2600
3113
 
2601
- append(parentGfx, polygon);
3114
+ append$1(parentGfx, polygon);
2602
3115
 
2603
3116
  return polygon;
2604
3117
  }
@@ -2612,7 +3125,7 @@
2612
3125
 
2613
3126
  var line = createLine(waypoints, attrs);
2614
3127
 
2615
- append(parentGfx, line);
3128
+ append$1(parentGfx, line);
2616
3129
 
2617
3130
  return line;
2618
3131
  }
@@ -2624,11 +3137,11 @@
2624
3137
  stroke: black
2625
3138
  });
2626
3139
 
2627
- var path = create('path');
2628
- attr(path, { d: d });
2629
- attr(path, attrs);
3140
+ var path = create$1('path');
3141
+ attr$2(path, { d: d });
3142
+ attr$2(path, attrs);
2630
3143
 
2631
- append(parentGfx, path);
3144
+ append$1(parentGfx, path);
2632
3145
 
2633
3146
  return path;
2634
3147
  }
@@ -2652,7 +3165,7 @@
2652
3165
  var event = getSemantic(element);
2653
3166
  var isThrowing = isThrowEvent(event);
2654
3167
 
2655
- if (event.eventDefinitions && event.eventDefinitions.length>1) {
3168
+ if (event.eventDefinitions && event.eventDefinitions.length > 1) {
2656
3169
  if (event.parallelMultiple) {
2657
3170
  return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
2658
3171
  }
@@ -2714,9 +3227,9 @@
2714
3227
 
2715
3228
  var text = textRenderer.createText(label || '', options);
2716
3229
 
2717
- classes(text).add('djs-label');
3230
+ classes$2(text).add('djs-label');
2718
3231
 
2719
- append(parentGfx, text);
3232
+ append$1(parentGfx, text);
2720
3233
 
2721
3234
  return text;
2722
3235
  }
@@ -3326,7 +3839,7 @@
3326
3839
  });
3327
3840
 
3328
3841
  var businessHeaderPath = drawPath(parentGfx, headerPathData);
3329
- attr(businessHeaderPath, {
3842
+ attr$2(businessHeaderPath, {
3330
3843
  strokeWidth: 1,
3331
3844
  fill: getFillColor(element, '#aaaaaa'),
3332
3845
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3340,7 +3853,7 @@
3340
3853
  });
3341
3854
 
3342
3855
  var businessPath = drawPath(parentGfx, headerData);
3343
- attr(businessPath, {
3856
+ attr$2(businessPath, {
3344
3857
  strokeWidth: 1,
3345
3858
  stroke: getStrokeColor(element, defaultStrokeColor)
3346
3859
  });
@@ -3358,7 +3871,7 @@
3358
3871
  var expanded = isExpanded(element);
3359
3872
 
3360
3873
  if (isEventSubProcess(element)) {
3361
- attr(rect, {
3874
+ attr$2(rect, {
3362
3875
  strokeDasharray: '1,2'
3363
3876
  });
3364
3877
  }
@@ -3368,7 +3881,7 @@
3368
3881
  if (expanded) {
3369
3882
  attachTaskMarkers(parentGfx, element);
3370
3883
  } else {
3371
- attachTaskMarkers(parentGfx, element, ['SubProcessMarker']);
3884
+ attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
3372
3885
  }
3373
3886
 
3374
3887
  return rect;
@@ -3580,7 +4093,7 @@
3580
4093
  });
3581
4094
 
3582
4095
  var parallelPath = drawPath(parentGfx, pathData);
3583
- attr(parallelPath, {
4096
+ attr$2(parallelPath, {
3584
4097
  strokeWidth: 1,
3585
4098
  fill: 'none'
3586
4099
  });
@@ -3588,7 +4101,7 @@
3588
4101
 
3589
4102
  if (!instantiate) {
3590
4103
  var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
3591
- attr(innerCircle, {
4104
+ attr$2(innerCircle, {
3592
4105
  strokeWidth: 1,
3593
4106
  fill: 'none',
3594
4107
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3633,7 +4146,7 @@
3633
4146
 
3634
4147
  // conditional flow marker
3635
4148
  if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
3636
- attr(path, {
4149
+ attr$2(path, {
3637
4150
  markerStart: marker('conditional-flow-marker', fill, stroke)
3638
4151
  });
3639
4152
  }
@@ -3641,7 +4154,7 @@
3641
4154
  // default marker
3642
4155
  if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
3643
4156
  source.default === sequenceFlow) {
3644
- attr(path, {
4157
+ attr$2(path, {
3645
4158
  markerStart: marker('conditional-default-flow-marker', fill, stroke)
3646
4159
  });
3647
4160
  }
@@ -4702,22 +5215,22 @@
4702
5215
  d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
4703
5216
  height: 36,
4704
5217
  width: 36,
4705
- heightElements: [6, 14],
4706
- widthElements: [10.5, 21]
5218
+ heightElements: [ 6, 14 ],
5219
+ widthElements: [ 10.5, 21 ]
4707
5220
  },
4708
5221
  'EVENT_SIGNAL': {
4709
5222
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
4710
5223
  height: 36,
4711
5224
  width: 36,
4712
- heightElements: [18],
4713
- widthElements: [10, 20]
5225
+ heightElements: [ 18 ],
5226
+ widthElements: [ 10, 20 ]
4714
5227
  },
4715
5228
  'EVENT_ESCALATION': {
4716
5229
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
4717
5230
  height: 36,
4718
5231
  width: 36,
4719
- heightElements: [20, 7],
4720
- widthElements: [8]
5232
+ heightElements: [ 20, 7 ],
5233
+ widthElements: [ 8 ]
4721
5234
  },
4722
5235
  'EVENT_CONDITIONAL': {
4723
5236
  d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
@@ -4729,67 +5242,67 @@
4729
5242
  'M {e.x2},{e.y8} l {e.x0},0 ',
4730
5243
  height: 36,
4731
5244
  width: 36,
4732
- heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
4733
- widthElements: [10.5, 14.5, 12.5]
5245
+ heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],
5246
+ widthElements: [ 10.5, 14.5, 12.5 ]
4734
5247
  },
4735
5248
  'EVENT_LINK': {
4736
5249
  d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
4737
5250
  height: 36,
4738
5251
  width: 36,
4739
- heightElements: [4.4375, 6.75, 7.8125],
4740
- widthElements: [9.84375, 13.5]
5252
+ heightElements: [ 4.4375, 6.75, 7.8125 ],
5253
+ widthElements: [ 9.84375, 13.5 ]
4741
5254
  },
4742
5255
  'EVENT_ERROR': {
4743
5256
  d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
4744
5257
  height: 36,
4745
5258
  width: 36,
4746
- heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
4747
- widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
5259
+ heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],
5260
+ widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]
4748
5261
  },
4749
5262
  'EVENT_CANCEL_45': {
4750
5263
  d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4751
5264
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4752
5265
  height: 36,
4753
5266
  width: 36,
4754
- heightElements: [4.75, 8.5],
4755
- widthElements: [4.75, 8.5]
5267
+ heightElements: [ 4.75, 8.5 ],
5268
+ widthElements: [ 4.75, 8.5 ]
4756
5269
  },
4757
5270
  'EVENT_COMPENSATION': {
4758
5271
  d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z',
4759
5272
  height: 36,
4760
5273
  width: 36,
4761
- heightElements: [6.5, 13, 0.4, 6.1],
4762
- widthElements: [9, 9.3, 8.7]
5274
+ heightElements: [ 6.5, 13, 0.4, 6.1 ],
5275
+ widthElements: [ 9, 9.3, 8.7 ]
4763
5276
  },
4764
5277
  'EVENT_TIMER_WH': {
4765
5278
  d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
4766
5279
  height: 36,
4767
5280
  width: 36,
4768
- heightElements: [10, 2],
4769
- widthElements: [3, 7]
5281
+ heightElements: [ 10, 2 ],
5282
+ widthElements: [ 3, 7 ]
4770
5283
  },
4771
5284
  'EVENT_TIMER_LINE': {
4772
5285
  d: 'M {mx},{my} ' +
4773
5286
  'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
4774
5287
  height: 36,
4775
5288
  width: 36,
4776
- heightElements: [10, 3],
4777
- widthElements: [0, 0]
5289
+ heightElements: [ 10, 3 ],
5290
+ widthElements: [ 0, 0 ]
4778
5291
  },
4779
5292
  'EVENT_MULTIPLE': {
4780
5293
  d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
4781
5294
  height: 36,
4782
5295
  width: 36,
4783
- heightElements: [6.28099, 12.56199],
4784
- widthElements: [3.1405, 9.42149, 12.56198]
5296
+ heightElements: [ 6.28099, 12.56199 ],
5297
+ widthElements: [ 3.1405, 9.42149, 12.56198 ]
4785
5298
  },
4786
5299
  'EVENT_PARALLEL_MULTIPLE': {
4787
5300
  d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
4788
5301
  '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
4789
5302
  height: 36,
4790
5303
  width: 36,
4791
- heightElements: [2.56228, 7.68683],
4792
- widthElements: [2.56228, 7.68683]
5304
+ heightElements: [ 2.56228, 7.68683 ],
5305
+ widthElements: [ 2.56228, 7.68683 ]
4793
5306
  },
4794
5307
  'GATEWAY_EXCLUSIVE': {
4795
5308
  d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
@@ -4797,23 +5310,23 @@
4797
5310
  '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
4798
5311
  height: 17.5,
4799
5312
  width: 17.5,
4800
- heightElements: [8.5, 6.5312, -6.5312, -8.5],
4801
- widthElements: [6.5, -6.5, 3, -3, 5, -5]
5313
+ heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],
5314
+ widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]
4802
5315
  },
4803
5316
  'GATEWAY_PARALLEL': {
4804
5317
  d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4805
5318
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4806
5319
  height: 30,
4807
5320
  width: 30,
4808
- heightElements: [5, 12.5],
4809
- widthElements: [5, 12.5]
5321
+ heightElements: [ 5, 12.5 ],
5322
+ widthElements: [ 5, 12.5 ]
4810
5323
  },
4811
5324
  'GATEWAY_EVENT_BASED': {
4812
5325
  d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
4813
5326
  height: 11,
4814
5327
  width: 11,
4815
- heightElements: [-6, 6, 12, -12],
4816
- widthElements: [9, -3, -12]
5328
+ heightElements: [ -6, 6, 12, -12 ],
5329
+ widthElements: [ 9, -3, -12 ]
4817
5330
  },
4818
5331
  'GATEWAY_COMPLEX': {
4819
5332
  d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
@@ -4822,15 +5335,15 @@
4822
5335
  '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
4823
5336
  height: 17.125,
4824
5337
  width: 17.125,
4825
- heightElements: [4.875, 3.4375, 2.125, 3],
4826
- widthElements: [3.4375, 2.125, 4.875, 3]
5338
+ heightElements: [ 4.875, 3.4375, 2.125, 3 ],
5339
+ widthElements: [ 3.4375, 2.125, 4.875, 3 ]
4827
5340
  },
4828
5341
  'DATA_OBJECT_PATH': {
4829
5342
  d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
4830
5343
  height: 61,
4831
5344
  width: 51,
4832
- heightElements: [10, 50, 60],
4833
- widthElements: [10, 40, 50, 60]
5345
+ heightElements: [ 10, 50, 60 ],
5346
+ widthElements: [ 10, 40, 50, 60 ]
4834
5347
  },
4835
5348
  'DATA_OBJECT_COLLECTION_PATH': {
4836
5349
  d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
@@ -4859,15 +5372,15 @@
4859
5372
  'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
4860
5373
  height: 61,
4861
5374
  width: 61,
4862
- heightElements: [7, 10, 45],
4863
- widthElements: [2, 58, 60]
5375
+ heightElements: [ 7, 10, 45 ],
5376
+ widthElements: [ 2, 58, 60 ]
4864
5377
  },
4865
5378
  'TEXT_ANNOTATION': {
4866
5379
  d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
4867
5380
  height: 30,
4868
5381
  width: 10,
4869
- heightElements: [30],
4870
- widthElements: [10]
5382
+ heightElements: [ 30 ],
5383
+ widthElements: [ 10 ]
4871
5384
  },
4872
5385
  'MARKER_SUB_PROCESS': {
4873
5386
  d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
@@ -4922,8 +5435,8 @@
4922
5435
  d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
4923
5436
  height: 14,
4924
5437
  width: 21,
4925
- heightElements: [6, 14],
4926
- widthElements: [10.5, 21]
5438
+ heightElements: [ 6, 14 ],
5439
+ widthElements: [ 10.5, 21 ]
4927
5440
  },
4928
5441
  'TASK_TYPE_SCRIPT': {
4929
5442
  d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
@@ -4934,8 +5447,8 @@
4934
5447
  'm -4,3 l 5,0',
4935
5448
  height: 15,
4936
5449
  width: 12.6,
4937
- heightElements: [6, 14],
4938
- widthElements: [10.5, 21]
5450
+ heightElements: [ 6, 14 ],
5451
+ widthElements: [ 10.5, 21 ]
4939
5452
  },
4940
5453
  'TASK_TYPE_USER_1': {
4941
5454
  d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
@@ -5616,11 +6129,6 @@
5616
6129
  parentElement = this._canvas.findRoot(parentElement);
5617
6130
  }
5618
6131
 
5619
- // insert sequence flows behind other flow nodes (cf. #727)
5620
- if (is(semantic, 'bpmn:SequenceFlow')) {
5621
- parentIndex = 0;
5622
- }
5623
-
5624
6132
  this._canvas.addConnection(element, parentElement, parentIndex);
5625
6133
  } else {
5626
6134
  throw new Error(translate('unknown di {di} for element {semantic}', {
@@ -8389,7 +8897,7 @@
8389
8897
 
8390
8898
  // dataAssociations are children of the subprocess but rendered on process level
8391
8899
  // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
8392
- if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
8900
+ if (isAny(bo, [ 'bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation' ])) {
8393
8901
  return false;
8394
8902
  }
8395
8903
 
@@ -8437,7 +8945,7 @@
8437
8945
  }, true);
8438
8946
 
8439
8947
 
8440
- this.executed(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8948
+ this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8441
8949
  function(context) {
8442
8950
  var oldParent = context.oldParent,
8443
8951
  newParent = context.newParent || context.parent,
@@ -8454,7 +8962,7 @@
8454
8962
  }, true);
8455
8963
 
8456
8964
 
8457
- this.reverted(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8965
+ this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8458
8966
  function(context) {
8459
8967
  var oldParent = context.oldParent,
8460
8968
  newParent = context.newParent || context.parent,
@@ -8573,7 +9081,7 @@
8573
9081
 
8574
9082
  var DrilldownModdule = {
8575
9083
  __depends__: [ OverlaysModule, ChangeSupportModule, RootElementsModule ],
8576
- __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility'],
9084
+ __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility' ],
8577
9085
  drilldownBreadcrumbs: [ 'type', DrilldownBreadcrumbs ],
8578
9086
  drilldownCentering: [ 'type', DrilldownCentering ],
8579
9087
  drilldownOverlayBehavior: [ 'type', DrilldownOverlayBehavior ],
@@ -8901,20 +9409,11 @@
8901
9409
  return function() {
8902
9410
  initializers.forEach(function(initializer) {
8903
9411
 
8904
- try {
8905
-
8906
- // eagerly resolve component (fn or string)
8907
- if (typeof initializer === 'string') {
8908
- injector.get(initializer);
8909
- } else {
8910
- injector.invoke(initializer);
8911
- }
8912
- } catch (error) {
8913
- if (typeof AggregateError !== 'undefined') {
8914
- throw new AggregateError([ error ], 'Failed to initialize!');
8915
- }
8916
-
8917
- throw new Error('Failed to initialize! ' + error.message);
9412
+ // eagerly resolve component (fn or string)
9413
+ if (typeof initializer === 'string') {
9414
+ injector.get(initializer);
9415
+ } else {
9416
+ injector.invoke(initializer);
8918
9417
  }
8919
9418
  });
8920
9419
  };
@@ -9230,7 +9729,7 @@
9230
9729
  *
9231
9730
  * @return {number} the previous index of the element
9232
9731
  */
9233
- function remove$2(collection, element) {
9732
+ function remove$3(collection, element) {
9234
9733
 
9235
9734
  if (!collection || !element) {
9236
9735
  return -1;
@@ -10182,7 +10681,7 @@
10182
10681
  graphicsFactory.remove(element);
10183
10682
 
10184
10683
  // unset parent <-> child relationship
10185
- remove$2(element.parent && element.parent.children, element);
10684
+ remove$3(element.parent && element.parent.children, element);
10186
10685
  element.parent = null;
10187
10686
 
10188
10687
  eventBus.fire(type + '.removed', { element: element });
@@ -11506,7 +12005,7 @@
11506
12005
  *
11507
12006
  * @return {Base} the new model instance
11508
12007
  */
11509
- function create$1(type, attrs) {
12008
+ function create$2(type, attrs) {
11510
12009
  var Type = types[type];
11511
12010
  if (!Type) {
11512
12011
  throw new Error('unknown type: <' + type + '>');
@@ -11554,7 +12053,7 @@
11554
12053
  attrs.id = type + '_' + (this._uid++);
11555
12054
  }
11556
12055
 
11557
- return create$1(type, attrs);
12056
+ return create$2(type, attrs);
11558
12057
  };
11559
12058
 
11560
12059
  var FN_REF = '__fn';
@@ -16075,7 +16574,23 @@
16075
16574
  value = escapeAttr(value);
16076
16575
  }
16077
16576
 
16078
- attrs.push({ name: name, value: value });
16577
+ // de-duplicate attributes
16578
+ // https://github.com/bpmn-io/moddle-xml/issues/66
16579
+ var idx = findIndex(attrs, function(element) {
16580
+ return (
16581
+ element.name.localName === name.localName &&
16582
+ element.name.uri === name.uri &&
16583
+ element.name.prefix === name.prefix
16584
+ );
16585
+ });
16586
+
16587
+ var attr = { name: name, value: value };
16588
+
16589
+ if (idx !== -1) {
16590
+ attrs.splice(idx, 1, attr);
16591
+ } else {
16592
+ attrs.push(attr);
16593
+ }
16079
16594
  };
16080
16595
 
16081
16596
  ElementSerializer.prototype.serializeAttributes = function(writer) {
@@ -16335,12 +16850,12 @@
16335
16850
  });
16336
16851
  };
16337
16852
 
16338
- var name = "BPMN20";
16339
- var uri = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16340
- var prefix$1 = "bpmn";
16341
- var associations = [
16853
+ var name$5 = "BPMN20";
16854
+ var uri$5 = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16855
+ var prefix$5 = "bpmn";
16856
+ var associations$5 = [
16342
16857
  ];
16343
- var types$1 = [
16858
+ var types$5 = [
16344
16859
  {
16345
16860
  name: "Interface",
16346
16861
  superClass: [
@@ -19158,7 +19673,7 @@
19158
19673
  ]
19159
19674
  }
19160
19675
  ];
19161
- var enumerations = [
19676
+ var enumerations$3 = [
19162
19677
  {
19163
19678
  name: "ProcessType",
19164
19679
  literalValues: [
@@ -19289,24 +19804,24 @@
19289
19804
  ]
19290
19805
  }
19291
19806
  ];
19292
- var xml = {
19807
+ var xml$1 = {
19293
19808
  tagAlias: "lowerCase",
19294
19809
  typePrefix: "t"
19295
19810
  };
19296
19811
  var BpmnPackage = {
19297
- name: name,
19298
- uri: uri,
19299
- prefix: prefix$1,
19300
- associations: associations,
19301
- types: types$1,
19302
- enumerations: enumerations,
19303
- xml: xml
19812
+ name: name$5,
19813
+ uri: uri$5,
19814
+ prefix: prefix$5,
19815
+ associations: associations$5,
19816
+ types: types$5,
19817
+ enumerations: enumerations$3,
19818
+ xml: xml$1
19304
19819
  };
19305
19820
 
19306
- var name$1 = "BPMNDI";
19307
- var uri$1 = "http://www.omg.org/spec/BPMN/20100524/DI";
19308
- var prefix$1$1 = "bpmndi";
19309
- var types$1$1 = [
19821
+ var name$4 = "BPMNDI";
19822
+ var uri$4 = "http://www.omg.org/spec/BPMN/20100524/DI";
19823
+ var prefix$4 = "bpmndi";
19824
+ var types$4 = [
19310
19825
  {
19311
19826
  name: "BPMNDiagram",
19312
19827
  properties: [
@@ -19457,7 +19972,7 @@
19457
19972
  ]
19458
19973
  }
19459
19974
  ];
19460
- var enumerations$1 = [
19975
+ var enumerations$2 = [
19461
19976
  {
19462
19977
  name: "ParticipantBandKind",
19463
19978
  literalValues: [
@@ -19493,21 +20008,21 @@
19493
20008
  ]
19494
20009
  }
19495
20010
  ];
19496
- var associations$1 = [
20011
+ var associations$4 = [
19497
20012
  ];
19498
20013
  var BpmnDiPackage = {
19499
- name: name$1,
19500
- uri: uri$1,
19501
- prefix: prefix$1$1,
19502
- types: types$1$1,
19503
- enumerations: enumerations$1,
19504
- associations: associations$1
20014
+ name: name$4,
20015
+ uri: uri$4,
20016
+ prefix: prefix$4,
20017
+ types: types$4,
20018
+ enumerations: enumerations$2,
20019
+ associations: associations$4
19505
20020
  };
19506
20021
 
19507
- var name$2 = "DC";
19508
- var uri$2 = "http://www.omg.org/spec/DD/20100524/DC";
19509
- var prefix$2 = "dc";
19510
- var types$2 = [
20022
+ var name$3 = "DC";
20023
+ var uri$3 = "http://www.omg.org/spec/DD/20100524/DC";
20024
+ var prefix$3 = "dc";
20025
+ var types$3 = [
19511
20026
  {
19512
20027
  name: "Boolean"
19513
20028
  },
@@ -19600,20 +20115,20 @@
19600
20115
  ]
19601
20116
  }
19602
20117
  ];
19603
- var associations$2 = [
20118
+ var associations$3 = [
19604
20119
  ];
19605
20120
  var DcPackage = {
19606
- name: name$2,
19607
- uri: uri$2,
19608
- prefix: prefix$2,
19609
- types: types$2,
19610
- associations: associations$2
20121
+ name: name$3,
20122
+ uri: uri$3,
20123
+ prefix: prefix$3,
20124
+ types: types$3,
20125
+ associations: associations$3
19611
20126
  };
19612
20127
 
19613
- var name$3 = "DI";
19614
- var uri$3 = "http://www.omg.org/spec/DD/20100524/DI";
19615
- var prefix$3 = "di";
19616
- var types$3 = [
20128
+ var name$2 = "DI";
20129
+ var uri$2 = "http://www.omg.org/spec/DD/20100524/DI";
20130
+ var prefix$2 = "di";
20131
+ var types$2 = [
19617
20132
  {
19618
20133
  name: "DiagramElement",
19619
20134
  isAbstract: true,
@@ -19842,24 +20357,24 @@
19842
20357
  ]
19843
20358
  }
19844
20359
  ];
19845
- var associations$3 = [
20360
+ var associations$2 = [
19846
20361
  ];
19847
- var xml$1 = {
20362
+ var xml = {
19848
20363
  tagAlias: "lowerCase"
19849
20364
  };
19850
20365
  var DiPackage = {
19851
- name: name$3,
19852
- uri: uri$3,
19853
- prefix: prefix$3,
19854
- types: types$3,
19855
- associations: associations$3,
19856
- xml: xml$1
20366
+ name: name$2,
20367
+ uri: uri$2,
20368
+ prefix: prefix$2,
20369
+ types: types$2,
20370
+ associations: associations$2,
20371
+ xml: xml
19857
20372
  };
19858
20373
 
19859
- var name$4 = "bpmn.io colors for BPMN";
19860
- var uri$4 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
19861
- var prefix$4 = "bioc";
19862
- var types$4 = [
20374
+ var name$1 = "bpmn.io colors for BPMN";
20375
+ var uri$1 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
20376
+ var prefix$1 = "bioc";
20377
+ var types$1 = [
19863
20378
  {
19864
20379
  name: "ColoredShape",
19865
20380
  "extends": [
@@ -19897,23 +20412,23 @@
19897
20412
  ]
19898
20413
  }
19899
20414
  ];
19900
- var enumerations$2 = [
20415
+ var enumerations$1 = [
19901
20416
  ];
19902
- var associations$4 = [
20417
+ var associations$1 = [
19903
20418
  ];
19904
20419
  var BiocPackage = {
19905
- name: name$4,
19906
- uri: uri$4,
19907
- prefix: prefix$4,
19908
- types: types$4,
19909
- enumerations: enumerations$2,
19910
- associations: associations$4
20420
+ name: name$1,
20421
+ uri: uri$1,
20422
+ prefix: prefix$1,
20423
+ types: types$1,
20424
+ enumerations: enumerations$1,
20425
+ associations: associations$1
19911
20426
  };
19912
20427
 
19913
- var name$5 = "BPMN in Color";
19914
- var uri$5 = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
19915
- var prefix$5 = "color";
19916
- var types$5 = [
20428
+ var name = "BPMN in Color";
20429
+ var uri = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
20430
+ var prefix$6 = "color";
20431
+ var types$6 = [
19917
20432
  {
19918
20433
  name: "ColoredLabel",
19919
20434
  "extends": [
@@ -19959,17 +20474,17 @@
19959
20474
  ]
19960
20475
  }
19961
20476
  ];
19962
- var enumerations$3 = [
20477
+ var enumerations = [
19963
20478
  ];
19964
- var associations$5 = [
20479
+ var associations = [
19965
20480
  ];
19966
20481
  var BpmnInColorPackage = {
19967
- name: name$5,
19968
- uri: uri$5,
19969
- prefix: prefix$5,
19970
- types: types$5,
19971
- enumerations: enumerations$3,
19972
- associations: associations$5
20482
+ name: name,
20483
+ uri: uri,
20484
+ prefix: prefix$6,
20485
+ types: types$6,
20486
+ enumerations: enumerations,
20487
+ associations: associations
19973
20488
  };
19974
20489
 
19975
20490
  var packages = {
@@ -20049,6 +20564,7 @@
20049
20564
  // bpmnElement can have multiple independent DIs
20050
20565
  if (!has(businessObject, 'di')) {
20051
20566
  Object.defineProperty(businessObject, 'di', {
20567
+ enumerable: false,
20052
20568
  get: function() {
20053
20569
  throw new Error(DI_ERROR_MESSAGE);
20054
20570
  }
@@ -21618,6 +22134,16 @@
21618
22134
  // default moddle extensions the viewer is composed of
21619
22135
  Viewer.prototype._moddleExtensions = {};
21620
22136
 
22137
+ var KEYCODE_C = 67;
22138
+ var KEYCODE_V = 86;
22139
+ var KEYCODE_Y = 89;
22140
+ var KEYCODE_Z = 90;
22141
+
22142
+ var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
22143
+ var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
22144
+ var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
22145
+ var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
22146
+
21621
22147
  /**
21622
22148
  * Returns true if event was triggered with any modifier
21623
22149
  * @param {KeyboardEvent} event
@@ -21657,6 +22183,26 @@
21657
22183
  */
21658
22184
  function isShift(event) {
21659
22185
  return event.shiftKey;
22186
+ }
22187
+
22188
+ function isCopy(event) {
22189
+ return isCmd(event) && isKey(KEYS_COPY, event);
22190
+ }
22191
+
22192
+ function isPaste(event) {
22193
+ return isCmd(event) && isKey(KEYS_PASTE, event);
22194
+ }
22195
+
22196
+ function isUndo(event) {
22197
+ return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
22198
+ }
22199
+
22200
+ function isRedo(event) {
22201
+ return isCmd(event) && (
22202
+ isKey(KEYS_REDO, event) || (
22203
+ isKey(KEYS_UNDO, event) && isShift(event)
22204
+ )
22205
+ );
21660
22206
  }
21661
22207
 
21662
22208
  var KEYDOWN_EVENT = 'keyboard.keydown',
@@ -21849,16 +22395,6 @@
21849
22395
 
21850
22396
  var LOW_PRIORITY$4 = 500;
21851
22397
 
21852
- var KEYCODE_C = 67;
21853
- var KEYCODE_V = 86;
21854
- var KEYCODE_Y = 89;
21855
- var KEYCODE_Z = 90;
21856
-
21857
- var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
21858
- var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
21859
- var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
21860
- var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
21861
-
21862
22398
 
21863
22399
  /**
21864
22400
  * Adds default keyboard bindings.
@@ -21916,7 +22452,7 @@
21916
22452
 
21917
22453
  var event = context.keyEvent;
21918
22454
 
21919
- if (isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event)) {
22455
+ if (isUndo(event)) {
21920
22456
  editorActions.trigger('undo');
21921
22457
 
21922
22458
  return true;
@@ -21930,7 +22466,7 @@
21930
22466
 
21931
22467
  var event = context.keyEvent;
21932
22468
 
21933
- if (isCmd(event) && (isKey(KEYS_REDO, event) || (isKey(KEYS_UNDO, event) && isShift(event)))) {
22469
+ if (isRedo(event)) {
21934
22470
  editorActions.trigger('redo');
21935
22471
 
21936
22472
  return true;
@@ -21943,7 +22479,7 @@
21943
22479
 
21944
22480
  var event = context.keyEvent;
21945
22481
 
21946
- if (isCmd(event) && isKey(KEYS_COPY, event)) {
22482
+ if (isCopy(event)) {
21947
22483
  editorActions.trigger('copy');
21948
22484
 
21949
22485
  return true;
@@ -21956,7 +22492,7 @@
21956
22492
 
21957
22493
  var event = context.keyEvent;
21958
22494
 
21959
- if (isCmd(event) && isKey(KEYS_PASTE, event)) {
22495
+ if (isPaste(event)) {
21960
22496
  editorActions.trigger('paste');
21961
22497
 
21962
22498
  return true;