{"version":3,"file":"line_controller-B4NHX3ne.js","sources":["../../../node_modules/anim-event/anim-event.esm.js","../../../node_modules/@jsplumb/browser-ui/js/jsplumb.browser-ui.es.js","../../../app/javascript/controllers/journeys/line_controller.js"],"sourcesContent":["/* ================================================\n DON'T MANUALLY EDIT THIS FILE\n================================================ */\n\n/*\n * AnimEvent\n * https://github.com/anseki/anim-event\n *\n * Copyright (c) 2021 anseki\n * Licensed under the MIT license.\n */\nvar MSPF = 1000 / 60,\n // ms/frame (FPS: 60)\nKEEP_LOOP = 500,\n\n/**\n * @typedef {Object} task\n * @property {Event} event\n * @property {function} listener\n */\n\n/** @type {task[]} */\ntasks = [];\n\nvar requestAnim = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n return setTimeout(callback, MSPF);\n},\n cancelAnim = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || function (requestID) {\n return clearTimeout(requestID);\n};\n\nvar lastFrameTime = Date.now(),\n requestID;\n\nfunction step() {\n var called, next;\n\n if (requestID) {\n cancelAnim.call(window, requestID);\n requestID = null;\n }\n\n tasks.forEach(function (task) {\n var event;\n\n if (event = task.event) {\n task.event = null; // Clear it before `task.listener()` because that might fire another event.\n\n task.listener(event);\n called = true;\n }\n });\n\n if (called) {\n lastFrameTime = Date.now();\n next = true;\n } else if (Date.now() - lastFrameTime < KEEP_LOOP) {\n // Go on for a while\n next = true;\n }\n\n if (next) {\n requestID = requestAnim.call(window, step);\n }\n}\n\nfunction indexOfTasks(listener) {\n var index = -1;\n tasks.some(function (task, i) {\n if (task.listener === listener) {\n index = i;\n return true;\n }\n\n return false;\n });\n return index;\n}\n\nvar AnimEvent = {\n /**\n * @param {function} listener - An event listener.\n * @returns {(function|null)} A wrapped event listener.\n */\n add: function add(listener) {\n var task;\n\n if (indexOfTasks(listener) === -1) {\n tasks.push(task = {\n listener: listener\n });\n return function (event) {\n task.event = event;\n\n if (!requestID) {\n step();\n }\n };\n }\n\n return null;\n },\n remove: function remove(listener) {\n var iRemove;\n\n if ((iRemove = indexOfTasks(listener)) > -1) {\n tasks.splice(iRemove, 1);\n\n if (!tasks.length && requestID) {\n cancelAnim.call(window, requestID);\n requestID = null;\n }\n }\n }\n};\nexport default AnimEvent;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction filterList(list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n}\nfunction extend(o1, o2, keys) {\n var i;\n o1 = o1 || {};\n o2 = o2 || {};\n var _o1 = o1,\n _o2 = o2;\n if (keys) {\n for (i = 0; i < keys.length; i++) {\n _o1[keys[i]] = _o2[keys[i]];\n }\n } else {\n for (i in _o2) {\n _o1[i] = _o2[i];\n }\n }\n return o1;\n}\nfunction isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n}\nfunction isString(s) {\n return typeof s === \"string\";\n}\nfunction isBoolean(s) {\n return typeof s === \"boolean\";\n}\nfunction isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\nfunction isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n}\nfunction isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n}\nfunction isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n}\nfunction clone(a) {\n if (isString(a)) {\n return \"\" + a;\n } else if (isBoolean(a)) {\n return !!a;\n } else if (isDate(a)) {\n return new Date(a.getTime());\n } else if (isFunction(a)) {\n return a;\n } else if (Array.isArray(a)) {\n var _b = [];\n for (var i = 0; i < a.length; i++) {\n _b.push(clone(a[i]));\n }\n return _b;\n } else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n } else {\n return a;\n }\n}\nfunction filterNull(obj) {\n var o = {};\n for (var k in obj) {\n if (obj[k] != null) {\n o[k] = obj[k];\n }\n }\n return o;\n}\nfunction merge(a, b, collations, overwrites) {\n var cMap = {},\n ar,\n i,\n oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n } else if (cMap[i]) {\n ar = [];\n ar.push.apply(ar, Array.isArray(c[i]) ? c[i] : [c[i]]);\n ar.push(b[i]);\n c[i] = ar;\n } else if (isString(b[i]) || isBoolean(b[i]) || isFunction(b[i]) || isNumber(b[i])) {\n c[i] = b[i];\n } else {\n if (Array.isArray(b[i])) {\n ar = [];\n if (Array.isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n } else if (isObject(b[i])) {\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n}\nfunction _areEqual(a, b) {\n if (a != null && b == null) {\n return false;\n } else {\n if ((a == null || isString(a) || isBoolean(a) || isNumber(a)) && a !== b) {\n return false;\n } else {\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n } else {\n if (!arraysEqual(a, b)) {\n return false;\n }\n }\n } else if (isObject(a)) {\n if (!isObject(a)) {\n return false;\n } else {\n if (!objectsEqual(a, b)) {\n return false;\n }\n }\n }\n }\n }\n return true;\n}\nfunction arraysEqual(a, b) {\n if (a == null && b == null) {\n return true;\n } else if (a == null && b != null) {\n return false;\n } else if (a != null && b == null) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n } else {\n for (var i = 0; i < a.length; i++) {\n if (!_areEqual(a[i], b[i])) {\n return false;\n }\n }\n }\n return true;\n}\nfunction objectsEqual(a, b) {\n if (a == null && b == null) {\n return true;\n } else if (a == null && b != null) {\n return false;\n } else if (a != null && b == null) {\n return false;\n }\n for (var key in a) {\n var va = a[key],\n vb = b[key];\n if (!_areEqual(va, vb)) {\n return false;\n }\n }\n return true;\n}\nfunction replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj,\n t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/),\n last = pos + term.length >= str.length,\n _getArray = function _getArray() {\n return t[array[1]] || function () {\n t[array[1]] = [];\n return t[array[1]];\n }();\n };\n if (last) {\n if (array) {\n _getArray()[array[3]] = value;\n } else {\n t[term] = value;\n }\n } else {\n if (array) {\n var _a2 = _getArray();\n t = _a2[array[3]] || function () {\n _a2[array[3]] = {};\n return _a2[array[3]];\n }();\n } else {\n t = t[term] || function () {\n t[term] = {};\n return t[term];\n }();\n }\n }\n return \"\";\n });\n return inObj;\n}\nfunction functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n}\nfunction populate(model, values, functionPrefix, doNotExpandFunctions) {\n var getValue = function getValue(fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n matches = fromString.match(/({{.*?}})/g);\n if (matches != null) {\n for (var _i = 0; _i < matches.length; _i++) {\n var _val = values[matches[_i].substring(2, matches[_i].length - 2)] || \"\";\n if (_val != null) {\n fromString = fromString.replace(matches[_i], _val);\n }\n }\n }\n return fromString;\n };\n var _one = function _one(d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n } else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n } else if (Array.isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n } else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n } else {\n return d;\n }\n }\n };\n return _one(model);\n}\nfunction forEach(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n f(a[i]);\n }\n } else {\n return null;\n }\n}\nfunction findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n}\nfunction findAllWithFunction(a, predicate) {\n var o = [];\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (predicate(a[i])) {\n o.push(i);\n }\n }\n }\n return o;\n}\nfunction getWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n return idx === -1 ? null : a[idx];\n}\nfunction getAllWithFunction(a, f) {\n var indexes = findAllWithFunction(a, f);\n return indexes.map(function (i) {\n return a[i];\n });\n}\nfunction getFromSetWithFunction(s, f) {\n var out = null;\n s.forEach(function (t) {\n if (f(t)) {\n out = t;\n }\n });\n return out;\n}\nfunction setToArray(s) {\n var a = [];\n s.forEach(function (t) {\n a.push(t);\n });\n return a;\n}\nfunction removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n}\nfunction fromArray(a) {\n if (Array.fromArray != null) {\n return Array.from(a);\n } else {\n var arr = [];\n Array.prototype.push.apply(arr, a);\n return arr;\n }\n}\nfunction remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n}\nfunction addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n}\nfunction addToDictionary(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n}\nfunction addToList(map, key, value, insertAtStart) {\n var l = map.get(key);\n if (l == null) {\n l = [];\n map.set(key, l);\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n}\nfunction suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n } else {\n list.push(item);\n }\n return true;\n }\n return false;\n}\nvar lut$1 = [];\nfor (var i$1 = 0; i$1 < 256; i$1++) {\n lut$1[i$1] = (i$1 < 16 ? '0' : '') + i$1.toString(16);\n}\nfunction uuid() {\n var d0 = Math.random() * 0xffffffff | 0;\n var d1 = Math.random() * 0xffffffff | 0;\n var d2 = Math.random() * 0xffffffff | 0;\n var d3 = Math.random() * 0xffffffff | 0;\n return lut$1[d0 & 0xff] + lut$1[d0 >> 8 & 0xff] + lut$1[d0 >> 16 & 0xff] + lut$1[d0 >> 24 & 0xff] + '-' + lut$1[d1 & 0xff] + lut$1[d1 >> 8 & 0xff] + '-' + lut$1[d1 >> 16 & 0x0f | 0x40] + lut$1[d1 >> 24 & 0xff] + '-' + lut$1[d2 & 0x3f | 0x80] + lut$1[d2 >> 8 & 0xff] + '-' + lut$1[d2 >> 16 & 0xff] + lut$1[d2 >> 24 & 0xff] + lut$1[d3 & 0xff] + lut$1[d3 >> 8 & 0xff] + lut$1[d3 >> 16 & 0xff] + lut$1[d3 >> 24 & 0xff];\n}\nfunction rotatePoint(point, center, rotation) {\n var radial = {\n x: point.x - center.x,\n y: point.y - center.y\n },\n cr = Math.cos(rotation / 360 * Math.PI * 2),\n sr = Math.sin(rotation / 360 * Math.PI * 2);\n return {\n x: radial.x * cr - radial.y * sr + center.x,\n y: radial.y * cr + radial.x * sr + center.y,\n cr: cr,\n sr: sr\n };\n}\nfunction rotateAnchorOrientation(orientation, rotation) {\n var r = rotatePoint({\n x: orientation[0],\n y: orientation[1]\n }, {\n x: 0,\n y: 0\n }, rotation);\n return [Math.round(r.x), Math.round(r.y)];\n}\nfunction fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''),\n ws = /\\s/,\n i = str.length;\n while (ws.test(str.charAt(--i))) {}\n return str.slice(0, i + 1);\n}\nfunction each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var _i2 = 0; _i2 < obj.length; _i2++) {\n fn(obj[_i2]);\n }\n}\nfunction map(obj, fn) {\n var o = [];\n for (var _i3 = 0; _i3 < obj.length; _i3++) {\n o.push(fn(obj[_i3]));\n }\n return o;\n}\nvar logEnabled = true;\nfunction log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n } catch (e) {}\n }\n}\nfunction sgn$1(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n}\nfunction wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n } catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if (wrappedFunction != null && (returnOnThisValue == null || r !== returnOnThisValue)) {\n try {\n r = wrappedFunction.apply(this, arguments);\n } catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n}\nfunction getsert(map, key, valueGenerator) {\n if (!map.has(key)) {\n map.set(key, valueGenerator());\n }\n return map.get(key);\n}\nfunction isAssignableFrom(object, cls) {\n var proto = object.__proto__;\n while (proto != null) {\n if (proto instanceof cls) {\n return true;\n } else {\n proto = proto.__proto__;\n }\n }\n return false;\n}\nfunction insertSorted(value, array, comparator, sortDescending) {\n if (array.length === 0) {\n array.push(value);\n } else {\n var flip = sortDescending ? -1 : 1;\n var min = 0;\n var max = array.length;\n var index = Math.floor((min + max) / 2);\n while (max > min) {\n var c = comparator(value, array[index]) * flip;\n if (c < 0) {\n max = index;\n } else {\n min = index + 1;\n }\n index = Math.floor((min + max) / 2);\n }\n array.splice(index, 0, value);\n }\n}\n\nfunction matchesSelector$1(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n}\nfunction consume(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n } else {\n e.returnValue = false;\n }\n if (!doNotPreventDefault && e.preventDefault) {\n e.preventDefault();\n }\n}\nfunction findParent(el, selector, container, matchOnElementAlso) {\n if (matchOnElementAlso && matchesSelector$1(el, selector, container)) {\n return el;\n } else {\n el = el.parentNode;\n }\n while (el != null && el !== container) {\n if (matchesSelector$1(el, selector)) {\n return el;\n } else {\n el = el.parentNode;\n }\n }\n}\nfunction getEventSource(e) {\n return e.srcElement || e.target;\n}\nfunction _setClassName(el, cn, classList) {\n cn = fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n } else {\n el.className = cn;\n }\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n } catch (e) {\n log(\"WARN: cannot set class list\", e);\n }\n}\nfunction _getClassName(el) {\n return el.className != null ? typeof el.className.baseVal === \"undefined\" ? el.className : el.className.baseVal : \"\";\n}\nfunction _classManip(el, classesToAdd, classesToRemove) {\n var cta = classesToAdd == null ? [] : Array.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n var ctr = classesToRemove == null ? [] : Array.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n var _oneSet = function _oneSet(add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n } else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n _oneSet(true, cta);\n _oneSet(false, ctr);\n _setClassName(el, curClasses.join(\" \"), curClasses);\n}\nfunction isNodeList(el) {\n return !isString(el) && !Array.isArray(el) && el.length != null && el.documentElement == null && el.nodeType == null;\n}\nfunction isArrayLike(el) {\n return !isString(el) && (Array.isArray(el) || isNodeList(el));\n}\nfunction getClass(el) {\n return _getClassName(el);\n}\nfunction addClass(el, clazz) {\n var _one = function _one(el, clazz) {\n if (el != null && clazz != null && clazz.length > 0) {\n if (el.classList) {\n var parts = fastTrim(clazz).split(/\\s+/);\n forEach(parts, function (part) {\n el.classList.add(part);\n });\n } else {\n _classManip(el, clazz);\n }\n }\n };\n if (isNodeList(el)) {\n forEach(el, function (el) {\n return _one(el, clazz);\n });\n } else {\n _one(el, clazz);\n }\n}\nfunction hasClass(el, clazz) {\n if (el.classList) {\n return el.classList.contains(clazz);\n } else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n}\nfunction removeClass(el, clazz) {\n var _one = function _one(el, clazz) {\n if (el != null && clazz != null && clazz.length > 0) {\n if (el.classList) {\n var parts = fastTrim(clazz).split(/\\s+/);\n parts.forEach(function (part) {\n el.classList.remove(part);\n });\n } else {\n _classManip(el, null, clazz);\n }\n }\n };\n if (isNodeList(el)) {\n forEach(el, function (el) {\n return _one(el, clazz);\n });\n } else {\n _one(el, clazz);\n }\n}\nfunction toggleClass(el, clazz) {\n var _this = this;\n var _one = function _one(el, clazz) {\n if (el != null && clazz != null && clazz.length > 0) {\n if (el.classList) {\n el.classList.toggle(clazz);\n } else {\n if (_this.hasClass(el, clazz)) {\n _this.removeClass(el, clazz);\n } else {\n _this.addClass(el, clazz);\n }\n }\n }\n };\n if (isNodeList(el)) {\n forEach(el, function (el) {\n return _one(el, clazz);\n });\n } else {\n _one(el, clazz);\n }\n}\nfunction createElement(tag, style, clazz, atts) {\n return createElementNS(null, tag, style, clazz, atts);\n}\nfunction createElementNS(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n if (clazz) {\n e.className = clazz;\n }\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n return e;\n}\nfunction offsetRelativeToRoot(el) {\n var box = el.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n return {\n x: Math.round(left),\n y: Math.round(top)\n };\n}\nfunction offsetSize(el) {\n return {\n w: el.offsetWidth,\n h: el.offsetHeight\n };\n}\nfunction svgWidthHeightSize(el) {\n try {\n return {\n w: parseFloat(el.width.baseVal.value),\n h: parseFloat(el.height.baseVal.value)\n };\n } catch (e) {\n return {\n w: 0,\n h: 0\n };\n }\n}\nfunction svgXYPosition(el) {\n try {\n return {\n x: parseFloat(el.x.baseVal.value),\n y: parseFloat(el.y.baseVal.value)\n };\n } catch (e) {\n return {\n x: 0,\n y: 0\n };\n }\n}\nfunction getElementPosition(el, instance) {\n var pc = instance.getContainer().getBoundingClientRect();\n var ec = el.getBoundingClientRect();\n var z = instance.currentZoom;\n return {\n x: (ec.left - pc.left) / z,\n y: (ec.top - pc.top) / z\n };\n}\nfunction getElementSize(el, instance) {\n var ec = el.getBoundingClientRect();\n var z = instance.currentZoom;\n return {\n w: ec.width / z,\n h: ec.height / z\n };\n}\nvar ElementTypes;\n(function (ElementTypes) {\n ElementTypes[\"SVG\"] = \"SVG\";\n ElementTypes[\"HTML\"] = \"HTML\";\n})(ElementTypes || (ElementTypes = {}));\nfunction getElementType(el) {\n return el instanceof SVGElement ? ElementTypes.SVG : ElementTypes.HTML;\n}\nfunction isSVGElement(el) {\n return getElementType(el) === ElementTypes.SVG;\n}\nfunction onDocumentReady(f) {\n var _do = function _do() {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof document.body !== \"undefined\" && document.body != null) {\n f();\n } else {\n setTimeout(_do, 9);\n }\n };\n _do();\n}\n\nfunction cls() {\n for (var _len = arguments.length, className = new Array(_len), _key = 0; _key < _len; _key++) {\n className[_key] = arguments[_key];\n }\n return className.map(function (cn) {\n return \".\" + cn;\n }).join(\",\");\n}\nfunction classList() {\n for (var _len2 = arguments.length, className = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n className[_key2] = arguments[_key2];\n }\n return className.join(\" \");\n}\nfunction att() {\n for (var _len3 = arguments.length, attName = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n attName[_key3] = arguments[_key3];\n }\n return attName.map(function (an) {\n return \"[\" + an + \"]\";\n }).join(\",\");\n}\nvar SOURCE = \"source\";\nvar TARGET = \"target\";\nvar BLOCK = \"block\";\nvar NONE = \"none\";\nvar SOURCE_INDEX = 0;\nvar TARGET_INDEX = 1;\nvar ABSOLUTE = \"absolute\";\nvar FIXED = \"fixed\";\nvar STATIC = \"static\";\nvar ATTRIBUTE_GROUP = \"data-jtk-group\";\nvar ATTRIBUTE_MANAGED = \"data-jtk-managed\";\nvar ATTRIBUTE_NOT_DRAGGABLE = \"data-jtk-not-draggable\";\nvar ATTRIBUTE_TABINDEX = \"tabindex\";\nvar ATTRIBUTE_SCOPE = \"data-jtk-scope\";\nvar ATTRIBUTE_SCOPE_PREFIX = ATTRIBUTE_SCOPE + \"-\";\nvar CHECK_CONDITION = \"checkCondition\";\nvar CHECK_DROP_ALLOWED = \"checkDropAllowed\";\nvar CLASS_CONNECTOR = \"jtk-connector\";\nvar CLASS_CONNECTOR_OUTLINE = \"jtk-connector-outline\";\nvar CLASS_CONNECTED = \"jtk-connected\";\nvar CLASS_ENDPOINT = \"jtk-endpoint\";\nvar CLASS_ENDPOINT_CONNECTED = \"jtk-endpoint-connected\";\nvar CLASS_ENDPOINT_FULL = \"jtk-endpoint-full\";\nvar CLASS_ENDPOINT_FLOATING = \"jtk-floating-endpoint\";\nvar CLASS_ENDPOINT_DROP_ALLOWED = \"jtk-endpoint-drop-allowed\";\nvar CLASS_ENDPOINT_DROP_FORBIDDEN = \"jtk-endpoint-drop-forbidden\";\nvar CLASS_ENDPOINT_ANCHOR_PREFIX = \"jtk-endpoint-anchor\";\nvar CLASS_GROUP_COLLAPSED = \"jtk-group-collapsed\";\nvar CLASS_GROUP_EXPANDED = \"jtk-group-expanded\";\nvar CLASS_OVERLAY = \"jtk-overlay\";\nvar EVENT_ANCHOR_CHANGED = \"anchor:changed\";\nvar EVENT_CONNECTION = \"connection\";\nvar EVENT_INTERNAL_CONNECTION = \"internal.connection\";\nvar EVENT_CONNECTION_DETACHED = \"connection:detach\";\nvar EVENT_CONNECTION_MOVED = \"connection:move\";\nvar EVENT_CONTAINER_CHANGE = \"container:change\";\nvar EVENT_ENDPOINT_REPLACED = \"endpoint:replaced\";\nvar EVENT_INTERNAL_ENDPOINT_UNREGISTERED = \"internal.endpoint:unregistered\";\nvar EVENT_INTERNAL_CONNECTION_DETACHED = \"internal.connection:detached\";\nvar EVENT_MANAGE_ELEMENT = \"element:manage\";\nvar EVENT_GROUP_ADDED = \"group:added\";\nvar EVENT_GROUP_COLLAPSE = \"group:collapse\";\nvar EVENT_GROUP_EXPAND = \"group:expand\";\nvar EVENT_GROUP_MEMBER_ADDED = \"group:member:added\";\nvar EVENT_GROUP_MEMBER_REMOVED = \"group:member:removed\";\nvar EVENT_GROUP_REMOVED = \"group:removed\";\nvar EVENT_MAX_CONNECTIONS = \"maxConnections\";\nvar EVENT_NESTED_GROUP_ADDED = \"group:nested:added\";\nvar EVENT_NESTED_GROUP_REMOVED = \"group:nested:removed\";\nvar EVENT_UNMANAGE_ELEMENT = \"element:unmanage\";\nvar EVENT_ZOOM = \"zoom\";\nvar IS_DETACH_ALLOWED = \"isDetachAllowed\";\nvar INTERCEPT_BEFORE_DRAG = \"beforeDrag\";\nvar INTERCEPT_BEFORE_DROP = \"beforeDrop\";\nvar INTERCEPT_BEFORE_DETACH = \"beforeDetach\";\nvar INTERCEPT_BEFORE_START_DETACH = \"beforeStartDetach\";\nvar SELECTOR_MANAGED_ELEMENT = att(ATTRIBUTE_MANAGED);\nvar ERROR_SOURCE_ENDPOINT_FULL = \"Cannot establish connection: source endpoint is full\";\nvar ERROR_TARGET_ENDPOINT_FULL = \"Cannot establish connection: target endpoint is full\";\nvar ERROR_SOURCE_DOES_NOT_EXIST = \"Cannot establish connection: source does not exist\";\nvar ERROR_TARGET_DOES_NOT_EXIST = \"Cannot establish connection: target does not exist\";\nvar KEY_CONNECTION_OVERLAYS = \"connectionOverlays\";\n\nvar svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n};\nvar STROKE_DASHARRAY = \"stroke-dasharray\";\nvar DASHSTYLE = \"dashstyle\";\nvar FILL = \"fill\";\nvar STROKE = \"stroke\";\nvar STROKE_WIDTH = \"stroke-width\";\nvar LINE_WIDTH = \"strokeWidth\";\nvar ELEMENT_SVG = \"svg\";\nvar ELEMENT_PATH = \"path\";\nvar ns = {\n svg: \"http://www.w3.org/2000/svg\"\n};\nfunction _attr(node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n}\nfunction _node(name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return createElementNS(ns.svg, name, null, null, attributes);\n}\nfunction _pos(d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n}\nfunction _applyStyles(parent, node, style) {\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n forEach(parts, function (p) {\n styleToUse += Math.floor(p * style.strokeWidth) + sep;\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n } else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n}\nfunction _appendAtIndex(svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n } else {\n svg.appendChild(path);\n }\n}\nvar svg = {\n attr: _attr,\n node: _node,\n ns: ns\n};\n\nfunction compoundEvent(stem, event, subevent) {\n var a = [stem, event];\n if (subevent) {\n a.push(subevent);\n }\n return a.join(\":\");\n}\nvar ATTRIBUTE_CONTAINER = \"data-jtk-container\";\nvar ATTRIBUTE_GROUP_CONTENT = \"data-jtk-group-content\";\nvar ATTRIBUTE_JTK_ENABLED = \"data-jtk-enabled\";\nvar ATTRIBUTE_JTK_SCOPE = \"data-jtk-scope\";\nvar ENDPOINT = \"endpoint\";\nvar ELEMENT = \"element\";\nvar CONNECTION = \"connection\";\nvar ELEMENT_DIV = \"div\";\nvar EVENT_CLICK = \"click\";\nvar EVENT_CONTEXTMENU = \"contextmenu\";\nvar EVENT_DBL_CLICK = \"dblclick\";\nvar EVENT_DBL_TAP = \"dbltap\";\nvar EVENT_FOCUS = \"focus\";\nvar EVENT_MOUSEDOWN = \"mousedown\";\nvar EVENT_MOUSEENTER = \"mouseenter\";\nvar EVENT_MOUSEEXIT = \"mouseexit\";\nvar EVENT_MOUSEMOVE = \"mousemove\";\nvar EVENT_MOUSEUP = \"mouseup\";\nvar EVENT_MOUSEOUT = \"mouseout\";\nvar EVENT_MOUSEOVER = \"mouseover\";\nvar EVENT_TAP = \"tap\";\nvar EVENT_TOUCHSTART = \"touchstart\";\nvar EVENT_TOUCHEND = \"touchend\";\nvar EVENT_TOUCHMOVE = \"touchmove\";\nvar EVENT_DRAG_MOVE = \"drag:move\";\nvar EVENT_DRAG_STOP = \"drag:stop\";\nvar EVENT_DRAG_START = \"drag:start\";\nvar EVENT_REVERT = \"revert\";\nvar EVENT_CONNECTION_ABORT = \"connection:abort\";\nvar EVENT_CONNECTION_DRAG = \"connection:drag\";\nvar EVENT_ELEMENT_CLICK = compoundEvent(ELEMENT, EVENT_CLICK);\nvar EVENT_ELEMENT_DBL_CLICK = compoundEvent(ELEMENT, EVENT_DBL_CLICK);\nvar EVENT_ELEMENT_DBL_TAP = compoundEvent(ELEMENT, EVENT_DBL_TAP);\nvar EVENT_ELEMENT_MOUSE_OUT = compoundEvent(ELEMENT, EVENT_MOUSEOUT);\nvar EVENT_ELEMENT_MOUSE_OVER = compoundEvent(ELEMENT, EVENT_MOUSEOVER);\nvar EVENT_ELEMENT_MOUSE_MOVE = compoundEvent(ELEMENT, EVENT_MOUSEMOVE);\nvar EVENT_ELEMENT_MOUSE_UP = compoundEvent(ELEMENT, EVENT_MOUSEUP);\nvar EVENT_ELEMENT_MOUSE_DOWN = compoundEvent(ELEMENT, EVENT_MOUSEDOWN);\nvar EVENT_ELEMENT_CONTEXTMENU = compoundEvent(ELEMENT, EVENT_CONTEXTMENU);\nvar EVENT_ELEMENT_TAP = compoundEvent(ELEMENT, EVENT_TAP);\nvar EVENT_ENDPOINT_CLICK = compoundEvent(ENDPOINT, EVENT_CLICK);\nvar EVENT_ENDPOINT_DBL_CLICK = compoundEvent(ENDPOINT, EVENT_DBL_CLICK);\nvar EVENT_ENDPOINT_DBL_TAP = compoundEvent(ENDPOINT, EVENT_DBL_TAP);\nvar EVENT_ENDPOINT_MOUSEOUT = compoundEvent(ENDPOINT, EVENT_MOUSEOUT);\nvar EVENT_ENDPOINT_MOUSEOVER = compoundEvent(ENDPOINT, EVENT_MOUSEOVER);\nvar EVENT_ENDPOINT_MOUSEUP = compoundEvent(ENDPOINT, EVENT_MOUSEUP);\nvar EVENT_ENDPOINT_MOUSEDOWN = compoundEvent(ENDPOINT, EVENT_MOUSEDOWN);\nvar EVENT_ENDPOINT_TAP = compoundEvent(ENDPOINT, EVENT_TAP);\nvar EVENT_CONNECTION_CLICK = compoundEvent(CONNECTION, EVENT_CLICK);\nvar EVENT_CONNECTION_DBL_CLICK = compoundEvent(CONNECTION, EVENT_DBL_CLICK);\nvar EVENT_CONNECTION_DBL_TAP = compoundEvent(CONNECTION, EVENT_DBL_TAP);\nvar EVENT_CONNECTION_MOUSEOUT = compoundEvent(CONNECTION, EVENT_MOUSEOUT);\nvar EVENT_CONNECTION_MOUSEOVER = compoundEvent(CONNECTION, EVENT_MOUSEOVER);\nvar EVENT_CONNECTION_MOUSEUP = compoundEvent(CONNECTION, EVENT_MOUSEUP);\nvar EVENT_CONNECTION_MOUSEDOWN = compoundEvent(CONNECTION, EVENT_MOUSEDOWN);\nvar EVENT_CONNECTION_CONTEXTMENU = compoundEvent(CONNECTION, EVENT_CONTEXTMENU);\nvar EVENT_CONNECTION_TAP = compoundEvent(CONNECTION, EVENT_TAP);\nvar PROPERTY_POSITION = \"position\";\nvar SELECTOR_CONNECTOR = cls(CLASS_CONNECTOR);\nvar SELECTOR_ENDPOINT = cls(CLASS_ENDPOINT);\nvar SELECTOR_GROUP = att(ATTRIBUTE_GROUP);\nvar SELECTOR_GROUP_CONTAINER = att(ATTRIBUTE_GROUP_CONTENT);\nvar SELECTOR_OVERLAY = cls(CLASS_OVERLAY);\n\nvar PerimeterAnchorShapes;\n(function (PerimeterAnchorShapes) {\n PerimeterAnchorShapes[\"Circle\"] = \"Circle\";\n PerimeterAnchorShapes[\"Ellipse\"] = \"Ellipse\";\n PerimeterAnchorShapes[\"Triangle\"] = \"Triangle\";\n PerimeterAnchorShapes[\"Diamond\"] = \"Diamond\";\n PerimeterAnchorShapes[\"Rectangle\"] = \"Rectangle\";\n PerimeterAnchorShapes[\"Square\"] = \"Square\";\n})(PerimeterAnchorShapes || (PerimeterAnchorShapes = {}));\nvar AnchorLocations;\n(function (AnchorLocations) {\n AnchorLocations[\"Assign\"] = \"Assign\";\n AnchorLocations[\"AutoDefault\"] = \"AutoDefault\";\n AnchorLocations[\"Bottom\"] = \"Bottom\";\n AnchorLocations[\"BottomLeft\"] = \"BottomLeft\";\n AnchorLocations[\"BottomRight\"] = \"BottomRight\";\n AnchorLocations[\"Center\"] = \"Center\";\n AnchorLocations[\"Continuous\"] = \"Continuous\";\n AnchorLocations[\"ContinuousBottom\"] = \"ContinuousBottom\";\n AnchorLocations[\"ContinuousLeft\"] = \"ContinuousLeft\";\n AnchorLocations[\"ContinuousRight\"] = \"ContinuousRight\";\n AnchorLocations[\"ContinuousTop\"] = \"ContinuousTop\";\n AnchorLocations[\"ContinuousLeftRight\"] = \"ContinuousLeftRight\";\n AnchorLocations[\"ContinuousTopBottom\"] = \"ContinuousTopBottom\";\n AnchorLocations[\"Left\"] = \"Left\";\n AnchorLocations[\"Perimeter\"] = \"Perimeter\";\n AnchorLocations[\"Right\"] = \"Right\";\n AnchorLocations[\"Top\"] = \"Top\";\n AnchorLocations[\"TopLeft\"] = \"TopLeft\";\n AnchorLocations[\"TopRight\"] = \"TopRight\";\n})(AnchorLocations || (AnchorLocations = {}));\n\nfunction noSuchPoint() {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: null,\n y1: null,\n x2: null,\n y2: null\n };\n}\nfunction EMPTY_BOUNDS() {\n return {\n xmin: Infinity,\n xmax: -Infinity,\n ymin: Infinity,\n ymax: -Infinity\n };\n}\nvar AbstractSegment = function () {\n function AbstractSegment(params) {\n _classCallCheck(this, AbstractSegment);\n this.params = params;\n _defineProperty(this, \"x1\", void 0);\n _defineProperty(this, \"x2\", void 0);\n _defineProperty(this, \"y1\", void 0);\n _defineProperty(this, \"y2\", void 0);\n _defineProperty(this, \"extents\", EMPTY_BOUNDS());\n _defineProperty(this, \"type\", void 0);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n _createClass(AbstractSegment, [{\n key: \"findClosestPointOnPath\",\n value: function findClosestPointOnPath(x, y) {\n return noSuchPoint();\n }\n }, {\n key: \"lineIntersection\",\n value: function lineIntersection(x1, y1, x2, y2) {\n return [];\n }\n }, {\n key: \"boxIntersection\",\n value: function boxIntersection(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n }\n }, {\n key: \"boundingBoxIntersection\",\n value: function boundingBoxIntersection(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n }\n }]);\n return AbstractSegment;\n}();\n\nvar UNDEFINED = \"undefined\";\nvar DEFAULT = \"default\";\nvar TRUE$1 = \"true\";\nvar FALSE$1 = \"false\";\nvar WILDCARD = \"*\";\n\nvar _touchMap, _tapProfiles2;\nfunction _touch(target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return new Touch({\n target: target,\n identifier: uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n}\nfunction _touchList() {\n var list = [];\n list.push.apply(list, arguments);\n list.item = function (index) {\n return this[index];\n };\n return list;\n}\nfunction _touchAndList(target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch(target, pageX, pageY, screenX, screenY, clientX, clientY));\n}\nfunction matchesSelector(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n}\nfunction _t(e) {\n return e.srcElement || e.target;\n}\nfunction _pi(e, target, obj, doCompute) {\n if (!doCompute) {\n return {\n path: [target],\n end: 1\n };\n } else {\n var path = e.composedPath ? e.composedPath() : e.path;\n if (typeof path !== \"undefined\" && path.indexOf) {\n return {\n path: path,\n end: path.indexOf(obj)\n };\n } else {\n var out = {\n path: [],\n end: -1\n },\n _one = function _one(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n } else if (el.parentNode != null) {\n _one(el.parentNode);\n }\n };\n _one(target);\n return out;\n }\n }\n}\nfunction _d(l, fn) {\n var i = 0,\n j;\n for (i = 0, j = l.length; i < j; i++) {\n if (l[i][0] === fn) {\n break;\n }\n }\n if (i < l.length) {\n l.splice(i, 1);\n }\n}\nvar guid = 1;\nvar forceTouchEvents = false;\nvar forceMouseEvents = false;\nfunction isTouchDevice() {\n return forceTouchEvents || \"ontouchstart\" in document.documentElement || navigator.maxTouchPoints != null && navigator.maxTouchPoints > 0;\n}\nfunction isMouseDevice() {\n return forceMouseEvents || \"onmousedown\" in document.documentElement;\n}\nvar touchMap = (_touchMap = {}, _defineProperty(_touchMap, EVENT_MOUSEDOWN, EVENT_TOUCHSTART), _defineProperty(_touchMap, EVENT_MOUSEUP, EVENT_TOUCHEND), _defineProperty(_touchMap, EVENT_MOUSEMOVE, EVENT_TOUCHMOVE), _touchMap);\nvar PAGE = \"page\";\nvar SCREEN = \"screen\";\nvar CLIENT = \"client\";\nfunction _genLoc(e, prefix) {\n if (e == null) return {\n x: 0,\n y: 0\n };\n var ts = touches(e),\n t = getTouch(ts, 0);\n return {\n x: t[prefix + \"X\"],\n y: t[prefix + \"Y\"]\n };\n}\nfunction pageLocation(e) {\n return _genLoc(e, PAGE);\n}\nfunction screenLocation(e) {\n return _genLoc(e, SCREEN);\n}\nfunction clientLocation(e) {\n return _genLoc(e, CLIENT);\n}\nfunction getTouch(touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n}\nfunction touches(e) {\n return e.touches && e.touches.length > 0 ? e.touches : e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches : e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches : [e];\n}\nfunction touchCount(e) {\n return touches(e).length;\n}\nfunction getPageLocation(e) {\n if (e == null) {\n return {\n x: 0,\n y: 0\n };\n } else if (e.pageX !== null) {\n return {\n x: e.pageX,\n y: e.pageY\n };\n } else {\n var ts = touches(e),\n t = getTouch(ts, 0);\n if (t != null && t.pageX != null) {\n return {\n x: t.pageX,\n y: t.pageY\n };\n } else {\n return {\n x: 0,\n y: 0\n };\n }\n }\n}\nfunction _bind(obj, type, fn, originalFn, options) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener) {\n obj.addEventListener(type, fn, false, options);\n } else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n}\nfunction _unbind(obj, type, fn) {\n var _this = this;\n if (fn == null) return;\n _each$1(obj, function (_el) {\n _unstore(_el, type, fn);\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice() && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n } else if (_this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n}\nfunction _each$1(obj, fn) {\n if (obj == null) return;\n var entries = typeof obj === \"string\" ? document.querySelectorAll(obj) : obj.length != null ? obj : [obj];\n for (var i = 0; i < entries.length; i++) {\n fn(entries[i]);\n }\n}\nfunction _store(obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n obj.__ta[event][g] = fn;\n fn.__tauid = g;\n return g;\n}\nfunction _unstore(obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n fn.__taUnstore && fn.__taUnstore();\n}\nvar NOT_SELECTOR_REGEX = /:not\\(([^)]+)\\)/;\nfunction _curryChildFilter(children, obj, fn, evt) {\n if (children == null) {\n return fn;\n } else {\n var c = children.split(\",\"),\n pc = [],\n nc = [];\n forEach(c, function (sel) {\n var m = sel.match(NOT_SELECTOR_REGEX);\n if (m != null) {\n nc.push(m[1]);\n } else {\n pc.push(sel);\n }\n });\n if (nc.length > 0 && pc.length === 0) {\n pc.push(WILDCARD);\n }\n var _fn = function _fn(e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e);\n var done = false;\n var target = t;\n var pathInfo = _pi(e, t, obj, children != null);\n if (pathInfo.end != -1) {\n for (var p = 0; !done && p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < nc.length; i++) {\n if (matchesSelector(target, nc[i], obj)) {\n return;\n }\n }\n for (var _i = 0; !done && _i < pc.length; _i++) {\n if (matchesSelector(target, pc[_i], obj)) {\n fn.apply(target, [e, target]);\n done = true;\n break;\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n}\nfunction registerExtraFunction(fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n}\nvar DefaultHandler = function DefaultHandler(obj, evt, fn, children, options) {\n if (isTouchDevice() && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn, fn, options);\n }\n if (evt === EVENT_FOCUS && obj.getAttribute(ATTRIBUTE_TABINDEX) == null) {\n obj.setAttribute(ATTRIBUTE_TABINDEX, \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn, options);\n};\nvar _tapProfiles = (_tapProfiles2 = {}, _defineProperty(_tapProfiles2, EVENT_TAP, {\n touches: 1,\n taps: 1\n}), _defineProperty(_tapProfiles2, EVENT_DBL_TAP, {\n touches: 1,\n taps: 2\n}), _defineProperty(_tapProfiles2, EVENT_CONTEXTMENU, {\n touches: 2,\n taps: 1\n}), _tapProfiles2);\nfunction meeHelper(type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [evt]);\n }\n }\n}\nvar TapHandler = function () {\n function TapHandler() {\n _classCallCheck(this, TapHandler);\n }\n _createClass(TapHandler, null, [{\n key: \"generate\",\n value: function generate(clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n if (evt == EVENT_CONTEXTMENU && isMouseDevice()) DefaultHandler(obj, evt, fn, children);else {\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function down(e) {\n var target = _t(e),\n pathInfo = _pi(e, target, obj, children != null),\n finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break;\n }\n }\n }\n },\n up = function up(e) {\n if (tt.down) {\n var target = _t(e),\n currentTarget,\n pathInfo;\n tt.taps++;\n var tc = touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [e, currentTarget]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function clearSingle() {\n tt.down = false;\n },\n clearDouble = function clearDouble() {\n tt.taps = 0;\n };\n obj.__taTapHandler.downHandler = down;\n obj.__taTapHandler.upHandler = up;\n DefaultHandler(obj, EVENT_MOUSEDOWN, down);\n DefaultHandler(obj, EVENT_MOUSEUP, up);\n }\n obj.__taTapHandler.downSelectors.push(children);\n obj.__taTapHandler[evt].push([fn, children]);\n fn.__taUnstore = function () {\n if (obj.__taTapHandler != null) {\n removeWithFunction(obj.__taTapHandler.downSelectors, function (ds) {\n return ds === children;\n });\n _d(obj.__taTapHandler[evt], fn);\n if (obj.__taTapHandler.downSelectors.length === 0) {\n _unbind(obj, EVENT_MOUSEDOWN, obj.__taTapHandler.downHandler);\n _unbind(obj, EVENT_MOUSEUP, obj.__taTapHandler.upHandler);\n delete obj.__taTapHandler;\n }\n }\n };\n }\n };\n }\n }]);\n return TapHandler;\n}();\nvar MouseEnterExitHandler = function () {\n function MouseEnterExitHandler() {\n _classCallCheck(this, MouseEnterExitHandler);\n }\n _createClass(MouseEnterExitHandler, null, [{\n key: \"generate\",\n value: function generate() {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n obj.__tamee = {\n over: false,\n mouseenter: [],\n mouseexit: []\n };\n var over = function over(e) {\n var t = _t(e);\n if (children == null && t == obj && !obj.__tamee.over || matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over)) {\n meeHelper(EVENT_MOUSEENTER, e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function out(e) {\n var t = _t(e);\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector(e.relatedTarget || e.toElement, \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(EVENT_MOUSEEXIT, e, obj, t);\n }\n }\n };\n _bind(obj, EVENT_MOUSEOVER, _curryChildFilter(children, obj, over, EVENT_MOUSEOVER), over);\n _bind(obj, EVENT_MOUSEOUT, _curryChildFilter(children, obj, out, EVENT_MOUSEOUT), out);\n }\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n }\n }]);\n return MouseEnterExitHandler;\n}();\nvar EventManager = function () {\n function EventManager(params) {\n _classCallCheck(this, EventManager);\n _defineProperty(this, \"clickThreshold\", void 0);\n _defineProperty(this, \"dblClickThreshold\", void 0);\n _defineProperty(this, \"tapHandler\", void 0);\n _defineProperty(this, \"mouseEnterExitHandler\", void 0);\n params = params || {};\n this.clickThreshold = params.clickThreshold || 250;\n this.dblClickThreshold = params.dblClickThreshold || 450;\n this.mouseEnterExitHandler = MouseEnterExitHandler.generate();\n this.tapHandler = TapHandler.generate(this.clickThreshold, this.dblClickThreshold);\n }\n _createClass(EventManager, [{\n key: \"_doBind\",\n value: function _doBind(el, evt, fn, children, options) {\n if (fn == null) return;\n var jel = el;\n if (evt === EVENT_TAP || evt === EVENT_DBL_TAP || evt === EVENT_CONTEXTMENU) {\n this.tapHandler(jel, evt, fn, children, options);\n } else if (evt === EVENT_MOUSEENTER || evt == EVENT_MOUSEEXIT) this.mouseEnterExitHandler(jel, evt, fn, children, options);else {\n DefaultHandler(jel, evt, fn, children, options);\n }\n }\n }, {\n key: \"on\",\n value: function on(el, event, children, fn, options) {\n var _c = fn == null ? null : children,\n _f = fn == null ? children : fn;\n this._doBind(el, event, _f, _c, options);\n return this;\n }\n }, {\n key: \"off\",\n value: function off(el, event, fn) {\n _unbind(el, event, fn);\n return this;\n }\n }, {\n key: \"trigger\",\n value: function trigger(el, event, originalEvent, payload, detail) {\n var originalIsMouse = isMouseDevice() && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n var eventToBind = isTouchDevice() && !isMouseDevice() && touchMap[event] ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice() && !isMouseDevice() && touchMap[event]);\n var pl = pageLocation(originalEvent),\n sl = screenLocation(originalEvent),\n cl = clientLocation(originalEvent);\n _each$1(el, function (_el) {\n var evt;\n originalEvent = originalEvent || {\n screenX: sl.x,\n screenY: sl.y,\n clientX: cl.x,\n clientY: cl.y\n };\n var _decorate = function _decorate(_evt) {\n if (payload) {\n _evt.payload = payload;\n }\n };\n var eventGenerators = {\n \"TouchEvent\": function TouchEvent(evt) {\n var touchList = _touchAndList(_el, pl.x, pl.y, sl.x, sl.y, cl.x, cl.y),\n init = evt.initTouchEvent || evt.initEvent;\n init(eventToBind, true, true, window, null, sl.x, sl.y, cl.x, cl.y, false, false, false, false, touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function MouseEvents(evt) {\n evt.initMouseEvent(eventToBind, true, true, window, detail == null ? 1 : detail, sl.x, sl.y, cl.x, cl.y, false, false, false, false, 1, _el);\n }\n };\n var ite = !bindingAMouseEvent && !originalIsMouse && isTouchDevice() && touchMap[event],\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n });\n return this;\n }\n }]);\n return EventManager;\n}();\nfunction setForceTouchEvents(value) {\n forceTouchEvents = value;\n}\nfunction setForceMouseEvents(value) {\n forceMouseEvents = value;\n}\n\nvar segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1]];\nvar inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1]];\nvar TWO_PI = 2 * Math.PI;\nfunction add(p1, p2) {\n return {\n x: p1.x + p2.x,\n y: p1.y + p2.y\n };\n}\nfunction subtract(p1, p2) {\n return {\n x: p1.x - p2.x,\n y: p1.y - p2.y\n };\n}\nfunction gradient(p1, p2) {\n if (p2.x === p1.x) return p2.y > p1.y ? Infinity : -Infinity;else if (p2.y === p1.y) return p2.x > p1.x ? 0 : -0;else return (p2.y - p1.y) / (p2.x - p1.x);\n}\nfunction normal(p1, p2) {\n return -1 / gradient(p1, p2);\n}\nfunction lineLength(p1, p2) {\n return Math.sqrt(Math.pow(p2.y - p1.y, 2) + Math.pow(p2.x - p1.x, 2));\n}\nfunction quadrant(p1, p2) {\n if (p2.x > p1.x) {\n return p2.y > p1.y ? 2 : 1;\n } else if (p2.x == p1.x) {\n return p2.y > p1.y ? 2 : 1;\n } else {\n return p2.y > p1.y ? 3 : 4;\n }\n}\nfunction theta(p1, p2) {\n var m = gradient(p1, p2),\n t = Math.atan(m),\n s = quadrant(p1, p2);\n if (s == 4 || s == 3) t += Math.PI;\n if (t < 0) t += 2 * Math.PI;\n return t;\n}\nfunction intersects(r1, r2) {\n var x1 = r1.x,\n x2 = r1.x + r1.w,\n y1 = r1.y,\n y2 = r1.y + r1.h,\n a1 = r2.x,\n a2 = r2.x + r2.w,\n b1 = r2.y,\n b2 = r2.y + r2.h;\n return x1 <= a1 && a1 <= x2 && y1 <= b1 && b1 <= y2 || x1 <= a2 && a2 <= x2 && y1 <= b1 && b1 <= y2 || x1 <= a1 && a1 <= x2 && y1 <= b2 && b2 <= y2 || x1 <= a2 && a1 <= x2 && y1 <= b2 && b2 <= y2 || a1 <= x1 && x1 <= a2 && b1 <= y1 && y1 <= b2 || a1 <= x2 && x2 <= a2 && b1 <= y1 && y1 <= b2 || a1 <= x1 && x1 <= a2 && b1 <= y2 && y2 <= b2 || a1 <= x2 && x1 <= a2 && b1 <= y2 && y2 <= b2;\n}\nfunction toABC(line) {\n var A = line[1].y - line[0].y;\n var B = line[0].x - line[1].x;\n return {\n A: A,\n B: B,\n C: fixPrecision(A * line[0].x + B * line[0].y)\n };\n}\nfunction fixPrecision(n, digits) {\n digits = digits == null ? 3 : digits;\n return Math.floor(n * Math.pow(10, digits)) / Math.pow(10, digits);\n}\nfunction lineIntersection(l1, l2) {\n var abc1 = toABC(l1),\n abc2 = toABC(l2),\n det = abc1.A * abc2.B - abc2.A * abc1.B;\n if (det == 0) {\n return null;\n } else {\n var candidate = {\n x: Math.round((abc2.B * abc1.C - abc1.B * abc2.C) / det),\n y: Math.round((abc1.A * abc2.C - abc2.A * abc1.C) / det)\n },\n l1xmin = Math.floor(Math.min(l1[0].x, l1[1].x)),\n l1xmax = Math.round(Math.max(l1[0].x, l1[1].x)),\n l1ymin = Math.floor(Math.min(l1[0].y, l1[1].y)),\n l1ymax = Math.round(Math.max(l1[0].y, l1[1].y)),\n l2xmin = Math.floor(Math.min(l2[0].x, l2[1].x)),\n l2xmax = Math.round(Math.max(l2[0].x, l2[1].x)),\n l2ymin = Math.floor(Math.min(l2[0].y, l2[1].y)),\n l2ymax = Math.round(Math.max(l2[0].y, l2[1].y));\n if (candidate.x >= l1xmin && candidate.x <= l1xmax && candidate.y >= l1ymin && candidate.y <= l1ymax && candidate.x >= l2xmin && candidate.x <= l2xmax && candidate.y >= l2ymin && candidate.y <= l2ymax) {\n return candidate;\n } else {\n return null;\n }\n }\n}\nfunction lineRectangleIntersection(line, r) {\n var out = [],\n rectangleLines = [[{\n x: r.x,\n y: r.y\n }, {\n x: r.x + r.w,\n y: r.y\n }], [{\n x: r.x + r.w,\n y: r.y\n }, {\n x: r.x + r.w,\n y: r.y + r.h\n }], [{\n x: r.x,\n y: r.y\n }, {\n x: r.x,\n y: r.y + r.h\n }], [{\n x: r.x,\n y: r.y + r.h\n }, {\n x: r.x + r.w,\n y: r.y + r.h\n }]];\n forEach(rectangleLines, function (rLine) {\n var intersection = lineIntersection(line, rLine);\n if (intersection != null) {\n out.push(intersection);\n }\n });\n return out;\n}\nfunction encloses(r1, r2, allowSharedEdges) {\n var x1 = r1.x,\n x2 = r1.x + r1.w,\n y1 = r1.y,\n y2 = r1.y + r1.h,\n a1 = r2.x,\n a2 = r2.x + r2.w,\n b1 = r2.y,\n b2 = r2.y + r2.h,\n c = function c(v1, v2, v3, v4) {\n return allowSharedEdges ? v1 <= v2 && v3 >= v4 : v1 < v2 && v3 > v4;\n };\n return c(x1, a1, x2, a2) && c(y1, b1, y2, b2);\n}\nfunction pointOnLine(fromPoint, toPoint, distance) {\n var m = gradient(fromPoint, toPoint),\n s = quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? segmentMultipliers[s] : inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return {\n x: fromPoint.x + x,\n y: fromPoint.y + y\n };\n}\nfunction perpendicularLineTo(fromPoint, toPoint, length) {\n var m = gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{\n x: toPoint.x + x,\n y: toPoint.y + y\n }, {\n x: toPoint.x - x,\n y: toPoint.y - y\n }];\n}\nfunction snapToGrid(pos, grid, thresholdX, thresholdY) {\n thresholdX = thresholdX == null ? grid.thresholdX == null ? grid.w / 2 : grid.thresholdX : thresholdX;\n thresholdY = thresholdY == null ? grid.thresholdY == null ? grid.h / 2 : grid.thresholdY : thresholdY;\n var _dx = Math.floor(pos.x / grid.w),\n _dxl = grid.w * _dx,\n _dxt = _dxl + grid.w,\n x = Math.abs(pos.x - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos.x) <= thresholdX ? _dxt : pos.x;\n var _dy = Math.floor(pos.y / grid.h),\n _dyl = grid.h * _dy,\n _dyt = _dyl + grid.h,\n y = Math.abs(pos.y - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos.y) <= thresholdY ? _dyt : pos.y;\n return {\n x: x,\n y: y\n };\n}\n\nfunction findDelegateElement(parentElement, childElement, selector) {\n if (matchesSelector$1(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector$1(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n}\nfunction _assignId(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n}\nfunction isInsideParent(instance, _el, pos) {\n var p = _el.parentNode,\n s = instance.getSize(p),\n ss = instance.getSize(_el),\n leftEdge = pos.x,\n rightEdge = leftEdge + ss.w,\n topEdge = pos.y,\n bottomEdge = topEdge + ss.h;\n return rightEdge > 0 && leftEdge < s.w && bottomEdge > 0 && topEdge < s.h;\n}\nfunction findMatchingSelector(availableSelectors, parentElement, childElement) {\n var el = null;\n var draggableId = parentElement.getAttribute(\"katavorio-draggable\"),\n prefix = draggableId != null ? \"[katavorio-draggable='\" + draggableId + \"'] \" : \"\";\n for (var i = 0; i < availableSelectors.length; i++) {\n el = findDelegateElement(parentElement, childElement, prefix + availableSelectors[i].selector);\n if (el != null) {\n if (availableSelectors[i].filter) {\n var matches = matchesSelector$1(childElement, availableSelectors[i].filter, el),\n exclude = availableSelectors[i].filterExclude === true;\n if (exclude && !matches || matches) {\n return null;\n }\n }\n return [availableSelectors[i], el];\n }\n }\n return null;\n}\nvar EVENT_START = \"start\";\nvar EVENT_BEFORE_START = \"beforeStart\";\nvar EVENT_DRAG = \"drag\";\nvar EVENT_DROP = \"drop\";\nvar EVENT_OVER = \"over\";\nvar EVENT_OUT = \"out\";\nvar EVENT_STOP = \"stop\";\nvar ATTRIBUTE_DRAGGABLE = \"katavorio-draggable\";\nvar CLASS_DRAGGABLE$1 = ATTRIBUTE_DRAGGABLE;\nvar DEFAULT_GRID_X = 10;\nvar DEFAULT_GRID_Y = 10;\nvar TRUE = function TRUE() {\n return true;\n};\nvar FALSE = function FALSE() {\n return false;\n};\nvar _classes = {\n delegatedDraggable: \"katavorio-delegated-draggable\",\n draggable: CLASS_DRAGGABLE$1,\n drag: \"katavorio-drag\",\n selected: \"katavorio-drag-selected\",\n noSelect: \"katavorio-drag-no-select\",\n ghostProxy: \"katavorio-ghost-proxy\",\n clonedDrag: \"katavorio-clone-drag\"\n};\nvar PositioningStrategies;\n(function (PositioningStrategies) {\n PositioningStrategies[\"absolutePosition\"] = \"absolutePosition\";\n PositioningStrategies[\"transform\"] = \"transform\";\n PositioningStrategies[\"xyAttributes\"] = \"xyAttributes\";\n})(PositioningStrategies || (PositioningStrategies = {}));\nvar positionerSetters = new Map();\npositionerSetters.set(PositioningStrategies.absolutePosition, function (el, p) {\n el.style.left = \"\".concat(p.x, \"px\");\n el.style.top = \"\".concat(p.y, \"px\");\n});\npositionerSetters.set(PositioningStrategies.xyAttributes, function (el, p) {\n el.setAttribute(\"x\", \"\".concat(p.x));\n el.setAttribute(\"y\", \"\".concat(p.y));\n});\nvar positionerGetters = new Map();\npositionerGetters.set(PositioningStrategies.absolutePosition, function (el) {\n return {\n x: el.offsetLeft,\n y: el.offsetTop\n };\n});\npositionerGetters.set(PositioningStrategies.xyAttributes, function (el) {\n return {\n x: parseFloat(el.getAttribute(\"x\")),\n y: parseFloat(el.getAttribute(\"y\"))\n };\n});\nvar sizeSetters = new Map();\nsizeSetters.set(PositioningStrategies.absolutePosition, function (el, s) {\n el.style.width = \"\".concat(s.w, \"px\");\n el.style.height = \"\".concat(s.h, \"px\");\n});\nsizeSetters.set(PositioningStrategies.xyAttributes, function (el, s) {\n el.setAttribute(\"width\", \"\".concat(s.w));\n el.setAttribute(\"height\", \"\".concat(s.h));\n});\nvar sizeGetters = new Map();\nsizeGetters.set(PositioningStrategies.absolutePosition, function (el) {\n return {\n w: el.offsetWidth,\n h: el.offsetHeight\n };\n});\nsizeGetters.set(PositioningStrategies.xyAttributes, function (el) {\n return {\n w: parseFloat(el.getAttribute(\"width\")),\n h: parseFloat(el.getAttribute(\"height\"))\n };\n});\nvar _events = [EVENT_STOP, EVENT_START, EVENT_DRAG, EVENT_DROP, EVENT_OVER, EVENT_OUT, EVENT_BEFORE_START];\nvar _devNull = function _devNull() {};\nvar _each = function _each(obj, fn) {\n if (obj == null) return;\n obj = !isString(obj) && obj.tagName == null && obj.length != null ? obj : [obj];\n for (var i = 0; i < obj.length; i++) {\n fn.apply(obj[i], [obj[i]]);\n }\n};\nvar _inputFilter = function _inputFilter(e, el, collicat) {\n var t = e.srcElement || e.target;\n return !matchesSelector$1(t, collicat.getInputFilterSelector(), el);\n};\nvar Base = function () {\n function Base(el, manager) {\n _classCallCheck(this, Base);\n this.el = el;\n this.manager = manager;\n _defineProperty(this, \"_class\", void 0);\n _defineProperty(this, \"uuid\", uuid());\n _defineProperty(this, \"enabled\", true);\n _defineProperty(this, \"scopes\", []);\n _defineProperty(this, \"eventManager\", void 0);\n this.eventManager = manager.eventManager;\n }\n _createClass(Base, [{\n key: \"setEnabled\",\n value: function setEnabled(e) {\n this.enabled = e;\n }\n }, {\n key: \"isEnabled\",\n value: function isEnabled() {\n return this.enabled;\n }\n }, {\n key: \"toggleEnabled\",\n value: function toggleEnabled() {\n this.enabled = !this.enabled;\n }\n }, {\n key: \"addScope\",\n value: function addScope(scopes) {\n var m = {};\n _each(this.scopes, function (s) {\n m[s] = true;\n });\n _each(scopes ? scopes.split(/\\s+/) : [], function (s) {\n m[s] = true;\n });\n this.scopes.length = 0;\n for (var i in m) {\n this.scopes.push(i);\n }\n }\n }, {\n key: \"removeScope\",\n value: function removeScope(scopes) {\n var m = {};\n _each(this.scopes, function (s) {\n m[s] = true;\n });\n _each(scopes ? scopes.split(/\\s+/) : [], function (s) {\n delete m[s];\n });\n this.scopes.length = 0;\n for (var i in m) {\n this.scopes.push(i);\n }\n }\n }, {\n key: \"toggleScope\",\n value: function toggleScope(scopes) {\n var m = {};\n _each(this.scopes, function (s) {\n m[s] = true;\n });\n _each(scopes ? scopes.split(/\\s+/) : [], function (s) {\n if (m[s]) delete m[s];else m[s] = true;\n });\n this.scopes.length = 0;\n for (var i in m) {\n this.scopes.push(i);\n }\n }\n }]);\n return Base;\n}();\nfunction getConstrainingRectangle(el) {\n return {\n w: el.parentNode.offsetWidth + el.parentNode.scrollLeft,\n h: el.parentNode.offsetHeight + el.parentNode.scrollTop\n };\n}\nvar ContainmentType;\n(function (ContainmentType) {\n ContainmentType[\"notNegative\"] = \"notNegative\";\n ContainmentType[\"parent\"] = \"parent\";\n ContainmentType[\"parentEnclosed\"] = \"parentEnclosed\";\n})(ContainmentType || (ContainmentType = {}));\nvar Drag = function (_Base) {\n _inherits(Drag, _Base);\n var _super = _createSuper(Drag);\n function Drag(el, params, manager) {\n var _this;\n _classCallCheck(this, Drag);\n _this = _super.call(this, el, manager);\n _defineProperty(_assertThisInitialized(_this), \"_class\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"rightButtonCanDrag\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"consumeStartEvent\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"clone\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"scroll\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"trackScroll\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_downAt\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_posAtDown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_pagePosAtDown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_pageDelta\", {\n x: 0,\n y: 0\n });\n _defineProperty(_assertThisInitialized(_this), \"_moving\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_lastPosition\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_lastScrollValues\", {\n x: 0,\n y: 0\n });\n _defineProperty(_assertThisInitialized(_this), \"_initialScroll\", {\n x: 0,\n y: 0\n });\n _defineProperty(_assertThisInitialized(_this), \"_size\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_currentParentPosition\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ghostParentPosition\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_dragEl\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_multipleDrop\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ghostProxyOffsets\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ghostDx\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ghostDy\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_isConstrained\", false);\n _defineProperty(_assertThisInitialized(_this), \"_ghostProxyParent\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_useGhostProxy\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ghostProxyFunction\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_activeSelectorParams\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_availableSelectors\", []);\n _defineProperty(_assertThisInitialized(_this), \"_canDrag\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_consumeFilteredEvents\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_parent\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_ignoreZoom\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_filters\", {});\n _defineProperty(_assertThisInitialized(_this), \"_constrainRect\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementToDrag\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"downListener\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"moveListener\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"upListener\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"scrollTracker\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"listeners\", {\n \"start\": [],\n \"drag\": [],\n \"stop\": [],\n \"over\": [],\n \"out\": [],\n \"beforeStart\": [],\n \"revert\": []\n });\n _this._class = _this.manager.css.draggable;\n addClass(_this.el, _this._class);\n _this.downListener = _this._downListener.bind(_assertThisInitialized(_this));\n _this.upListener = _this._upListener.bind(_assertThisInitialized(_this));\n _this.moveListener = _this._moveListener.bind(_assertThisInitialized(_this));\n _this.rightButtonCanDrag = params.rightButtonCanDrag === true;\n _this.consumeStartEvent = params.consumeStartEvent !== false;\n _this._dragEl = _this.el;\n _this.clone = params.clone === true;\n _this.scroll = params.scroll === true;\n _this.trackScroll = params.trackScroll !== false;\n _this._multipleDrop = params.multipleDrop !== false;\n _this._canDrag = params.canDrag || TRUE;\n _this._consumeFilteredEvents = params.consumeFilteredEvents;\n _this._parent = params.parent;\n _this._ignoreZoom = params.ignoreZoom === true;\n _this._ghostProxyParent = params.ghostProxyParent;\n if (_this.trackScroll) {\n _this.scrollTracker = _this._trackScroll.bind(_assertThisInitialized(_this));\n document.addEventListener(\"scroll\", _this.scrollTracker);\n }\n if (params.ghostProxy === true) {\n _this._useGhostProxy = TRUE;\n } else {\n if (params.ghostProxy && typeof params.ghostProxy === \"function\") {\n _this._useGhostProxy = params.ghostProxy;\n } else {\n _this._useGhostProxy = function (container, dragEl) {\n if (_this._activeSelectorParams && _this._activeSelectorParams.useGhostProxy) {\n return _this._activeSelectorParams.useGhostProxy(container, dragEl);\n } else {\n return false;\n }\n };\n }\n }\n if (params.makeGhostProxy) {\n _this._ghostProxyFunction = params.makeGhostProxy;\n } else {\n _this._ghostProxyFunction = function (el) {\n if (_this._activeSelectorParams && _this._activeSelectorParams.makeGhostProxy) {\n return _this._activeSelectorParams.makeGhostProxy(el);\n } else {\n return el.cloneNode(true);\n }\n };\n }\n if (params.selector) {\n var draggableId = _this.el.getAttribute(ATTRIBUTE_DRAGGABLE);\n if (draggableId == null) {\n draggableId = \"\" + new Date().getTime();\n _this.el.setAttribute(\"katavorio-draggable\", draggableId);\n }\n _this._availableSelectors.push(params);\n }\n _this.eventManager.on(_this.el, EVENT_MOUSEDOWN, _this.downListener);\n return _this;\n }\n _createClass(Drag, [{\n key: \"_trackScroll\",\n value: function _trackScroll(e) {\n if (this._moving) {\n var currentScrollValues = {\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop\n },\n dsx = currentScrollValues.x - this._lastScrollValues.x,\n dsy = currentScrollValues.y - this._lastScrollValues.y,\n _pos = {\n x: dsx + this._lastPosition.x,\n y: dsy + this._lastPosition.y\n },\n dx = _pos.x - this._downAt.x,\n dy = _pos.y - this._downAt.y,\n _z = this._ignoreZoom ? 1 : this.manager.getZoom();\n if (this._dragEl && this._dragEl.parentNode) {\n dx += this._dragEl.parentNode.scrollLeft - this._initialScroll.x;\n dy += this._dragEl.parentNode.scrollTop - this._initialScroll.y;\n }\n dx /= _z;\n dy /= _z;\n this.moveBy(dx, dy, e);\n this._lastPosition = _pos;\n this._lastScrollValues = currentScrollValues;\n }\n }\n }, {\n key: \"on\",\n value: function on(evt, fn) {\n if (this.listeners[evt]) {\n this.listeners[evt].push(fn);\n }\n }\n }, {\n key: \"off\",\n value: function off(evt, fn) {\n if (this.listeners[evt]) {\n var l = [];\n for (var i = 0; i < this.listeners[evt].length; i++) {\n if (this.listeners[evt][i] !== fn) {\n l.push(this.listeners[evt][i]);\n }\n }\n this.listeners[evt] = l;\n }\n }\n }, {\n key: \"_upListener\",\n value: function _upListener(e) {\n if (this._downAt) {\n this._downAt = null;\n this.eventManager.off(document, EVENT_MOUSEMOVE, this.moveListener);\n this.eventManager.off(document, EVENT_MOUSEUP, this.upListener);\n removeClass(document.body, _classes.noSelect);\n this.unmark(e);\n this.stop(e);\n this._moving = false;\n if (this.clone) {\n this._dragEl && this._dragEl.parentNode && this._dragEl.parentNode.removeChild(this._dragEl);\n this._dragEl = null;\n } else {\n if (this._activeSelectorParams && this._activeSelectorParams.revertFunction) {\n if (this._activeSelectorParams.revertFunction(this._dragEl, this.manager.getPosition(this._dragEl)) === true) {\n this.manager.setPosition(this._dragEl, this._posAtDown);\n this._dispatch(EVENT_REVERT, this._dragEl);\n }\n }\n }\n }\n }\n }, {\n key: \"_downListener\",\n value: function _downListener(e) {\n if (e.defaultPrevented) {\n return;\n }\n var isNotRightClick = this.rightButtonCanDrag || e.which !== 3 && e.button !== 2;\n if (isNotRightClick && this.isEnabled() && this._canDrag()) {\n var _f = this._testFilter(e) && _inputFilter(e, this.el, this.manager);\n if (_f) {\n this._activeSelectorParams = null;\n this._elementToDrag = null;\n if (this._availableSelectors.length === 0) {\n console.log(\"JSPLUMB: no available drag selectors\");\n }\n var eventTarget = e.target || e.srcElement;\n var match = findMatchingSelector(this._availableSelectors, this.el, eventTarget);\n if (match != null) {\n this._activeSelectorParams = match[0];\n this._elementToDrag = match[1];\n }\n if (this._activeSelectorParams == null || this._elementToDrag == null) {\n return;\n }\n var initial = this._activeSelectorParams.dragInit ? this._activeSelectorParams.dragInit(this._elementToDrag, e) : null;\n if (initial != null) {\n this._elementToDrag = initial;\n }\n if (this.clone) {\n this._dragEl = this._elementToDrag.cloneNode(true);\n addClass(this._dragEl, _classes.clonedDrag);\n this._dragEl.setAttribute(\"id\", null);\n this._dragEl.style.position = \"absolute\";\n if (this._parent != null) {\n var _p2 = this.manager.getPosition(this.el);\n this._dragEl.style.left = _p2.x + \"px\";\n this._dragEl.style.top = _p2.y + \"px\";\n this._parent.appendChild(this._dragEl);\n } else {\n var b = offsetRelativeToRoot(this._elementToDrag);\n this._dragEl.style.left = b.x + \"px\";\n this._dragEl.style.top = b.y + \"px\";\n document.body.appendChild(this._dragEl);\n }\n } else {\n this._dragEl = this._elementToDrag;\n }\n if (this.consumeStartEvent) {\n consume(e);\n }\n this._downAt = pageLocation(e);\n if (this._dragEl && this._dragEl.parentNode) {\n this._initialScroll = {\n x: this._dragEl.parentNode.scrollLeft,\n y: this._dragEl.parentNode.scrollTop\n };\n }\n this._posAtDown = this.manager.getPosition(this._dragEl);\n this._pagePosAtDown = offsetRelativeToRoot(this._dragEl);\n this._pageDelta = {\n x: this._pagePosAtDown.x - this._posAtDown.x,\n y: this._pagePosAtDown.y - this._posAtDown.y\n };\n this._size = this.manager.getSize(this._dragEl);\n this.eventManager.on(document, EVENT_MOUSEMOVE, this.moveListener);\n this.eventManager.on(document, EVENT_MOUSEUP, this.upListener);\n addClass(document.body, _classes.noSelect);\n this._dispatch(EVENT_BEFORE_START, {\n el: this.el,\n pos: this._posAtDown,\n e: e,\n drag: this,\n size: this._size\n });\n } else if (this._consumeFilteredEvents) {\n consume(e);\n }\n }\n }\n }, {\n key: \"_moveListener\",\n value: function _moveListener(e) {\n if (this._downAt) {\n if (!this._moving) {\n var dispatchResult = this._dispatch(EVENT_START, {\n el: this.el,\n pos: this._posAtDown,\n e: e,\n drag: this,\n size: this._size\n });\n if (dispatchResult !== false) {\n if (!this._downAt) {\n return;\n }\n this.mark(dispatchResult);\n this._moving = true;\n } else {\n this.abort();\n }\n }\n if (this._downAt) {\n var _pos2 = pageLocation(e),\n dx = _pos2.x - this._downAt.x,\n dy = _pos2.y - this._downAt.y,\n _z2 = this._ignoreZoom ? 1 : this.manager.getZoom();\n this._lastPosition = {\n x: _pos2.x,\n y: _pos2.y\n };\n this._lastScrollValues = {\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop\n };\n if (this._dragEl && this._dragEl.parentNode) {\n dx += this._dragEl.parentNode.scrollLeft - this._initialScroll.x;\n dy += this._dragEl.parentNode.scrollTop - this._initialScroll.y;\n }\n dx /= _z2;\n dy /= _z2;\n this.moveBy(dx, dy, e);\n }\n }\n }\n }, {\n key: \"getDragDelta\",\n value: function getDragDelta() {\n if (this._posAtDown != null && this._downAt != null) {\n return {\n x: this._downAt.x - this._posAtDown.x,\n y: this._downAt.y - this._posAtDown.y\n };\n } else {\n return {\n x: 0,\n y: 0\n };\n }\n }\n }, {\n key: \"mark\",\n value: function mark(payload) {\n this._posAtDown = this.manager.getPosition(this._dragEl);\n this._pagePosAtDown = offsetRelativeToRoot(this._dragEl);\n this._pageDelta = {\n x: this._pagePosAtDown.x - this._posAtDown.x,\n y: this._pagePosAtDown.y - this._posAtDown.y\n };\n this._size = this.manager.getSize(this._dragEl);\n addClass(this._dragEl, this.manager.css.drag);\n this._constrainRect = getConstrainingRectangle(this._dragEl);\n this._ghostDx = 0;\n this._ghostDy = 0;\n }\n }, {\n key: \"unmark\",\n value: function unmark(e) {\n if (this._isConstrained && this._useGhostProxy(this._elementToDrag, this._dragEl)) {\n this._ghostProxyOffsets = {\n x: this._dragEl.offsetLeft - this._ghostDx,\n y: this._dragEl.offsetTop - this._ghostDy\n };\n this._dragEl.parentNode.removeChild(this._dragEl);\n this._dragEl = this._elementToDrag;\n } else {\n this._ghostProxyOffsets = null;\n }\n removeClass(this._dragEl, this.manager.css.drag);\n this._isConstrained = false;\n }\n }, {\n key: \"moveBy\",\n value: function moveBy(dx, dy, e) {\n var desiredLoc = this.toGrid({\n x: this._posAtDown.x + dx,\n y: this._posAtDown.y + dy\n }),\n cPos = this._doConstrain(desiredLoc, this._dragEl, this._constrainRect, this._size, e);\n if (cPos != null) {\n if (this._useGhostProxy(this.el, this._dragEl)) {\n if (desiredLoc.x !== cPos.x || desiredLoc.y !== cPos.y) {\n if (!this._isConstrained) {\n var gp = this._ghostProxyFunction(this._elementToDrag);\n addClass(gp, _classes.ghostProxy);\n if (this._ghostProxyParent) {\n this._ghostProxyParent.appendChild(gp);\n this._currentParentPosition = offsetRelativeToRoot(this._elementToDrag.parentNode);\n this._ghostParentPosition = offsetRelativeToRoot(this._ghostProxyParent);\n this._ghostDx = this._currentParentPosition.x - this._ghostParentPosition.x;\n this._ghostDy = this._currentParentPosition.y - this._ghostParentPosition.y;\n } else {\n this._elementToDrag.parentNode.appendChild(gp);\n }\n this._dragEl = gp;\n this._isConstrained = true;\n }\n cPos = desiredLoc;\n } else {\n if (this._isConstrained) {\n this._dragEl.parentNode.removeChild(this._dragEl);\n this._dragEl = this._elementToDrag;\n this._isConstrained = false;\n this._currentParentPosition = null;\n this._ghostParentPosition = null;\n this._ghostDx = 0;\n this._ghostDy = 0;\n }\n }\n }\n this.manager.setPosition(this._dragEl, {\n x: cPos.x + this._ghostDx,\n y: cPos.y + this._ghostDy\n });\n this._dispatch(EVENT_DRAG, {\n el: this.el,\n pos: cPos,\n e: e,\n drag: this,\n size: this._size,\n originalPos: this._posAtDown\n });\n }\n }\n }, {\n key: \"abort\",\n value: function abort() {\n if (this._downAt != null) {\n this._upListener();\n }\n }\n }, {\n key: \"getDragElement\",\n value: function getDragElement(retrieveOriginalElement) {\n return retrieveOriginalElement ? this._elementToDrag || this.el : this._dragEl || this.el;\n }\n }, {\n key: \"stop\",\n value: function stop(e, force) {\n if (force || this._moving) {\n var positions = [],\n dPos = this.manager.getPosition(this._dragEl);\n positions.push([this._dragEl, dPos, this, this._size]);\n this._dispatch(EVENT_STOP, {\n el: this._dragEl,\n pos: this._ghostProxyOffsets || dPos,\n finalPos: dPos,\n e: e,\n drag: this,\n selection: positions,\n size: this._size,\n originalPos: {\n x: this._posAtDown.x,\n y: this._posAtDown.y\n }\n });\n } else if (!this._moving) {\n this._activeSelectorParams.dragAbort ? this._activeSelectorParams.dragAbort(this._elementToDrag) : null;\n }\n }\n }, {\n key: \"_dispatch\",\n value: function _dispatch(evt, value) {\n var result = null;\n if (this._activeSelectorParams && this._activeSelectorParams[evt]) {\n result = this._activeSelectorParams[evt](value);\n } else if (this.listeners[evt]) {\n for (var i = 0; i < this.listeners[evt].length; i++) {\n try {\n var v = this.listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n } catch (e) {}\n }\n }\n return result;\n }\n }, {\n key: \"resolveGrid\",\n value: function resolveGrid() {\n var out = {\n grid: null,\n thresholdX: DEFAULT_GRID_X / 2,\n thresholdY: DEFAULT_GRID_Y / 2\n };\n if (this._activeSelectorParams != null && this._activeSelectorParams.grid != null) {\n out.grid = this._activeSelectorParams.grid;\n if (this._activeSelectorParams.snapThreshold != null) {\n out.thresholdX = this._activeSelectorParams.snapThreshold;\n out.thresholdY = this._activeSelectorParams.snapThreshold;\n }\n }\n return out;\n }\n }, {\n key: \"toGrid\",\n value: function toGrid(pos) {\n var _this$resolveGrid = this.resolveGrid(),\n grid = _this$resolveGrid.grid,\n thresholdX = _this$resolveGrid.thresholdX,\n thresholdY = _this$resolveGrid.thresholdY;\n if (grid == null) {\n return pos;\n } else {\n var tx = grid ? grid.w / 2 : thresholdX,\n ty = grid ? grid.h / 2 : thresholdY;\n return snapToGrid(pos, grid, tx, ty);\n }\n }\n }, {\n key: \"setUseGhostProxy\",\n value: function setUseGhostProxy(val) {\n this._useGhostProxy = val ? TRUE : FALSE;\n }\n }, {\n key: \"_doConstrain\",\n value: function _doConstrain(pos, dragEl, _constrainRect, _size, e) {\n if (this._activeSelectorParams != null && this._activeSelectorParams.constrainFunction && typeof this._activeSelectorParams.constrainFunction === \"function\") {\n return this._activeSelectorParams.constrainFunction(pos, dragEl, _constrainRect, _size, e);\n } else {\n return pos;\n }\n }\n }, {\n key: \"_testFilter\",\n value: function _testFilter(e) {\n for (var key in this._filters) {\n var f = this._filters[key];\n var rv = f[0](e);\n if (f[1]) {\n rv = !rv;\n }\n if (!rv) {\n return false;\n }\n }\n return true;\n }\n }, {\n key: \"addFilter\",\n value: function addFilter(f, _exclude) {\n var _this2 = this;\n if (f) {\n var key = _assignId(f);\n this._filters[key] = [function (e) {\n var t = e.srcElement || e.target;\n var m;\n if (isString(f)) {\n m = matchesSelector$1(t, f, _this2.el);\n } else if (typeof f === \"function\") {\n m = f(e, _this2.el);\n }\n return m;\n }, _exclude !== false];\n }\n }\n }, {\n key: \"removeFilter\",\n value: function removeFilter(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete this._filters[key];\n }\n }, {\n key: \"clearAllFilters\",\n value: function clearAllFilters() {\n this._filters = {};\n }\n }, {\n key: \"addSelector\",\n value: function addSelector(params, atStart) {\n if (params.selector) {\n if (atStart) {\n this._availableSelectors.unshift(params);\n } else {\n this._availableSelectors.push(params);\n }\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.eventManager.off(this.el, EVENT_MOUSEDOWN, this.downListener);\n this.eventManager.off(document, EVENT_MOUSEMOVE, this.moveListener);\n this.eventManager.off(document, EVENT_MOUSEUP, this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n if (this.scrollTracker != null) {\n document.removeEventListener(\"scroll\", this.scrollTracker);\n }\n }\n }]);\n return Drag;\n}(Base);\nvar DEFAULT_INPUTS = [\"input\", \"textarea\", \"select\", \"button\", \"option\"];\nvar DEFAULT_INPUT_FILTER_SELECTOR = DEFAULT_INPUTS.join(\",\");\nvar Collicat = function () {\n function Collicat(options) {\n _classCallCheck(this, Collicat);\n _defineProperty(this, \"eventManager\", void 0);\n _defineProperty(this, \"zoom\", 1);\n _defineProperty(this, \"css\", {});\n _defineProperty(this, \"inputFilterSelector\", void 0);\n _defineProperty(this, \"positioningStrategy\", void 0);\n _defineProperty(this, \"_positionSetter\", void 0);\n _defineProperty(this, \"_positionGetter\", void 0);\n _defineProperty(this, \"_sizeSetter\", void 0);\n _defineProperty(this, \"_sizeGetter\", void 0);\n options = options || {};\n this.inputFilterSelector = options.inputFilterSelector || DEFAULT_INPUT_FILTER_SELECTOR;\n this.eventManager = new EventManager();\n this.zoom = options.zoom || 1;\n this.positioningStrategy = options.positioningStrategy || PositioningStrategies.absolutePosition;\n this._positionGetter = positionerGetters.get(this.positioningStrategy);\n this._positionSetter = positionerSetters.get(this.positioningStrategy);\n this._sizeGetter = sizeGetters.get(this.positioningStrategy);\n this._sizeSetter = sizeSetters.get(this.positioningStrategy);\n var _c = options.css || {};\n extend(this.css, _c);\n }\n _createClass(Collicat, [{\n key: \"getPosition\",\n value: function getPosition(el) {\n return this._positionGetter(el);\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(el, p) {\n this._positionSetter(el, p);\n }\n }, {\n key: \"getSize\",\n value: function getSize(el) {\n return this._sizeGetter(el);\n }\n }, {\n key: \"getZoom\",\n value: function getZoom() {\n return this.zoom;\n }\n }, {\n key: \"setZoom\",\n value: function setZoom(z) {\n this.zoom = z;\n }\n }, {\n key: \"_prepareParams\",\n value: function _prepareParams(p) {\n p = p || {};\n var _p = {\n events: {}\n },\n i;\n for (i in p) {\n _p[i] = p[i];\n }\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n return _p;\n }\n }, {\n key: \"getInputFilterSelector\",\n value: function getInputFilterSelector() {\n return this.inputFilterSelector;\n }\n }, {\n key: \"setInputFilterSelector\",\n value: function setInputFilterSelector(selector) {\n this.inputFilterSelector = selector;\n return this;\n }\n }, {\n key: \"draggable\",\n value: function draggable(el, params) {\n if (el._katavorioDrag == null) {\n var _p3 = this._prepareParams(params);\n var d = new Drag(el, _p3, this);\n addClass(el, _classes.delegatedDraggable);\n el._katavorioDrag = d;\n return d;\n } else {\n return el._katavorioDrag;\n }\n }\n }, {\n key: \"destroyDraggable\",\n value: function destroyDraggable(el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.destroy();\n delete el._katavorioDrag;\n }\n }\n }]);\n return Collicat;\n}();\n\nvar CLASS_DRAG_SELECTED = \"jtk-drag-selected\";\nvar DragSelection = function () {\n function DragSelection(instance) {\n _classCallCheck(this, DragSelection);\n this.instance = instance;\n _defineProperty(this, \"_dragSelection\", []);\n _defineProperty(this, \"_dragSizes\", new Map());\n _defineProperty(this, \"_dragElements\", new Map());\n _defineProperty(this, \"_dragElementStartPositions\", new Map());\n _defineProperty(this, \"_dragElementPositions\", new Map());\n _defineProperty(this, \"__activeSet\", void 0);\n }\n _createClass(DragSelection, [{\n key: \"_activeSet\",\n get: function get() {\n if (this.__activeSet == null) {\n return this._dragSelection;\n } else {\n return this.__activeSet;\n }\n }\n }, {\n key: \"length\",\n get: function get() {\n return this._dragSelection.length;\n }\n }, {\n key: \"filterActiveSet\",\n value: function filterActiveSet(fn) {\n var _this = this;\n this.__activeSet = [];\n forEach(this._dragSelection, function (p) {\n if (fn(p)) {\n _this.__activeSet.push(p);\n }\n });\n }\n }, {\n key: \"clear\",\n value: function clear() {\n var _this2 = this;\n this.reset();\n forEach(this._dragSelection, function (p) {\n return _this2.instance.removeClass(p.jel, CLASS_DRAG_SELECTED);\n });\n this._dragSelection.length = 0;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this._dragElementStartPositions.clear();\n this._dragElementPositions.clear();\n this._dragSizes.clear();\n this._dragElements.clear();\n this.__activeSet = null;\n }\n }, {\n key: \"initialisePositions\",\n value: function initialisePositions() {\n var _this3 = this;\n forEach(this._activeSet, function (p) {\n var vp = _this3.instance.viewport.getPosition(p.id);\n var off = {\n x: parseInt(\"\" + p.jel.offsetLeft, 10),\n y: parseInt(\"\" + p.jel.offsetTop, 10)\n };\n _this3._dragElementStartPositions.set(p.id, off);\n _this3._dragElementPositions.set(p.id, off);\n _this3._dragSizes.set(p.id, {\n w: vp.w,\n h: vp.h\n });\n });\n }\n }, {\n key: \"updatePositions\",\n value: function updatePositions(currentPosition, originalPosition, callback) {\n var _this4 = this;\n var dx = currentPosition.x - originalPosition.x,\n dy = currentPosition.y - originalPosition.y;\n forEach(this._activeSet, function (p) {\n var op = _this4._dragElementStartPositions.get(p.id);\n if (op) {\n var x = op.x + dx,\n y = op.y + dy;\n var _s = _this4._dragSizes.get(p.id);\n var _b = {\n x: x,\n y: y,\n w: _s.w,\n h: _s.h\n };\n if (p.jel._jsPlumbParentGroup && p.jel._jsPlumbParentGroup.constrain) {\n var constrainRect = {\n w: p.jel.parentNode.offsetWidth + p.jel.parentNode.scrollLeft,\n h: p.jel.parentNode.offsetHeight + p.jel.parentNode.scrollTop\n };\n _b.x = Math.max(_b.x, 0);\n _b.y = Math.max(_b.y, 0);\n _b.x = Math.min(_b.x, constrainRect.w - _s.w);\n _b.y = Math.min(_b.y, constrainRect.h - _s.h);\n }\n _this4._dragElementPositions.set(p.id, {\n x: x,\n y: y\n });\n p.jel.style.left = _b.x + \"px\";\n p.jel.style.top = _b.y + \"px\";\n callback(p.jel, p.id, _s, _b);\n }\n });\n }\n }, {\n key: \"each\",\n value: function each(f) {\n var _this5 = this;\n forEach(this._activeSet, function (p) {\n var s = _this5._dragSizes.get(p.id);\n var o = _this5._dragElementPositions.get(p.id);\n var orig = _this5._dragElementStartPositions.get(p.id);\n f(p.jel, p.id, o, s, orig);\n });\n }\n }, {\n key: \"add\",\n value: function add(el, id) {\n var jel = el;\n id = id || this.instance.getId(jel);\n var idx = findWithFunction(this._dragSelection, function (p) {\n return p.id === id;\n });\n if (idx === -1) {\n this.instance.addClass(el, CLASS_DRAG_SELECTED);\n this._dragSelection.push({\n id: id,\n jel: jel\n });\n }\n }\n }, {\n key: \"remove\",\n value: function remove(el) {\n var _this6 = this;\n var jel = el;\n this._dragSelection = this._dragSelection.filter(function (p) {\n var out = p.jel !== jel;\n if (!out) {\n _this6.instance.removeClass(p.jel, CLASS_DRAG_SELECTED);\n }\n return out;\n });\n }\n }, {\n key: \"toggle\",\n value: function toggle(el) {\n var jel = el;\n var idx = findWithFunction(this._dragSelection, function (p) {\n return p.jel === jel;\n });\n if (idx !== -1) {\n this.remove(jel);\n } else {\n this.add(el);\n }\n }\n }]);\n return DragSelection;\n}();\n\nvar CLASS_DELEGATED_DRAGGABLE = \"jtk-delegated-draggable\";\nvar CLASS_DRAGGABLE = \"jtk-draggable\";\nvar CLASS_DRAG_CONTAINER = \"jtk-drag\";\nvar CLASS_GHOST_PROXY = \"jtk-ghost-proxy\";\nvar CLASS_DRAG_ACTIVE = \"jtk-drag-active\";\nvar CLASS_DRAGGED = \"jtk-dragged\";\nvar CLASS_DRAG_HOVER = \"jtk-drag-hover\";\nvar DragManager = function () {\n function DragManager(instance, dragSelection, options) {\n var _this = this;\n _classCallCheck(this, DragManager);\n this.instance = instance;\n this.dragSelection = dragSelection;\n _defineProperty(this, \"collicat\", void 0);\n _defineProperty(this, \"drag\", void 0);\n _defineProperty(this, \"_draggables\", {});\n _defineProperty(this, \"_dlist\", []);\n _defineProperty(this, \"_elementsWithEndpoints\", {});\n _defineProperty(this, \"_draggablesForElements\", {});\n _defineProperty(this, \"handlers\", []);\n _defineProperty(this, \"_trackScroll\", void 0);\n _defineProperty(this, \"_filtersToAdd\", []);\n this.collicat = new Collicat({\n zoom: this.instance.currentZoom,\n css: {\n noSelect: this.instance.dragSelectClass,\n delegatedDraggable: CLASS_DELEGATED_DRAGGABLE,\n draggable: CLASS_DRAGGABLE,\n drag: CLASS_DRAG_CONTAINER,\n selected: CLASS_DRAG_SELECTED,\n active: CLASS_DRAG_ACTIVE,\n hover: CLASS_DRAG_HOVER,\n ghostProxy: CLASS_GHOST_PROXY\n }\n });\n this.instance.bind(EVENT_ZOOM, function (z) {\n _this.collicat.setZoom(z);\n });\n options = options || {};\n this._trackScroll = options.trackScroll !== false;\n }\n _createClass(DragManager, [{\n key: \"addHandler\",\n value: function addHandler(handler, dragOptions) {\n var _this2 = this;\n var o = extend({\n selector: handler.selector\n }, dragOptions || {});\n o.start = wrap(o.start, function (p) {\n return handler.onStart(p);\n }, false);\n o.drag = wrap(o.drag, function (p) {\n return handler.onDrag(p);\n });\n o.stop = wrap(o.stop, function (p) {\n return handler.onStop(p);\n });\n var handlerBeforeStart = (handler.onBeforeStart || function (p) {}).bind(handler);\n o.beforeStart = wrap(o.beforeStart, function (p) {\n return handlerBeforeStart(p);\n });\n o.dragInit = function (el, e) {\n return handler.onDragInit(el, e);\n };\n o.dragAbort = function (el) {\n return handler.onDragAbort(el);\n };\n if (handler.useGhostProxy) {\n o.useGhostProxy = handler.useGhostProxy;\n o.makeGhostProxy = handler.makeGhostProxy;\n }\n if (o.constrainFunction == null && o.containment != null) {\n switch (o.containment) {\n case ContainmentType.notNegative:\n {\n o.constrainFunction = function (pos, dragEl, _constrainRect, _size) {\n return {\n x: Math.max(0, Math.min(pos.x)),\n y: Math.max(0, Math.min(pos.y))\n };\n };\n break;\n }\n case ContainmentType.parent:\n {\n var padding = o.containmentPadding || 5;\n o.constrainFunction = function (pos, dragEl, _constrainRect, _size) {\n var x = pos.x < 0 ? 0 : pos.x > _constrainRect.w - padding ? _constrainRect.w - padding : pos.x;\n var y = pos.y < 0 ? 0 : pos.y > _constrainRect.h - padding ? _constrainRect.h - padding : pos.y;\n return {\n x: x,\n y: y\n };\n };\n break;\n }\n case ContainmentType.parentEnclosed:\n {\n o.constrainFunction = function (pos, dragEl, _constrainRect, _size) {\n var x = pos.x < 0 ? 0 : pos.x + _size.w > _constrainRect.w ? _constrainRect.w - _size.w : pos.x;\n var y = pos.y < 0 ? 0 : pos.y + _size.h > _constrainRect.h ? _constrainRect.h - _size.h : pos.y;\n return {\n x: x,\n y: y\n };\n };\n break;\n }\n }\n }\n if (this.drag == null) {\n o.trackScroll = this._trackScroll;\n this.drag = this.collicat.draggable(this.instance.getContainer(), o);\n forEach(this._filtersToAdd, function (filterToAdd) {\n return _this2.drag.addFilter(filterToAdd[0], filterToAdd[1]);\n });\n this.drag.on(EVENT_REVERT, function (el) {\n _this2.instance.revalidate(el);\n });\n } else {\n this.drag.addSelector(o);\n }\n this.handlers.push({\n handler: handler,\n options: o\n });\n handler.init(this.drag);\n }\n }, {\n key: \"addSelector\",\n value: function addSelector(params, atStart) {\n this.drag && this.drag.addSelector(params, atStart);\n }\n }, {\n key: \"addFilter\",\n value: function addFilter(filter, exclude) {\n if (this.drag == null) {\n this._filtersToAdd.push([filter, exclude === true]);\n } else {\n this.drag.addFilter(filter, exclude);\n }\n }\n }, {\n key: \"removeFilter\",\n value: function removeFilter(filter) {\n if (this.drag != null) {\n this.drag.removeFilter(filter);\n }\n }\n }, {\n key: \"setFilters\",\n value: function setFilters(filters) {\n var _this3 = this;\n forEach(filters, function (f) {\n _this3.drag.addFilter(f[0], f[1]);\n });\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var out = [];\n forEach(this.handlers, function (p) {\n p.handler.reset();\n });\n this.handlers.length = 0;\n if (this.drag != null) {\n var currentFilters = this.drag._filters;\n for (var f in currentFilters) {\n out.push([f, currentFilters[f][1]]);\n }\n this.collicat.destroyDraggable(this.instance.getContainer());\n }\n delete this.drag;\n return out;\n }\n }, {\n key: \"setOption\",\n value: function setOption(handler, options) {\n var handlerAndOptions = getWithFunction(this.handlers, function (p) {\n return p.handler === handler;\n });\n if (handlerAndOptions != null) {\n extend(handlerAndOptions.options, options || {});\n }\n }\n }]);\n return DragManager;\n}();\n\nfunction decodeDragGroupSpec(instance, spec) {\n if (isString(spec)) {\n return {\n id: spec,\n active: true\n };\n } else {\n return {\n id: spec.id,\n active: spec.active\n };\n }\n}\nfunction isActiveDragGroupMember(dragGroup, el) {\n var details = getFromSetWithFunction(dragGroup.members, function (m) {\n return m.el === el;\n });\n if (details !== null) {\n return details.active === true;\n } else {\n return false;\n }\n}\nfunction getAncestors(el) {\n var ancestors = [];\n var p = el._jsPlumbParentGroup;\n while (p != null) {\n ancestors.push(p.el);\n p = p.group;\n }\n return ancestors;\n}\nvar ElementDragHandler = function () {\n function ElementDragHandler(instance, _dragSelection) {\n _classCallCheck(this, ElementDragHandler);\n this.instance = instance;\n this._dragSelection = _dragSelection;\n _defineProperty(this, \"selector\", \"> \" + SELECTOR_MANAGED_ELEMENT + \":not(\" + cls(CLASS_OVERLAY) + \")\");\n _defineProperty(this, \"_dragOffset\", null);\n _defineProperty(this, \"_groupLocations\", []);\n _defineProperty(this, \"_intersectingGroups\", []);\n _defineProperty(this, \"_currentDragParentGroup\", null);\n _defineProperty(this, \"_dragGroupByElementIdMap\", {});\n _defineProperty(this, \"_dragGroupMap\", {});\n _defineProperty(this, \"_currentDragGroup\", null);\n _defineProperty(this, \"_currentDragGroupOffsets\", new Map());\n _defineProperty(this, \"_currentDragGroupSizes\", new Map());\n _defineProperty(this, \"_currentDragGroupOriginalPositions\", new Map());\n _defineProperty(this, \"_dragPayload\", null);\n _defineProperty(this, \"drag\", void 0);\n _defineProperty(this, \"originalPosition\", void 0);\n }\n _createClass(ElementDragHandler, [{\n key: \"onDragInit\",\n value: function onDragInit(el) {\n return null;\n }\n }, {\n key: \"onDragAbort\",\n value: function onDragAbort(el) {\n return null;\n }\n }, {\n key: \"getDropGroup\",\n value: function getDropGroup() {\n var dropGroup = null;\n if (this._intersectingGroups.length > 0) {\n var targetGroup = this._intersectingGroups[0].groupLoc.group;\n var intersectingElement = this._intersectingGroups[0].intersectingElement;\n var currentGroup = intersectingElement._jsPlumbParentGroup;\n if (currentGroup !== targetGroup) {\n if (currentGroup == null || !currentGroup.overrideDrop(intersectingElement, targetGroup)) {\n dropGroup = this._intersectingGroups[0];\n }\n }\n }\n return dropGroup;\n }\n }, {\n key: \"onStop\",\n value: function onStop(params) {\n var _this$_currentDragGro,\n _this = this;\n var jel = params.drag.getDragElement();\n var dropGroup = this.getDropGroup();\n var elementsToProcess = [];\n elementsToProcess.push({\n el: jel,\n id: this.instance.getId(jel),\n pos: params.finalPos,\n originalGroup: jel._jsPlumbParentGroup,\n redrawResult: null,\n originalPos: params.originalPos,\n reverted: false,\n dropGroup: dropGroup != null ? dropGroup.groupLoc.group : null\n });\n function addElementToProcess(el, id, currentPos, s, originalPosition) {\n var x = currentPos.x,\n y = currentPos.y;\n if (el._jsPlumbParentGroup && el._jsPlumbParentGroup.constrain) {\n var constrainRect = {\n w: el.parentNode.offsetWidth + el.parentNode.scrollLeft,\n h: el.parentNode.offsetHeight + el.parentNode.scrollTop\n };\n x = Math.max(x, 0);\n y = Math.max(y, 0);\n x = Math.min(x, constrainRect.w - s.w);\n y = Math.min(y, constrainRect.h - s.h);\n currentPos.x = x;\n currentPos.y = y;\n }\n elementsToProcess.push({\n el: el,\n id: id,\n pos: currentPos,\n originalPos: originalPosition,\n originalGroup: el._jsPlumbParentGroup,\n redrawResult: null,\n reverted: false,\n dropGroup: dropGroup === null || dropGroup === void 0 ? void 0 : dropGroup.groupLoc.group\n });\n }\n this._dragSelection.each(function (el, id, o, s, originalPosition) {\n if (el !== params.el) {\n addElementToProcess(el, id, {\n x: o.x,\n y: o.y\n }, s, originalPosition);\n }\n });\n (_this$_currentDragGro = this._currentDragGroup) === null || _this$_currentDragGro === void 0 ? void 0 : _this$_currentDragGro.members.forEach(function (d) {\n if (d.el !== params.el) {\n var offset = _this._currentDragGroupOffsets.get(d.elId);\n var s = _this._currentDragGroupSizes.get(d.elId);\n var pp = {\n x: params.finalPos.x + offset[0].x,\n y: params.finalPos.y + offset[0].y\n };\n addElementToProcess(d.el, d.elId, pp, s, _this._currentDragGroupOriginalPositions.get(d.elId));\n }\n });\n forEach(elementsToProcess, function (p) {\n var wasInGroup = p.originalGroup != null,\n isInOriginalGroup = wasInGroup && isInsideParent(_this.instance, p.el, p.pos),\n parentOffset = {\n x: 0,\n y: 0\n };\n if (wasInGroup && !isInOriginalGroup) {\n if (dropGroup == null) {\n var orphanedPosition = _this._pruneOrOrphan(p, true, true);\n if (orphanedPosition.pos != null) {\n p.pos = orphanedPosition.pos.pos;\n } else {\n if (!orphanedPosition.pruned && p.originalGroup.revert) {\n p.pos = p.originalPos;\n p.reverted = true;\n }\n }\n }\n } else if (wasInGroup && isInOriginalGroup) {\n parentOffset = _this._computeOffsetByParentGroup(p.originalGroup);\n }\n if (dropGroup != null && !isInOriginalGroup) {\n _this.instance.groupManager.addToGroup(dropGroup.groupLoc.group, false, p.el);\n } else {\n p.dropGroup = null;\n }\n if (p.reverted) {\n _this.instance.setPosition(p.el, p.pos);\n }\n p.redrawResult = _this.instance.setElementPosition(p.el, p.pos.x + parentOffset.x, p.pos.y + parentOffset.y);\n _this.instance.removeClass(p.el, CLASS_DRAGGED);\n _this.instance.select({\n source: p.el\n }).removeClass(_this.instance.elementDraggingClass + \" \" + _this.instance.sourceElementDraggingClass, true);\n _this.instance.select({\n target: p.el\n }).removeClass(_this.instance.elementDraggingClass + \" \" + _this.instance.targetElementDraggingClass, true);\n });\n if (elementsToProcess[0].originalGroup != null) {\n var currentGroup = jel._jsPlumbParentGroup;\n if (currentGroup !== elementsToProcess[0].originalGroup) {\n var originalElement = params.drag.getDragElement(true);\n if (elementsToProcess[0].originalGroup.ghost) {\n var o1 = this.instance.getPosition(this.instance.getGroupContentArea(currentGroup));\n var o2 = this.instance.getPosition(this.instance.getGroupContentArea(elementsToProcess[0].originalGroup));\n var o = {\n x: o2.x + params.pos.x - o1.x,\n y: o2.y + params.pos.y - o1.y\n };\n originalElement.style.left = o.x + \"px\";\n originalElement.style.top = o.y + \"px\";\n this.instance.revalidate(originalElement);\n }\n }\n }\n this.instance.fire(EVENT_DRAG_STOP, {\n elements: elementsToProcess,\n e: params.e,\n el: jel,\n payload: this._dragPayload\n });\n this._cleanup();\n }\n }, {\n key: \"_cleanup\",\n value: function _cleanup() {\n var _this2 = this;\n forEach(this._groupLocations, function (groupLoc) {\n _this2.instance.removeClass(groupLoc.el, CLASS_DRAG_ACTIVE);\n _this2.instance.removeClass(groupLoc.el, CLASS_DRAG_HOVER);\n });\n this._currentDragParentGroup = null;\n this._groupLocations.length = 0;\n this.instance.hoverSuspended = false;\n this._dragOffset = null;\n this._dragSelection.reset();\n this._dragPayload = null;\n this._currentDragGroupOffsets.clear();\n this._currentDragGroupSizes.clear();\n this._currentDragGroupOriginalPositions.clear();\n this._currentDragGroup = null;\n }\n }, {\n key: \"reset\",\n value: function reset() {}\n }, {\n key: \"init\",\n value: function init(drag) {\n this.drag = drag;\n }\n }, {\n key: \"onDrag\",\n value: function onDrag(params) {\n var _this3 = this;\n var el = params.drag.getDragElement();\n var id = this.instance.getId(el);\n var finalPos = params.pos;\n var elSize = this.instance.viewport.getPosition(id);\n var ui = {\n x: finalPos.x,\n y: finalPos.y\n };\n this._intersectingGroups.length = 0;\n if (this._dragOffset != null) {\n ui.x += this._dragOffset.x;\n ui.y += this._dragOffset.y;\n }\n var _one = function _one(el, bounds, findIntersectingGroups) {\n if (findIntersectingGroups) {\n var ancestorsOfIntersectingGroups = new Set();\n forEach(_this3._groupLocations, function (groupLoc) {\n if (!ancestorsOfIntersectingGroups.has(groupLoc.group.id) && intersects(bounds, groupLoc.r)) {\n if (groupLoc.group !== _this3._currentDragParentGroup) {\n _this3.instance.addClass(groupLoc.el, CLASS_DRAG_HOVER);\n }\n _this3._intersectingGroups.push({\n groupLoc: groupLoc,\n intersectingElement: params.drag.getDragElement(true),\n d: 0\n });\n forEach(_this3.instance.groupManager.getAncestors(groupLoc.group), function (g) {\n return ancestorsOfIntersectingGroups.add(g.id);\n });\n } else {\n _this3.instance.removeClass(groupLoc.el, CLASS_DRAG_HOVER);\n }\n });\n }\n _this3.instance.setElementPosition(el, bounds.x, bounds.y);\n _this3.instance.fire(EVENT_DRAG_MOVE, {\n el: el,\n e: params.e,\n pos: {\n x: bounds.x,\n y: bounds.y\n },\n originalPosition: _this3.originalPosition,\n payload: _this3._dragPayload\n });\n };\n var elBounds = {\n x: ui.x,\n y: ui.y,\n w: elSize.w,\n h: elSize.h\n };\n _one(el, elBounds, true);\n this._dragSelection.updatePositions(finalPos, this.originalPosition, function (el, id, s, b) {\n _one(el, b, false);\n });\n this._currentDragGroupOffsets.forEach(function (v, k) {\n var s = _this3._currentDragGroupSizes.get(k);\n var _b = {\n x: elBounds.x + v[0].x,\n y: elBounds.y + v[0].y,\n w: s.w,\n h: s.h\n };\n v[1].style.left = _b.x + \"px\";\n v[1].style.top = _b.y + \"px\";\n _one(v[1], _b, false);\n });\n }\n }, {\n key: \"_computeOffsetByParentGroup\",\n value: function _computeOffsetByParentGroup(group) {\n var parentGroupOffset = this.instance.getPosition(group.el);\n var contentArea = group.contentArea;\n if (contentArea !== group.el) {\n var caOffset = this.instance.getPosition(contentArea);\n parentGroupOffset.x += caOffset.x;\n parentGroupOffset.y += caOffset.y;\n }\n if (group.el._jsPlumbParentGroup) {\n var ancestorOffset = this._computeOffsetByParentGroup(group.el._jsPlumbParentGroup);\n parentGroupOffset.x += ancestorOffset.x;\n parentGroupOffset.y += ancestorOffset.y;\n }\n return parentGroupOffset;\n }\n }, {\n key: \"onStart\",\n value: function onStart(params) {\n var _this4 = this;\n var el = params.drag.getDragElement();\n var elOffset = this.instance.getPosition(el);\n this.originalPosition = {\n x: params.pos.x,\n y: params.pos.y\n };\n if (el._jsPlumbParentGroup) {\n this._dragOffset = this._computeOffsetByParentGroup(el._jsPlumbParentGroup);\n this._currentDragParentGroup = el._jsPlumbParentGroup;\n }\n var cont = true;\n var nd = el.getAttribute(ATTRIBUTE_NOT_DRAGGABLE);\n if (this.instance.elementsDraggable === false || nd != null && nd !== FALSE$1) {\n cont = false;\n }\n if (cont) {\n this._groupLocations.length = 0;\n this._intersectingGroups.length = 0;\n this.instance.hoverSuspended = true;\n var originalElement = params.drag.getDragElement(true),\n descendants = originalElement.querySelectorAll(SELECTOR_MANAGED_ELEMENT),\n ancestors = getAncestors(originalElement),\n a = [];\n Array.prototype.push.apply(a, descendants);\n Array.prototype.push.apply(a, ancestors);\n this._dragSelection.filterActiveSet(function (p) {\n return a.indexOf(p.jel) === -1;\n });\n this._dragSelection.initialisePositions();\n var _one = function _one(_el, dragGroup, dragGroupMemberSpec) {\n if (!_el._isJsPlumbGroup || _this4.instance.allowNestedGroups) {\n var isNotInAGroup = !_el._jsPlumbParentGroup;\n var membersAreDroppable = isNotInAGroup || _el._jsPlumbParentGroup.dropOverride !== true;\n var isGhostOrNotConstrained = !isNotInAGroup && (_el._jsPlumbParentGroup.ghost || _el._jsPlumbParentGroup.constrain !== true);\n if (isNotInAGroup || membersAreDroppable && isGhostOrNotConstrained) {\n forEach(_this4.instance.groupManager.getGroups(), function (group) {\n var elementGroup = _el._jsPlumbGroup;\n if (group.droppable !== false && group.enabled !== false && _el._jsPlumbGroup !== group && !_this4.instance.groupManager.isDescendant(group, elementGroup)) {\n var groupEl = group.el,\n groupElId = _this4.instance.getId(groupEl),\n p = _this4.instance.viewport.getPosition(groupElId),\n boundingRect = {\n x: p.x,\n y: p.y,\n w: p.w,\n h: p.h\n };\n var groupLocation = {\n el: groupEl,\n r: boundingRect,\n group: group\n };\n _this4._groupLocations.push(groupLocation);\n if (group !== _this4._currentDragParentGroup) {\n _this4.instance.addClass(groupEl, CLASS_DRAG_ACTIVE);\n }\n }\n });\n _this4._groupLocations.sort(function (a, b) {\n if (_this4.instance.groupManager.isDescendant(a.group, b.group)) {\n return -1;\n } else if (_this4.instance.groupManager.isAncestor(b.group, a.group)) {\n return 1;\n } else {\n return 0;\n }\n });\n }\n }\n _this4.instance.select({\n source: _el\n }).addClass(_this4.instance.elementDraggingClass + \" \" + _this4.instance.sourceElementDraggingClass, true);\n _this4.instance.select({\n target: _el\n }).addClass(_this4.instance.elementDraggingClass + \" \" + _this4.instance.targetElementDraggingClass, true);\n return _this4.instance.fire(EVENT_DRAG_START, {\n el: _el,\n e: params.e,\n originalPosition: _this4.originalPosition,\n pos: _this4.originalPosition,\n dragGroup: dragGroup,\n dragGroupMemberSpec: dragGroupMemberSpec\n });\n };\n var elId = this.instance.getId(el);\n this._currentDragGroup = this._dragGroupByElementIdMap[elId];\n if (this._currentDragGroup && !isActiveDragGroupMember(this._currentDragGroup, el)) {\n this._currentDragGroup = null;\n }\n var dragStartReturn = _one(el);\n if (dragStartReturn === false) {\n this._cleanup();\n return false;\n } else {\n this._dragPayload = dragStartReturn;\n }\n if (this._currentDragGroup != null) {\n this._currentDragGroupOffsets.clear();\n this._currentDragGroupSizes.clear();\n this._currentDragGroup.members.forEach(function (jel) {\n var vp = _this4.instance.viewport.getPosition(jel.elId);\n _this4._currentDragGroupOffsets.set(jel.elId, [{\n x: vp.x - elOffset.x,\n y: vp.y - elOffset.y\n }, jel.el]);\n _this4._currentDragGroupSizes.set(jel.elId, vp);\n _this4._currentDragGroupOriginalPositions.set(jel.elId, {\n x: vp.x,\n y: vp.y\n });\n _one(jel.el, _this4._currentDragGroup, jel);\n });\n }\n }\n return cont;\n }\n }, {\n key: \"addToDragGroup\",\n value: function addToDragGroup(spec) {\n var _this5 = this;\n var details = decodeDragGroupSpec(this.instance, spec);\n var dragGroup = this._dragGroupMap[details.id];\n if (dragGroup == null) {\n dragGroup = {\n id: details.id,\n members: new Set()\n };\n this._dragGroupMap[details.id] = dragGroup;\n }\n for (var _len = arguments.length, els = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n els[_key - 1] = arguments[_key];\n }\n this.removeFromDragGroup.apply(this, els);\n forEach(els, function (el) {\n var elId = _this5.instance.getId(el);\n dragGroup.members.add({\n elId: elId,\n el: el,\n active: details.active\n });\n _this5._dragGroupByElementIdMap[elId] = dragGroup;\n });\n }\n }, {\n key: \"removeFromDragGroup\",\n value: function removeFromDragGroup() {\n var _this6 = this;\n for (var _len2 = arguments.length, els = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n els[_key2] = arguments[_key2];\n }\n forEach(els, function (el) {\n var id = _this6.instance.getId(el);\n var dragGroup = _this6._dragGroupByElementIdMap[id];\n if (dragGroup != null) {\n var s = new Set();\n dragGroup.members.forEach(function (member) {\n if (member.el !== el) {\n s.add(member);\n }\n });\n dragGroup.members = s;\n delete _this6._dragGroupByElementIdMap[id];\n }\n });\n }\n }, {\n key: \"setDragGroupState\",\n value: function setDragGroupState(active) {\n var _this7 = this;\n for (var _len3 = arguments.length, els = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n els[_key3 - 1] = arguments[_key3];\n }\n var elementIds = els.map(function (el) {\n return _this7.instance.getId(el);\n });\n forEach(elementIds, function (id) {\n var dragGroup = _this7._dragGroupByElementIdMap[id];\n if (dragGroup != null) {\n var member = getFromSetWithFunction(dragGroup.members, function (m) {\n return m.elId === id;\n });\n if (member != null) {\n member.active = active;\n }\n }\n });\n }\n }, {\n key: \"clearDragGroup\",\n value: function clearDragGroup(name) {\n var _this8 = this;\n var dragGroup = this._dragGroupMap[name];\n if (dragGroup != null) {\n dragGroup.members.forEach(function (member) {\n delete _this8._dragGroupByElementIdMap[member.elId];\n });\n dragGroup.members.clear();\n }\n }\n }, {\n key: \"_pruneOrOrphan\",\n value: function _pruneOrOrphan(params, doNotTransferToAncestor, isDefinitelyNotInsideParent) {\n var jel = params.el;\n var orphanedPosition = {\n pruned: false,\n pos: null\n };\n if (isDefinitelyNotInsideParent || !isInsideParent(this.instance, jel, params.pos)) {\n var group = jel._jsPlumbParentGroup;\n if (group.prune) {\n if (jel._isJsPlumbGroup) {\n this.instance.removeGroup(jel._jsPlumbGroup);\n } else {\n group.remove(params.el, true);\n }\n orphanedPosition.pruned = true;\n } else if (group.orphan) {\n orphanedPosition.pos = this.instance.groupManager.orphan(params.el, doNotTransferToAncestor);\n if (jel._isJsPlumbGroup) {\n group.removeGroup(jel._jsPlumbGroup);\n } else {\n group.remove(params.el);\n }\n }\n }\n return orphanedPosition;\n }\n }]);\n return ElementDragHandler;\n}();\n\nvar endpointMap$1 = {};\nvar endpointComputers = {};\nvar handlers = {};\nvar EndpointFactory = {\n get: function get(ep, name, params) {\n var e = endpointMap$1[name];\n if (!e) {\n throw {\n message: \"jsPlumb: unknown endpoint type '\" + name + \"'\"\n };\n } else {\n return new e(ep, params);\n }\n },\n clone: function clone(epr) {\n var handler = handlers[epr.type];\n return EndpointFactory.get(epr.endpoint, epr.type, handler.getParams(epr));\n },\n compute: function compute(endpoint, anchorPoint, orientation, endpointStyle) {\n var c = endpointComputers[endpoint.type];\n if (c != null) {\n return c(endpoint, anchorPoint, orientation, endpointStyle);\n } else {\n log(\"jsPlumb: cannot find endpoint calculator for endpoint of type \", endpoint.type);\n }\n },\n registerHandler: function registerHandler(eph) {\n handlers[eph.type] = eph;\n endpointMap$1[eph.type] = eph.cls;\n endpointComputers[eph.type] = eph.compute;\n }\n};\n\nvar EndpointRepresentation = function () {\n function EndpointRepresentation(endpoint, params) {\n _classCallCheck(this, EndpointRepresentation);\n this.endpoint = endpoint;\n _defineProperty(this, \"typeId\", void 0);\n _defineProperty(this, \"x\", void 0);\n _defineProperty(this, \"y\", void 0);\n _defineProperty(this, \"w\", void 0);\n _defineProperty(this, \"h\", void 0);\n _defineProperty(this, \"computedValue\", void 0);\n _defineProperty(this, \"bounds\", EMPTY_BOUNDS());\n _defineProperty(this, \"classes\", []);\n _defineProperty(this, \"instance\", void 0);\n _defineProperty(this, \"type\", void 0);\n params = params || {};\n this.instance = endpoint.instance;\n if (endpoint.cssClass) {\n this.classes.push(endpoint.cssClass);\n }\n if (params.cssClass) {\n this.classes.push(params.cssClass);\n }\n }\n _createClass(EndpointRepresentation, [{\n key: \"addClass\",\n value: function addClass(c) {\n this.classes.push(c);\n this.instance.addEndpointClass(this.endpoint, c);\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(c) {\n this.classes = this.classes.filter(function (_c) {\n return _c !== c;\n });\n this.instance.removeEndpointClass(this.endpoint, c);\n }\n }, {\n key: \"compute\",\n value: function compute(anchorPoint, orientation, endpointStyle) {\n this.computedValue = EndpointFactory.compute(this, anchorPoint, orientation, endpointStyle);\n this.bounds.xmin = this.x;\n this.bounds.ymin = this.y;\n this.bounds.xmax = this.x + this.w;\n this.bounds.ymax = this.y + this.h;\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v) {\n this.instance.setEndpointVisible(this.endpoint, v);\n }\n }]);\n return EndpointRepresentation;\n}();\n\nvar _opposites, _clockwiseOptions, _antiClockwiseOptions;\nvar FaceValues;\n(function (FaceValues) {\n FaceValues[\"top\"] = \"top\";\n FaceValues[\"left\"] = \"left\";\n FaceValues[\"right\"] = \"right\";\n FaceValues[\"bottom\"] = \"bottom\";\n})(FaceValues || (FaceValues = {}));\nvar TOP = FaceValues.top;\nvar LEFT = FaceValues.left;\nvar RIGHT = FaceValues.right;\nvar BOTTOM = FaceValues.bottom;\nvar X_AXIS_FACES = [LEFT, RIGHT];\nvar Y_AXIS_FACES = [TOP, BOTTOM];\nvar LightweightFloatingAnchor = function () {\n function LightweightFloatingAnchor(instance, element, elementId) {\n _classCallCheck(this, LightweightFloatingAnchor);\n this.instance = instance;\n this.element = element;\n _defineProperty(this, \"isFloating\", true);\n _defineProperty(this, \"isContinuous\", void 0);\n _defineProperty(this, \"isDynamic\", void 0);\n _defineProperty(this, \"locations\", []);\n _defineProperty(this, \"currentLocation\", 0);\n _defineProperty(this, \"locked\", false);\n _defineProperty(this, \"cssClass\", '');\n _defineProperty(this, \"timestamp\", null);\n _defineProperty(this, \"type\", \"Floating\");\n _defineProperty(this, \"id\", uuid());\n _defineProperty(this, \"orientation\", [0, 0]);\n _defineProperty(this, \"size\", void 0);\n this.size = instance.viewport.getPosition(elementId);\n this.locations.push({\n x: 0.5,\n y: 0.5,\n ox: this.orientation[0],\n oy: this.orientation[1],\n offx: 0,\n offy: 0,\n iox: this.orientation[0],\n ioy: this.orientation[1],\n cls: ''\n });\n }\n _createClass(LightweightFloatingAnchor, [{\n key: \"_updateOrientationInRouter\",\n value: function _updateOrientationInRouter() {\n this.instance.router.setAnchorOrientation(this, [this.locations[0].ox, this.locations[0].oy]);\n }\n }, {\n key: \"over\",\n value: function over(endpoint) {\n this.orientation = this.instance.router.getEndpointOrientation(endpoint);\n this.locations[0].ox = this.orientation[0];\n this.locations[0].oy = this.orientation[1];\n this._updateOrientationInRouter();\n }\n }, {\n key: \"out\",\n value: function out() {\n this.orientation = null;\n this.locations[0].ox = this.locations[0].iox;\n this.locations[0].oy = this.locations[0].ioy;\n this._updateOrientationInRouter();\n }\n }]);\n return LightweightFloatingAnchor;\n}();\nvar opposites = (_opposites = {}, _defineProperty(_opposites, TOP, BOTTOM), _defineProperty(_opposites, RIGHT, LEFT), _defineProperty(_opposites, LEFT, RIGHT), _defineProperty(_opposites, BOTTOM, TOP), _opposites);\nvar clockwiseOptions = (_clockwiseOptions = {}, _defineProperty(_clockwiseOptions, TOP, RIGHT), _defineProperty(_clockwiseOptions, RIGHT, BOTTOM), _defineProperty(_clockwiseOptions, LEFT, TOP), _defineProperty(_clockwiseOptions, BOTTOM, LEFT), _clockwiseOptions);\nvar antiClockwiseOptions = (_antiClockwiseOptions = {}, _defineProperty(_antiClockwiseOptions, TOP, LEFT), _defineProperty(_antiClockwiseOptions, RIGHT, TOP), _defineProperty(_antiClockwiseOptions, LEFT, BOTTOM), _defineProperty(_antiClockwiseOptions, BOTTOM, RIGHT), _antiClockwiseOptions);\nfunction getDefaultFace(a) {\n return a.faces.length === 0 ? TOP : a.faces[0];\n}\nfunction _isFaceAvailable(a, face) {\n return a.faces.indexOf(face) !== -1;\n}\nfunction _secondBest(a, edge) {\n return (a.clockwise ? clockwiseOptions : antiClockwiseOptions)[edge];\n}\nfunction _lastChoice(a, edge) {\n return (a.clockwise ? antiClockwiseOptions : clockwiseOptions)[edge];\n}\nfunction isEdgeSupported(a, edge) {\n return a.lockedAxis == null ? a.lockedFace == null ? _isFaceAvailable(a, edge) === true : a.lockedFace === edge : a.lockedAxis.indexOf(edge) !== -1;\n}\nfunction verifyFace(a, edge) {\n if (_isFaceAvailable(a, edge)) {\n return edge;\n } else if (_isFaceAvailable(a, opposites[edge])) {\n return opposites[edge];\n } else {\n var secondBest = _secondBest(a, edge);\n if (_isFaceAvailable(a, secondBest)) {\n return secondBest;\n } else {\n var lastChoice = _lastChoice(a, edge);\n if (_isFaceAvailable(a, lastChoice)) {\n return lastChoice;\n }\n }\n }\n return edge;\n}\nvar _top = {\n x: 0.5,\n y: 0,\n ox: 0,\n oy: -1,\n offx: 0,\n offy: 0\n},\n _bottom = {\n x: 0.5,\n y: 1,\n ox: 0,\n oy: 1,\n offx: 0,\n offy: 0\n},\n _left = {\n x: 0,\n y: 0.5,\n ox: -1,\n oy: 0,\n offx: 0,\n offy: 0\n},\n _right = {\n x: 1,\n y: 0.5,\n ox: 1,\n oy: 0,\n offx: 0,\n offy: 0\n},\n _topLeft = {\n x: 0,\n y: 0,\n ox: 0,\n oy: -1,\n offx: 0,\n offy: 0\n},\n _topRight = {\n x: 1,\n y: 0,\n ox: 1,\n oy: -1,\n offx: 0,\n offy: 0\n},\n _bottomLeft = {\n x: 0,\n y: 1,\n ox: 0,\n oy: 1,\n offx: 0,\n offy: 0\n},\n _bottomRight = {\n x: 1,\n y: 1,\n ox: 0,\n oy: 1,\n offx: 0,\n offy: 0\n},\n _center = {\n x: 0.5,\n y: 0.5,\n ox: 0,\n oy: 0,\n offx: 0,\n offy: 0\n};\nvar namedValues = {\n \"Top\": [_top],\n \"Bottom\": [_bottom],\n \"Left\": [_left],\n \"Right\": [_right],\n \"TopLeft\": [_topLeft],\n \"TopRight\": [_topRight],\n \"BottomLeft\": [_bottomLeft],\n \"BottomRight\": [_bottomRight],\n \"Center\": [_center],\n \"AutoDefault\": [_top, _left, _bottom, _right]\n};\nvar namedContinuousValues = {\n \"Continuous\": {\n faces: [TOP, LEFT, BOTTOM, RIGHT]\n },\n \"ContinuousTop\": {\n faces: [TOP]\n },\n \"ContinuousRight\": {\n faces: [RIGHT]\n },\n \"ContinuousBottom\": {\n faces: [BOTTOM]\n },\n \"ContinuousLeft\": {\n faces: [LEFT]\n },\n \"ContinuousLeftRight\": {\n faces: [LEFT, RIGHT]\n },\n \"ContinuousTopBottom\": {\n faces: [TOP, BOTTOM]\n }\n};\nfunction getNamedAnchor(name, params) {\n params = params || {};\n if (name === AnchorLocations.Perimeter) {\n return _createPerimeterAnchor(params);\n }\n var a = namedValues[name];\n if (a != null) {\n return _createAnchor(name, map(a, function (_a) {\n return extend({\n iox: _a.ox,\n ioy: _a.oy\n }, _a);\n }), params);\n }\n a = namedContinuousValues[name];\n if (a != null) {\n return _createContinuousAnchor(name, a.faces, params);\n }\n throw {\n message: \"jsPlumb: unknown anchor type '\" + name + \"'\"\n };\n}\nfunction _createAnchor(type, locations, params) {\n return {\n type: type,\n locations: locations,\n currentLocation: 0,\n locked: false,\n id: uuid(),\n isFloating: false,\n isContinuous: false,\n isDynamic: locations.length > 1,\n timestamp: null,\n cssClass: params.cssClass || \"\"\n };\n}\nfunction createFloatingAnchor(instance, element, elementId) {\n return new LightweightFloatingAnchor(instance, element, elementId);\n}\nvar PROPERTY_CURRENT_FACE = \"currentFace\";\nfunction _createContinuousAnchor(type, faces, params) {\n var ca = {\n type: type,\n locations: [],\n currentLocation: 0,\n locked: false,\n id: uuid(),\n cssClass: params.cssClass || \"\",\n isFloating: false,\n isContinuous: true,\n timestamp: null,\n faces: params.faces || faces,\n lockedFace: null,\n lockedAxis: null,\n clockwise: !(params.clockwise === false),\n __currentFace: null\n };\n Object.defineProperty(ca, PROPERTY_CURRENT_FACE, {\n get: function get() {\n return this.__currentFace;\n },\n set: function set(f) {\n this.__currentFace = verifyFace(this, f);\n }\n });\n return ca;\n}\nfunction isPrimitiveAnchorSpec(sa) {\n return sa.length < 7 && sa.every(isNumber) || sa.length === 7 && sa.slice(0, 5).every(isNumber) && isString(sa[6]);\n}\nfunction makeLightweightAnchorFromSpec(spec) {\n if (isString(spec)) {\n return getNamedAnchor(spec, null);\n } else if (Array.isArray(spec)) {\n if (isPrimitiveAnchorSpec(spec)) {\n var _spec = spec;\n return _createAnchor(null, [{\n x: _spec[0],\n y: _spec[1],\n ox: _spec[2],\n oy: _spec[3],\n offx: _spec[4] == null ? 0 : _spec[4],\n offy: _spec[5] == null ? 0 : _spec[5],\n iox: _spec[2],\n ioy: _spec[3],\n cls: _spec[6] || \"\"\n }], {\n cssClass: _spec[6] || \"\"\n });\n } else {\n var locations = map(spec, function (aSpec) {\n if (isString(aSpec)) {\n var a = namedValues[aSpec];\n return a != null ? extend({\n iox: a[0].ox,\n ioy: a[0].oy,\n cls: \"\"\n }, a[0]) : null;\n } else if (isPrimitiveAnchorSpec(aSpec)) {\n return {\n x: aSpec[0],\n y: aSpec[1],\n ox: aSpec[2],\n oy: aSpec[3],\n offx: aSpec[4] == null ? 0 : aSpec[4],\n offy: aSpec[5] == null ? 0 : aSpec[5],\n iox: aSpec[2],\n ioy: aSpec[3],\n cls: aSpec[6] || \"\"\n };\n }\n }).filter(function (ar) {\n return ar != null;\n });\n return _createAnchor(\"Dynamic\", locations, {});\n }\n } else {\n var sa = spec;\n return getNamedAnchor(sa.type, sa.options);\n }\n}\nfunction circleGenerator(anchorCount) {\n var r = 0.5,\n step = Math.PI * 2 / anchorCount,\n a = [];\n var current = 0;\n for (var i = 0; i < anchorCount; i++) {\n var x = r + r * Math.sin(current),\n y = r + r * Math.cos(current);\n a.push({\n x: x,\n y: y,\n ox: 0,\n oy: 0,\n offx: 0,\n offy: 0,\n iox: 0,\n ioy: 0,\n cls: ''\n });\n current += step;\n }\n return a;\n}\nfunction _path(segments, anchorCount) {\n var anchorsPerFace = anchorCount / segments.length,\n a = [],\n _computeFace = function _computeFace(x1, y1, x2, y2, fractionalLength, ox, oy) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace,\n dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push({\n x: x1 + dx * i,\n y: y1 + dy * i,\n ox: ox == null ? 0 : ox,\n oy: oy == null ? 0 : oy,\n offx: 0,\n offy: 0,\n iox: 0,\n ioy: 0,\n cls: ''\n });\n }\n };\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n return a;\n}\nfunction shapeGenerator(faces, anchorCount) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length, faces[i][4], faces[i][5]]);\n }\n return _path(s, anchorCount);\n}\nfunction rectangleGenerator(anchorCount) {\n return shapeGenerator([[0, 0, 1, 0, 0, -1], [1, 0, 1, 1, 1, 0], [1, 1, 0, 1, 0, 1], [0, 1, 0, 0, -1, 0]], anchorCount);\n}\nfunction diamondGenerator(anchorCount) {\n return shapeGenerator([[0.5, 0, 1, 0.5], [1, 0.5, 0.5, 1], [0.5, 1, 0, 0.5], [0, 0.5, 0.5, 0]], anchorCount);\n}\nfunction triangleGenerator(anchorCount) {\n return shapeGenerator([[0.5, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0.5, 0]], anchorCount);\n}\nfunction rotate$1(points, amountInDegrees) {\n var o = [],\n theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i].x - 0.5,\n _y = points[i].y - 0.5;\n o.push({\n x: 0.5 + (_x * Math.cos(theta) - _y * Math.sin(theta)),\n y: 0.5 + (_x * Math.sin(theta) + _y * Math.cos(theta)),\n ox: points[i].ox,\n oy: points[i].oy,\n offx: 0,\n offy: 0,\n iox: 0,\n ioy: 0,\n cls: ''\n });\n }\n return o;\n}\nvar anchorGenerators = new Map();\nanchorGenerators.set(PerimeterAnchorShapes.Circle, circleGenerator);\nanchorGenerators.set(PerimeterAnchorShapes.Ellipse, circleGenerator);\nanchorGenerators.set(PerimeterAnchorShapes.Rectangle, rectangleGenerator);\nanchorGenerators.set(PerimeterAnchorShapes.Square, rectangleGenerator);\nanchorGenerators.set(PerimeterAnchorShapes.Diamond, diamondGenerator);\nanchorGenerators.set(PerimeterAnchorShapes.Triangle, triangleGenerator);\nfunction _createPerimeterAnchor(params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n if (!anchorGenerators.has(shape)) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n var da = anchorGenerators.get(shape)(anchorCount);\n if (params.rotation) {\n da = rotate$1(da, params.rotation);\n }\n var a = _createAnchor(AnchorLocations.Perimeter, da, params);\n var aa = extend(a, {\n shape: shape\n });\n return aa;\n}\n\nvar ConnectionDragSelector = function () {\n function ConnectionDragSelector(selector, def) {\n var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n _classCallCheck(this, ConnectionDragSelector);\n this.selector = selector;\n this.def = def;\n this.exclude = exclude;\n _defineProperty(this, \"id\", void 0);\n _defineProperty(this, \"redrop\", void 0);\n this.id = uuid();\n this.redrop = def.def.redrop || REDROP_POLICY_STRICT;\n }\n _createClass(ConnectionDragSelector, [{\n key: \"setEnabled\",\n value: function setEnabled(enabled) {\n this.def.enabled = enabled;\n }\n }, {\n key: \"isEnabled\",\n value: function isEnabled() {\n return this.def.enabled !== false;\n }\n }]);\n return ConnectionDragSelector;\n}();\nvar REDROP_POLICY_STRICT = \"strict\";\nvar REDROP_POLICY_ANY = \"any\";\nvar REDROP_POLICY_ANY_SOURCE = \"anySource\";\nvar REDROP_POLICY_ANY_TARGET = \"anyTarget\";\nvar REDROP_POLICY_ANY_SOURCE_OR_TARGET = \"anySourceOrTarget\";\n\nfunction _makeFloatingEndpoint(ep, endpoint, referenceCanvas, sourceElement, sourceElementId, instance) {\n var floatingAnchor = createFloatingAnchor(instance, sourceElement, sourceElementId);\n var p = {\n paintStyle: ep.getPaintStyle(),\n preparedAnchor: floatingAnchor,\n element: sourceElement,\n scope: ep.scope,\n cssClass: [CLASS_ENDPOINT_FLOATING, ep.cssClass].join(\" \")\n };\n if (endpoint != null) {\n if (isAssignableFrom(endpoint, EndpointRepresentation)) {\n p.existingEndpoint = endpoint;\n } else {\n p.endpoint = endpoint;\n }\n }\n var actualEndpoint = instance._internal_newEndpoint(p);\n instance._paintEndpoint(actualEndpoint, {});\n return actualEndpoint;\n}\nfunction selectorFilter(evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement,\n ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n}\nvar SELECTOR_DRAG_ACTIVE_OR_HOVER = cls(CLASS_DRAG_ACTIVE, CLASS_DRAG_HOVER);\nvar SOURCE_SELECTOR_UNIQUE_ENDPOINT_DATA = \"sourceSelectorEndpoint\";\nvar EndpointDragHandler = function () {\n function EndpointDragHandler(instance) {\n _classCallCheck(this, EndpointDragHandler);\n this.instance = instance;\n _defineProperty(this, \"jpc\", void 0);\n _defineProperty(this, \"existingJpc\", void 0);\n _defineProperty(this, \"_originalAnchorSpec\", void 0);\n _defineProperty(this, \"ep\", void 0);\n _defineProperty(this, \"endpointRepresentation\", void 0);\n _defineProperty(this, \"canvasElement\", void 0);\n _defineProperty(this, \"_activeDefinition\", void 0);\n _defineProperty(this, \"placeholderInfo\", {\n id: null,\n element: null\n });\n _defineProperty(this, \"floatingIndex\", void 0);\n _defineProperty(this, \"floatingId\", void 0);\n _defineProperty(this, \"floatingElement\", void 0);\n _defineProperty(this, \"floatingEndpoint\", void 0);\n _defineProperty(this, \"floatingAnchor\", void 0);\n _defineProperty(this, \"_stopped\", void 0);\n _defineProperty(this, \"inPlaceCopy\", void 0);\n _defineProperty(this, \"endpointDropTargets\", []);\n _defineProperty(this, \"currentDropTarget\", null);\n _defineProperty(this, \"payload\", void 0);\n _defineProperty(this, \"floatingConnections\", {});\n _defineProperty(this, \"_forceReattach\", void 0);\n _defineProperty(this, \"_forceDetach\", void 0);\n _defineProperty(this, \"mousedownHandler\", void 0);\n _defineProperty(this, \"mouseupHandler\", void 0);\n _defineProperty(this, \"selector\", cls(CLASS_ENDPOINT));\n var container = instance.getContainer();\n this.mousedownHandler = this._mousedownHandler.bind(this);\n this.mouseupHandler = this._mouseupHandler.bind(this);\n instance.on(container, EVENT_MOUSEDOWN, SELECTOR_MANAGED_ELEMENT, this.mousedownHandler);\n instance.on(container, EVENT_MOUSEUP, [SELECTOR_MANAGED_ELEMENT, cls(CLASS_ENDPOINT)].join(\",\"), this.mouseupHandler);\n }\n _createClass(EndpointDragHandler, [{\n key: \"_resolveDragParent\",\n value: function _resolveDragParent(def, eventTarget) {\n var container = this.instance.getContainer();\n var parent = findParent(eventTarget, SELECTOR_MANAGED_ELEMENT, container, true);\n if (def.parentSelector != null) {\n var child = findParent(eventTarget, def.parentSelector, container, true);\n if (child != null) {\n parent = findParent(child.parentNode, SELECTOR_MANAGED_ELEMENT, container, false);\n }\n return child || parent;\n } else {\n return parent;\n }\n }\n }, {\n key: \"_mousedownHandler\",\n value: function _mousedownHandler(e) {\n var sourceEl;\n var sourceSelector;\n if (e.which === 3 || e.button === 2) {\n return;\n }\n var eventTarget = e.target || e.srcElement;\n sourceSelector = this._getSourceDefinition(e);\n if (sourceSelector != null) {\n sourceEl = this._resolveDragParent(sourceSelector.def.def, eventTarget);\n if (sourceEl == null || sourceEl.getAttribute(ATTRIBUTE_JTK_ENABLED) === FALSE$1) {\n return;\n }\n }\n if (sourceSelector) {\n var sourceElement = e.currentTarget,\n def;\n if (eventTarget.getAttribute(ATTRIBUTE_JTK_ENABLED) !== FALSE$1) {\n consume(e);\n this._activeDefinition = sourceSelector;\n def = sourceSelector.def.def;\n if (def.canAcceptNewConnection != null && !def.canAcceptNewConnection(sourceEl, e)) {\n return false;\n }\n var elxy = getPositionOnElement(e, sourceEl, this.instance.currentZoom);\n var tempEndpointParams = {\n element: sourceEl\n };\n extend(tempEndpointParams, def);\n tempEndpointParams.isTemporarySource = true;\n if (def.scope) {\n tempEndpointParams.scope = def.scope;\n } else {\n var scopeFromElement = eventTarget.getAttribute(ATTRIBUTE_JTK_SCOPE);\n if (scopeFromElement != null) {\n tempEndpointParams.scope = scopeFromElement;\n }\n }\n var extractedParameters = def.parameterExtractor ? def.parameterExtractor(sourceEl, eventTarget, e) : {};\n tempEndpointParams = merge(tempEndpointParams, extractedParameters);\n if (tempEndpointParams.maxConnections != null && tempEndpointParams.maxConnections >= 0) {\n var sourceCount = this.instance.select({\n source: sourceEl\n }).length;\n if (sourceCount >= tempEndpointParams.maxConnections) {\n consume(e);\n if (def.onMaxConnections) {\n def.onMaxConnections({\n element: sourceEl,\n maxConnections: tempEndpointParams.maxConnections\n }, e);\n }\n e.stopImmediatePropagation && e.stopImmediatePropagation();\n return false;\n }\n }\n if (def.anchorPositionFinder) {\n var maybeAnchorSpec = def.anchorPositionFinder(sourceEl, elxy, def, e);\n if (maybeAnchorSpec != null) {\n tempEndpointParams.anchor = maybeAnchorSpec;\n }\n }\n this._originalAnchorSpec = tempEndpointParams.anchor || (this.instance.areDefaultAnchorsSet() ? this.instance.defaults.anchors[0] : this.instance.defaults.anchor);\n var _originalAnchor = this.instance.router.prepareAnchor(this._originalAnchorSpec);\n var anchorSpecToUse = [elxy.x, elxy.y, 0, 0];\n if (_originalAnchor.locations.length > 0) {\n anchorSpecToUse[2] = _originalAnchor.locations[0].ox;\n anchorSpecToUse[3] = _originalAnchor.locations[0].oy;\n } else if (_originalAnchor.isContinuous) {\n var dx = elxy.x < 0.5 ? elxy.x : 1 - elxy.x;\n var dy = elxy.y < 0.5 ? elxy.y : 1 - elxy.y;\n anchorSpecToUse[2] = dx < dy ? elxy.x < 0.5 ? -1 : 1 : 0;\n anchorSpecToUse[3] = dy < dx ? elxy.y < 0.5 ? -1 : 1 : 0;\n }\n tempEndpointParams.anchor = anchorSpecToUse;\n tempEndpointParams.deleteOnEmpty = true;\n this.ep = this.instance._internal_newEndpoint(tempEndpointParams);\n var payload = {};\n if (def.extract) {\n for (var att in def.extract) {\n var v = eventTarget.getAttribute(att);\n if (v) {\n payload[def.extract[att]] = v;\n }\n }\n this.ep.mergeParameters(payload);\n }\n if (tempEndpointParams.uniqueEndpoint) {\n var elementId = this.ep.elementId;\n var existingUniqueEndpoint = this.instance.getManagedData(elementId, SOURCE_SELECTOR_UNIQUE_ENDPOINT_DATA, sourceSelector.id);\n if (existingUniqueEndpoint == null) {\n this.instance.setManagedData(elementId, SOURCE_SELECTOR_UNIQUE_ENDPOINT_DATA, sourceSelector.id, this.ep);\n this.ep.deleteOnEmpty = false;\n } else {\n this.ep.finalEndpoint = existingUniqueEndpoint;\n }\n }\n sourceElement._jsPlumbOrphanedEndpoints = sourceElement._jsPlumbOrphanedEndpoints || [];\n sourceElement._jsPlumbOrphanedEndpoints.push(this.ep);\n this.instance.trigger(this.ep.endpoint.canvas, EVENT_MOUSEDOWN, e, payload);\n }\n }\n }\n }, {\n key: \"_mouseupHandler\",\n value: function _mouseupHandler(e) {\n var el = e.currentTarget || e.srcElement;\n if (el._jsPlumbOrphanedEndpoints) {\n each(el._jsPlumbOrphanedEndpoints, this.instance._maybePruneEndpoint.bind(this.instance));\n el._jsPlumbOrphanedEndpoints.length = 0;\n }\n this._activeDefinition = null;\n }\n }, {\n key: \"onDragInit\",\n value: function onDragInit(el) {\n var ipco = getElementPosition(el, this.instance),\n ips = getElementSize(el, this.instance);\n this._makeDraggablePlaceholder(ipco, ips);\n this.placeholderInfo.element.jtk = el.jtk;\n return this.placeholderInfo.element;\n }\n }, {\n key: \"onDragAbort\",\n value: function onDragAbort(el) {\n this._cleanupDraggablePlaceholder();\n }\n }, {\n key: \"_makeDraggablePlaceholder\",\n value: function _makeDraggablePlaceholder(ipco, ips) {\n this.placeholderInfo = this.placeholderInfo || {};\n var n = createElement(ELEMENT_DIV, {\n position: \"absolute\"\n });\n this.instance._appendElementToContainer(n);\n var id = this.instance.getId(n);\n this.instance.setPosition(n, ipco);\n n.style.width = ips.w + \"px\";\n n.style.height = ips.h + \"px\";\n this.instance.manage(n);\n this.placeholderInfo.id = id;\n this.placeholderInfo.element = n;\n return n;\n }\n }, {\n key: \"_cleanupDraggablePlaceholder\",\n value: function _cleanupDraggablePlaceholder() {\n if (this.placeholderInfo.element) {\n this.instance.unmanage(this.placeholderInfo.element, true);\n delete this.placeholderInfo.element;\n delete this.placeholderInfo.id;\n }\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var c = this.instance.getContainer();\n this.instance.off(c, EVENT_MOUSEUP, this.mouseupHandler);\n this.instance.off(c, EVENT_MOUSEDOWN, this.mousedownHandler);\n }\n }, {\n key: \"init\",\n value: function init(drag) {}\n }, {\n key: \"startNewConnectionDrag\",\n value: function startNewConnectionDrag(scope, data) {\n this.jpc = this.instance._newConnection({\n sourceEndpoint: this.ep,\n targetEndpoint: this.floatingEndpoint,\n source: this.ep.element,\n target: this.placeholderInfo.element,\n paintStyle: this.ep.connectorStyle,\n hoverPaintStyle: this.ep.connectorHoverStyle,\n connector: this.ep.connector,\n overlays: this.ep.connectorOverlays,\n type: this.ep.edgeType,\n cssClass: this.ep.connectorClass,\n hoverClass: this.ep.connectorHoverClass,\n scope: scope,\n data: data\n });\n this.jpc.pending = true;\n this.jpc.addClass(this.instance.draggingClass);\n this.ep.addClass(this.instance.draggingClass);\n this.instance.fire(EVENT_CONNECTION_DRAG, this.jpc);\n }\n }, {\n key: \"startExistingConnectionDrag\",\n value: function startExistingConnectionDrag() {\n this.existingJpc = true;\n this.instance.setHover(this.jpc, false);\n var anchorIdx = this.jpc.endpoints[0].id === this.ep.id ? 0 : 1;\n this.ep.detachFromConnection(this.jpc, null, true);\n this.floatingEndpoint.addConnection(this.jpc);\n this.instance.fire(EVENT_CONNECTION_DRAG, this.jpc);\n this.instance.sourceOrTargetChanged(this.jpc.endpoints[anchorIdx].elementId, this.placeholderInfo.id, this.jpc, this.placeholderInfo.element, anchorIdx);\n this.jpc.suspendedEndpoint = this.jpc.endpoints[anchorIdx];\n this.jpc.suspendedElement = this.jpc.endpoints[anchorIdx].element;\n this.jpc.suspendedElementId = this.jpc.endpoints[anchorIdx].elementId;\n this.jpc.suspendedElementType = anchorIdx === 0 ? SOURCE : TARGET;\n this.instance.setHover(this.jpc.suspendedEndpoint, false);\n this.floatingEndpoint.referenceEndpoint = this.jpc.suspendedEndpoint;\n this.floatingEndpoint.mergeParameters(this.jpc.suspendedEndpoint.parameters);\n this.jpc.endpoints[anchorIdx] = this.floatingEndpoint;\n this.jpc.addClass(this.instance.draggingClass);\n this.floatingId = this.placeholderInfo.id;\n this.floatingIndex = anchorIdx;\n this.instance._refreshEndpoint(this.ep);\n }\n }, {\n key: \"_shouldStartDrag\",\n value: function _shouldStartDrag() {\n var _continue = true;\n if (!this.ep.enabled) {\n _continue = false;\n }\n if (this.jpc == null && !this.ep.isSource && !this.ep.isTemporarySource) {\n _continue = false;\n }\n if (this.ep.isSource && this.ep.isFull() && !(this.jpc != null && this.ep.dragAllowedWhenFull)) {\n _continue = false;\n }\n if (this.jpc != null && !this.jpc.isDetachable(this.ep)) {\n if (this.ep.isFull()) {\n _continue = false;\n } else {\n this.jpc = null;\n }\n }\n var payload = {};\n var beforeDrag = this.instance.checkCondition(this.jpc == null ? INTERCEPT_BEFORE_DRAG : INTERCEPT_BEFORE_START_DETACH, {\n endpoint: this.ep,\n source: this.ep.element,\n sourceId: this.ep.elementId,\n connection: this.jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n else if (_typeof(beforeDrag) === \"object\") {\n payload = beforeDrag;\n extend(payload, this.payload || {});\n } else {\n payload = this.payload || {};\n }\n return [_continue, payload];\n }\n }, {\n key: \"_createFloatingEndpoint\",\n value: function _createFloatingEndpoint(canvasElement) {\n var endpointToFloat = this.ep.endpoint;\n if (this.ep.edgeType != null) {\n var aae = this.instance._deriveEndpointAndAnchorSpec(this.ep.edgeType);\n endpointToFloat = aae.endpoints[1];\n }\n this.floatingEndpoint = _makeFloatingEndpoint(this.ep, endpointToFloat, canvasElement, this.placeholderInfo.element, this.placeholderInfo.id, this.instance);\n this.floatingAnchor = this.floatingEndpoint._anchor;\n this.floatingEndpoint.deleteOnEmpty = true;\n this.floatingElement = this.floatingEndpoint.endpoint.canvas;\n this.floatingId = this.instance.getId(this.floatingElement);\n }\n }, {\n key: \"_populateTargets\",\n value: function _populateTargets(canvasElement, event) {\n var _this = this;\n var isSourceDrag = this.jpc && this.jpc.endpoints[0] === this.ep;\n var boundingRect;\n var matchingEndpoints = this.instance.getContainer().querySelectorAll([\".\", CLASS_ENDPOINT, \"[\", ATTRIBUTE_SCOPE_PREFIX, this.ep.scope, \"]:not(.\", CLASS_ENDPOINT_FLOATING, \")\"].join(\"\"));\n forEach(matchingEndpoints, function (candidate) {\n if ((_this.jpc != null || candidate !== canvasElement) && candidate !== _this.floatingElement && (_this.jpc != null || !candidate.jtk.endpoint.isFull())) {\n if (isSourceDrag && candidate.jtk.endpoint.isSource || !isSourceDrag && candidate.jtk.endpoint.isTarget) {\n var o = getElementPosition(candidate, _this.instance),\n s = getElementSize(candidate, _this.instance);\n boundingRect = {\n x: o.x,\n y: o.y,\n w: s.w,\n h: s.h\n };\n _this.endpointDropTargets.push({\n el: candidate,\n targetEl: candidate,\n r: boundingRect,\n endpoint: candidate.jtk.endpoint,\n def: null\n });\n _this.instance.addClass(candidate, CLASS_DRAG_ACTIVE);\n }\n }\n });\n if (isSourceDrag) {\n var sourceDef = getWithFunction(this.instance.sourceSelectors, function (sSel) {\n return sSel.isEnabled() && (sSel.def.def.scope == null || sSel.def.def.scope === _this.ep.scope);\n });\n if (sourceDef != null) {\n var targetZones = this._findTargetZones(sourceDef);\n forEach(targetZones, function (el) {\n if (el.getAttribute(ATTRIBUTE_JTK_ENABLED) !== FALSE$1) {\n var scopeFromElement = el.getAttribute(ATTRIBUTE_JTK_SCOPE);\n if (scopeFromElement != null && scopeFromElement !== _this.ep.scope) {\n return;\n }\n var d = {\n r: null,\n el: el\n };\n d.targetEl = findParent(el, SELECTOR_MANAGED_ELEMENT, _this.instance.getContainer(), true);\n var o = getElementPosition(d.el, _this.instance),\n s = getElementSize(d.el, _this.instance);\n d.r = {\n x: o.x,\n y: o.y,\n w: s.w,\n h: s.h\n };\n if (sourceDef.def.def.rank != null) {\n d.rank = sourceDef.def.def.rank;\n }\n d.def = sourceDef.def;\n _this.endpointDropTargets.push(d);\n _this.instance.addClass(d.targetEl, CLASS_DRAG_ACTIVE);\n }\n });\n }\n } else {\n var targetDefs = getAllWithFunction(this.instance.targetSelectors, function (tSel) {\n return tSel.isEnabled();\n });\n targetDefs.forEach(function (targetDef) {\n var targetZones = _this._findTargetZones(targetDef);\n forEach(targetZones, function (el) {\n if (el.getAttribute(ATTRIBUTE_JTK_ENABLED) !== FALSE$1) {\n var scopeFromElement = el.getAttribute(ATTRIBUTE_JTK_SCOPE);\n if (scopeFromElement != null && scopeFromElement !== _this.ep.scope) {\n return;\n }\n var d = {\n r: null,\n el: el\n };\n if (targetDef.def.def.parentSelector != null) {\n d.targetEl = findParent(el, targetDef.def.def.parentSelector, _this.instance.getContainer(), true);\n }\n if (d.targetEl == null) {\n d.targetEl = findParent(el, SELECTOR_MANAGED_ELEMENT, _this.instance.getContainer(), true);\n }\n if (targetDef.def.def.allowLoopback === false || _this._activeDefinition && _this._activeDefinition.def.def.allowLoopback === false) {\n if (d.targetEl === _this.ep.element) {\n return;\n }\n }\n if (targetDef.def.def.canAcceptNewConnection != null && !targetDef.def.def.canAcceptNewConnection(d.targetEl, event)) {\n return;\n }\n var maxConnections = targetDef.def.def.maxConnections;\n if (maxConnections != null && maxConnections !== -1) {\n if (_this.instance.select({\n target: d.targetEl\n }).length >= maxConnections) {\n return;\n }\n }\n var o = getElementPosition(el, _this.instance),\n s = getElementSize(el, _this.instance);\n d.r = {\n x: o.x,\n y: o.y,\n w: s.w,\n h: s.h\n };\n d.def = targetDef.def;\n if (targetDef.def.def.rank != null) {\n d.rank = targetDef.def.def.rank;\n }\n _this.endpointDropTargets.push(d);\n _this.instance.addClass(d.targetEl, CLASS_DRAG_ACTIVE);\n }\n });\n });\n }\n this.endpointDropTargets.sort(function (a, b) {\n if (a.targetEl._isJsPlumbGroup && !b.targetEl._isJsPlumbGroup) {\n return 1;\n } else if (!a.targetEl._isJsPlumbGroup && b.targetEl._isJsPlumbGroup) {\n return -1;\n } else {\n if (a.targetEl._isJsPlumbGroup && b.targetEl._isJsPlumbGroup) {\n if (_this.instance.groupManager.isAncestor(a.targetEl._jsPlumbGroup, b.targetEl._jsPlumbGroup)) {\n return -1;\n } else if (_this.instance.groupManager.isAncestor(b.targetEl._jsPlumbGroup, a.targetEl._jsPlumbGroup)) {\n return 1;\n }\n } else {\n if (a.rank != null && b.rank != null) {\n if (a.rank > b.rank) {\n return -1;\n } else if (a.rank < b.rank) {\n return 1;\n } else ;\n } else {\n return 0;\n }\n }\n }\n });\n }\n }, {\n key: \"_findTargetZones\",\n value: function _findTargetZones(dragSelector) {\n var targetZonesSelector;\n if (dragSelector.redrop === REDROP_POLICY_ANY) {\n var t = this.instance.targetSelectors.map(function (s) {\n return s.selector;\n });\n t.push.apply(t, _toConsumableArray(this.instance.sourceSelectors.map(function (s) {\n return s.selector;\n })));\n t.push(SELECTOR_MANAGED_ELEMENT);\n targetZonesSelector = t.join(\",\");\n } else if (dragSelector.redrop === REDROP_POLICY_STRICT) {\n targetZonesSelector = dragSelector.selector;\n } else if (dragSelector.redrop === REDROP_POLICY_ANY_SOURCE) {\n targetZonesSelector = this.instance.sourceSelectors.map(function (s) {\n return s.selector;\n }).join(\",\");\n } else if (dragSelector.redrop === REDROP_POLICY_ANY_TARGET) {\n targetZonesSelector = this.instance.targetSelectors.map(function (s) {\n return s.selector;\n }).join(\",\");\n } else if (dragSelector.redrop === REDROP_POLICY_ANY_SOURCE_OR_TARGET) {\n var _t = this.instance.targetSelectors.map(function (s) {\n return s.selector;\n });\n _t.push.apply(_t, _toConsumableArray(this.instance.sourceSelectors.map(function (s) {\n return s.selector;\n })));\n targetZonesSelector = _t.join(\",\");\n }\n return this.instance.getContainer().querySelectorAll(targetZonesSelector);\n }\n }, {\n key: \"onStart\",\n value: function onStart(p) {\n this.endpointDropTargets.length = 0;\n this.currentDropTarget = null;\n this._stopped = false;\n var dragEl = p.drag.getDragElement();\n this.ep = dragEl.jtk.endpoint;\n if (!this.ep) {\n return false;\n }\n this.endpointRepresentation = this.ep.endpoint;\n this.canvasElement = this.endpointRepresentation.canvas;\n this.jpc = this.ep.connectorSelector();\n var _this$_shouldStartDra = this._shouldStartDrag(),\n _this$_shouldStartDra2 = _slicedToArray(_this$_shouldStartDra, 2),\n _continue = _this$_shouldStartDra2[0],\n payload = _this$_shouldStartDra2[1];\n if (_continue === false) {\n this._stopped = true;\n return false;\n }\n this.instance.setHover(this.ep, false);\n this.instance.isConnectionBeingDragged = true;\n if (this.jpc && !this.ep.isFull() && this.ep.isSource) {\n this.jpc = null;\n }\n this._createFloatingEndpoint(this.canvasElement);\n this._populateTargets(this.canvasElement, p.e);\n if (this.jpc == null) {\n this.startNewConnectionDrag(this.ep.scope, payload);\n } else {\n this.startExistingConnectionDrag();\n }\n this._registerFloatingConnection(this.placeholderInfo, this.jpc);\n this.instance.currentlyDragging = true;\n }\n }, {\n key: \"onBeforeStart\",\n value: function onBeforeStart(beforeStartParams) {\n this.payload = beforeStartParams.e.payload || {};\n }\n }, {\n key: \"onDrag\",\n value: function onDrag(params) {\n if (this._stopped) {\n return true;\n }\n if (this.placeholderInfo.element) {\n var floatingElementSize = getElementSize(this.floatingElement, this.instance);\n this.instance.setElementPosition(this.placeholderInfo.element, params.pos.x, params.pos.y);\n var boundingRect = {\n x: params.pos.x,\n y: params.pos.y,\n w: floatingElementSize.w,\n h: floatingElementSize.h\n },\n newDropTarget,\n idx,\n _cont;\n for (var i = 0; i < this.endpointDropTargets.length; i++) {\n if (intersects(boundingRect, this.endpointDropTargets[i].r)) {\n newDropTarget = this.endpointDropTargets[i];\n break;\n }\n }\n if (newDropTarget !== this.currentDropTarget && this.currentDropTarget != null) {\n idx = this._getFloatingAnchorIndex();\n this.instance.removeClass(this.currentDropTarget.el, CLASS_DRAG_HOVER);\n if (this.currentDropTarget.endpoint) {\n this.currentDropTarget.endpoint.endpoint.removeClass(this.instance.endpointDropAllowedClass);\n this.currentDropTarget.endpoint.endpoint.removeClass(this.instance.endpointDropForbiddenClass);\n }\n this.floatingAnchor.out();\n }\n if (newDropTarget != null) {\n this.instance.addClass(newDropTarget.el, CLASS_DRAG_HOVER);\n idx = this._getFloatingAnchorIndex();\n if (newDropTarget.endpoint != null) {\n _cont = newDropTarget.endpoint.isSource && idx === 0 || newDropTarget.endpoint.isTarget && idx !== 0 || this.jpc.suspendedEndpoint && newDropTarget.endpoint.referenceEndpoint && newDropTarget.endpoint.referenceEndpoint.id === this.jpc.suspendedEndpoint.id;\n if (_cont) {\n var bb = this.instance.checkCondition(CHECK_DROP_ALLOWED, {\n sourceEndpoint: this.jpc.endpoints[idx],\n targetEndpoint: newDropTarget.endpoint.endpoint,\n connection: this.jpc\n });\n if (bb) {\n newDropTarget.endpoint.endpoint.addClass(this.instance.endpointDropAllowedClass);\n newDropTarget.endpoint.endpoint.removeClass(this.instance.endpointDropForbiddenClass);\n } else {\n newDropTarget.endpoint.endpoint.removeClass(this.instance.endpointDropAllowedClass);\n newDropTarget.endpoint.endpoint.addClass(this.instance.endpointDropForbiddenClass);\n }\n this.floatingAnchor.over(newDropTarget.endpoint);\n this.instance._paintConnection(this.jpc);\n } else {\n newDropTarget = null;\n }\n }\n }\n this.currentDropTarget = newDropTarget;\n }\n }\n }, {\n key: \"_maybeCleanup\",\n value: function _maybeCleanup(ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n this.instance.deleteEndpoint(ep);\n } else {\n delete ep._mtNew;\n }\n }\n }, {\n key: \"_reattachOrDiscard\",\n value: function _reattachOrDiscard(originalEvent) {\n var existingConnection = this.jpc.suspendedEndpoint != null;\n var idx = this._getFloatingAnchorIndex();\n if (existingConnection && this._shouldReattach()) {\n if (idx === 0) {\n this.jpc.source = this.jpc.suspendedElement;\n this.jpc.sourceId = this.jpc.suspendedElementId;\n } else {\n this.jpc.target = this.jpc.suspendedElement;\n this.jpc.targetId = this.jpc.suspendedElementId;\n }\n this._doForceReattach(idx);\n return true;\n } else {\n this._discard(idx, originalEvent);\n return false;\n }\n }\n }, {\n key: \"onStop\",\n value: function onStop(p) {\n var _this2 = this;\n var originalEvent = p.e;\n this.instance.isConnectionBeingDragged = false;\n this.instance.currentlyDragging = false;\n var classesToRemove = classList(CLASS_DRAG_HOVER, CLASS_DRAG_ACTIVE);\n var matchingSelectors = this.instance.getContainer().querySelectorAll(SELECTOR_DRAG_ACTIVE_OR_HOVER);\n forEach(matchingSelectors, function (el) {\n _this2.instance.removeClass(el, classesToRemove);\n });\n if (this.jpc && this.jpc.endpoints != null) {\n var existingConnection = this.jpc.suspendedEndpoint != null;\n var idx = this._getFloatingAnchorIndex();\n var suspendedEndpoint = this.jpc.suspendedEndpoint;\n var dropEndpoint;\n if (this.currentDropTarget != null) {\n dropEndpoint = this._getDropEndpoint(p, this.jpc);\n if (dropEndpoint == null) {\n this._reattachOrDiscard(p.e);\n } else {\n if (suspendedEndpoint && suspendedEndpoint.id === dropEndpoint.id) {\n this._doForceReattach(idx);\n } else {\n if (!dropEndpoint.enabled) {\n this._reattachOrDiscard(p.e);\n } else if (dropEndpoint.isFull()) {\n dropEndpoint.fire(EVENT_MAX_CONNECTIONS, {\n endpoint: this,\n connection: this.jpc,\n maxConnections: this.instance.defaults.maxConnections\n }, originalEvent);\n this._reattachOrDiscard(p.e);\n } else {\n if (idx === 0) {\n this.jpc.source = dropEndpoint.element;\n this.jpc.sourceId = dropEndpoint.elementId;\n } else {\n this.jpc.target = dropEndpoint.element;\n this.jpc.targetId = dropEndpoint.elementId;\n }\n var _doContinue = true;\n if (existingConnection && this.jpc.suspendedEndpoint.id !== dropEndpoint.id) {\n if (!this.jpc.isDetachAllowed(this.jpc) || !this.jpc.endpoints[idx].isDetachAllowed(this.jpc) || !this.jpc.suspendedEndpoint.isDetachAllowed(this.jpc) || !this.instance.checkCondition(\"beforeDetach\", this.jpc)) {\n _doContinue = false;\n }\n }\n _doContinue = _doContinue && dropEndpoint.isDropAllowed(this.jpc.sourceId, this.jpc.targetId, this.jpc.scope, this.jpc, dropEndpoint);\n if (_doContinue) {\n this._drop(dropEndpoint, idx, originalEvent, _doContinue);\n } else {\n this._reattachOrDiscard(p.e);\n }\n }\n }\n }\n } else {\n this._reattachOrDiscard(p.e);\n }\n this.instance._refreshEndpoint(this.ep);\n this.ep.removeClass(this.instance.draggingClass);\n this._cleanupDraggablePlaceholder();\n this.jpc.removeClass(this.instance.draggingClass);\n delete this.jpc.suspendedEndpoint;\n delete this.jpc.suspendedElement;\n delete this.jpc.suspendedElementType;\n delete this.jpc.suspendedElementId;\n delete this.jpc.suspendedIndex;\n delete this.floatingId;\n delete this.floatingIndex;\n delete this.floatingElement;\n delete this.floatingEndpoint;\n delete this.floatingAnchor;\n delete this.jpc.pending;\n if (dropEndpoint != null) {\n this._maybeCleanup(dropEndpoint);\n }\n }\n }\n }, {\n key: \"_getSourceDefinition\",\n value: function _getSourceDefinition(evt) {\n var selector;\n var container = this.instance.getContainer();\n for (var i = 0; i < this.instance.sourceSelectors.length; i++) {\n selector = this.instance.sourceSelectors[i];\n if (selector.isEnabled()) {\n var r = selectorFilter(evt, container, selector.selector, this.instance, selector.exclude);\n if (r !== false) {\n return selector;\n }\n }\n }\n }\n }, {\n key: \"_getDropEndpoint\",\n value: function _getDropEndpoint(p, jpc) {\n var dropEndpoint;\n if (this.currentDropTarget.endpoint == null) {\n var targetDefinition = this.currentDropTarget.def;\n var eventTarget = p.e.target || p.e.srcElement;\n if (targetDefinition == null) {\n return null;\n }\n var targetElement = this.currentDropTarget.targetEl;\n var elxy = getPositionOnElement(p.e, targetElement, this.instance.currentZoom);\n var eps = this.instance._deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? extend(p, {\n endpoint: targetDefinition.def.endpoint || eps.endpoints[1],\n cssClass: targetDefinition.def.cssClass || \"\",\n source: targetDefinition.def.source === true,\n target: targetDefinition.def.target === true\n }) : p;\n var anchorsToUse = this.instance.validAnchorsSpec(eps.anchors) ? eps.anchors : this.instance.areDefaultAnchorsSet() ? this.instance.defaults.anchors : null;\n var anchorFromDef = targetDefinition.def.anchor;\n var anchorFromPositionFinder = targetDefinition.def.anchorPositionFinder ? targetDefinition.def.anchorPositionFinder(targetElement, elxy, targetDefinition.def, p.e) : null;\n var dropAnchor = anchorFromPositionFinder != null ? anchorFromPositionFinder : anchorFromDef != null ? anchorFromDef : anchorsToUse != null && anchorsToUse[1] != null ? anchorsToUse[1] : null;\n if (dropAnchor != null) {\n pp = extend(pp, {\n anchor: dropAnchor\n });\n }\n if (targetDefinition.def.portId != null) {\n pp.portId = targetDefinition.def.portId;\n }\n var extractedParameters = targetDefinition.def.parameterExtractor ? targetDefinition.def.parameterExtractor(this.currentDropTarget.el, eventTarget, p.e) : {};\n pp = merge(pp, extractedParameters);\n pp.element = targetElement;\n dropEndpoint = this.instance._internal_newEndpoint(pp);\n dropEndpoint._mtNew = true;\n dropEndpoint.deleteOnEmpty = true;\n if (targetDefinition.def.parameters) {\n dropEndpoint.mergeParameters(targetDefinition.def.parameters);\n }\n if (targetDefinition.def.extract) {\n var tpayload = {};\n for (var att in targetDefinition.def.extract) {\n var v = this.currentDropTarget.el.getAttribute(att);\n if (v) {\n tpayload[targetDefinition.def.extract[att]] = v;\n }\n }\n dropEndpoint.mergeParameters(tpayload);\n }\n } else {\n dropEndpoint = this.currentDropTarget.endpoint;\n }\n if (dropEndpoint) {\n dropEndpoint.removeClass(this.instance.endpointDropAllowedClass);\n dropEndpoint.removeClass(this.instance.endpointDropForbiddenClass);\n }\n return dropEndpoint;\n }\n }, {\n key: \"_doForceReattach\",\n value: function _doForceReattach(idx) {\n this.floatingEndpoint.detachFromConnection(this.jpc, null, true);\n this.jpc.endpoints[idx] = this.jpc.suspendedEndpoint;\n this.instance.setHover(this.jpc, false);\n this.jpc._forceDetach = true;\n this.jpc.suspendedEndpoint.addConnection(this.jpc);\n this.instance.sourceOrTargetChanged(this.floatingId, this.jpc.suspendedEndpoint.elementId, this.jpc, this.jpc.suspendedEndpoint.element, idx);\n this.instance.deleteEndpoint(this.floatingEndpoint);\n this.instance.repaint(this.jpc.source);\n delete this.jpc._forceDetach;\n }\n }, {\n key: \"_shouldReattach\",\n value: function _shouldReattach() {\n if (this.jpc.isReattach() || this.jpc._forceReattach) {\n return true;\n } else {\n var suspendedEndpoint = this.jpc.suspendedEndpoint,\n otherEndpointIdx = this.jpc.suspendedElementType == SOURCE ? 1 : 0,\n otherEndpoint = this.jpc.endpoints[otherEndpointIdx];\n return !functionChain(true, false, [[suspendedEndpoint, IS_DETACH_ALLOWED, [this.jpc]], [otherEndpoint, IS_DETACH_ALLOWED, [this.jpc]], [this.jpc, IS_DETACH_ALLOWED, [this.jpc]], [this.instance, CHECK_CONDITION, [INTERCEPT_BEFORE_DETACH, this.jpc]]]);\n }\n }\n }, {\n key: \"_discard\",\n value: function _discard(idx, originalEvent) {\n if (this.jpc.pending) {\n this.instance.fire(EVENT_CONNECTION_ABORT, this.jpc, originalEvent);\n } else {\n if (idx === 0) {\n this.jpc.source = this.jpc.suspendedEndpoint.element;\n this.jpc.sourceId = this.jpc.suspendedEndpoint.elementId;\n } else {\n this.jpc.target = this.jpc.suspendedEndpoint.element;\n this.jpc.targetId = this.jpc.suspendedEndpoint.elementId;\n }\n this.jpc.endpoints[idx] = this.jpc.suspendedEndpoint;\n }\n if (this.floatingEndpoint) {\n this.floatingEndpoint.detachFromConnection(this.jpc);\n }\n this.instance.deleteConnection(this.jpc, {\n originalEvent: originalEvent,\n force: true\n });\n }\n }, {\n key: \"_drop\",\n value: function _drop(dropEndpoint, idx, originalEvent, optionalData) {\n this.jpc.endpoints[idx].detachFromConnection(this.jpc);\n if (this.jpc.suspendedEndpoint) {\n this.jpc.suspendedEndpoint.detachFromConnection(this.jpc);\n }\n this.jpc.endpoints[idx] = dropEndpoint;\n dropEndpoint.addConnection(this.jpc);\n if (this.jpc.suspendedEndpoint) {\n var suspendedElementId = this.jpc.suspendedEndpoint.elementId;\n this.instance.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : this.jpc.sourceId,\n newSourceId: idx === 0 ? dropEndpoint.elementId : this.jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : this.jpc.targetId,\n newTargetId: idx === 1 ? dropEndpoint.elementId : this.jpc.targetId,\n originalEndpoint: this.jpc.suspendedEndpoint,\n connection: this.jpc,\n newEndpoint: dropEndpoint\n }, originalEvent);\n }\n if (idx === 1) {\n this.instance.sourceOrTargetChanged(this.floatingId, this.jpc.targetId, this.jpc, this.jpc.target, 1);\n } else {\n this.instance.sourceOrTargetChanged(this.floatingId, this.jpc.sourceId, this.jpc, this.jpc.source, 0);\n }\n if (this.jpc.endpoints[0].finalEndpoint) {\n var _toDelete = this.jpc.endpoints[0];\n _toDelete.detachFromConnection(this.jpc);\n this.jpc.endpoints[0] = this.jpc.endpoints[0].finalEndpoint;\n this.jpc.endpoints[0].addConnection(this.jpc);\n }\n if (isObject(optionalData)) {\n this.jpc.mergeData(optionalData);\n }\n if (this._originalAnchorSpec) {\n this.jpc.endpoints[0].setAnchor(this._originalAnchorSpec);\n this._originalAnchorSpec = null;\n }\n this.instance._finaliseConnection(this.jpc, null, originalEvent);\n this.instance.setHover(this.jpc, false);\n this.instance.revalidate(this.jpc.endpoints[0].element);\n }\n }, {\n key: \"_registerFloatingConnection\",\n value: function _registerFloatingConnection(info, conn) {\n this.floatingConnections[info.id] = conn;\n }\n }, {\n key: \"_getFloatingAnchorIndex\",\n value: function _getFloatingAnchorIndex() {\n return this.floatingIndex == null ? 1 : this.floatingIndex;\n }\n }]);\n return EndpointDragHandler;\n}();\n\nvar GroupDragHandler = function (_ElementDragHandler) {\n _inherits(GroupDragHandler, _ElementDragHandler);\n var _super = _createSuper(GroupDragHandler);\n function GroupDragHandler(instance, dragSelection) {\n var _this;\n _classCallCheck(this, GroupDragHandler);\n _this = _super.call(this, instance, dragSelection);\n _this.instance = instance;\n _this.dragSelection = dragSelection;\n _defineProperty(_assertThisInitialized(_this), \"selector\", [\">\", SELECTOR_GROUP, SELECTOR_MANAGED_ELEMENT].join(\" \"));\n _defineProperty(_assertThisInitialized(_this), \"doRevalidate\", void 0);\n _this.doRevalidate = _this._revalidate.bind(_assertThisInitialized(_this));\n return _this;\n }\n _createClass(GroupDragHandler, [{\n key: \"reset\",\n value: function reset() {\n this.drag.off(EVENT_REVERT, this.doRevalidate);\n }\n }, {\n key: \"_revalidate\",\n value: function _revalidate(el) {\n this.instance.revalidate(el);\n }\n }, {\n key: \"init\",\n value: function init(drag) {\n this.drag = drag;\n drag.on(EVENT_REVERT, this.doRevalidate);\n }\n }, {\n key: \"useGhostProxy\",\n value: function useGhostProxy(container, dragEl) {\n var group = dragEl._jsPlumbParentGroup;\n return group == null ? false : group.ghost === true;\n }\n }, {\n key: \"makeGhostProxy\",\n value: function makeGhostProxy(el) {\n var jel = el;\n var newEl = jel.cloneNode(true);\n newEl._jsPlumbParentGroup = jel._jsPlumbParentGroup;\n return newEl;\n }\n }]);\n return GroupDragHandler;\n}(ElementDragHandler);\n\nvar HTMLElementOverlay = function () {\n function HTMLElementOverlay(instance, overlay) {\n _classCallCheck(this, HTMLElementOverlay);\n this.instance = instance;\n this.overlay = overlay;\n _defineProperty(this, \"htmlElementOverlay\", void 0);\n this.htmlElementOverlay = overlay;\n }\n _createClass(HTMLElementOverlay, null, [{\n key: \"getElement\",\n value: function getElement(o, component, elementCreator) {\n if (o.canvas == null) {\n if (elementCreator && component) {\n o.canvas = elementCreator(component);\n var cls = o.instance.overlayClass + \" \" + (o.cssClass ? o.cssClass : \"\");\n o.instance.addClass(o.canvas, cls);\n } else {\n o.canvas = createElement(ELEMENT_DIV, {}, o.instance.overlayClass + \" \" + (o.cssClass ? o.cssClass : \"\"));\n }\n o.instance.setAttribute(o.canvas, \"jtk-overlay-id\", o.id);\n for (var att in o.attributes) {\n o.instance.setAttribute(o.canvas, att, o.attributes[att]);\n }\n o.canvas.style.position = ABSOLUTE;\n o.instance._appendElement(o.canvas, o.instance.getContainer());\n o.instance.getId(o.canvas);\n var ts = \"translate(-50%, -50%)\";\n o.canvas.style.webkitTransform = ts;\n o.canvas.style.mozTransform = ts;\n o.canvas.style.msTransform = ts;\n o.canvas.style.oTransform = ts;\n o.canvas.style.transform = ts;\n if (!o.isVisible()) {\n o.canvas.style.display = NONE;\n }\n o.canvas.jtk = {\n overlay: o\n };\n }\n return o.canvas;\n }\n }, {\n key: \"destroy\",\n value: function destroy(o) {\n o.canvas && o.canvas.parentNode && o.canvas.parentNode.removeChild(o.canvas);\n delete o.canvas;\n delete o.cachedDimensions;\n }\n }, {\n key: \"_getDimensions\",\n value: function _getDimensions(o, forceRefresh) {\n if (o.cachedDimensions == null || forceRefresh) {\n o.cachedDimensions = {\n w: 1,\n h: 1\n };\n }\n return o.cachedDimensions;\n }\n }]);\n return HTMLElementOverlay;\n}();\n\nvar EventGenerator = function () {\n function EventGenerator() {\n _classCallCheck(this, EventGenerator);\n _defineProperty(this, \"_listeners\", {});\n _defineProperty(this, \"eventsSuspended\", false);\n _defineProperty(this, \"tick\", false);\n _defineProperty(this, \"eventsToDieOn\", {\n \"ready\": true\n });\n _defineProperty(this, \"queue\", []);\n }\n _createClass(EventGenerator, [{\n key: \"fire\",\n value: function fire(event, value, originalEvent) {\n var ret = null;\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length,\n i = 0,\n _gone = false;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i](value, originalEvent);\n } else {\n try {\n ret = this._listeners[event][i](value, originalEvent);\n } catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + (e.message || e));\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n } else {\n this.queue.unshift(arguments);\n }\n return ret;\n }\n }, {\n key: \"_drain\",\n value: function _drain() {\n var n = this.queue.pop();\n if (n) {\n this.fire.apply(this, n);\n }\n }\n }, {\n key: \"unbind\",\n value: function unbind(eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n } else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n } else if (eventOrListener.__jsPlumb) {\n var evt;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n } else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n }\n }, {\n key: \"getListener\",\n value: function getListener(forEvent) {\n return this._listeners[forEvent] || [];\n }\n }, {\n key: \"isSuspendEvents\",\n value: function isSuspendEvents() {\n return this.eventsSuspended;\n }\n }, {\n key: \"setSuspendEvents\",\n value: function setSuspendEvents(val) {\n this.eventsSuspended = val;\n }\n }, {\n key: \"bind\",\n value: function bind(event, listener, insertAtStart) {\n var _this = this;\n var _one = function _one(evt) {\n addToDictionary(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n } else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return this;\n }\n }, {\n key: \"silently\",\n value: function silently(fn) {\n this.setSuspendEvents(true);\n try {\n fn();\n } catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n this.setSuspendEvents(false);\n }\n }]);\n return EventGenerator;\n}();\nvar OptimisticEventGenerator = function (_EventGenerator) {\n _inherits(OptimisticEventGenerator, _EventGenerator);\n var _super = _createSuper(OptimisticEventGenerator);\n function OptimisticEventGenerator() {\n _classCallCheck(this, OptimisticEventGenerator);\n return _super.apply(this, arguments);\n }\n _createClass(OptimisticEventGenerator, [{\n key: \"shouldFireEvent\",\n value: function shouldFireEvent(event, value, originalEvent) {\n return true;\n }\n }]);\n return OptimisticEventGenerator;\n}(EventGenerator);\n\nfunction isFullOverlaySpec(o) {\n return o.type != null && o.options != null;\n}\nfunction convertToFullOverlaySpec(spec) {\n var o = null;\n if (isString(spec)) {\n o = {\n type: spec,\n options: {}\n };\n } else {\n o = spec;\n }\n o.options.id = o.options.id || uuid();\n return o;\n}\nvar Overlay = function (_EventGenerator) {\n _inherits(Overlay, _EventGenerator);\n var _super = _createSuper(Overlay);\n function Overlay(instance, component, p) {\n var _this;\n _classCallCheck(this, Overlay);\n _this = _super.call(this);\n _this.instance = instance;\n _this.component = component;\n _defineProperty(_assertThisInitialized(_this), \"id\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cssClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"visible\", true);\n _defineProperty(_assertThisInitialized(_this), \"location\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"events\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"attributes\", void 0);\n p = p || {};\n _this.id = p.id || uuid();\n _this.cssClass = p.cssClass || \"\";\n _this.setLocation(p.location);\n _this.events = p.events || {};\n _this.attributes = p.attributes || {};\n for (var _event in _this.events) {\n _this.bind(_event, _this.events[_event]);\n }\n return _this;\n }\n _createClass(Overlay, [{\n key: \"setLocation\",\n value: function setLocation(l) {\n var newLocation = this.location == null ? 0.5 : this.location;\n if (l != null) {\n try {\n var _l = typeof l === \"string\" ? parseFloat(l) : l;\n if (!isNaN(_l)) {\n newLocation = _l;\n }\n } catch (e) {\n }\n }\n this.location = newLocation;\n }\n }, {\n key: \"shouldFireEvent\",\n value: function shouldFireEvent(event, value, originalEvent) {\n return true;\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v) {\n this.visible = v;\n this.instance.setOverlayVisible(this, v);\n }\n }, {\n key: \"isVisible\",\n value: function isVisible() {\n return this.visible;\n }\n }]);\n return Overlay;\n}(EventGenerator);\n\nvar overlayMap = {};\nvar OverlayFactory = {\n get: function get(instance, name, component, params) {\n var c = overlayMap[name];\n if (!c) {\n throw {\n message: \"jsPlumb: unknown overlay type '\" + name + \"'\"\n };\n } else {\n return new c(instance, component, params);\n }\n },\n register: function register(name, overlay) {\n overlayMap[name] = overlay;\n }\n};\n\nvar LabelOverlay = function (_Overlay) {\n _inherits(LabelOverlay, _Overlay);\n var _super = _createSuper(LabelOverlay);\n function LabelOverlay(instance, component, p) {\n var _this;\n _classCallCheck(this, LabelOverlay);\n _this = _super.call(this, instance, component, p);\n _this.instance = instance;\n _this.component = component;\n _defineProperty(_assertThisInitialized(_this), \"label\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"labelText\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", LabelOverlay.type);\n _defineProperty(_assertThisInitialized(_this), \"cachedDimensions\", void 0);\n p = p || {\n label: \"\"\n };\n _this.setLabel(p.label);\n return _this;\n }\n _createClass(LabelOverlay, [{\n key: \"getLabel\",\n value: function getLabel() {\n if (isFunction(this.label)) {\n return this.label(this);\n } else {\n return this.labelText;\n }\n }\n }, {\n key: \"setLabel\",\n value: function setLabel(l) {\n this.label = l;\n this.labelText = null;\n this.instance.updateLabel(this);\n }\n }, {\n key: \"getDimensions\",\n value: function getDimensions() {\n return {\n w: 1,\n h: 1\n };\n }\n }, {\n key: \"updateFrom\",\n value: function updateFrom(d) {\n if (d.label != null) {\n this.setLabel(d.label);\n }\n if (d.location != null) {\n this.setLocation(d.location);\n this.instance.updateLabel(this);\n }\n }\n }]);\n return LabelOverlay;\n}(Overlay);\n_defineProperty(LabelOverlay, \"type\", \"Label\");\nfunction isLabelOverlay(o) {\n return o.type === LabelOverlay.type;\n}\nOverlayFactory.register(LabelOverlay.type, LabelOverlay);\n\nfunction _splitType(t) {\n return t == null ? null : t.split(\" \").filter(function (t) {\n return t != null && t.length > 0;\n });\n}\nfunction _mapType(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n}\nvar CONNECTOR = \"connector\";\nvar MERGE_STRATEGY_OVERRIDE = \"override\";\nvar CSS_CLASS = \"cssClass\";\nvar DEFAULT_TYPE_KEY = \"__default\";\nvar ANCHOR = \"anchor\";\nvar ANCHORS = \"anchors\";\nvar _internalLabelOverlayId = \"__label\";\nvar _internalLabelOverlayClass = \"jtk-default-label\";\nvar TYPE_ITEM_OVERLAY = \"overlay\";\nvar LOCATION_ATTRIBUTE = \"labelLocation\";\nvar ACTION_ADD = \"add\";\nvar ACTION_REMOVE = \"remove\";\nfunction _applyTypes(component, params) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(),\n map = {};\n var defType = component.getDefaultType();\n var o = extend({}, defType);\n _mapType(map, defType, DEFAULT_TYPE_KEY);\n component._types.forEach(function (tid) {\n if (tid !== DEFAULT_TYPE_KEY) {\n var _t = component.instance.getType(tid, td);\n if (_t != null) {\n var overrides = new Set([CONNECTOR, ANCHOR, ANCHORS]);\n if (_t.mergeStrategy === MERGE_STRATEGY_OVERRIDE) {\n for (var k in _t) {\n overrides.add(k);\n }\n }\n o = merge(o, _t, [CSS_CLASS], setToArray(overrides));\n _mapType(map, _t, tid);\n }\n }\n });\n if (params) {\n o = populate(o, params, \"_\");\n }\n component.applyType(o, map);\n }\n}\nfunction _removeTypeCssHelper(component, typeId) {\n var type = component.instance.getType(typeId, component.getTypeDescriptor());\n if (type != null && type.cssClass) {\n component.removeClass(type.cssClass);\n }\n}\nfunction _updateHoverStyle(component) {\n if (component.paintStyle && component.hoverPaintStyle) {\n var mergedHoverStyle = {};\n extend(mergedHoverStyle, component.paintStyle);\n extend(mergedHoverStyle, component.hoverPaintStyle);\n component.hoverPaintStyle = mergedHoverStyle;\n }\n}\nvar ADD_CLASS_ACTION = \"add\";\nvar REMOVE_CLASS_ACTION = \"remove\";\nfunction _makeLabelOverlay(component, params) {\n var _params = {\n cssClass: params.cssClass,\n id: _internalLabelOverlayId,\n component: component\n },\n mergedParams = extend(_params, params);\n return new LabelOverlay(component.instance, component, mergedParams);\n}\nfunction _processOverlay(component, o) {\n var _newOverlay = null;\n if (isString(o)) {\n _newOverlay = OverlayFactory.get(component.instance, o, component, {});\n } else if (o.type != null && o.options != null) {\n var oa = o;\n var p = extend({}, oa.options);\n _newOverlay = OverlayFactory.get(component.instance, oa.type, component, p);\n } else {\n _newOverlay = o;\n }\n _newOverlay.id = _newOverlay.id || uuid();\n component.cacheTypeItem(TYPE_ITEM_OVERLAY, _newOverlay, _newOverlay.id);\n component.overlays[_newOverlay.id] = _newOverlay;\n return _newOverlay;\n}\nvar Component = function (_EventGenerator) {\n _inherits(Component, _EventGenerator);\n var _super = _createSuper(Component);\n function Component(instance, params) {\n var _this;\n _classCallCheck(this, Component);\n _this = _super.call(this);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"defaultLabelLocation\", 0.5);\n _defineProperty(_assertThisInitialized(_this), \"overlays\", {});\n _defineProperty(_assertThisInitialized(_this), \"overlayPositions\", {});\n _defineProperty(_assertThisInitialized(_this), \"overlayPlacements\", {});\n _defineProperty(_assertThisInitialized(_this), \"clone\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"deleted\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"segment\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"x\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"y\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"w\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"h\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"id\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"visible\", true);\n _defineProperty(_assertThisInitialized(_this), \"typeId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"params\", {});\n _defineProperty(_assertThisInitialized(_this), \"paintStyle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"hoverPaintStyle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"paintStyleInUse\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_hover\", false);\n _defineProperty(_assertThisInitialized(_this), \"lastPaintedAt\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"data\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_defaultType\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"events\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"parameters\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_types\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_typeCache\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cssClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"hoverClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"beforeDetach\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"beforeDrop\", void 0);\n params = params || {};\n _this.cssClass = params.cssClass || \"\";\n _this.hoverClass = params.hoverClass || instance.defaults.hoverClass;\n _this.beforeDetach = params.beforeDetach;\n _this.beforeDrop = params.beforeDrop;\n _this._types = new Set();\n _this._typeCache = {};\n _this.parameters = clone(params.parameters || {});\n _this.id = params.id || _this.getIdPrefix() + new Date().getTime();\n _this._defaultType = {\n parameters: _this.parameters,\n scope: params.scope || _this.instance.defaultScope,\n overlays: {}\n };\n if (params.events) {\n for (var evtName in params.events) {\n _this.bind(evtName, params.events[evtName]);\n }\n }\n _this.clone = function () {\n var o = Object.create(_this.constructor.prototype);\n _this.constructor.apply(o, [instance, params]);\n return o;\n };\n _this.overlays = {};\n _this.overlayPositions = {};\n var o = params.overlays || [],\n oo = {};\n var defaultOverlayKey = _this.getDefaultOverlayKey();\n if (defaultOverlayKey) {\n var defaultOverlays = _this.instance.defaults[defaultOverlayKey];\n if (defaultOverlays) {\n o.push.apply(o, _toConsumableArray(defaultOverlays));\n }\n for (var i = 0; i < o.length; i++) {\n var fo = convertToFullOverlaySpec(o[i]);\n oo[fo.options.id] = fo;\n }\n }\n _this._defaultType.overlays = oo;\n if (params.label) {\n _this.getDefaultType().overlays[_internalLabelOverlayId] = {\n type: LabelOverlay.type,\n options: {\n label: params.label,\n location: params.labelLocation || _this.defaultLabelLocation,\n id: _internalLabelOverlayId,\n cssClass: _internalLabelOverlayClass\n }\n };\n }\n return _this;\n }\n _createClass(Component, [{\n key: \"isDetachAllowed\",\n value: function isDetachAllowed(connection) {\n var r = true;\n if (this.beforeDetach) {\n try {\n r = this.beforeDetach(connection);\n } catch (e) {\n log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n }\n }, {\n key: \"isDropAllowed\",\n value: function isDropAllowed(sourceId, targetId, scope, connection, dropEndpoint) {\n var r;\n var payload = {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint\n };\n if (this.beforeDrop) {\n try {\n r = this.beforeDrop(payload);\n } catch (e) {\n log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n } else {\n r = this.instance.checkCondition(INTERCEPT_BEFORE_DROP, payload);\n }\n return r;\n }\n }, {\n key: \"getDefaultType\",\n value: function getDefaultType() {\n return this._defaultType;\n }\n }, {\n key: \"appendToDefaultType\",\n value: function appendToDefaultType(obj) {\n for (var i in obj) {\n this._defaultType[i] = obj[i];\n }\n }\n }, {\n key: \"getId\",\n value: function getId() {\n return this.id;\n }\n }, {\n key: \"cacheTypeItem\",\n value: function cacheTypeItem(key, item, typeId) {\n this._typeCache[typeId] = this._typeCache[typeId] || {};\n this._typeCache[typeId][key] = item;\n }\n }, {\n key: \"getCachedTypeItem\",\n value: function getCachedTypeItem(key, typeId) {\n return this._typeCache[typeId] ? this._typeCache[typeId][key] : null;\n }\n }, {\n key: \"setType\",\n value: function setType(typeId, params) {\n this.clearTypes();\n (_splitType(typeId) || []).forEach(this._types.add, this._types);\n _applyTypes(this, params);\n }\n }, {\n key: \"getType\",\n value: function getType() {\n return Array.from(this._types.keys());\n }\n }, {\n key: \"reapplyTypes\",\n value: function reapplyTypes(params) {\n _applyTypes(this, params);\n }\n }, {\n key: \"hasType\",\n value: function hasType(typeId) {\n return this._types.has(typeId);\n }\n }, {\n key: \"addType\",\n value: function addType(typeId, params) {\n var t = _splitType(typeId),\n _somethingAdded = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this._types.has(t[i])) {\n this._types.add(t[i]);\n _somethingAdded = true;\n }\n }\n if (_somethingAdded) {\n _applyTypes(this, params);\n }\n }\n }\n }, {\n key: \"removeType\",\n value: function removeType(typeId, params) {\n var _this2 = this;\n var t = _splitType(typeId),\n _cont = false,\n _one = function _one(tt) {\n if (_this2._types.has(tt)) {\n _removeTypeCssHelper(_this2, tt);\n _this2._types[\"delete\"](tt);\n return true;\n }\n return false;\n };\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params);\n }\n }\n }\n }, {\n key: \"clearTypes\",\n value: function clearTypes(params) {\n var _this3 = this;\n this._types.forEach(function (t) {\n _removeTypeCssHelper(_this3, t);\n });\n this._types.clear();\n _applyTypes(this, params);\n }\n }, {\n key: \"toggleType\",\n value: function toggleType(typeId, params) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (this._types.has(t[i])) {\n _removeTypeCssHelper(this, t[i]);\n this._types[\"delete\"](t[i]);\n } else {\n this._types.add(t[i]);\n }\n }\n _applyTypes(this, params);\n }\n }\n }, {\n key: \"applyType\",\n value: function applyType(t, params) {\n this.setPaintStyle(t.paintStyle);\n this.setHoverPaintStyle(t.hoverPaintStyle);\n this.mergeParameters(t.parameters);\n this.paintStyleInUse = this.getPaintStyle();\n if (t.overlays) {\n var keep = {},\n i;\n for (i in t.overlays) {\n var existing = this.overlays[t.overlays[i].options.id];\n if (existing) {\n existing.updateFrom(t.overlays[i].options);\n keep[t.overlays[i].options.id] = true;\n this.instance.reattachOverlay(existing, this);\n } else {\n var _c = this.getCachedTypeItem(TYPE_ITEM_OVERLAY, t.overlays[i].options.id);\n if (_c != null) {\n this.instance.reattachOverlay(_c, this);\n _c.setVisible(true);\n _c.updateFrom(t.overlays[i].options);\n this.overlays[_c.id] = _c;\n } else {\n _c = this.addOverlay(t.overlays[i]);\n }\n keep[_c.id] = true;\n }\n }\n for (i in this.overlays) {\n if (keep[this.overlays[i].id] == null) {\n this.removeOverlay(this.overlays[i].id, true);\n }\n }\n }\n }\n }, {\n key: \"setPaintStyle\",\n value: function setPaintStyle(style) {\n this.paintStyle = style;\n this.paintStyleInUse = this.paintStyle;\n _updateHoverStyle(this);\n }\n }, {\n key: \"getPaintStyle\",\n value: function getPaintStyle() {\n return this.paintStyle;\n }\n }, {\n key: \"setHoverPaintStyle\",\n value: function setHoverPaintStyle(style) {\n this.hoverPaintStyle = style;\n _updateHoverStyle(this);\n }\n }, {\n key: \"getHoverPaintStyle\",\n value: function getHoverPaintStyle() {\n return this.hoverPaintStyle;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n for (var i in this.overlays) {\n this.instance.destroyOverlay(this.overlays[i]);\n }\n this.overlays = {};\n this.overlayPositions = {};\n this.unbind();\n this.clone = null;\n }\n }, {\n key: \"isHover\",\n value: function isHover() {\n return this._hover;\n }\n }, {\n key: \"mergeParameters\",\n value: function mergeParameters(p) {\n if (p != null) {\n extend(this.parameters, p);\n }\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v) {\n this.visible = v;\n if (v) {\n this.showOverlays();\n } else {\n this.hideOverlays();\n }\n }\n }, {\n key: \"isVisible\",\n value: function isVisible() {\n return this.visible;\n }\n }, {\n key: \"setAbsoluteOverlayPosition\",\n value: function setAbsoluteOverlayPosition(overlay, xy) {\n this.overlayPositions[overlay.id] = xy;\n }\n }, {\n key: \"getAbsoluteOverlayPosition\",\n value: function getAbsoluteOverlayPosition(overlay) {\n return this.overlayPositions ? this.overlayPositions[overlay.id] : null;\n }\n }, {\n key: \"_clazzManip\",\n value: function _clazzManip(action, clazz) {\n for (var i in this.overlays) {\n if (action === ACTION_ADD) {\n this.instance.addOverlayClass(this.overlays[i], clazz);\n } else if (action === ACTION_REMOVE) {\n this.instance.removeOverlayClass(this.overlays[i], clazz);\n }\n }\n }\n }, {\n key: \"addClass\",\n value: function addClass(clazz, cascade) {\n var parts = (this.cssClass || \"\").split(\" \");\n parts.push(clazz);\n this.cssClass = parts.join(\" \");\n this._clazzManip(ACTION_ADD, clazz);\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(clazz, cascade) {\n var parts = (this.cssClass || \"\").split(\" \");\n this.cssClass = parts.filter(function (p) {\n return p !== clazz;\n }).join(\" \");\n this._clazzManip(ACTION_REMOVE, clazz);\n }\n }, {\n key: \"getClass\",\n value: function getClass() {\n return this.cssClass;\n }\n }, {\n key: \"shouldFireEvent\",\n value: function shouldFireEvent(event, value, originalEvent) {\n return true;\n }\n }, {\n key: \"getData\",\n value: function getData() {\n return this.data;\n }\n }, {\n key: \"setData\",\n value: function setData(d) {\n this.data = d || {};\n }\n }, {\n key: \"mergeData\",\n value: function mergeData(d) {\n this.data = extend(this.data, d);\n }\n }, {\n key: \"addOverlay\",\n value: function addOverlay(overlay) {\n var o = _processOverlay(this, overlay);\n if (this.getData && o.type === LabelOverlay.type && !isString(overlay)) {\n var d = this.getData(),\n p = overlay.options;\n if (d) {\n var locationAttribute = p.labelLocationAttribute || LOCATION_ATTRIBUTE;\n var loc = d[locationAttribute];\n if (loc) {\n o.location = loc;\n }\n }\n }\n return o;\n }\n }, {\n key: \"getOverlay\",\n value: function getOverlay(id) {\n return this.overlays[id];\n }\n }, {\n key: \"getOverlays\",\n value: function getOverlays() {\n return this.overlays;\n }\n }, {\n key: \"hideOverlay\",\n value: function hideOverlay(id) {\n var o = this.getOverlay(id);\n if (o) {\n o.setVisible(false);\n }\n }\n }, {\n key: \"hideOverlays\",\n value: function hideOverlays() {\n for (var _len = arguments.length, ids = new Array(_len), _key = 0; _key < _len; _key++) {\n ids[_key] = arguments[_key];\n }\n ids = ids || [];\n for (var i in this.overlays) {\n if (ids.length === 0 || ids.indexOf(i) !== -1) {\n this.overlays[i].setVisible(false);\n }\n }\n }\n }, {\n key: \"showOverlay\",\n value: function showOverlay(id) {\n var o = this.getOverlay(id);\n if (o) {\n o.setVisible(true);\n }\n }\n }, {\n key: \"showOverlays\",\n value: function showOverlays() {\n for (var _len2 = arguments.length, ids = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n ids[_key2] = arguments[_key2];\n }\n ids = ids || [];\n for (var i in this.overlays) {\n if (ids.length === 0 || ids.indexOf(i) !== -1) {\n this.overlays[i].setVisible(true);\n }\n }\n }\n }, {\n key: \"removeAllOverlays\",\n value: function removeAllOverlays() {\n for (var i in this.overlays) {\n this.instance.destroyOverlay(this.overlays[i]);\n }\n this.overlays = {};\n this.overlayPositions = null;\n this.overlayPlacements = {};\n }\n }, {\n key: \"removeOverlay\",\n value: function removeOverlay(overlayId, dontCleanup) {\n var o = this.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup) {\n this.instance.destroyOverlay(o);\n }\n delete this.overlays[overlayId];\n if (this.overlayPositions) {\n delete this.overlayPositions[overlayId];\n }\n if (this.overlayPlacements) {\n delete this.overlayPlacements[overlayId];\n }\n }\n }\n }, {\n key: \"removeOverlays\",\n value: function removeOverlays() {\n for (var _len3 = arguments.length, overlays = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n overlays[_key3] = arguments[_key3];\n }\n for (var i = 0, j = overlays.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n }\n }, {\n key: \"getLabel\",\n value: function getLabel() {\n var lo = this.getLabelOverlay();\n return lo != null ? lo.getLabel() : null;\n }\n }, {\n key: \"getLabelOverlay\",\n value: function getLabelOverlay() {\n return this.getOverlay(_internalLabelOverlayId);\n }\n }, {\n key: \"setLabel\",\n value: function setLabel(l) {\n var lo = this.getLabelOverlay();\n if (!lo) {\n var _params2 = isString(l) || isFunction(l) ? {\n label: l\n } : l;\n lo = _makeLabelOverlay(this, _params2);\n this.overlays[_internalLabelOverlayId] = lo;\n } else {\n if (isString(l) || isFunction(l)) {\n lo.setLabel(l);\n } else {\n var ll = l;\n if (ll.label) {\n lo.setLabel(ll.label);\n }\n if (ll.location) {\n lo.location = ll.location;\n }\n }\n }\n }\n }]);\n return Component;\n}(EventGenerator);\n\nvar typeParameters = [\"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\", \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\"];\nvar Endpoint = function (_Component) {\n _inherits(Endpoint, _Component);\n var _super = _createSuper(Endpoint);\n function Endpoint(instance, params) {\n var _this;\n _classCallCheck(this, Endpoint);\n _this = _super.call(this, instance, params);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"connections\", []);\n _defineProperty(_assertThisInitialized(_this), \"endpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"element\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"elementId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"dragAllowedWhenFull\", true);\n _defineProperty(_assertThisInitialized(_this), \"timestamp\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"portId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"maxConnections\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"proxiedBy\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectorClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectorHoverClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"finalEndpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"enabled\", true);\n _defineProperty(_assertThisInitialized(_this), \"isSource\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"isTarget\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"isTemporarySource\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectionCost\", 1);\n _defineProperty(_assertThisInitialized(_this), \"connectionsDirected\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectionsDetachable\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"reattachConnections\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"currentAnchorClass\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"referenceEndpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"edgeType\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connector\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectorOverlays\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectorStyle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connectorHoverStyle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"deleteOnEmpty\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"uuid\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"scope\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_anchor\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"defaultLabelLocation\", [0.5, 0.5]);\n _this.appendToDefaultType({\n edgeType: params.edgeType,\n maxConnections: params.maxConnections == null ? _this.instance.defaults.maxConnections : params.maxConnections,\n paintStyle: params.paintStyle || _this.instance.defaults.endpointStyle,\n hoverPaintStyle: params.hoverPaintStyle || _this.instance.defaults.endpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector\n });\n _this.enabled = !(params.enabled === false);\n _this.visible = true;\n _this.element = params.element;\n _this.uuid = params.uuid;\n _this.portId = params.portId;\n _this.elementId = params.elementId;\n _this.connectionCost = params.connectionCost == null ? 1 : params.connectionCost;\n _this.connectionsDirected = params.connectionsDirected;\n _this.currentAnchorClass = \"\";\n _this.events = {};\n _this.connectorOverlays = params.connectorOverlays;\n _this.connectorStyle = params.connectorStyle;\n _this.connectorHoverStyle = params.connectorHoverStyle;\n _this.connector = params.connector;\n _this.edgeType = params.edgeType;\n _this.connectorClass = params.connectorClass;\n _this.connectorHoverClass = params.connectorHoverClass;\n _this.deleteOnEmpty = params.deleteOnEmpty === true;\n _this.isSource = params.source || false;\n _this.isTemporarySource = params.isTemporarySource || false;\n _this.isTarget = params.target || false;\n _this.connections = params.connections || [];\n _this.scope = params.scope || instance.defaultScope;\n _this.timestamp = null;\n _this.reattachConnections = params.reattachConnections || instance.defaults.reattachConnections;\n _this.connectionsDetachable = instance.defaults.connectionsDetachable;\n if (params.connectionsDetachable === false) {\n _this.connectionsDetachable = false;\n }\n _this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n if (params.onMaxConnections) {\n _this.bind(EVENT_MAX_CONNECTIONS, params.onMaxConnections);\n }\n var ep = params.endpoint || params.existingEndpoint || instance.defaults.endpoint;\n _this.setEndpoint(ep);\n if (params.preparedAnchor != null) {\n _this.setPreparedAnchor(params.preparedAnchor);\n } else {\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : instance.defaults.anchor || AnchorLocations.Top;\n _this.setAnchor(anchorParamsToUse);\n }\n var type = [DEFAULT, params.type || \"\"].join(\" \");\n _this.addType(type, params.data);\n return _this;\n }\n _createClass(Endpoint, [{\n key: \"getIdPrefix\",\n value: function getIdPrefix() {\n return \"_jsplumb_e\";\n }\n }, {\n key: \"getTypeDescriptor\",\n value: function getTypeDescriptor() {\n return \"endpoint\";\n }\n }, {\n key: \"getXY\",\n value: function getXY() {\n return {\n x: this.endpoint.x,\n y: this.endpoint.y\n };\n }\n }, {\n key: \"getDefaultOverlayKey\",\n value: function getDefaultOverlayKey() {\n return \"endpointOverlays\";\n }\n }, {\n key: \"_updateAnchorClass\",\n value: function _updateAnchorClass() {\n var ac = this._anchor && this._anchor.cssClass;\n if (ac != null && ac.length > 0) {\n var oldAnchorClass = this.instance.endpointAnchorClassPrefix + \"-\" + this.currentAnchorClass;\n this.currentAnchorClass = ac;\n var anchorClass = this.instance.endpointAnchorClassPrefix + (this.currentAnchorClass ? \"-\" + this.currentAnchorClass : \"\");\n if (oldAnchorClass !== anchorClass) {\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n this.instance.removeClass(this.element, oldAnchorClass);\n this.instance.addClass(this.element, anchorClass);\n }\n }\n }\n }, {\n key: \"setPreparedAnchor\",\n value: function setPreparedAnchor(anchor) {\n this.instance.router.setAnchor(this, anchor);\n this._updateAnchorClass();\n return this;\n }\n }, {\n key: \"_anchorLocationChanged\",\n value: function _anchorLocationChanged(currentAnchor) {\n this.fire(EVENT_ANCHOR_CHANGED, {\n endpoint: this,\n anchor: currentAnchor\n });\n this._updateAnchorClass();\n }\n }, {\n key: \"setAnchor\",\n value: function setAnchor(anchorParams) {\n var a = this.instance.router.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a);\n return this;\n }\n }, {\n key: \"addConnection\",\n value: function addConnection(conn) {\n this.connections.push(conn);\n this.instance._refreshEndpoint(this);\n }\n }, {\n key: \"detachFromConnection\",\n value: function detachFromConnection(connection, idx, transientDetach) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this.instance._refreshEndpoint(this);\n }\n if (!transientDetach && this.deleteOnEmpty && this.connections.length === 0) {\n this.instance.deleteEndpoint(this);\n }\n }\n }, {\n key: \"deleteEveryConnection\",\n value: function deleteEveryConnection(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n this.instance.deleteConnection(this.connections[0], params);\n }\n }\n }, {\n key: \"detachFrom\",\n value: function detachFrom(otherEndpoint) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === otherEndpoint || this.connections[i].endpoints[0] === otherEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n this.instance.deleteConnection(c[0]);\n }\n return this;\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n _get(_getPrototypeOf(Endpoint.prototype), \"setVisible\", this).call(this, v);\n this.endpoint.setVisible(v);\n if (v) {\n this.showOverlays();\n } else {\n this.hideOverlays();\n }\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n }\n }, {\n key: \"applyType\",\n value: function applyType(t, typeMap) {\n _get(_getPrototypeOf(Endpoint.prototype), \"applyType\", this).call(this, t, typeMap);\n this.setPaintStyle(t.endpointStyle || t.paintStyle);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle);\n this.connectorStyle = t.connectorStyle;\n this.connectorHoverStyle = t.connectorHoverStyle;\n this.connector = t.connector;\n this.connectorOverlays = t.connectorOverlays;\n this.edgeType = t.edgeType;\n if (t.maxConnections != null) {\n this.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n extend(t, typeParameters);\n this.instance.applyEndpointType(this, t);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Endpoint.prototype), \"destroy\", this).call(this);\n this.deleted = true;\n if (this.endpoint != null) {\n this.instance.destroyEndpoint(this);\n }\n }\n }, {\n key: \"isFull\",\n value: function isFull() {\n return this.maxConnections === 0 ? true : !(this.isFloating() || this.maxConnections < 0 || this.connections.length < this.maxConnections);\n }\n }, {\n key: \"isFloating\",\n value: function isFloating() {\n return this.instance.router.isFloating(this);\n }\n }, {\n key: \"isConnectedTo\",\n value: function isConnectedTo(otherEndpoint) {\n var found = false;\n if (otherEndpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === otherEndpoint || this.connections[i].endpoints[0] === otherEndpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n }\n }, {\n key: \"setDragAllowedWhenFull\",\n value: function setDragAllowedWhenFull(allowed) {\n this.dragAllowedWhenFull = allowed;\n }\n }, {\n key: \"getUuid\",\n value: function getUuid() {\n return this.uuid;\n }\n }, {\n key: \"connectorSelector\",\n value: function connectorSelector() {\n return this.connections[0];\n }\n }, {\n key: \"prepareEndpoint\",\n value: function prepareEndpoint(ep, typeId) {\n var endpointArgs = {\n cssClass: this.cssClass,\n endpoint: this\n };\n var endpoint;\n if (isAssignableFrom(ep, EndpointRepresentation)) {\n var epr = ep;\n endpoint = EndpointFactory.clone(epr);\n endpoint.classes = endpointArgs.cssClass.split(\" \");\n } else if (isString(ep)) {\n endpoint = EndpointFactory.get(this, ep, endpointArgs);\n } else {\n var fep = ep;\n extend(endpointArgs, fep.options || {});\n endpoint = EndpointFactory.get(this, fep.type, endpointArgs);\n }\n endpoint.typeId = typeId;\n return endpoint;\n }\n }, {\n key: \"setEndpoint\",\n value: function setEndpoint(ep) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep);\n }\n }, {\n key: \"setPreparedEndpoint\",\n value: function setPreparedEndpoint(ep) {\n if (this.endpoint != null) {\n this.instance.destroyEndpoint(this);\n }\n this.endpoint = ep;\n }\n }, {\n key: \"addClass\",\n value: function addClass(clazz, cascade) {\n _get(_getPrototypeOf(Endpoint.prototype), \"addClass\", this).call(this, clazz, cascade);\n if (this.endpoint != null) {\n this.endpoint.addClass(clazz);\n }\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(clazz, cascade) {\n _get(_getPrototypeOf(Endpoint.prototype), \"removeClass\", this).call(this, clazz, cascade);\n if (this.endpoint != null) {\n this.endpoint.removeClass(clazz);\n }\n }\n }]);\n return Endpoint;\n}(Component);\n\nvar TYPE_ITEM_ANCHORS = \"anchors\";\nvar TYPE_ITEM_CONNECTOR = \"connector\";\nfunction prepareEndpoint(conn, existing, index, anchor, element, elementId, endpoint) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n var ep = endpoint || conn.endpointSpec || conn.endpointsSpec[index] || conn.instance.defaults.endpoints[index] || conn.instance.defaults.endpoint;\n var es = conn.endpointStyles[index] || conn.endpointStyle || conn.instance.defaults.endpointStyles[index] || conn.instance.defaults.endpointStyle;\n if (es.fill == null && conn.paintStyle != null) {\n es.fill = conn.paintStyle.stroke;\n }\n if (es.outlineStroke == null && conn.paintStyle != null) {\n es.outlineStroke = conn.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && conn.paintStyle != null) {\n es.outlineWidth = conn.paintStyle.outlineWidth;\n }\n var ehs = conn.endpointHoverStyles[index] || conn.endpointHoverStyle || conn.endpointHoverStyle || conn.instance.defaults.endpointHoverStyles[index] || conn.instance.defaults.endpointHoverStyle;\n if (conn.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = conn.hoverPaintStyle.stroke;\n }\n }\n var u = conn.uuids ? conn.uuids[index] : null;\n anchor = anchor != null ? anchor : conn.instance.defaults.anchors != null ? conn.instance.defaults.anchors[index] : conn.instance.defaults.anchor;\n e = conn.instance._internal_newEndpoint({\n paintStyle: es,\n hoverPaintStyle: ehs,\n endpoint: ep,\n connections: [conn],\n uuid: u,\n element: element,\n scope: conn.scope,\n anchor: anchor,\n reattachConnections: conn.reattach || conn.instance.defaults.reattachConnections,\n connectionsDetachable: conn.detachable || conn.instance.defaults.connectionsDetachable\n });\n conn.instance._refreshEndpoint(e);\n if (existing == null) {\n e.deleteOnEmpty = true;\n }\n conn.endpoints[index] = e;\n }\n return e;\n}\nvar Connection = function (_Component) {\n _inherits(Connection, _Component);\n var _super = _createSuper(Connection);\n function Connection(instance, params) {\n var _this;\n _classCallCheck(this, Connection);\n _this = _super.call(this, instance, params);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"connector\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"defaultLabelLocation\", 0.5);\n _defineProperty(_assertThisInitialized(_this), \"scope\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"typeId\", \"_jsplumb_connection\");\n _defineProperty(_assertThisInitialized(_this), \"previousConnection\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"sourceId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"targetId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"source\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"target\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"detachable\", true);\n _defineProperty(_assertThisInitialized(_this), \"reattach\", false);\n _defineProperty(_assertThisInitialized(_this), \"uuids\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cost\", 1);\n _defineProperty(_assertThisInitialized(_this), \"directed\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endpoints\", [null, null]);\n _defineProperty(_assertThisInitialized(_this), \"endpointStyles\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endpointSpec\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endpointsSpec\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endpointStyle\", {});\n _defineProperty(_assertThisInitialized(_this), \"endpointHoverStyle\", {});\n _defineProperty(_assertThisInitialized(_this), \"endpointHoverStyles\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"suspendedEndpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"suspendedIndex\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"suspendedElement\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"suspendedElementId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"suspendedElementType\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_forceReattach\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_forceDetach\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"proxies\", []);\n _defineProperty(_assertThisInitialized(_this), \"pending\", false);\n _this.id = params.id;\n _this.previousConnection = params.previousConnection;\n _this.source = params.source;\n _this.target = params.target;\n if (params.sourceEndpoint) {\n _this.source = params.sourceEndpoint.element;\n _this.sourceId = params.sourceEndpoint.elementId;\n } else {\n _this.sourceId = instance.getId(_this.source);\n }\n if (params.targetEndpoint) {\n _this.target = params.targetEndpoint.element;\n _this.targetId = params.targetEndpoint.elementId;\n } else {\n _this.targetId = instance.getId(_this.target);\n }\n _this.scope = params.scope;\n var sourceAnchor = params.anchors ? params.anchors[0] : params.anchor;\n var targetAnchor = params.anchors ? params.anchors[1] : params.anchor;\n instance.manage(_this.source);\n instance.manage(_this.target);\n _this.visible = true;\n _this.params = {\n cssClass: params.cssClass,\n hoverClass: params.hoverClass,\n \"pointer-events\": params[\"pointer-events\"],\n overlays: params.overlays\n };\n _this.lastPaintedAt = null;\n if (params.type) {\n params.endpoints = params.endpoints || _this.instance._deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n _this.endpointSpec = params.endpoint;\n _this.endpointsSpec = params.endpoints || [null, null];\n _this.endpointStyle = params.endpointStyle;\n _this.endpointHoverStyle = params.endpointHoverStyle;\n _this.endpointStyles = params.endpointStyles || [null, null];\n _this.endpointHoverStyles = params.endpointHoverStyles || [null, null];\n _this.paintStyle = params.paintStyle;\n _this.hoverPaintStyle = params.hoverPaintStyle;\n _this.uuids = params.uuids;\n _this.makeEndpoint(true, _this.source, _this.sourceId, sourceAnchor, params.sourceEndpoint);\n _this.makeEndpoint(false, _this.target, _this.targetId, targetAnchor, params.targetEndpoint);\n if (!_this.scope) {\n _this.scope = _this.endpoints[0].scope;\n }\n if (params.deleteEndpointsOnEmpty != null) {\n _this.endpoints[0].deleteOnEmpty = params.deleteEndpointsOnEmpty;\n _this.endpoints[1].deleteOnEmpty = params.deleteEndpointsOnEmpty;\n }\n var _detachable = _this.instance.defaults.connectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (_this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (_this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n _this.endpointsSpec = params.endpoints || [null, null];\n _this.endpointSpec = params.endpoint || null;\n var _reattach = params.reattach || _this.endpoints[0].reattachConnections || _this.endpoints[1].reattachConnections || _this.instance.defaults.reattachConnections;\n var initialPaintStyle = extend({}, _this.endpoints[0].connectorStyle || _this.endpoints[1].connectorStyle || params.paintStyle || _this.instance.defaults.paintStyle);\n _this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle: initialPaintStyle,\n hoverPaintStyle: extend({}, _this.endpoints[0].connectorHoverStyle || _this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _this.instance.defaults.hoverPaintStyle)\n });\n if (params.outlineWidth) {\n initialPaintStyle.outlineWidth = params.outlineWidth;\n }\n if (params.outlineColor) {\n initialPaintStyle.outlineStroke = params.outlineColor;\n }\n if (params.lineWidth) {\n initialPaintStyle.strokeWidth = params.lineWidth;\n }\n if (params.color) {\n initialPaintStyle.stroke = params.color;\n }\n if (!_this.instance._suspendDrawing) {\n var initialTimestamp = _this.instance._suspendedAt || uuid();\n _this.instance._paintEndpoint(_this.endpoints[0], {\n timestamp: initialTimestamp\n });\n _this.instance._paintEndpoint(_this.endpoints[1], {\n timestamp: initialTimestamp\n });\n }\n _this.cost = params.cost || _this.endpoints[0].connectionCost;\n _this.directed = params.directed;\n if (params.directed == null) {\n _this.directed = _this.endpoints[0].connectionsDirected;\n }\n var _p = extend({}, _this.endpoints[1].parameters);\n extend(_p, _this.endpoints[0].parameters);\n extend(_p, _this.parameters);\n _this.parameters = _p;\n _this.paintStyleInUse = _this.getPaintStyle() || {};\n _this._setConnector(_this.endpoints[0].connector || _this.endpoints[1].connector || params.connector || _this.instance.defaults.connector, true);\n var data = params.data == null || !isObject(params.data) ? {} : params.data;\n _this.setData(data);\n var _types = [DEFAULT, _this.endpoints[0].edgeType, _this.endpoints[1].edgeType, params.type].join(\" \");\n if (/[^\\s]/.test(_types)) {\n _this.addType(_types, params.data);\n }\n return _this;\n }\n _createClass(Connection, [{\n key: \"getIdPrefix\",\n value: function getIdPrefix() {\n return \"_jsPlumb_c\";\n }\n }, {\n key: \"getDefaultOverlayKey\",\n value: function getDefaultOverlayKey() {\n return KEY_CONNECTION_OVERLAYS;\n }\n }, {\n key: \"getXY\",\n value: function getXY() {\n return {\n x: this.connector.x,\n y: this.connector.y\n };\n }\n }, {\n key: \"makeEndpoint\",\n value: function makeEndpoint(isSource, el, elId, anchor, ep) {\n elId = elId || this.instance.getId(el);\n return prepareEndpoint(this, ep, isSource ? 0 : 1, anchor, el);\n }\n }, {\n key: \"getTypeDescriptor\",\n value: function getTypeDescriptor() {\n return Connection.type;\n }\n }, {\n key: \"isDetachable\",\n value: function isDetachable(ep) {\n return this.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this.detachable === true;\n }\n }, {\n key: \"setDetachable\",\n value: function setDetachable(detachable) {\n this.detachable = detachable === true;\n }\n }, {\n key: \"isReattach\",\n value: function isReattach() {\n return this.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n }\n }, {\n key: \"setReattach\",\n value: function setReattach(reattach) {\n this.reattach = reattach === true;\n }\n }, {\n key: \"applyType\",\n value: function applyType(t, typeMap) {\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(TYPE_ITEM_CONNECTOR, typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(TYPE_ITEM_CONNECTOR, _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n _get(_getPrototypeOf(Connection.prototype), \"applyType\", this).call(this, t, typeMap);\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n var _anchors = null;\n if (t.anchor) {\n _anchors = this.getCachedTypeItem(TYPE_ITEM_ANCHORS, typeMap.anchor);\n if (_anchors == null) {\n _anchors = [makeLightweightAnchorFromSpec(t.anchor), makeLightweightAnchorFromSpec(t.anchor)];\n this.cacheTypeItem(TYPE_ITEM_ANCHORS, _anchors, typeMap.anchor);\n }\n } else if (t.anchors) {\n _anchors = this.getCachedTypeItem(TYPE_ITEM_ANCHORS, typeMap.anchors);\n if (_anchors == null) {\n _anchors = [makeLightweightAnchorFromSpec(t.anchors[0]), makeLightweightAnchorFromSpec(t.anchors[1])];\n this.cacheTypeItem(TYPE_ITEM_ANCHORS, _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.instance.router.setConnectionAnchors(this, _anchors);\n if (this.instance.router.isDynamicAnchor(this.endpoints[1])) {\n this.instance.repaint(this.endpoints[1].element);\n }\n }\n this.instance.applyConnectorType(this.connector, t);\n }\n }, {\n key: \"addClass\",\n value: function addClass(c, cascade) {\n _get(_getPrototypeOf(Connection.prototype), \"addClass\", this).call(this, c);\n if (cascade) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.instance.addConnectorClass(this.connector, c);\n }\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(c, cascade) {\n _get(_getPrototypeOf(Connection.prototype), \"removeClass\", this).call(this, c);\n if (cascade) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.instance.removeConnectorClass(this.connector, c);\n }\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v) {\n _get(_getPrototypeOf(Connection.prototype), \"setVisible\", this).call(this, v);\n if (this.connector) {\n this.instance.setConnectorVisible(this.connector, v);\n }\n this.instance._paintConnection(this);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Connection.prototype), \"destroy\", this).call(this);\n this.endpoints = null;\n this.endpointStyles = null;\n this.source = null;\n this.target = null;\n this.instance.destroyConnector(this);\n this.connector = null;\n this.deleted = true;\n }\n }, {\n key: \"getUuids\",\n value: function getUuids() {\n return [this.endpoints[0].getUuid(), this.endpoints[1].getUuid()];\n }\n }, {\n key: \"prepareConnector\",\n value: function prepareConnector(connectorSpec, typeId) {\n var connectorArgs = {\n cssClass: this.params.cssClass,\n hoverClass: this.params.hoverClass,\n \"pointer-events\": this.params[\"pointer-events\"]\n },\n connector;\n if (isString(connectorSpec)) {\n connector = this.instance._makeConnector(this, connectorSpec, connectorArgs);\n } else {\n var co = connectorSpec;\n connector = this.instance._makeConnector(this, co.type, merge(co.options || {}, connectorArgs));\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n }\n }, {\n key: \"setPreparedConnector\",\n value: function setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n if (this.connector !== connector) {\n var previous,\n previousClasses = \"\";\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = this.instance.getConnectorClass(this.connector);\n this.instance.destroyConnector(this);\n }\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(TYPE_ITEM_CONNECTOR, connector, typeId);\n }\n this.addClass(previousClasses);\n if (previous != null) {\n var o = this.getOverlays();\n for (var i in o) {\n this.instance.reattachOverlay(o[i], this);\n }\n }\n if (!doNotRepaint) {\n this.instance._paintConnection(this);\n }\n }\n }\n }, {\n key: \"_setConnector\",\n value: function _setConnector(connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n }\n }, {\n key: \"replaceEndpoint\",\n value: function replaceEndpoint(idx, endpointDef) {\n var current = this.endpoints[idx],\n elId = current.elementId,\n ebe = this.instance.getEndpoints(current.element),\n _idx = ebe.indexOf(current),\n _new = prepareEndpoint(this, null, idx, null, current.element, elId, endpointDef);\n this.endpoints[idx] = _new;\n ebe.splice(_idx, 1, _new);\n current.detachFromConnection(this);\n this.instance.deleteEndpoint(current);\n this.instance.fire(EVENT_ENDPOINT_REPLACED, {\n previous: current,\n current: _new\n });\n }\n }]);\n return Connection;\n}(Component);\n_defineProperty(Connection, \"type\", \"connection\");\n\nfunction ensureSVGOverlayPath(o) {\n if (o.path == null) {\n var atts = extend({\n \"jtk-overlay-id\": o.id\n }, o.attributes);\n o.path = _node(ELEMENT_PATH, atts);\n var cls = o.instance.overlayClass + \" \" + (o.cssClass ? o.cssClass : \"\");\n o.instance.addClass(o.path, cls);\n o.path.jtk = {\n overlay: o\n };\n }\n var parent = o.path.parentNode;\n if (parent == null) {\n if (o.component instanceof Connection) {\n var connector = o.component.connector;\n parent = connector != null ? connector.canvas : null;\n } else if (o.component instanceof Endpoint) {\n var endpoint = o.component.endpoint;\n parent = endpoint != null ? endpoint.canvas : endpoint;\n }\n if (parent != null) {\n _appendAtIndex(parent, o.path, 1);\n }\n }\n return o.path;\n}\nfunction paintSVGOverlay(o, path, params, extents) {\n ensureSVGOverlayPath(o);\n var offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n var a = {\n \"d\": path,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": \"visibleStroke\"\n };\n _attr(o.path, a);\n}\nfunction destroySVGOverlay(o, force) {\n var _o = o;\n if (_o.path != null && _o.path.parentNode != null) {\n _o.path.parentNode.removeChild(_o.path);\n }\n if (_o.bgPath != null && _o.bgPath.parentNode != null) {\n _o.bgPath.parentNode.removeChild(_o.bgPath);\n }\n delete _o.path;\n delete _o.bgPath;\n}\n(function (_Overlay) {\n _inherits(SVGElementOverlay, _Overlay);\n var _super = _createSuper(SVGElementOverlay);\n function SVGElementOverlay() {\n var _this;\n _classCallCheck(this, SVGElementOverlay);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"path\", void 0);\n return _this;\n }\n return SVGElementOverlay;\n})(Overlay);\n\nvar SvgComponent = function () {\n function SvgComponent() {\n _classCallCheck(this, SvgComponent);\n }\n _createClass(SvgComponent, null, [{\n key: \"paint\",\n value: function paint(connector, instance, paintStyle, extents) {\n if (paintStyle != null) {\n var xy = [connector.x, connector.y],\n wh = [connector.w, connector.h];\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + (extents.xmin < 0 ? -extents.xmin : 0);\n wh[1] = extents.ymax + (extents.ymin < 0 ? -extents.ymin : 0);\n }\n if (isFinite(wh[0]) && isFinite(wh[1])) {\n var attrs = {\n \"width\": \"\" + (wh[0] || 0),\n \"height\": \"\" + (wh[1] || 0)\n };\n if (instance.containerType === ElementTypes.HTML) {\n _attr(connector.canvas, extend(attrs, {\n style: _pos([xy[0], xy[1]])\n }));\n } else {\n _attr(connector.canvas, extend(attrs, {\n x: xy[0],\n y: xy[1]\n }));\n }\n }\n }\n }\n }]);\n return SvgComponent;\n}();\n\nfunction paintSvgConnector(instance, connector, paintStyle, extents) {\n getConnectorElement(instance, connector);\n SvgComponent.paint(connector, instance, paintStyle, extents);\n var p = \"\",\n offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n if (connector.segments.length > 0) {\n p = instance.getPathData(connector);\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": \"visibleStroke\"\n },\n outlineStyle = null;\n if (paintStyle.outlineStroke) {\n var outlineWidth = paintStyle.outlineWidth || 1,\n outlineStrokeWidth = paintStyle.strokeWidth + 2 * outlineWidth;\n outlineStyle = extend({}, paintStyle);\n outlineStyle.stroke = paintStyle.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n if (connector.bgPath == null) {\n connector.bgPath = _node(ELEMENT_PATH, a);\n instance.addClass(connector.bgPath, instance.connectorOutlineClass);\n _appendAtIndex(connector.canvas, connector.bgPath, 0);\n } else {\n _attr(connector.bgPath, a);\n }\n _applyStyles(connector.canvas, connector.bgPath, outlineStyle);\n }\n var cany = connector;\n if (cany.path == null) {\n cany.path = _node(ELEMENT_PATH, a);\n _appendAtIndex(cany.canvas, cany.path, paintStyle.outlineStroke ? 1 : 0);\n } else {\n if (cany.path.parentNode !== cany.canvas) {\n _appendAtIndex(cany.canvas, cany.path, paintStyle.outlineStroke ? 1 : 0);\n }\n _attr(connector.path, a);\n }\n _applyStyles(connector.canvas, connector.path, paintStyle);\n }\n}\nfunction getConnectorElement(instance, c) {\n if (c.canvas != null) {\n return c.canvas;\n } else {\n var svg = _node(ELEMENT_SVG, {\n \"style\": \"\",\n \"width\": \"0\",\n \"height\": \"0\",\n \"pointer-events\": NONE,\n \"position\": ABSOLUTE\n });\n c.canvas = svg;\n instance._appendElement(c.canvas, instance.getContainer());\n if (c.cssClass != null) {\n instance.addClass(svg, c.cssClass);\n }\n instance.addClass(svg, instance.connectorClass);\n svg.jtk = svg.jtk || {};\n svg.jtk.connector = c;\n return svg;\n }\n}\n\nvar SvgEndpoint = function () {\n function SvgEndpoint() {\n _classCallCheck(this, SvgEndpoint);\n }\n _createClass(SvgEndpoint, null, [{\n key: \"getEndpointElement\",\n value: function getEndpointElement(ep) {\n if (ep.canvas != null) {\n return ep.canvas;\n } else {\n var canvas = _node(ELEMENT_SVG, {\n \"style\": \"\",\n \"width\": \"0\",\n \"height\": \"0\",\n \"pointer-events\": \"all\",\n \"position\": ABSOLUTE\n });\n ep.canvas = canvas;\n var classes = ep.classes.join(\" \");\n ep.instance.addClass(canvas, classes);\n var scopes = ep.endpoint.scope.split(/\\s/);\n for (var i = 0; i < scopes.length; i++) {\n ep.instance.setAttribute(canvas, ATTRIBUTE_SCOPE_PREFIX + scopes[i], TRUE$1);\n }\n ep.instance._appendElementToContainer(canvas);\n if (ep.cssClass != null) {\n ep.instance.addClass(canvas, ep.cssClass);\n }\n ep.instance.addClass(canvas, ep.instance.endpointClass);\n canvas.jtk = canvas.jtk || {};\n canvas.jtk.endpoint = ep.endpoint;\n canvas.style.display = ep.endpoint.visible !== false ? BLOCK : NONE;\n return canvas;\n }\n }\n }, {\n key: \"paint\",\n value: function paint(ep, handlers, paintStyle) {\n if (ep.endpoint.deleted !== true) {\n this.getEndpointElement(ep);\n SvgComponent.paint(ep, ep.instance, paintStyle);\n var s = extend({}, paintStyle);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n if (ep.node == null) {\n ep.node = handlers.makeNode(ep, s);\n ep.canvas.appendChild(ep.node);\n } else if (handlers.updateNode != null) {\n handlers.updateNode(ep, ep.node);\n }\n _applyStyles(ep.canvas, ep.node, s);\n }\n }\n }]);\n return SvgEndpoint;\n}();\n\nvar AbstractConnector = function () {\n function AbstractConnector(connection, params) {\n _classCallCheck(this, AbstractConnector);\n this.connection = connection;\n _defineProperty(this, \"type\", void 0);\n _defineProperty(this, \"edited\", false);\n _defineProperty(this, \"stub\", void 0);\n _defineProperty(this, \"sourceStub\", void 0);\n _defineProperty(this, \"targetStub\", void 0);\n _defineProperty(this, \"maxStub\", void 0);\n _defineProperty(this, \"typeId\", void 0);\n _defineProperty(this, \"gap\", void 0);\n _defineProperty(this, \"sourceGap\", void 0);\n _defineProperty(this, \"targetGap\", void 0);\n _defineProperty(this, \"segments\", []);\n _defineProperty(this, \"totalLength\", 0);\n _defineProperty(this, \"segmentProportions\", []);\n _defineProperty(this, \"segmentProportionalLengths\", []);\n _defineProperty(this, \"paintInfo\", null);\n _defineProperty(this, \"strokeWidth\", void 0);\n _defineProperty(this, \"x\", void 0);\n _defineProperty(this, \"y\", void 0);\n _defineProperty(this, \"w\", void 0);\n _defineProperty(this, \"h\", void 0);\n _defineProperty(this, \"segment\", void 0);\n _defineProperty(this, \"bounds\", EMPTY_BOUNDS());\n _defineProperty(this, \"cssClass\", void 0);\n _defineProperty(this, \"hoverClass\", void 0);\n _defineProperty(this, \"geometry\", void 0);\n this.stub = params.stub || this.getDefaultStubs();\n this.sourceStub = Array.isArray(this.stub) ? this.stub[0] : this.stub;\n this.targetStub = Array.isArray(this.stub) ? this.stub[1] : this.stub;\n this.gap = params.gap || 0;\n this.sourceGap = Array.isArray(this.gap) ? this.gap[0] : this.gap;\n this.targetGap = Array.isArray(this.gap) ? this.gap[1] : this.gap;\n this.maxStub = Math.max(this.sourceStub, this.targetStub);\n this.cssClass = params.cssClass || \"\";\n this.hoverClass = params.hoverClass || \"\";\n }\n _createClass(AbstractConnector, [{\n key: \"getTypeDescriptor\",\n value: function getTypeDescriptor() {\n return \"connector\";\n }\n }, {\n key: \"getIdPrefix\",\n value: function getIdPrefix() {\n return \"_jsplumb_connector\";\n }\n }, {\n key: \"setGeometry\",\n value: function setGeometry(g, internal) {\n this.geometry = g;\n this.edited = g != null && !internal;\n }\n }, {\n key: \"exportGeometry\",\n value: function exportGeometry() {\n return this.geometry;\n }\n }, {\n key: \"importGeometry\",\n value: function importGeometry(g) {\n this.geometry = g;\n return true;\n }\n }, {\n key: \"resetGeometry\",\n value: function resetGeometry() {\n this.geometry = null;\n this.edited = false;\n }\n }, {\n key: \"transformAnchorPlacement\",\n value:\n function transformAnchorPlacement(a, dx, dy) {\n return {\n x: a.x,\n y: a.y,\n ox: a.ox,\n oy: a.oy,\n curX: a.curX + dx,\n curY: a.curY + dy\n };\n }\n }, {\n key: \"resetBounds\",\n value: function resetBounds() {\n this.bounds = EMPTY_BOUNDS();\n }\n }, {\n key: \"findSegmentForPoint\",\n value: function findSegmentForPoint(x, y) {\n var out = {\n d: Infinity,\n s: null,\n x: null,\n y: null,\n l: null,\n x1: null,\n y1: null,\n x2: null,\n y2: null,\n index: null,\n connectorLocation: null\n };\n for (var i = 0; i < this.segments.length; i++) {\n var _s = this.segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = this.segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n out.connectorLocation = this.segmentProportions[i][0] + _s.l * (this.segmentProportions[i][1] - this.segmentProportions[i][0]);\n }\n }\n return out;\n }\n }, {\n key: \"lineIntersection\",\n value: function lineIntersection(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < this.segments.length; i++) {\n out.push.apply(out, this.segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n }\n }, {\n key: \"boxIntersection\",\n value: function boxIntersection(x, y, w, h) {\n var out = [];\n for (var i = 0; i < this.segments.length; i++) {\n out.push.apply(out, this.segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n }\n }, {\n key: \"boundingBoxIntersection\",\n value: function boundingBoxIntersection(box) {\n var out = [];\n for (var i = 0; i < this.segments.length; i++) {\n out.push.apply(out, this.segments[i].boundingBoxIntersection(box));\n }\n return out;\n }\n }, {\n key: \"_updateSegmentProportions\",\n value: function _updateSegmentProportions() {\n var curLoc = 0;\n for (var i = 0; i < this.segments.length; i++) {\n var sl = this.segments[i].getLength();\n this.segmentProportionalLengths[i] = sl / this.totalLength;\n this.segmentProportions[i] = [curLoc, curLoc += sl / this.totalLength];\n }\n }\n }, {\n key: \"_findSegmentForLocation\",\n value: function _findSegmentForLocation(location, absolute) {\n var idx, i, inSegmentProportion;\n if (absolute) {\n location = location > 0 ? location / this.totalLength : (this.totalLength + location) / this.totalLength;\n }\n if (location === 1) {\n idx = this.segments.length - 1;\n inSegmentProportion = 1;\n } else if (location === 0) {\n inSegmentProportion = 0;\n idx = 0;\n } else {\n if (location >= 0.5) {\n idx = 0;\n inSegmentProportion = 0;\n for (i = this.segmentProportions.length - 1; i > -1; i--) {\n if (this.segmentProportions[i][1] >= location && this.segmentProportions[i][0] <= location) {\n idx = i;\n inSegmentProportion = (location - this.segmentProportions[i][0]) / this.segmentProportionalLengths[i];\n break;\n }\n }\n } else {\n idx = this.segmentProportions.length - 1;\n inSegmentProportion = 1;\n for (i = 0; i < this.segmentProportions.length; i++) {\n if (this.segmentProportions[i][1] >= location) {\n idx = i;\n inSegmentProportion = (location - this.segmentProportions[i][0]) / this.segmentProportionalLengths[i];\n break;\n }\n }\n }\n }\n return {\n segment: this.segments[idx],\n proportion: inSegmentProportion,\n index: idx\n };\n }\n }, {\n key: \"_addSegment\",\n value: function _addSegment(clazz, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new clazz(params);\n this.segments.push(s);\n this.totalLength += s.getLength();\n this.updateBounds(s);\n }\n }, {\n key: \"_clearSegments\",\n value: function _clearSegments() {\n this.totalLength = 0;\n this.segments.length = 0;\n this.segmentProportions.length = 0;\n this.segmentProportionalLengths.length = 0;\n }\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.totalLength;\n }\n }, {\n key: \"_prepareCompute\",\n value: function _prepareCompute(params) {\n this.strokeWidth = params.strokeWidth;\n var x1 = params.sourcePos.curX,\n x2 = params.targetPos.curX,\n y1 = params.sourcePos.curY,\n y2 = params.targetPos.curY,\n segment = quadrant({\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n }),\n swapX = x2 < x1,\n swapY = y2 < y1,\n so = [params.sourcePos.ox, params.sourcePos.oy],\n to = [params.targetPos.ox, params.targetPos.oy],\n x = swapX ? x2 : x1,\n y = swapY ? y2 : y1,\n w = Math.abs(x2 - x1),\n h = Math.abs(y2 - y1);\n var noSourceOrientation = so[0] === 0 && so[1] === 0;\n var noTargetOrientation = to[0] === 0 && to[1] === 0;\n if (noSourceOrientation || noTargetOrientation) {\n var index = w > h ? 0 : 1,\n oIndex = [1, 0][index],\n v1 = index === 0 ? x1 : y1,\n v2 = index === 0 ? x2 : y2;\n if (noSourceOrientation) {\n so[index] = v1 > v2 ? -1 : 1;\n so[oIndex] = 0;\n }\n if (noTargetOrientation) {\n to[index] = v1 > v2 ? 1 : -1;\n to[oIndex] = 0;\n }\n }\n var sx = swapX ? w + this.sourceGap * so[0] : this.sourceGap * so[0],\n sy = swapY ? h + this.sourceGap * so[1] : this.sourceGap * so[1],\n tx = swapX ? this.targetGap * to[0] : w + this.targetGap * to[0],\n ty = swapY ? this.targetGap * to[1] : h + this.targetGap * to[1],\n oProduct = so[0] * to[0] + so[1] * to[1];\n var result = {\n sx: sx,\n sy: sy,\n tx: tx,\n ty: ty,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so,\n to: to,\n x: x,\n y: y,\n w: w,\n h: h,\n segment: segment,\n startStubX: sx + so[0] * this.sourceStub,\n startStubY: sy + so[1] * this.sourceStub,\n endStubX: tx + to[0] * this.targetStub,\n endStubY: ty + to[1] * this.targetStub,\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > this.sourceStub + this.targetStub,\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > this.sourceStub + this.targetStub,\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty],\n stubs: [this.sourceStub, this.targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n }\n }, {\n key: \"updateBounds\",\n value: function updateBounds(segment) {\n var segBounds = segment.extents;\n this.bounds.xmin = Math.min(this.bounds.xmin, segBounds.xmin);\n this.bounds.xmax = Math.max(this.bounds.xmax, segBounds.xmax);\n this.bounds.ymin = Math.min(this.bounds.ymin, segBounds.ymin);\n this.bounds.ymax = Math.max(this.bounds.ymax, segBounds.ymax);\n }\n }, {\n key: \"dumpSegmentsToConsole\",\n value: function dumpSegmentsToConsole() {\n log(\"SEGMENTS:\");\n for (var i = 0; i < this.segments.length; i++) {\n log(this.segments[i].type, \"\" + this.segments[i].getLength(), \"\" + this.segmentProportions[i]);\n }\n }\n }, {\n key: \"pointOnPath\",\n value: function pointOnPath(location, absolute) {\n var seg = this._findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || {\n x: 0,\n y: 0\n };\n }\n }, {\n key: \"gradientAtPoint\",\n value: function gradientAtPoint(location, absolute) {\n var seg = this._findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n }\n }, {\n key: \"pointAlongPathFrom\",\n value: function pointAlongPathFrom(location, distance, absolute) {\n var seg = this._findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || {\n x: 0,\n y: 0\n };\n }\n }, {\n key: \"compute\",\n value: function compute(params) {\n this.paintInfo = this._prepareCompute(params);\n this._clearSegments();\n this._compute(this.paintInfo, params);\n this.x = this.paintInfo.points[0];\n this.y = this.paintInfo.points[1];\n this.w = this.paintInfo.points[2];\n this.h = this.paintInfo.points[3];\n this.segment = this.paintInfo.segment;\n this._updateSegmentProportions();\n }\n }, {\n key: \"setAnchorOrientation\",\n value: function setAnchorOrientation(idx, orientation) {}\n }]);\n return AbstractConnector;\n}();\n\nvar DEFAULT_WIDTH = 20;\nvar DEFAULT_LENGTH = 20;\nvar ArrowOverlay = function (_Overlay) {\n _inherits(ArrowOverlay, _Overlay);\n var _super = _createSuper(ArrowOverlay);\n function ArrowOverlay(instance, component, p) {\n var _this;\n _classCallCheck(this, ArrowOverlay);\n _this = _super.call(this, instance, component, p);\n _this.instance = instance;\n _this.component = component;\n _defineProperty(_assertThisInitialized(_this), \"width\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"length\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"foldback\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"direction\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"location\", 0.5);\n _defineProperty(_assertThisInitialized(_this), \"paintStyle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", ArrowOverlay.type);\n _defineProperty(_assertThisInitialized(_this), \"cachedDimensions\", void 0);\n p = p || {};\n _this.width = p.width || DEFAULT_WIDTH;\n _this.length = p.length || DEFAULT_LENGTH;\n _this.direction = (p.direction || 1) < 0 ? -1 : 1;\n _this.foldback = p.foldback || 0.623;\n _this.paintStyle = p.paintStyle || {\n \"strokeWidth\": 1\n };\n _this.location = p.location == null ? _this.location : Array.isArray(p.location) ? p.location[0] : p.location;\n return _this;\n }\n _createClass(ArrowOverlay, [{\n key: \"draw\",\n value: function draw(component, currentConnectionPaintStyle, absolutePosition) {\n if (component instanceof AbstractConnector) {\n var connector = component;\n var hxy, mid, txy, tail, cxy;\n if (this.location > 1 || this.location < 0) {\n var fromLoc = this.location < 0 ? 1 : 0;\n hxy = connector.pointAlongPathFrom(fromLoc, this.location, false);\n mid = connector.pointAlongPathFrom(fromLoc, this.location - this.direction * this.length / 2, false);\n txy = pointOnLine(hxy, mid, this.length);\n } else if (this.location === 1) {\n hxy = connector.pointOnPath(this.location);\n mid = connector.pointAlongPathFrom(this.location, -this.length);\n txy = pointOnLine(hxy, mid, this.length);\n if (this.direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n } else if (this.location === 0) {\n txy = connector.pointOnPath(this.location);\n mid = connector.pointAlongPathFrom(this.location, this.length);\n hxy = pointOnLine(txy, mid, this.length);\n if (this.direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n } else {\n hxy = connector.pointAlongPathFrom(this.location, this.direction * this.length / 2);\n mid = connector.pointOnPath(this.location);\n txy = pointOnLine(hxy, mid, this.length);\n }\n tail = perpendicularLineTo(hxy, txy, this.width);\n cxy = pointOnLine(hxy, txy, this.foldback * this.length);\n var d = {\n hxy: hxy,\n tail: tail,\n cxy: cxy\n },\n stroke = this.paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = this.paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = this.paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n xmin: Math.min(hxy.x, tail[0].x, tail[1].x),\n xmax: Math.max(hxy.x, tail[0].x, tail[1].x),\n ymin: Math.min(hxy.y, tail[0].y, tail[1].y),\n ymax: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n }\n }, {\n key: \"updateFrom\",\n value: function updateFrom(d) {}\n }]);\n return ArrowOverlay;\n}(Overlay);\n_defineProperty(ArrowOverlay, \"type\", \"Arrow\");\nfunction isArrowOverlay(o) {\n return o.type === ArrowOverlay.type;\n}\nOverlayFactory.register(ArrowOverlay.type, ArrowOverlay);\n\nvar DiamondOverlay = function (_ArrowOverlay) {\n _inherits(DiamondOverlay, _ArrowOverlay);\n var _super = _createSuper(DiamondOverlay);\n function DiamondOverlay(instance, component, p) {\n var _this;\n _classCallCheck(this, DiamondOverlay);\n _this = _super.call(this, instance, component, p);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"type\", DiamondOverlay.type);\n _this.length = _this.length / 2;\n _this.foldback = 2;\n return _this;\n }\n return DiamondOverlay;\n}(ArrowOverlay);\n_defineProperty(DiamondOverlay, \"type\", \"Diamond\");\nfunction isDiamondOverlay(o) {\n return o.type === DiamondOverlay.type;\n}\nOverlayFactory.register(DiamondOverlay.type, DiamondOverlay);\n\nvar PlainArrowOverlay = function (_ArrowOverlay) {\n _inherits(PlainArrowOverlay, _ArrowOverlay);\n var _super = _createSuper(PlainArrowOverlay);\n function PlainArrowOverlay(instance, component, p) {\n var _this;\n _classCallCheck(this, PlainArrowOverlay);\n _this = _super.call(this, instance, component, p);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"type\", PlainArrowOverlay.type);\n _this.foldback = 1;\n return _this;\n }\n return PlainArrowOverlay;\n}(ArrowOverlay);\n_defineProperty(PlainArrowOverlay, \"type\", \"PlainArrow\");\nfunction isPlainArrowOverlay(o) {\n return o.type === PlainArrowOverlay.type;\n}\nOverlayFactory.register(\"PlainArrow\", PlainArrowOverlay);\n\nvar CustomOverlay = function (_Overlay) {\n _inherits(CustomOverlay, _Overlay);\n var _super = _createSuper(CustomOverlay);\n function CustomOverlay(instance, component, p) {\n var _this;\n _classCallCheck(this, CustomOverlay);\n _this = _super.call(this, instance, component, p);\n _this.instance = instance;\n _this.component = component;\n _defineProperty(_assertThisInitialized(_this), \"create\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", CustomOverlay.type);\n _this.create = p.create;\n return _this;\n }\n _createClass(CustomOverlay, [{\n key: \"updateFrom\",\n value: function updateFrom(d) {}\n }]);\n return CustomOverlay;\n}(Overlay);\n_defineProperty(CustomOverlay, \"type\", \"Custom\");\nfunction isCustomOverlay(o) {\n return o.type === CustomOverlay.type;\n}\nOverlayFactory.register(CustomOverlay.type, CustomOverlay);\n\nvar DEFAULT_KEY_ALLOW_NESTED_GROUPS = \"allowNestedGroups\";\nvar DEFAULT_KEY_ANCHOR = \"anchor\";\nvar DEFAULT_KEY_ANCHORS = \"anchors\";\nvar DEFAULT_KEY_CONNECTION_OVERLAYS = \"connectionOverlays\";\nvar DEFAULT_KEY_CONNECTIONS_DETACHABLE = \"connectionsDetachable\";\nvar DEFAULT_KEY_CONNECTOR = \"connector\";\nvar DEFAULT_KEY_CONTAINER = \"container\";\nvar DEFAULT_KEY_ENDPOINT = \"endpoint\";\nvar DEFAULT_KEY_ENDPOINT_OVERLAYS = \"endpointOverlays\";\nvar DEFAULT_KEY_ENDPOINTS = \"endpoints\";\nvar DEFAULT_KEY_ENDPOINT_STYLE = \"endpointStyle\";\nvar DEFAULT_KEY_ENDPOINT_STYLES = \"endpointStyles\";\nvar DEFAULT_KEY_ENDPOINT_HOVER_STYLE = \"endpointHoverStyle\";\nvar DEFAULT_KEY_ENDPOINT_HOVER_STYLES = \"endpointHoverStyles\";\nvar DEFAULT_KEY_HOVER_CLASS = \"hoverClass\";\nvar DEFAULT_KEY_HOVER_PAINT_STYLE = \"hoverPaintStyle\";\nvar DEFAULT_KEY_LIST_STYLE = \"listStyle\";\nvar DEFAULT_KEY_MAX_CONNECTIONS = \"maxConnections\";\nvar DEFAULT_KEY_PAINT_STYLE = \"paintStyle\";\nvar DEFAULT_KEY_REATTACH_CONNECTIONS = \"reattachConnections\";\nvar DEFAULT_KEY_SCOPE = \"scope\";\n\nvar DotEndpoint = function (_EndpointRepresentati) {\n _inherits(DotEndpoint, _EndpointRepresentati);\n var _super = _createSuper(DotEndpoint);\n function DotEndpoint(endpoint, params) {\n var _this;\n _classCallCheck(this, DotEndpoint);\n _this = _super.call(this, endpoint, params);\n _defineProperty(_assertThisInitialized(_this), \"radius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"defaultOffset\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"defaultInnerRadius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", DotEndpoint.type);\n params = params || {};\n _this.radius = params.radius || 5;\n _this.defaultOffset = 0.5 * _this.radius;\n _this.defaultInnerRadius = _this.radius / 3;\n return _this;\n }\n return DotEndpoint;\n}(EndpointRepresentation);\n_defineProperty(DotEndpoint, \"type\", \"Dot\");\nvar DotEndpointHandler = {\n type: DotEndpoint.type,\n cls: DotEndpoint,\n compute: function compute(ep, anchorPoint, orientation, endpointStyle) {\n var x = anchorPoint.curX - ep.radius,\n y = anchorPoint.curY - ep.radius,\n w = ep.radius * 2,\n h = ep.radius * 2;\n if (endpointStyle && endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += lw * 2;\n h += lw * 2;\n }\n ep.x = x;\n ep.y = y;\n ep.w = w;\n ep.h = h;\n return [x, y, w, h, ep.radius];\n },\n getParams: function getParams(ep) {\n return {\n radius: ep.radius\n };\n }\n};\n\nvar UINode = function UINode(instance, el) {\n _classCallCheck(this, UINode);\n this.instance = instance;\n this.el = el;\n _defineProperty(this, \"group\", void 0);\n};\nvar UIGroup = function (_UINode) {\n _inherits(UIGroup, _UINode);\n var _super = _createSuper(UIGroup);\n function UIGroup(instance, el, options) {\n var _this;\n _classCallCheck(this, UIGroup);\n _this = _super.call(this, instance, el);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"children\", []);\n _defineProperty(_assertThisInitialized(_this), \"collapsed\", false);\n _defineProperty(_assertThisInitialized(_this), \"droppable\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"enabled\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"orphan\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"constrain\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"proxied\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"ghost\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"revert\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"prune\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"dropOverride\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"anchor\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"connections\", {\n source: [],\n target: [],\n internal: []\n });\n _defineProperty(_assertThisInitialized(_this), \"manager\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"id\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"elId\", void 0);\n var jel = _this.el;\n jel._isJsPlumbGroup = true;\n jel._jsPlumbGroup = _assertThisInitialized(_this);\n _this.elId = instance.getId(el);\n _this.orphan = options.orphan === true;\n _this.revert = _this.orphan === true ? false : options.revert !== false;\n _this.droppable = options.droppable !== false;\n _this.ghost = options.ghost === true;\n _this.enabled = options.enabled !== false;\n _this.prune = _this.orphan !== true && options.prune === true;\n _this.constrain = _this.ghost || options.constrain === true;\n _this.proxied = options.proxied !== false;\n _this.id = options.id || uuid();\n _this.dropOverride = options.dropOverride === true;\n _this.anchor = options.anchor;\n _this.endpoint = options.endpoint;\n _this.anchor = options.anchor;\n instance.setAttribute(el, ATTRIBUTE_GROUP, \"\");\n return _this;\n }\n _createClass(UIGroup, [{\n key: \"contentArea\",\n get: function get() {\n return this.instance.getGroupContentArea(this);\n }\n }, {\n key: \"overrideDrop\",\n value: function overrideDrop(el, targetGroup) {\n return this.dropOverride && (this.revert || this.prune || this.orphan);\n }\n }, {\n key: \"getAnchor\",\n value: function getAnchor(conn, endpointIndex) {\n return this.anchor || \"Continuous\";\n }\n }, {\n key: \"getEndpoint\",\n value: function getEndpoint(conn, endpointIndex) {\n return this.endpoint || {\n type: DotEndpoint.type,\n options: {\n radius: 10\n }\n };\n }\n }, {\n key: \"add\",\n value: function add(_el, doNotFireEvent) {\n var dragArea = this.instance.getGroupContentArea(this);\n var __el = _el;\n if (__el._jsPlumbParentGroup != null) {\n if (__el._jsPlumbParentGroup === this) {\n return;\n } else {\n __el._jsPlumbParentGroup.remove(_el, true, doNotFireEvent, false);\n }\n }\n __el._jsPlumbParentGroup = this;\n this.children.push(new UINode(this.instance, _el));\n this.instance._appendElement(__el, dragArea);\n this.manager._updateConnectionsForGroup(this);\n }\n }, {\n key: \"resolveNode\",\n value: function resolveNode(el) {\n return el == null ? null : getWithFunction(this.children, function (u) {\n return u.el === el;\n });\n }\n }, {\n key: \"remove\",\n value: function remove(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n var uiNode = this.resolveNode(el);\n if (uiNode != null) {\n this._doRemove(uiNode, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup);\n }\n }\n }, {\n key: \"_doRemove\",\n value: function _doRemove(child, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n var __el = child.el;\n delete __el._jsPlumbParentGroup;\n removeWithFunction(this.children, function (e) {\n return e === child;\n });\n if (manipulateDOM) {\n try {\n this.instance.getGroupContentArea(this).removeChild(__el);\n } catch (e) {\n log(\"Could not remove element from Group \" + e);\n }\n }\n if (!doNotFireEvent) {\n var p = {\n group: this,\n el: __el\n };\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n this.instance.fire(EVENT_GROUP_MEMBER_REMOVED, p);\n }\n if (!doNotUpdateConnections) {\n this.manager._updateConnectionsForGroup(this);\n }\n }\n }, {\n key: \"removeAll\",\n value: function removeAll(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = this.children.length; i < l; i++) {\n var child = this.children[0];\n this._doRemove(child, manipulateDOM, doNotFireEvent, true);\n this.instance.unmanage(child.el, true);\n }\n this.children.length = 0;\n this.manager._updateConnectionsForGroup(this);\n }\n }, {\n key: \"orphanAll\",\n value: function orphanAll() {\n var orphanedPositions = {};\n for (var i = 0; i < this.children.length; i++) {\n var newPosition = this.manager.orphan(this.children[i].el, false);\n orphanedPositions[newPosition.id] = newPosition.pos;\n }\n this.children.length = 0;\n return orphanedPositions;\n }\n }, {\n key: \"addGroup\",\n value: function addGroup(group) {\n if (this.instance.allowNestedGroups && group !== this) {\n if (this.instance.groupManager.isAncestor(this, group)) {\n return false;\n }\n if (group.group != null) {\n group.group.removeGroup(group);\n }\n var groupElId = this.instance.getId(group.el);\n var entry = this.instance.getManagedElements()[groupElId];\n entry.group = this.elId;\n var elpos = this.instance.getOffsetRelativeToRoot(group.el);\n var cpos = this.collapsed ? this.instance.getOffsetRelativeToRoot(this.el) : this.instance.getOffsetRelativeToRoot(this.instance.getGroupContentArea(this));\n group.el._jsPlumbParentGroup = this;\n this.children.push(group);\n this.instance._appendElementToGroup(this, group.el);\n group.group = this;\n var newPosition = {\n x: elpos.x - cpos.x,\n y: elpos.y - cpos.y\n };\n this.instance.setPosition(group.el, newPosition);\n this.instance.fire(EVENT_NESTED_GROUP_ADDED, {\n parent: this,\n child: group\n });\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"removeGroup\",\n value: function removeGroup(group) {\n if (group.group === this) {\n var jel = group.el;\n var d = this.instance.getGroupContentArea(this);\n if (d === jel.parentNode) {\n d.removeChild(group.el);\n }\n var groupElId = this.instance.getId(group.el);\n var entry = this.instance.getManagedElements()[groupElId];\n if (entry) {\n delete entry.group;\n }\n this.children = this.children.filter(function (cg) {\n return cg.id !== group.id;\n });\n delete group.group;\n delete jel._jsPlumbParentGroup;\n this.instance.fire(EVENT_NESTED_GROUP_REMOVED, {\n parent: this,\n child: group\n });\n }\n }\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n return this.children.filter(function (cg) {\n return cg.constructor === UIGroup;\n });\n }\n }, {\n key: \"getNodes\",\n value: function getNodes() {\n return this.children.filter(function (cg) {\n return cg.constructor === UINode;\n });\n }\n }, {\n key: \"collapseParent\",\n get: function get() {\n var cg = null;\n if (this.group == null) {\n return null;\n } else {\n var g = this.group;\n while (g != null) {\n if (g.collapsed) {\n cg = g;\n }\n g = g.group;\n }\n return cg;\n }\n }\n }]);\n return UIGroup;\n}(UINode);\n\nvar GroupManager = function () {\n function GroupManager(instance) {\n var _this = this;\n _classCallCheck(this, GroupManager);\n this.instance = instance;\n _defineProperty(this, \"groupMap\", {});\n _defineProperty(this, \"_connectionSourceMap\", {});\n _defineProperty(this, \"_connectionTargetMap\", {});\n instance.bind(EVENT_INTERNAL_CONNECTION, function (p) {\n var sourceGroup = _this.getGroupFor(p.source);\n var targetGroup = _this.getGroupFor(p.target);\n if (sourceGroup != null && targetGroup != null && sourceGroup === targetGroup) {\n _this._connectionSourceMap[p.connection.id] = sourceGroup;\n _this._connectionTargetMap[p.connection.id] = sourceGroup;\n suggest(sourceGroup.connections.internal, p.connection);\n } else {\n if (sourceGroup != null) {\n if (p.target._jsPlumbGroup === sourceGroup) {\n suggest(sourceGroup.connections.internal, p.connection);\n } else {\n suggest(sourceGroup.connections.source, p.connection);\n }\n _this._connectionSourceMap[p.connection.id] = sourceGroup;\n }\n if (targetGroup != null) {\n if (p.source._jsPlumbGroup === targetGroup) {\n suggest(targetGroup.connections.internal, p.connection);\n } else {\n suggest(targetGroup.connections.target, p.connection);\n }\n _this._connectionTargetMap[p.connection.id] = targetGroup;\n }\n }\n });\n instance.bind(EVENT_INTERNAL_CONNECTION_DETACHED, function (p) {\n _this._cleanupDetachedConnection(p.connection);\n });\n instance.bind(EVENT_CONNECTION_MOVED, function (p) {\n var originalElement = p.originalEndpoint.element,\n originalGroup = _this.getGroupFor(originalElement),\n newEndpoint = p.connection.endpoints[p.index],\n newElement = newEndpoint.element,\n newGroup = _this.getGroupFor(newElement),\n connMap = p.index === 0 ? _this._connectionSourceMap : _this._connectionTargetMap,\n otherConnMap = p.index === 0 ? _this._connectionTargetMap : _this._connectionSourceMap;\n if (newGroup != null) {\n connMap[p.connection.id] = newGroup;\n if (p.connection.source === p.connection.target) {\n otherConnMap[p.connection.id] = newGroup;\n }\n } else {\n delete connMap[p.connection.id];\n if (p.connection.source === p.connection.target) {\n delete otherConnMap[p.connection.id];\n }\n }\n if (originalGroup != null) {\n _this._updateConnectionsForGroup(originalGroup);\n }\n if (newGroup != null) {\n _this._updateConnectionsForGroup(newGroup);\n }\n });\n }\n _createClass(GroupManager, [{\n key: \"_cleanupDetachedConnection\",\n value: function _cleanupDetachedConnection(conn) {\n conn.proxies.length = 0;\n var group = this._connectionSourceMap[conn.id],\n f;\n if (group != null) {\n f = function f(c) {\n return c.id === conn.id;\n };\n removeWithFunction(group.connections.source, f);\n removeWithFunction(group.connections.target, f);\n removeWithFunction(group.connections.internal, f);\n delete this._connectionSourceMap[conn.id];\n }\n group = this._connectionTargetMap[conn.id];\n if (group != null) {\n f = function f(c) {\n return c.id === conn.id;\n };\n removeWithFunction(group.connections.source, f);\n removeWithFunction(group.connections.target, f);\n removeWithFunction(group.connections.internal, f);\n delete this._connectionTargetMap[conn.id];\n }\n }\n }, {\n key: \"addGroup\",\n value: function addGroup(params) {\n var jel = params.el;\n if (this.groupMap[params.id] != null) {\n throw new Error(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (jel._isJsPlumbGroup != null) {\n throw new Error(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new UIGroup(this.instance, params.el, params);\n this.groupMap[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n this.instance.manage(group.el);\n this.instance.addClass(group.el, CLASS_GROUP_EXPANDED);\n group.manager = this;\n this._updateConnectionsForGroup(group);\n this.instance.fire(EVENT_GROUP_ADDED, {\n group: group\n });\n return group;\n }\n }, {\n key: \"getGroup\",\n value: function getGroup(groupId) {\n var group = groupId;\n if (isString(groupId)) {\n group = this.groupMap[groupId];\n if (group == null) {\n throw new Error(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n }\n }, {\n key: \"getGroupFor\",\n value: function getGroupFor(el) {\n var jel = el;\n var c = this.instance.getContainer();\n var abort = false,\n g = null;\n while (!abort) {\n if (jel == null || jel === c) {\n abort = true;\n } else {\n if (jel._jsPlumbParentGroup) {\n g = jel._jsPlumbParentGroup;\n abort = true;\n } else {\n jel = jel.parentNode;\n }\n }\n }\n return g;\n }\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n var g = [];\n for (var key in this.groupMap) {\n g.push(this.groupMap[key]);\n }\n return g;\n }\n }, {\n key: \"removeGroup\",\n value: function removeGroup(group, deleteMembers, manipulateView, doNotFireEvent) {\n var _this2 = this;\n var actualGroup = this.getGroup(group);\n this.expandGroup(actualGroup, true);\n var newPositions = {};\n forEach(actualGroup.children, function (uiNode) {\n var entry = _this2.instance.getManagedElements()[_this2.instance.getId(uiNode.el)];\n if (entry) {\n delete entry.group;\n }\n });\n if (deleteMembers) {\n forEach(actualGroup.getGroups(), function (cg) {\n return _this2.removeGroup(cg, deleteMembers, manipulateView);\n });\n actualGroup.removeAll(manipulateView, doNotFireEvent);\n } else {\n if (actualGroup.group) {\n forEach(actualGroup.children, function (c) {\n return actualGroup.group.add(c.el);\n });\n }\n newPositions = actualGroup.orphanAll();\n }\n if (actualGroup.group) {\n actualGroup.group.removeGroup(actualGroup);\n }\n this.instance.unmanage(actualGroup.el, true);\n delete this.groupMap[actualGroup.id];\n this.instance.fire(EVENT_GROUP_REMOVED, {\n group: actualGroup\n });\n return newPositions;\n }\n }, {\n key: \"removeAllGroups\",\n value: function removeAllGroups(deleteMembers, manipulateView, doNotFireEvent) {\n for (var _g in this.groupMap) {\n this.removeGroup(this.groupMap[_g], deleteMembers, manipulateView, doNotFireEvent);\n }\n }\n }, {\n key: \"forEach\",\n value: function forEach(f) {\n for (var key in this.groupMap) {\n f(this.groupMap[key]);\n }\n }\n }, {\n key: \"orphan\",\n value: function orphan(el, doNotTransferToAncestor) {\n var jel = el;\n if (jel._jsPlumbParentGroup) {\n var currentParent = jel._jsPlumbParentGroup;\n var id = this.instance.getId(jel);\n var pos = this.instance.getOffset(el);\n if (doNotTransferToAncestor !== true && currentParent.group) {\n this.instance._appendElementToGroup(currentParent.group, el);\n } else {\n this.instance._appendElementToContainer(el);\n }\n this.instance.setPosition(el, pos);\n delete jel._jsPlumbParentGroup;\n return {\n id: id,\n pos: pos\n };\n }\n }\n }, {\n key: \"_updateConnectionsForGroup\",\n value: function _updateConnectionsForGroup(group) {\n var _this3 = this;\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n group.connections.internal.length = 0;\n var members = group.children.slice().map(function (cn) {\n return cn.el;\n });\n var childMembers = [];\n forEach(members, function (member) {\n Array.prototype.push.apply(childMembers, _this3.instance.getSelector(member, SELECTOR_MANAGED_ELEMENT));\n });\n Array.prototype.push.apply(members, childMembers);\n if (members.length > 0) {\n var c1 = this.instance.getConnections({\n source: members,\n scope: WILDCARD\n }, true);\n var c2 = this.instance.getConnections({\n target: members,\n scope: WILDCARD\n }, true);\n var processed = {};\n var gs, gt;\n var oneSet = function oneSet(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n gs = _this3.getGroupFor(c[i].source);\n gt = _this3.getGroupFor(c[i].target);\n if (c[i].source === group.el && gt === group || c[i].target === group.el && gs === group) {\n group.connections.internal.push(c[i]);\n } else if (gs === group) {\n if (gt !== group) {\n group.connections.source.push(c[i]);\n } else {\n group.connections.internal.push(c[i]);\n }\n _this3._connectionSourceMap[c[i].id] = group;\n } else if (gt === group) {\n group.connections.target.push(c[i]);\n _this3._connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1);\n oneSet(c2);\n }\n }\n }, {\n key: \"_collapseConnection\",\n value: function _collapseConnection(conn, index, group) {\n var otherEl = conn.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl._jsPlumbParentGroup && !otherEl._jsPlumbParentGroup.proxied && otherEl._jsPlumbParentGroup.collapsed) {\n return false;\n }\n var es = conn.endpoints[0].element,\n esg = es._jsPlumbParentGroup,\n esgcp = esg != null ? esg.collapseParent || esg : null,\n et = conn.endpoints[1].element,\n etg = et._jsPlumbParentGroup,\n etgcp = etg != null ? etg.collapseParent || etg : null;\n if (esgcp == null || etgcp == null || esgcp.id !== etgcp.id) {\n var groupEl = group.el;\n this.instance.getId(groupEl);\n this.instance.proxyConnection(conn, index, groupEl,\n function (conn, index) {\n return group.getEndpoint(conn, index);\n }, function (conn, index) {\n return group.getAnchor(conn, index);\n });\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"_expandConnection\",\n value: function _expandConnection(c, index, group) {\n this.instance.unproxyConnection(c, index);\n }\n }, {\n key: \"isElementDescendant\",\n value: function isElementDescendant(el, parentEl) {\n var c = this.instance.getContainer();\n var abort = false;\n while (!abort) {\n if (el == null || el === c) {\n return false;\n } else {\n if (el === parentEl) {\n return true;\n } else {\n el = el.parentNode;\n }\n }\n }\n }\n }, {\n key: \"collapseGroup\",\n value: function collapseGroup(group) {\n var _this4 = this;\n var actualGroup = this.getGroup(group);\n if (actualGroup == null || actualGroup.collapsed) {\n return;\n }\n var groupEl = actualGroup.el;\n if (actualGroup.collapseParent == null) {\n this.instance.setGroupVisible(actualGroup, false);\n actualGroup.collapsed = true;\n this.instance.removeClass(groupEl, CLASS_GROUP_EXPANDED);\n this.instance.addClass(groupEl, CLASS_GROUP_COLLAPSED);\n if (actualGroup.proxied) {\n var collapsedConnectionIds = new Set();\n var _collapseSet = function _collapseSet(conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n if (_this4._collapseConnection(c, index, actualGroup) === true) {\n collapsedConnectionIds.add(c.id);\n }\n }\n };\n _collapseSet(actualGroup.connections.source, 0);\n _collapseSet(actualGroup.connections.target, 1);\n forEach(actualGroup.getGroups(), function (cg) {\n _this4.cascadeCollapse(actualGroup, cg, collapsedConnectionIds);\n });\n }\n this.instance.revalidate(groupEl);\n this.repaintGroup(actualGroup);\n this.instance.fire(EVENT_GROUP_COLLAPSE, {\n group: actualGroup\n });\n } else {\n actualGroup.collapsed = true;\n this.instance.removeClass(groupEl, CLASS_GROUP_EXPANDED);\n this.instance.addClass(groupEl, CLASS_GROUP_COLLAPSED);\n }\n }\n }, {\n key: \"cascadeCollapse\",\n value: function cascadeCollapse(collapsedGroup, targetGroup, collapsedIds) {\n var _this5 = this;\n if (collapsedGroup.proxied) {\n var _collapseSet = function _collapseSet(conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n if (!collapsedIds.has(c.id)) {\n if (_this5._collapseConnection(c, index, collapsedGroup) === true) {\n collapsedIds.add(c.id);\n }\n }\n }\n };\n _collapseSet(targetGroup.connections.source, 0);\n _collapseSet(targetGroup.connections.target, 1);\n }\n forEach(targetGroup.getGroups(), function (cg) {\n _this5.cascadeCollapse(collapsedGroup, cg, collapsedIds);\n });\n }\n }, {\n key: \"expandGroup\",\n value: function expandGroup(group, doNotFireEvent) {\n var _this6 = this;\n var actualGroup = this.getGroup(group);\n if (actualGroup == null) {\n return;\n }\n var groupEl = actualGroup.el;\n if (actualGroup.collapseParent == null) {\n this.instance.setGroupVisible(actualGroup, true);\n actualGroup.collapsed = false;\n this.instance.addClass(groupEl, CLASS_GROUP_EXPANDED);\n this.instance.removeClass(groupEl, CLASS_GROUP_COLLAPSED);\n if (actualGroup.proxied) {\n var _expandSet = function _expandSet(conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _this6._expandConnection(c, index, actualGroup);\n }\n };\n _expandSet(actualGroup.connections.source, 0);\n _expandSet(actualGroup.connections.target, 1);\n var _expandNestedGroup = function _expandNestedGroup(group, ignoreCollapsedStateForNested) {\n if (ignoreCollapsedStateForNested || group.collapsed) {\n var _collapseSet = function _collapseSet(conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _this6._collapseConnection(c, index, group.collapseParent || group);\n }\n };\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n forEach(group.connections.internal, function (c) {\n return c.setVisible(false);\n });\n forEach(group.getGroups(), function (g) {\n return _expandNestedGroup(g, true);\n });\n } else {\n _this6.expandGroup(group, true);\n }\n };\n forEach(actualGroup.getGroups(), _expandNestedGroup);\n }\n this.instance.revalidate(groupEl);\n this.repaintGroup(actualGroup);\n if (!doNotFireEvent) {\n this.instance.fire(EVENT_GROUP_EXPAND, {\n group: actualGroup\n });\n }\n } else {\n actualGroup.collapsed = false;\n this.instance.addClass(groupEl, CLASS_GROUP_EXPANDED);\n this.instance.removeClass(groupEl, CLASS_GROUP_COLLAPSED);\n }\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(group) {\n group = this.getGroup(group);\n if (group != null) {\n if (group.collapsed) {\n this.expandGroup(group);\n } else {\n this.collapseGroup(group);\n }\n }\n }\n }, {\n key: \"repaintGroup\",\n value: function repaintGroup(group) {\n var actualGroup = this.getGroup(group);\n var m = actualGroup.children;\n for (var i = 0; i < m.length; i++) {\n this.instance.revalidate(m[i].el);\n }\n }\n }, {\n key: \"addToGroup\",\n value: function addToGroup(group, doNotFireEvent) {\n var _this7 = this;\n var actualGroup = this.getGroup(group);\n if (actualGroup) {\n var groupEl = actualGroup.el;\n var _one = function _one(el) {\n var jel = el;\n var isGroup = jel._isJsPlumbGroup != null,\n droppingGroup = jel._jsPlumbGroup;\n var currentGroup = jel._jsPlumbParentGroup;\n if (currentGroup !== actualGroup) {\n var entry = _this7.instance.manage(el);\n var elpos = _this7.instance.getOffset(el);\n var cpos = actualGroup.collapsed ? _this7.instance.getOffsetRelativeToRoot(groupEl) : _this7.instance.getOffset(_this7.instance.getGroupContentArea(actualGroup));\n entry.group = actualGroup.elId;\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, actualGroup);\n _this7._updateConnectionsForGroup(currentGroup);\n }\n if (isGroup) {\n actualGroup.addGroup(droppingGroup);\n } else {\n actualGroup.add(el, doNotFireEvent);\n }\n var handleDroppedConnections = function handleDroppedConnections(list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === actualGroup) {\n c.endpoints[oidx].setVisible(false);\n _this7._expandConnection(c, oidx, actualGroup);\n } else {\n c.endpoints[index].setVisible(false);\n _this7._collapseConnection(c, index, actualGroup);\n }\n });\n };\n if (actualGroup.collapsed) {\n handleDroppedConnections(_this7.instance.select({\n source: el\n }), 0);\n handleDroppedConnections(_this7.instance.select({\n target: el\n }), 1);\n }\n _this7.instance.getId(el);\n var newPosition = {\n x: elpos.x - cpos.x,\n y: elpos.y - cpos.y\n };\n _this7.instance.setPosition(el, newPosition);\n _this7._updateConnectionsForGroup(actualGroup);\n _this7.instance.revalidate(el);\n if (!doNotFireEvent) {\n var p = {\n group: actualGroup,\n el: el,\n pos: newPosition\n };\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _this7.instance.fire(EVENT_GROUP_MEMBER_ADDED, p);\n }\n }\n };\n for (var _len = arguments.length, el = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n el[_key - 2] = arguments[_key];\n }\n forEach(el, _one);\n }\n }\n }, {\n key: \"removeFromGroup\",\n value: function removeFromGroup(group, doNotFireEvent) {\n var _this8 = this;\n var actualGroup = this.getGroup(group);\n if (actualGroup) {\n var _one = function _one(_el) {\n if (actualGroup.collapsed) {\n var _expandSet = function _expandSet(conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n if (c.proxies) {\n for (var j = 0; j < c.proxies.length; j++) {\n if (c.proxies[j] != null) {\n var proxiedElement = c.proxies[j].originalEp.element;\n if (proxiedElement === _el || _this8.isElementDescendant(proxiedElement, _el)) {\n _this8._expandConnection(c, index, actualGroup);\n }\n }\n }\n }\n }\n };\n _expandSet(actualGroup.connections.source.slice(), 0);\n _expandSet(actualGroup.connections.target.slice(), 1);\n }\n actualGroup.remove(_el, null, doNotFireEvent);\n var entry = _this8.instance.getManagedElements()[_this8.instance.getId(_el)];\n if (entry) {\n delete entry.group;\n }\n };\n for (var _len2 = arguments.length, el = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n el[_key2 - 2] = arguments[_key2];\n }\n forEach(el, _one);\n }\n }\n }, {\n key: \"getAncestors\",\n value: function getAncestors(group) {\n var ancestors = [];\n var p = group.group;\n while (p != null) {\n ancestors.push(p);\n p = p.group;\n }\n return ancestors;\n }\n }, {\n key: \"isAncestor\",\n value: function isAncestor(group, possibleAncestor) {\n if (group == null || possibleAncestor == null) {\n return false;\n }\n return this.getAncestors(group).indexOf(possibleAncestor) !== -1;\n }\n }, {\n key: \"getDescendants\",\n value: function getDescendants(group) {\n var d = [];\n var _one = function _one(g) {\n var childGroups = g.getGroups();\n d.push.apply(d, _toConsumableArray(childGroups));\n forEach(childGroups, _one);\n };\n _one(group);\n return d;\n }\n }, {\n key: \"isDescendant\",\n value: function isDescendant(possibleDescendant, ancestor) {\n if (possibleDescendant == null || ancestor == null) {\n return false;\n }\n return this.getDescendants(ancestor).indexOf(possibleDescendant) !== -1;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this._connectionSourceMap = {};\n this._connectionTargetMap = {};\n this.groupMap = {};\n }\n }]);\n return GroupManager;\n}();\n\nvar SelectionBase = function () {\n function SelectionBase(instance, entries) {\n _classCallCheck(this, SelectionBase);\n this.instance = instance;\n this.entries = entries;\n }\n _createClass(SelectionBase, [{\n key: \"length\",\n get: function get() {\n return this.entries.length;\n }\n }, {\n key: \"each\",\n value: function each(handler) {\n forEach(this.entries, function (e) {\n return handler(e);\n });\n return this;\n }\n }, {\n key: \"get\",\n value: function get(index) {\n return this.entries[index];\n }\n }, {\n key: \"addClass\",\n value: function addClass(clazz, cascade) {\n this.each(function (c) {\n return c.addClass(clazz, cascade);\n });\n return this;\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(clazz, cascade) {\n this.each(function (c) {\n return c.removeClass(clazz, cascade);\n });\n return this;\n }\n }, {\n key: \"removeAllOverlays\",\n value: function removeAllOverlays() {\n this.each(function (c) {\n return c.removeAllOverlays();\n });\n return this;\n }\n }, {\n key: \"setLabel\",\n value: function setLabel(label) {\n this.each(function (c) {\n return c.setLabel(label);\n });\n return this;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.entries.length = 0;\n return this;\n }\n }, {\n key: \"map\",\n value: function map(fn) {\n var a = [];\n this.each(function (e) {\n return a.push(fn(e));\n });\n return a;\n }\n }, {\n key: \"addOverlay\",\n value: function addOverlay(spec) {\n this.each(function (c) {\n return c.addOverlay(spec);\n });\n return this;\n }\n }, {\n key: \"removeOverlay\",\n value: function removeOverlay(id) {\n this.each(function (c) {\n return c.removeOverlay(id);\n });\n return this;\n }\n }, {\n key: \"removeOverlays\",\n value: function removeOverlays() {\n this.each(function (c) {\n return c.removeOverlays();\n });\n return this;\n }\n }, {\n key: \"showOverlay\",\n value: function showOverlay(id) {\n this.each(function (c) {\n return c.showOverlay(id);\n });\n return this;\n }\n }, {\n key: \"hideOverlay\",\n value: function hideOverlay(id) {\n this.each(function (c) {\n return c.hideOverlay(id);\n });\n return this;\n }\n }, {\n key: \"setPaintStyle\",\n value: function setPaintStyle(style) {\n this.each(function (c) {\n return c.setPaintStyle(style);\n });\n return this;\n }\n }, {\n key: \"setHoverPaintStyle\",\n value: function setHoverPaintStyle(style) {\n this.each(function (c) {\n return c.setHoverPaintStyle(style);\n });\n return this;\n }\n }, {\n key: \"setSuspendEvents\",\n value: function setSuspendEvents(suspend) {\n this.each(function (c) {\n return c.setSuspendEvents(suspend);\n });\n return this;\n }\n }, {\n key: \"setParameter\",\n value: function setParameter(name, value) {\n this.each(function (c) {\n return c.parameters[name] = value;\n });\n return this;\n }\n }, {\n key: \"setParameters\",\n value: function setParameters(p) {\n this.each(function (c) {\n return c.parameters = p;\n });\n return this;\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(v) {\n this.each(function (c) {\n return c.setVisible(v);\n });\n return this;\n }\n }, {\n key: \"addType\",\n value: function addType(name) {\n this.each(function (c) {\n return c.addType(name);\n });\n return this;\n }\n }, {\n key: \"toggleType\",\n value: function toggleType(name) {\n this.each(function (c) {\n return c.toggleType(name);\n });\n return this;\n }\n }, {\n key: \"removeType\",\n value: function removeType(name) {\n this.each(function (c) {\n return c.removeType(name);\n });\n return this;\n }\n }, {\n key: \"bind\",\n value: function bind(evt, handler) {\n this.each(function (c) {\n return c.bind(evt, handler);\n });\n return this;\n }\n }, {\n key: \"unbind\",\n value: function unbind(evt, handler) {\n this.each(function (c) {\n return c.unbind(evt, handler);\n });\n return this;\n }\n }, {\n key: \"setHover\",\n value: function setHover(h) {\n var _this = this;\n this.each(function (c) {\n return _this.instance.setHover(c, h);\n });\n return this;\n }\n }]);\n return SelectionBase;\n}();\n\nvar EndpointSelection = function (_SelectionBase) {\n _inherits(EndpointSelection, _SelectionBase);\n var _super = _createSuper(EndpointSelection);\n function EndpointSelection() {\n _classCallCheck(this, EndpointSelection);\n return _super.apply(this, arguments);\n }\n _createClass(EndpointSelection, [{\n key: \"setEnabled\",\n value: function setEnabled(e) {\n this.each(function (ep) {\n return ep.enabled = e;\n });\n return this;\n }\n }, {\n key: \"setAnchor\",\n value: function setAnchor(a) {\n this.each(function (ep) {\n return ep.setAnchor(a);\n });\n return this;\n }\n }, {\n key: \"deleteEveryConnection\",\n value: function deleteEveryConnection() {\n this.each(function (ep) {\n return ep.deleteEveryConnection();\n });\n return this;\n }\n }, {\n key: \"deleteAll\",\n value: function deleteAll() {\n var _this = this;\n this.each(function (ep) {\n return _this.instance.deleteEndpoint(ep);\n });\n this.clear();\n return this;\n }\n }]);\n return EndpointSelection;\n}(SelectionBase);\n\nvar ConnectionSelection = function (_SelectionBase) {\n _inherits(ConnectionSelection, _SelectionBase);\n var _super = _createSuper(ConnectionSelection);\n function ConnectionSelection() {\n _classCallCheck(this, ConnectionSelection);\n return _super.apply(this, arguments);\n }\n _createClass(ConnectionSelection, [{\n key: \"setDetachable\",\n value: function setDetachable(d) {\n this.each(function (c) {\n return c.setDetachable(d);\n });\n return this;\n }\n }, {\n key: \"setReattach\",\n value: function setReattach(d) {\n this.each(function (c) {\n return c.setReattach(d);\n });\n return this;\n }\n }, {\n key: \"setConnector\",\n value: function setConnector(spec) {\n this.each(function (c) {\n return c._setConnector(spec);\n });\n return this;\n }\n }, {\n key: \"deleteAll\",\n value: function deleteAll() {\n var _this = this;\n this.each(function (c) {\n return _this.instance.deleteConnection(c);\n });\n this.clear();\n }\n }, {\n key: \"repaint\",\n value: function repaint() {\n var _this2 = this;\n this.each(function (c) {\n return _this2.instance._paintConnection(c);\n });\n return this;\n }\n }]);\n return ConnectionSelection;\n}(SelectionBase);\n\nvar Transaction = function Transaction() {\n _classCallCheck(this, Transaction);\n _defineProperty(this, \"affectedElements\", new Set());\n};\nfunction EMPTY_POSITION() {\n return {\n x: 0,\n y: 0,\n w: 0,\n h: 0,\n r: 0,\n c: {\n x: 0,\n y: 0\n },\n x2: 0,\n y2: 0,\n t: {\n x: 0,\n y: 0,\n c: {\n x: 0,\n y: 0\n },\n w: 0,\n h: 0,\n r: 0,\n x2: 0,\n y2: 0,\n cr: 0,\n sr: 0\n },\n dirty: true\n };\n}\nfunction rotate(x, y, w, h, r) {\n var center = {\n x: x + w / 2,\n y: y + h / 2\n },\n cr = Math.cos(r / 360 * Math.PI * 2),\n sr = Math.sin(r / 360 * Math.PI * 2),\n _point = function _point(x, y) {\n return {\n x: center.x + Math.round((x - center.x) * cr - (y - center.y) * sr),\n y: center.y + Math.round((y - center.y) * cr - (x - center.x) * sr)\n };\n };\n var p1 = _point(x, y),\n p2 = _point(x + w, y),\n p3 = _point(x + w, y + h),\n p4 = _point(x, y + h),\n c = _point(x + w / 2, y + h / 2);\n var xmin = Math.min(p1.x, p2.x, p3.x, p4.x),\n xmax = Math.max(p1.x, p2.x, p3.x, p4.x),\n ymin = Math.min(p1.y, p2.y, p3.y, p4.y),\n ymax = Math.max(p1.y, p2.y, p3.y, p4.y);\n return {\n x: xmin,\n y: ymin,\n w: xmax - xmin,\n h: ymax - ymin,\n c: c,\n r: r,\n x2: xmax,\n y2: ymax,\n cr: cr,\n sr: sr\n };\n}\nvar entryComparator = function entryComparator(value, arrayEntry) {\n var c = 0;\n if (arrayEntry[1] > value[1]) {\n c = -1;\n } else if (arrayEntry[1] < value[1]) {\n c = 1;\n }\n return c;\n};\nvar reverseEntryComparator = function reverseEntryComparator(value, arrayEntry) {\n return entryComparator(value, arrayEntry) * -1;\n};\nfunction _updateElementIndex(id, value, array, sortDescending) {\n insertSorted([id, value], array, entryComparator, sortDescending);\n}\nfunction _clearElementIndex(id, array) {\n var idx = findWithFunction(array, function (entry) {\n return entry[0] === id;\n });\n if (idx > -1) {\n array.splice(idx, 1);\n }\n}\nvar Viewport = function (_EventGenerator) {\n _inherits(Viewport, _EventGenerator);\n var _super = _createSuper(Viewport);\n function Viewport(instance) {\n var _this;\n _classCallCheck(this, Viewport);\n _this = _super.call(this);\n _this.instance = instance;\n _defineProperty(_assertThisInitialized(_this), \"_currentTransaction\", null);\n _defineProperty(_assertThisInitialized(_this), \"_sortedElements\", {\n xmin: [],\n xmax: [],\n ymin: [],\n ymax: []\n });\n _defineProperty(_assertThisInitialized(_this), \"_elementMap\", new Map());\n _defineProperty(_assertThisInitialized(_this), \"_transformedElementMap\", new Map());\n _defineProperty(_assertThisInitialized(_this), \"_bounds\", {\n minx: 0,\n maxx: 0,\n miny: 0,\n maxy: 0\n });\n return _this;\n }\n _createClass(Viewport, [{\n key: \"_updateBounds\",\n value: function _updateBounds(id, updatedElement, doNotRecalculateBounds) {\n if (updatedElement != null) {\n _clearElementIndex(id, this._sortedElements.xmin);\n _clearElementIndex(id, this._sortedElements.xmax);\n _clearElementIndex(id, this._sortedElements.ymin);\n _clearElementIndex(id, this._sortedElements.ymax);\n _updateElementIndex(id, updatedElement.t.x, this._sortedElements.xmin, false);\n _updateElementIndex(id, updatedElement.t.x + updatedElement.t.w, this._sortedElements.xmax, true);\n _updateElementIndex(id, updatedElement.t.y, this._sortedElements.ymin, false);\n _updateElementIndex(id, updatedElement.t.y + updatedElement.t.h, this._sortedElements.ymax, true);\n if (doNotRecalculateBounds !== true) {\n this._recalculateBounds();\n }\n }\n }\n }, {\n key: \"_recalculateBounds\",\n value: function _recalculateBounds() {\n this._bounds.minx = this._sortedElements.xmin.length > 0 ? this._sortedElements.xmin[0][1] : 0;\n this._bounds.maxx = this._sortedElements.xmax.length > 0 ? this._sortedElements.xmax[0][1] : 0;\n this._bounds.miny = this._sortedElements.ymin.length > 0 ? this._sortedElements.ymin[0][1] : 0;\n this._bounds.maxy = this._sortedElements.ymax.length > 0 ? this._sortedElements.ymax[0][1] : 0;\n }\n }, {\n key: \"recomputeBounds\",\n value: function recomputeBounds() {\n var _this2 = this;\n this._sortedElements.xmin.length = 0;\n this._sortedElements.xmax.length = 0;\n this._sortedElements.ymin.length = 0;\n this._sortedElements.ymax.length = 0;\n this._elementMap.forEach(function (vp, id) {\n _this2._sortedElements.xmin.push([id, vp.t.x]);\n _this2._sortedElements.xmax.push([id, vp.t.x + vp.t.w]);\n _this2._sortedElements.ymin.push([id, vp.t.y]);\n _this2._sortedElements.ymax.push([id, vp.t.y + vp.t.h]);\n });\n this._sortedElements.xmin.sort(entryComparator);\n this._sortedElements.ymin.sort(entryComparator);\n this._sortedElements.xmax.sort(reverseEntryComparator);\n this._sortedElements.ymax.sort(reverseEntryComparator);\n this._recalculateBounds();\n }\n }, {\n key: \"_finaliseUpdate\",\n value: function _finaliseUpdate(id, e, doNotRecalculateBounds) {\n e.t = rotate(e.x, e.y, e.w, e.h, e.r);\n this._transformedElementMap.set(id, e.t);\n if (doNotRecalculateBounds !== true) {\n this._updateBounds(id, e, doNotRecalculateBounds);\n }\n }\n }, {\n key: \"shouldFireEvent\",\n value: function shouldFireEvent(event, value, originalEvent) {\n return true;\n }\n }, {\n key: \"startTransaction\",\n value: function startTransaction() {\n if (this._currentTransaction != null) {\n throw new Error(\"Viewport: cannot start transaction; a transaction is currently active.\");\n }\n this._currentTransaction = new Transaction();\n }\n }, {\n key: \"endTransaction\",\n value: function endTransaction() {\n var _this3 = this;\n if (this._currentTransaction != null) {\n this._currentTransaction.affectedElements.forEach(function (id) {\n var entry = _this3.getPosition(id);\n _this3._finaliseUpdate(id, entry, true);\n });\n this.recomputeBounds();\n this._currentTransaction = null;\n }\n }\n }, {\n key: \"updateElements\",\n value: function updateElements(entries) {\n var _this4 = this;\n forEach(entries, function (e) {\n return _this4.updateElement(e.id, e.x, e.y, e.width, e.height, e.rotation);\n });\n }\n }, {\n key: \"updateElement\",\n value: function updateElement(id, x, y, width, height, rotation, doNotRecalculateBounds) {\n var e = getsert(this._elementMap, id, EMPTY_POSITION);\n e.dirty = x == null && e.x == null || y == null && e.y == null || width == null && e.w == null || height == null && e.h == null;\n if (x != null) {\n e.x = x;\n }\n if (y != null) {\n e.y = y;\n }\n if (width != null) {\n e.w = width;\n }\n if (height != null) {\n e.h = height;\n }\n if (rotation != null) {\n e.r = rotation || 0;\n }\n e.c.x = e.x + e.w / 2;\n e.c.y = e.y + e.h / 2;\n e.x2 = e.x + e.w;\n e.y2 = e.y + e.h;\n if (this._currentTransaction == null) {\n this._finaliseUpdate(id, e, doNotRecalculateBounds);\n } else {\n this._currentTransaction.affectedElements.add(id);\n }\n return e;\n }\n }, {\n key: \"refreshElement\",\n value: function refreshElement(elId, doNotRecalculateBounds) {\n var me = this.instance.getManagedElements();\n var s = me[elId] ? me[elId].el : null;\n if (s != null) {\n var size = this.getSize(s);\n var offset = this.getOffset(s);\n return this.updateElement(elId, offset.x, offset.y, size.w, size.h, null, doNotRecalculateBounds);\n } else {\n return null;\n }\n }\n }, {\n key: \"getSize\",\n value: function getSize(el) {\n return this.instance.getSize(el);\n }\n }, {\n key: \"getOffset\",\n value: function getOffset(el) {\n return this.instance.getOffset(el);\n }\n }, {\n key: \"registerElement\",\n value: function registerElement(id, doNotRecalculateBounds) {\n return this.updateElement(id, 0, 0, 0, 0, 0, doNotRecalculateBounds);\n }\n }, {\n key: \"addElement\",\n value: function addElement(id, x, y, width, height, rotation) {\n return this.updateElement(id, x, y, width, height, rotation);\n }\n }, {\n key: \"rotateElement\",\n value: function rotateElement(id, rotation) {\n var e = getsert(this._elementMap, id, EMPTY_POSITION);\n e.r = rotation || 0;\n this._finaliseUpdate(id, e);\n return e;\n }\n }, {\n key: \"getBoundsWidth\",\n value: function getBoundsWidth() {\n return this._bounds.maxx - this._bounds.minx;\n }\n }, {\n key: \"getBoundsHeight\",\n value: function getBoundsHeight() {\n return this._bounds.maxy - this._bounds.miny;\n }\n }, {\n key: \"getX\",\n value: function getX() {\n return this._bounds.minx;\n }\n }, {\n key: \"getY\",\n value: function getY() {\n return this._bounds.miny;\n }\n }, {\n key: \"setSize\",\n value: function setSize(id, w, h) {\n if (this._elementMap.has(id)) {\n return this.updateElement(id, null, null, w, h, null);\n }\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(id, x, y) {\n if (this._elementMap.has(id)) {\n return this.updateElement(id, x, y, null, null, null);\n }\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this._sortedElements.xmin.length = 0;\n this._sortedElements.xmax.length = 0;\n this._sortedElements.ymin.length = 0;\n this._sortedElements.ymax.length = 0;\n this._elementMap.clear();\n this._transformedElementMap.clear();\n this._recalculateBounds();\n }\n }, {\n key: \"remove\",\n value: function remove(id) {\n _clearElementIndex(id, this._sortedElements.xmin);\n _clearElementIndex(id, this._sortedElements.xmax);\n _clearElementIndex(id, this._sortedElements.ymin);\n _clearElementIndex(id, this._sortedElements.ymax);\n this._elementMap[\"delete\"](id);\n this._transformedElementMap[\"delete\"](id);\n this._recalculateBounds();\n }\n }, {\n key: \"getPosition\",\n value: function getPosition(id) {\n return this._elementMap.get(id);\n }\n }, {\n key: \"getElements\",\n value: function getElements() {\n return this._elementMap;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n return this._elementMap.size === 0;\n }\n }]);\n return Viewport;\n}(EventGenerator);\n\nvar _edgeSortFunctions;\nfunction _placeAnchorsOnLine(element, connections, horizontal, otherMultiplier, reverse) {\n var sizeInAxis = horizontal ? element.w : element.h;\n var sizeInOtherAxis = horizontal ? element.h : element.w;\n var a = [],\n step = sizeInAxis / (connections.length + 1);\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step,\n other = otherMultiplier * sizeInOtherAxis;\n if (reverse) {\n val = sizeInAxis - val;\n }\n var dx = horizontal ? val : other,\n x = element.x + dx,\n xp = dx / element.w;\n var dy = horizontal ? other : val,\n y = element.y + dy,\n yp = dy / element.h;\n if (element.r !== 0 && element.r != null) {\n var rotated = rotatePoint({\n x: x,\n y: y\n }, element.c, element.r);\n x = rotated.x;\n y = rotated.y;\n }\n a.push({\n x: x,\n y: y,\n xLoc: xp,\n yLoc: yp,\n c: connections[i].c\n });\n }\n return a;\n}\nfunction _rightAndBottomSort(a, b) {\n return b.theta - a.theta;\n}\nfunction _leftAndTopSort(a, b) {\n var p1 = a.theta < 0 ? -Math.PI - a.theta : Math.PI - a.theta,\n p2 = b.theta < 0 ? -Math.PI - b.theta : Math.PI - b.theta;\n return p1 - p2;\n}\nvar edgeSortFunctions = (_edgeSortFunctions = {}, _defineProperty(_edgeSortFunctions, TOP, _leftAndTopSort), _defineProperty(_edgeSortFunctions, RIGHT, _rightAndBottomSort), _defineProperty(_edgeSortFunctions, BOTTOM, _rightAndBottomSort), _defineProperty(_edgeSortFunctions, LEFT, _leftAndTopSort), _edgeSortFunctions);\nfunction isContinuous(a) {\n return a.isContinuous === true;\n}\nfunction _isFloating(a) {\n return a.isContinuous === true;\n}\nfunction isDynamic(a) {\n return a.locations.length > 1;\n}\nfunction getCurrentLocation(anchor) {\n return [anchor.currentLocation, anchor.locations[anchor.currentLocation]];\n}\nvar LightweightRouter = function () {\n function LightweightRouter(instance) {\n var _this = this;\n _classCallCheck(this, LightweightRouter);\n this.instance = instance;\n _defineProperty(this, \"anchorLists\", new Map());\n _defineProperty(this, \"anchorLocations\", new Map());\n instance.bind(EVENT_INTERNAL_CONNECTION_DETACHED, function (p) {\n if (p.sourceEndpoint._anchor.isContinuous) {\n _this._removeEndpointFromAnchorLists(p.sourceEndpoint);\n }\n if (p.targetEndpoint._anchor.isContinuous) {\n _this._removeEndpointFromAnchorLists(p.targetEndpoint);\n }\n });\n instance.bind(EVENT_INTERNAL_ENDPOINT_UNREGISTERED, function (ep) {\n _this._removeEndpointFromAnchorLists(ep);\n });\n }\n _createClass(LightweightRouter, [{\n key: \"getAnchorOrientation\",\n value: function getAnchorOrientation(anchor) {\n var loc = this.anchorLocations.get(anchor.id);\n return loc ? [loc.ox, loc.oy] : [0, 0];\n }\n }, {\n key: \"_distance\",\n value: function _distance(anchor, cx, cy, xy, wh, rotation, targetRotation) {\n var ax = xy.x + anchor.x * wh.w,\n ay = xy.y + anchor.y * wh.h,\n acx = xy.x + wh.w / 2,\n acy = xy.y + wh.h / 2;\n if (rotation != null && rotation.length > 0) {\n var rotated = this.instance._applyRotations([ax, ay, 0, 0], rotation);\n ax = rotated.x;\n ay = rotated.y;\n }\n return Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) + Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2));\n }\n }, {\n key: \"_anchorSelector\",\n value: function _anchorSelector(xy, wh, txy, twh, rotation, targetRotation, locations) {\n var cx = txy.x + twh.w / 2,\n cy = txy.y + twh.h / 2;\n var minIdx = -1,\n minDist = Infinity;\n for (var i = 0; i < locations.length; i++) {\n var d = this._distance(locations[i], cx, cy, xy, wh, rotation, targetRotation);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return [minIdx, locations[minIdx]];\n }\n }, {\n key: \"_floatingAnchorCompute\",\n value: function _floatingAnchorCompute(anchor, params) {\n var xy = params.xy;\n var pos = {\n curX: xy.x + anchor.size.w / 2,\n curY: xy.y + anchor.size.h / 2,\n x: 0,\n y: 0,\n ox: 0,\n oy: 0\n };\n return this._setComputedPosition(anchor, pos);\n }\n }, {\n key: \"_setComputedPosition\",\n value: function _setComputedPosition(anchor, pos, timestamp) {\n this.anchorLocations.set(anchor.id, pos);\n anchor.computedPosition = pos;\n if (timestamp) {\n anchor.timestamp = timestamp;\n }\n return pos;\n }\n }, {\n key: \"_computeSingleLocation\",\n value: function _computeSingleLocation(loc, xy, wh, params) {\n var pos;\n var rotation = params.rotation;\n var candidate = {\n curX: xy.x + loc.x * wh.w + loc.offx,\n curY: xy.y + loc.y * wh.h + loc.offy,\n x: loc.x,\n y: loc.y,\n ox: 0,\n oy: 0\n };\n if (rotation != null && rotation.length > 0) {\n var o = [loc.iox, loc.ioy],\n current = {\n x: candidate.curX,\n y: candidate.curY,\n cr: 0,\n sr: 0\n };\n forEach(rotation, function (r) {\n current = rotatePoint(current, r.c, r.r);\n var _o = [Math.round(o[0] * current.cr - o[1] * current.sr), Math.round(o[1] * current.cr + o[0] * current.sr)];\n o = _o.slice();\n });\n loc.ox = o[0];\n loc.oy = o[1];\n pos = {\n curX: current.x,\n curY: current.y,\n x: loc.x,\n y: loc.y,\n ox: o[0],\n oy: o[1]\n };\n } else {\n loc.ox = loc.iox;\n loc.oy = loc.ioy;\n pos = extend({\n ox: loc.iox,\n oy: loc.ioy\n }, candidate);\n }\n return pos;\n }\n }, {\n key: \"_singleAnchorCompute\",\n value: function _singleAnchorCompute(anchor, params) {\n var xy = params.xy,\n wh = params.wh,\n timestamp = params.timestamp,\n pos = this.anchorLocations.get(anchor.id);\n if (pos != null && timestamp && timestamp === anchor.timestamp) {\n return pos;\n }\n var _getCurrentLocation = getCurrentLocation(anchor),\n _getCurrentLocation2 = _slicedToArray(_getCurrentLocation, 2);\n _getCurrentLocation2[0];\n var currentLoc = _getCurrentLocation2[1];\n pos = this._computeSingleLocation(currentLoc, xy, wh, params);\n return this._setComputedPosition(anchor, pos, timestamp);\n }\n }, {\n key: \"_defaultAnchorCompute\",\n value: function _defaultAnchorCompute(anchor, params) {\n var pos;\n if (anchor.locations.length === 1) {\n return this._singleAnchorCompute(anchor, params);\n }\n var xy = params.xy,\n wh = params.wh,\n txy = params.txy,\n twh = params.twh;\n var _getCurrentLocation3 = getCurrentLocation(anchor),\n _getCurrentLocation4 = _slicedToArray(_getCurrentLocation3, 2),\n currentIdx = _getCurrentLocation4[0],\n currentLoc = _getCurrentLocation4[1];\n if (anchor.locked || txy == null || twh == null) {\n pos = this._computeSingleLocation(currentLoc, xy, wh, params);\n } else {\n var _this$_anchorSelector = this._anchorSelector(xy, wh, txy, twh, params.rotation, params.tRotation, anchor.locations),\n _this$_anchorSelector2 = _slicedToArray(_this$_anchorSelector, 2),\n newIdx = _this$_anchorSelector2[0],\n newLoc = _this$_anchorSelector2[1];\n anchor.currentLocation = newIdx;\n if (newIdx !== currentIdx) {\n anchor.cssClass = newLoc.cls || anchor.cssClass;\n params.element._anchorLocationChanged(anchor);\n }\n pos = this._computeSingleLocation(newLoc, xy, wh, params);\n }\n return this._setComputedPosition(anchor, pos, params.timestamp);\n }\n }, {\n key: \"_placeAnchors\",\n value: function _placeAnchors(elementId, _anchorLists) {\n var _this2 = this;\n var cd = this.instance.viewport.getPosition(elementId),\n placeSomeAnchors = function placeSomeAnchors(desc, element, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = unsortedConnections.sort(edgeSortFunctions[desc]),\n reverse = desc === RIGHT || desc === TOP,\n anchors = _placeAnchorsOnLine(cd, sc, isHorizontal, otherMultiplier, reverse);\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i].c,\n weAreSource = c.endpoints[0].elementId === elementId,\n ep = weAreSource ? c.endpoints[0] : c.endpoints[1];\n _this2._setComputedPosition(ep._anchor, {\n curX: anchors[i].x,\n curY: anchors[i].y,\n x: anchors[i].xLoc,\n y: anchors[i].yLoc,\n ox: orientation[0],\n oy: orientation[1]\n });\n }\n }\n };\n placeSomeAnchors(BOTTOM, cd, _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(TOP, cd, _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(LEFT, cd, _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(RIGHT, cd, _anchorLists.right, false, 1, [1, 0]);\n }\n }, {\n key: \"_updateAnchorList\",\n value: function _updateAnchorList(lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, connsToPaint, endpointsToPaint) {\n var endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = {\n theta: theta,\n order: order,\n c: conn,\n b: aBoolean,\n elId: otherElId,\n epId: endpointId\n },\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n candidate;\n if (listToRemoveFrom) {\n var rIdx = findWithFunction(listToRemoveFrom, function (e) {\n return e.epId === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n for (var i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i].c;\n if (candidate.placeholder !== true) {\n connsToPaint.add(candidate);\n }\n endpointsToPaint.add(listToRemoveFrom[i].c.endpoints[idx]);\n endpointsToPaint.add(listToRemoveFrom[i].c.endpoints[oIdx]);\n }\n }\n }\n for (var _i = 0; _i < listToAddTo.length; _i++) {\n candidate = listToAddTo[_i].c;\n if (candidate.placeholder !== true) {\n connsToPaint.add(candidate);\n }\n endpointsToPaint.add(listToAddTo[_i].c.endpoints[idx]);\n endpointsToPaint.add(listToAddTo[_i].c.endpoints[oIdx]);\n }\n {\n var insertIdx = reverse ? 0 : listToAddTo.length;\n listToAddTo.splice(insertIdx, 0, values);\n }\n endpoint._continuousAnchorEdge = edgeId;\n }\n }, {\n key: \"_removeEndpointFromAnchorLists\",\n value: function _removeEndpointFromAnchorLists(endpoint) {\n var listsForElement = this.anchorLists.get(endpoint.elementId);\n var total = 0;\n (function (list, eId) {\n if (list) {\n var f = function f(e) {\n return e.epId === eId;\n };\n removeWithFunction(list.top, f);\n removeWithFunction(list.left, f);\n removeWithFunction(list.bottom, f);\n removeWithFunction(list.right, f);\n total += list.top.length;\n total += list.left.length;\n total += list.bottom.length;\n total += list.right.length;\n }\n })(listsForElement, endpoint.id);\n if (total === 0) {\n this.anchorLists[\"delete\"](endpoint.elementId);\n }\n this.anchorLocations[\"delete\"](endpoint._anchor.id);\n }\n }, {\n key: \"computeAnchorLocation\",\n value: function computeAnchorLocation(anchor, params) {\n var pos;\n if (isContinuous(anchor)) {\n pos = this.anchorLocations.get(anchor.id) || {\n curX: 0,\n curY: 0,\n x: 0,\n y: 0,\n ox: 0,\n oy: 0\n };\n } else if (_isFloating(anchor)) {\n pos = this._floatingAnchorCompute(anchor, params);\n } else {\n pos = this._defaultAnchorCompute(anchor, params);\n }\n anchor.timestamp = params.timestamp;\n return pos;\n }\n }, {\n key: \"computePath\",\n value: function computePath(connection, timestamp) {\n var sourceInfo = this.instance.viewport.getPosition(connection.sourceId),\n targetInfo = this.instance.viewport.getPosition(connection.targetId),\n sE = connection.endpoints[0],\n tE = connection.endpoints[1];\n var sAnchorP = this.getEndpointLocation(sE, {\n xy: sourceInfo,\n wh: sourceInfo,\n element: sE,\n timestamp: timestamp,\n rotation: this.instance._getRotations(connection.sourceId)\n }),\n tAnchorP = this.getEndpointLocation(tE, {\n xy: targetInfo,\n wh: targetInfo,\n element: tE,\n timestamp: timestamp,\n rotation: this.instance._getRotations(connection.targetId)\n });\n connection.connector.resetBounds();\n connection.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceEndpoint: connection.endpoints[0],\n targetEndpoint: connection.endpoints[1],\n strokeWidth: connection.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n }\n }, {\n key: \"getEndpointLocation\",\n value: function getEndpointLocation(endpoint, params) {\n params = params || {};\n var anchor = endpoint._anchor;\n var pos = this.anchorLocations.get(anchor.id);\n if (pos == null || params.timestamp != null && anchor.timestamp !== params.timestamp) {\n pos = this.computeAnchorLocation(anchor, params);\n this._setComputedPosition(anchor, pos, params.timestamp);\n }\n return pos;\n }\n }, {\n key: \"getEndpointOrientation\",\n value: function getEndpointOrientation(ep) {\n return ep._anchor ? this.getAnchorOrientation(ep._anchor) : [0, 0];\n }\n }, {\n key: \"setAnchorOrientation\",\n value: function setAnchorOrientation(anchor, orientation) {\n var anchorLoc = this.anchorLocations.get(anchor.id);\n if (anchorLoc != null) {\n anchorLoc.ox = orientation[0];\n anchorLoc.oy = orientation[1];\n }\n }\n }, {\n key: \"isDynamicAnchor\",\n value: function isDynamicAnchor(ep) {\n return ep._anchor ? !isContinuous(ep._anchor) && ep._anchor.locations.length > 1 : false;\n }\n }, {\n key: \"isFloating\",\n value: function isFloating(ep) {\n return ep._anchor ? _isFloating(ep._anchor) : false;\n }\n }, {\n key: \"prepareAnchor\",\n value: function prepareAnchor(params) {\n return makeLightweightAnchorFromSpec(params);\n }\n }, {\n key: \"redraw\",\n value: function redraw(elementId, timestamp, offsetToUI) {\n var _this3 = this;\n var connectionsToPaint = new Set(),\n endpointsToPaint = new Set(),\n anchorsToUpdate = new Set();\n if (!this.instance._suspendDrawing) {\n var ep = this.instance.endpointsByElement[elementId] || [];\n timestamp = timestamp || uuid();\n var orientationCache = {},\n a,\n anEndpoint;\n for (var i = 0; i < ep.length; i++) {\n anEndpoint = ep[i];\n if (anEndpoint.visible === false) {\n continue;\n }\n endpointsToPaint.add(anEndpoint);\n a = anEndpoint._anchor;\n if (anEndpoint.connections.length === 0) {\n if (isContinuous(a)) {\n if (!this.anchorLists.has(elementId)) {\n this.anchorLists.set(elementId, {\n top: [],\n right: [],\n bottom: [],\n left: []\n });\n }\n this._updateAnchorList(this.anchorLists.get(elementId), -Math.PI / 2, 0, {\n endpoints: [anEndpoint, anEndpoint],\n placeholder: true\n }, false, elementId, 0, false, getDefaultFace(a), connectionsToPaint, endpointsToPaint);\n anchorsToUpdate.add(elementId);\n }\n } else {\n for (var _i2 = 0; _i2 < anEndpoint.connections.length; _i2++) {\n var conn = anEndpoint.connections[_i2],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = isContinuous(conn.endpoints[0]._anchor),\n targetContinuous = isContinuous(conn.endpoints[1]._anchor);\n if (sourceContinuous || targetContinuous) {\n var c1 = (conn.endpoints[0]._anchor.faces || []).join(\"-\"),\n c2 = (conn.endpoints[1]._anchor.faces || []).join(\"-\"),\n oKey = [sourceId, c1, targetId, c2].join(\"-\"),\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n if (sourceContinuous && !this.anchorLists.has(sourceId)) {\n this.anchorLists.set(sourceId, {\n top: [],\n right: [],\n bottom: [],\n left: []\n });\n }\n if (targetContinuous && !this.anchorLists.has(targetId)) {\n this.anchorLists.set(targetId, {\n top: [],\n right: [],\n bottom: [],\n left: []\n });\n }\n var td = this.instance.viewport.getPosition(targetId),\n sd = this.instance.viewport.getPosition(sourceId);\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n this._updateAnchorList(this.anchorLists.get(sourceId), -Math.PI / 2, 0, conn, false, targetId, 0, false, TOP, connectionsToPaint, endpointsToPaint);\n this._updateAnchorList(this.anchorLists.get(targetId), -Math.PI / 2, 0, conn, false, sourceId, 1, false, TOP, connectionsToPaint, endpointsToPaint);\n } else {\n var sourceRotation = this.instance._getRotations(sourceId);\n var targetRotation = this.instance._getRotations(targetId);\n if (!o) {\n o = this._calculateOrientation(sourceId, targetId, sd, td, conn.endpoints[0]._anchor, conn.endpoints[1]._anchor, sourceRotation, targetRotation);\n orientationCache[oKey] = o;\n }\n if (sourceContinuous) {\n this._updateAnchorList(this.anchorLists.get(sourceId), o.theta, 0, conn, false, targetId, 0, false, o.a[0], connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n this._updateAnchorList(this.anchorLists.get(targetId), o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], connectionsToPaint, endpointsToPaint);\n }\n }\n if (sourceContinuous) {\n anchorsToUpdate.add(sourceId);\n }\n if (targetContinuous) {\n anchorsToUpdate.add(targetId);\n }\n connectionsToPaint.add(conn);\n if (sourceContinuous && oIdx === 0 || targetContinuous && oIdx === 1) {\n endpointsToPaint.add(conn.endpoints[oIdx]);\n }\n } else {\n var otherEndpoint = anEndpoint.connections[_i2].endpoints[conn.sourceId === elementId ? 1 : 0],\n otherAnchor = otherEndpoint._anchor;\n if (isDynamic(otherAnchor)) {\n this.instance._paintEndpoint(otherEndpoint, {\n elementWithPrecedence: elementId,\n timestamp: timestamp\n });\n connectionsToPaint.add(anEndpoint.connections[_i2]);\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== anEndpoint.connections[_i2]) {\n connectionsToPaint.add(otherEndpoint.connections[k]);\n }\n }\n } else {\n connectionsToPaint.add(anEndpoint.connections[_i2]);\n }\n }\n }\n }\n }\n anchorsToUpdate.forEach(function (anchor) {\n _this3._placeAnchors(anchor, _this3.anchorLists.get(anchor));\n });\n endpointsToPaint.forEach(function (ep) {\n var cd = _this3.instance.viewport.getPosition(ep.elementId);\n _this3.instance._paintEndpoint(ep, {\n timestamp: timestamp,\n offset: cd\n });\n });\n connectionsToPaint.forEach(function (c) {\n _this3.instance._paintConnection(c, {\n timestamp: timestamp\n });\n });\n }\n return {\n c: connectionsToPaint,\n e: endpointsToPaint\n };\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.anchorLocations.clear();\n this.anchorLists.clear();\n }\n }, {\n key: \"setAnchor\",\n value: function setAnchor(endpoint, anchor) {\n if (anchor != null) {\n endpoint._anchor = anchor;\n }\n }\n }, {\n key: \"setConnectionAnchors\",\n value: function setConnectionAnchors(conn, anchors) {\n conn.endpoints[0]._anchor = anchors[0];\n conn.endpoints[1]._anchor = anchors[1];\n }\n }, {\n key: \"_calculateOrientation\",\n value: function _calculateOrientation(sourceId, targetId, sd, td, sourceAnchor, targetAnchor, sourceRotation, targetRotation) {\n var _this4 = this;\n var Orientation = {\n HORIZONTAL: \"horizontal\",\n VERTICAL: \"vertical\",\n DIAGONAL: \"diagonal\",\n IDENTITY: \"identity\"\n };\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [TOP, TOP]\n };\n }\n var theta = Math.atan2(td.c.y - sd.c.y, td.c.x - sd.c.x),\n theta2 = Math.atan2(sd.c.y - td.c.y, sd.c.x - td.c.x);\n var candidates = [],\n midpoints = {};\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n var _midpoints$types$i;\n midpoints[types[i]] = (_midpoints$types$i = {}, _defineProperty(_midpoints$types$i, LEFT, {\n x: dim[i][0].x,\n y: dim[i][0].c.y\n }), _defineProperty(_midpoints$types$i, RIGHT, {\n x: dim[i][0].x + dim[i][0].w,\n y: dim[i][0].c.y\n }), _defineProperty(_midpoints$types$i, TOP, {\n x: dim[i][0].c.x,\n y: dim[i][0].y\n }), _defineProperty(_midpoints$types$i, BOTTOM, {\n x: dim[i][0].c.x,\n y: dim[i][0].y + dim[i][0].h\n }), _midpoints$types$i);\n if (dim[i][1] != null && dim[i][1].length > 0) {\n for (var axis in midpoints[types[i]]) {\n midpoints[types[i]][axis] = _this4.instance._applyRotationsXY(midpoints[types[i]][axis], dim[i][1]);\n }\n }\n }\n })([SOURCE, TARGET], [[sd, sourceRotation], [td, targetRotation]]);\n var FACES = [TOP, LEFT, RIGHT, BOTTOM];\n for (var sf = 0; sf < FACES.length; sf++) {\n for (var tf = 0; tf < FACES.length; tf++) {\n candidates.push({\n source: FACES[sf],\n target: FACES[tf],\n dist: lineLength(midpoints.source[FACES[sf]], midpoints.target[FACES[tf]])\n });\n }\n }\n candidates.sort(function (a, b) {\n if (a.dist < b.dist) {\n return -1;\n } else if (b.dist < a.dist) {\n return 1;\n } else {\n var _axisIndices;\n var axisIndices = (_axisIndices = {}, _defineProperty(_axisIndices, LEFT, 0), _defineProperty(_axisIndices, TOP, 1), _defineProperty(_axisIndices, RIGHT, 2), _defineProperty(_axisIndices, BOTTOM, 3), _axisIndices),\n ais = axisIndices[a.source],\n bis = axisIndices[b.source],\n ait = axisIndices[a.target],\n bit = axisIndices[b.target];\n return ais < bis ? -1 : bis < ais ? 1 : ait < bit ? -1 : bit < ait ? 1 : 0;\n }\n });\n var sourceEdge = candidates[0].source,\n targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n if (isContinuous(sourceAnchor) && sourceAnchor.locked) {\n sourceEdge = sourceAnchor.currentFace;\n } else if (!sourceAnchor.isContinuous || isEdgeSupported(sourceAnchor, candidates[i].source)) {\n sourceEdge = candidates[i].source;\n } else {\n sourceEdge = null;\n }\n if (targetAnchor.isContinuous && targetAnchor.locked) {\n targetEdge = targetAnchor.currentFace;\n } else if (!targetAnchor.isContinuous || isEdgeSupported(targetAnchor, candidates[i].target)) {\n targetEdge = candidates[i].target;\n } else {\n targetEdge = null;\n }\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n if (sourceAnchor.isContinuous) {\n this.setCurrentFace(sourceAnchor, sourceEdge);\n }\n if (targetAnchor.isContinuous) {\n this.setCurrentFace(targetAnchor, targetEdge);\n }\n return {\n a: [sourceEdge, targetEdge],\n theta: theta,\n theta2: theta2\n };\n }\n }, {\n key: \"setCurrentFace\",\n value: function setCurrentFace(a, face, overrideLock) {\n a.currentFace = face;\n if (overrideLock && a.lockedFace != null) {\n a.lockedFace = a.currentFace;\n }\n }\n }, {\n key: \"lock\",\n value: function lock(a) {\n a.locked = true;\n if (isContinuous(a)) {\n a.lockedFace = a.currentFace;\n }\n }\n }, {\n key: \"unlock\",\n value: function unlock(a) {\n a.locked = false;\n if (isContinuous(a)) {\n a.lockedFace = null;\n }\n }\n }, {\n key: \"selectAnchorLocation\",\n value: function selectAnchorLocation(a, coords) {\n var idx = findWithFunction(a.locations, function (loc) {\n return loc.x === coords.x && loc.y === coords.y;\n });\n if (idx !== -1) {\n a.currentLocation = idx;\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"lockCurrentAxis\",\n value: function lockCurrentAxis(a) {\n if (a.currentFace != null) {\n a.lockedAxis = a.currentFace === LEFT || a.currentFace === RIGHT ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n }\n }, {\n key: \"unlockCurrentAxis\",\n value: function unlockCurrentAxis(a) {\n a.lockedAxis = null;\n }\n }, {\n key: \"anchorsEqual\",\n value: function anchorsEqual(a1, a2) {\n if (!a1 || !a2) {\n return false;\n }\n var l1 = a1.locations[a1.currentLocation],\n l2 = a2.locations[a2.currentLocation];\n return l1.x === l2.x && l1.y === l2.y && l1.offx === l2.offx && l1.offy === l2.offy && l1.ox === l2.ox && l1.oy === l2.oy;\n }\n }]);\n return LightweightRouter;\n}();\n\nvar connectorMap = {};\nvar Connectors = {\n get: function get(connection, name, params) {\n var c = connectorMap[name];\n if (!c) {\n throw {\n message: \"jsPlumb: unknown connector type '\" + name + \"'\"\n };\n } else {\n return new c(connection, params);\n }\n },\n register: function register(name, conn) {\n connectorMap[name] = conn;\n }\n};\n\nvar StraightSegment = function (_AbstractSegment) {\n _inherits(StraightSegment, _AbstractSegment);\n var _super = _createSuper(StraightSegment);\n function StraightSegment(params) {\n var _this;\n _classCallCheck(this, StraightSegment);\n _this = _super.call(this, params);\n _defineProperty(_assertThisInitialized(_this), \"length\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"m\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"m2\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", StraightSegment.segmentType);\n _this._setCoordinates({\n x1: params.x1,\n y1: params.y1,\n x2: params.x2,\n y2: params.y2\n });\n return _this;\n }\n _createClass(StraightSegment, [{\n key: \"getPath\",\n value: function getPath(isFirstSegment) {\n return (isFirstSegment ? \"M \" + this.x1 + \" \" + this.y1 + \" \" : \"\") + \"L \" + this.x2 + \" \" + this.y2;\n }\n }, {\n key: \"_recalc\",\n value: function _recalc() {\n this.length = Math.sqrt(Math.pow(this.x2 - this.x1, 2) + Math.pow(this.y2 - this.y1, 2));\n this.m = gradient({\n x: this.x1,\n y: this.y1\n }, {\n x: this.x2,\n y: this.y2\n });\n this.m2 = -1 / this.m;\n this.extents = {\n xmin: Math.min(this.x1, this.x2),\n ymin: Math.min(this.y1, this.y2),\n xmax: Math.max(this.x1, this.x2),\n ymax: Math.max(this.y1, this.y2)\n };\n }\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.length;\n }\n }, {\n key: \"getGradient\",\n value: function getGradient() {\n return this.m;\n }\n }, {\n key: \"_setCoordinates\",\n value: function _setCoordinates(coords) {\n this.x1 = coords.x1;\n this.y1 = coords.y1;\n this.x2 = coords.x2;\n this.y2 = coords.y2;\n this._recalc();\n }\n }, {\n key: \"pointOnPath\",\n value: function pointOnPath(location, absolute) {\n if (location === 0 && !absolute) {\n return {\n x: this.x1,\n y: this.y1\n };\n } else if (location === 1 && !absolute) {\n return {\n x: this.x2,\n y: this.y2\n };\n } else {\n var l = absolute ? location > 0 ? location : this.length + location : location * this.length;\n return pointOnLine({\n x: this.x1,\n y: this.y1\n }, {\n x: this.x2,\n y: this.y2\n }, l);\n }\n }\n }, {\n key: \"gradientAtPoint\",\n value: function gradientAtPoint(location, absolute) {\n return this.m;\n }\n }, {\n key: \"pointAlongPathFrom\",\n value: function pointAlongPathFrom(location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {\n x: this.x1,\n y: this.y1\n } : {\n x: this.x2,\n y: this.y2\n };\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n return pointOnLine(p, farAwayPoint, distance);\n }\n }, {\n key: \"within\",\n value: function within(a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n }\n }, {\n key: \"closest\",\n value: function closest(a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n }\n }, {\n key: \"findClosestPointOnPath\",\n value: function findClosestPointOnPath(x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: this.x1,\n x2: this.x2,\n y1: this.y1,\n y2: this.y2\n };\n if (this.m === 0) {\n out.y = this.y1;\n out.x = this.within(this.x1, this.x2, x) ? x : this.closest(this.x1, this.x2, x);\n } else if (this.m === Infinity || this.m === -Infinity) {\n out.x = this.x1;\n out.y = this.within(this.y1, this.y2, y) ? y : this.closest(this.y1, this.y2, y);\n } else {\n var b = this.y1 - this.m * this.x1,\n b2 = y - this.m2 * x,\n _x1 = (b2 - b) / (this.m - this.m2),\n _y1 = this.m * _x1 + b;\n out.x = this.within(this.x1, this.x2, _x1) ? _x1 : this.closest(this.x1, this.x2, _x1);\n out.y = this.within(this.y1, this.y2, _y1) ? _y1 : this.closest(this.y1, this.y2, _y1);\n }\n var fractionInSegment = lineLength({\n x: out.x,\n y: out.y\n }, {\n x: this.x1,\n y: this.y1\n });\n out.d = lineLength({\n x: x,\n y: y\n }, out);\n out.l = fractionInSegment / length;\n return out;\n }\n }, {\n key: \"_pointLiesBetween\",\n value: function _pointLiesBetween(q, p1, p2) {\n return p2 > p1 ? p1 <= q && q <= p2 : p1 >= q && q >= p2;\n }\n }, {\n key: \"lineIntersection\",\n value: function lineIntersection(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(gradient({\n x: _x1,\n y: _y1\n }, {\n x: _x2,\n y: _y2\n })),\n m1 = Math.abs(this.m),\n b = m1 === Infinity ? this.x1 : this.y1 - m1 * this.x1,\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - m2 * _x1;\n if (m2 !== m1) {\n if (m2 === Infinity && m1 === 0) {\n if (this._pointLiesBetween(_x1, this.x1, this.x2) && this._pointLiesBetween(this.y1, _y1, _y2)) {\n out.push({\n x: _x1,\n y: this.y1\n });\n }\n } else if (m2 === 0 && m1 === Infinity) {\n if (this._pointLiesBetween(_y1, this.y1, this.y2) && this._pointLiesBetween(this.x1, _x1, _x2)) {\n out.push({\n x: this.x1,\n y: _y1\n });\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n X = _x1;\n if (this._pointLiesBetween(X, this.x1, this.x2)) {\n Y = m1 * _x1 + b;\n if (this._pointLiesBetween(Y, _y1, _y2)) {\n out.push({\n x: X,\n y: Y\n });\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n if (this._pointLiesBetween(Y, this.y1, this.y2)) {\n X = (_y1 - b) / m1;\n if (this._pointLiesBetween(X, _x1, _x2)) {\n out.push({\n x: X,\n y: Y\n });\n }\n }\n } else {\n X = (b2 - b) / (m1 - m2);\n Y = m1 * X + b;\n if (this._pointLiesBetween(X, this.x1, this.x2) && this._pointLiesBetween(Y, this.y1, this.y2)) {\n out.push({\n x: X,\n y: Y\n });\n }\n }\n }\n }\n return out;\n }\n }, {\n key: \"boxIntersection\",\n value: function boxIntersection(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n }\n }]);\n return StraightSegment;\n}(AbstractSegment);\n_defineProperty(StraightSegment, \"segmentType\", \"Straight\");\n\nvar StraightConnector = function (_AbstractConnector) {\n _inherits(StraightConnector, _AbstractConnector);\n var _super = _createSuper(StraightConnector);\n function StraightConnector() {\n var _this;\n _classCallCheck(this, StraightConnector);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"type\", StraightConnector.type);\n return _this;\n }\n _createClass(StraightConnector, [{\n key: \"getDefaultStubs\",\n value: function getDefaultStubs() {\n return [0, 0];\n }\n }, {\n key: \"_compute\",\n value: function _compute(paintInfo, p) {\n this._addSegment(StraightSegment, {\n x1: paintInfo.sx,\n y1: paintInfo.sy,\n x2: paintInfo.startStubX,\n y2: paintInfo.startStubY\n });\n this._addSegment(StraightSegment, {\n x1: paintInfo.startStubX,\n y1: paintInfo.startStubY,\n x2: paintInfo.endStubX,\n y2: paintInfo.endStubY\n });\n this._addSegment(StraightSegment, {\n x1: paintInfo.endStubX,\n y1: paintInfo.endStubY,\n x2: paintInfo.tx,\n y2: paintInfo.ty\n });\n this.geometry = {\n source: p.sourcePos,\n target: p.targetPos\n };\n }\n }, {\n key: \"transformGeometry\",\n value: function transformGeometry(g, dx, dy) {\n return {\n source: this.transformAnchorPlacement(g.source, dx, dy),\n target: this.transformAnchorPlacement(g.target, dx, dy)\n };\n }\n }]);\n return StraightConnector;\n}(AbstractConnector);\n_defineProperty(StraightConnector, \"type\", \"Straight\");\n\nfunction _scopeMatch(e1, e2) {\n var s1 = e1.scope.split(/\\s/),\n s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n return false;\n}\nfunction prepareList(instance, input, doNotGetIds) {\n var r = [];\n var _resolveId = function _resolveId(i) {\n if (isString(i)) {\n return i;\n } else {\n return instance.getId(i);\n }\n };\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n } else {\n if (doNotGetIds) {\n r = input;\n } else {\n if (input.length != null) {\n var _r;\n (_r = r).push.apply(_r, _toConsumableArray(_toConsumableArray(input).map(_resolveId)));\n } else {\n r.push(_resolveId(input));\n }\n }\n }\n }\n return r;\n}\nfunction addManagedEndpoint(managedElement, ep) {\n if (managedElement != null) {\n managedElement.endpoints.push(ep);\n }\n}\nfunction removeManagedEndpoint(managedElement, endpoint) {\n if (managedElement != null) {\n removeWithFunction(managedElement.endpoints, function (ep) {\n return ep === endpoint;\n });\n }\n}\nfunction addManagedConnection(connection, sourceEl, targetEl) {\n if (sourceEl != null) {\n sourceEl.connections.push(connection);\n if (sourceEl.connections.length === 1) {\n connection.instance.addClass(connection.source, connection.instance.connectedClass);\n }\n }\n if (targetEl != null) {\n if (sourceEl == null || connection.sourceId !== connection.targetId) {\n targetEl.connections.push(connection);\n if (targetEl.connections.length === 1) {\n connection.instance.addClass(connection.target, connection.instance.connectedClass);\n }\n }\n }\n}\nfunction removeManagedConnection(connection, sourceEl, targetEl) {\n if (sourceEl != null) {\n var sourceCount = sourceEl.connections.length;\n removeWithFunction(sourceEl.connections, function (_c) {\n return connection.id === _c.id;\n });\n if (sourceCount > 0 && sourceEl.connections.length === 0) {\n connection.instance.removeClass(connection.source, connection.instance.connectedClass);\n }\n }\n if (targetEl != null) {\n var targetCount = targetEl.connections.length;\n if (sourceEl == null || connection.sourceId !== connection.targetId) {\n removeWithFunction(targetEl.connections, function (_c) {\n return connection.id === _c.id;\n });\n }\n if (targetCount > 0 && targetEl.connections.length === 0) {\n connection.instance.removeClass(connection.target, connection.instance.connectedClass);\n }\n }\n}\nvar JsPlumbInstance = function (_EventGenerator) {\n _inherits(JsPlumbInstance, _EventGenerator);\n var _super = _createSuper(JsPlumbInstance);\n function JsPlumbInstance(_instanceIndex, defaults) {\n var _this;\n _classCallCheck(this, JsPlumbInstance);\n _this = _super.call(this);\n _this._instanceIndex = _instanceIndex;\n _defineProperty(_assertThisInitialized(_this), \"defaults\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_initialDefaults\", {});\n _defineProperty(_assertThisInitialized(_this), \"isConnectionBeingDragged\", false);\n _defineProperty(_assertThisInitialized(_this), \"currentlyDragging\", false);\n _defineProperty(_assertThisInitialized(_this), \"hoverSuspended\", false);\n _defineProperty(_assertThisInitialized(_this), \"_suspendDrawing\", false);\n _defineProperty(_assertThisInitialized(_this), \"_suspendedAt\", null);\n _defineProperty(_assertThisInitialized(_this), \"connectorClass\", CLASS_CONNECTOR);\n _defineProperty(_assertThisInitialized(_this), \"connectorOutlineClass\", CLASS_CONNECTOR_OUTLINE);\n _defineProperty(_assertThisInitialized(_this), \"connectedClass\", CLASS_CONNECTED);\n _defineProperty(_assertThisInitialized(_this), \"endpointClass\", CLASS_ENDPOINT);\n _defineProperty(_assertThisInitialized(_this), \"endpointConnectedClass\", CLASS_ENDPOINT_CONNECTED);\n _defineProperty(_assertThisInitialized(_this), \"endpointFullClass\", CLASS_ENDPOINT_FULL);\n _defineProperty(_assertThisInitialized(_this), \"endpointFloatingClass\", CLASS_ENDPOINT_FLOATING);\n _defineProperty(_assertThisInitialized(_this), \"endpointDropAllowedClass\", CLASS_ENDPOINT_DROP_ALLOWED);\n _defineProperty(_assertThisInitialized(_this), \"endpointDropForbiddenClass\", CLASS_ENDPOINT_DROP_FORBIDDEN);\n _defineProperty(_assertThisInitialized(_this), \"endpointAnchorClassPrefix\", CLASS_ENDPOINT_ANCHOR_PREFIX);\n _defineProperty(_assertThisInitialized(_this), \"overlayClass\", CLASS_OVERLAY);\n _defineProperty(_assertThisInitialized(_this), \"connections\", []);\n _defineProperty(_assertThisInitialized(_this), \"endpointsByElement\", {});\n _defineProperty(_assertThisInitialized(_this), \"endpointsByUUID\", new Map());\n _defineProperty(_assertThisInitialized(_this), \"sourceSelectors\", []);\n _defineProperty(_assertThisInitialized(_this), \"targetSelectors\", []);\n _defineProperty(_assertThisInitialized(_this), \"allowNestedGroups\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_curIdStamp\", 1);\n _defineProperty(_assertThisInitialized(_this), \"viewport\", new Viewport(_assertThisInitialized(_this)));\n _defineProperty(_assertThisInitialized(_this), \"router\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"groupManager\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectionTypes\", new Map());\n _defineProperty(_assertThisInitialized(_this), \"_endpointTypes\", new Map());\n _defineProperty(_assertThisInitialized(_this), \"_container\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_managedElements\", {});\n _defineProperty(_assertThisInitialized(_this), \"DEFAULT_SCOPE\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_zoom\", 1);\n _this.defaults = {\n anchor: AnchorLocations.Bottom,\n anchors: [null, null],\n connectionsDetachable: true,\n connectionOverlays: [],\n connector: StraightConnector.type,\n container: null,\n endpoint: DotEndpoint.type,\n endpointOverlays: [],\n endpoints: [null, null],\n endpointStyle: {\n fill: \"#456\"\n },\n endpointStyles: [null, null],\n endpointHoverStyle: null,\n endpointHoverStyles: [null, null],\n hoverPaintStyle: null,\n listStyle: {},\n maxConnections: 1,\n paintStyle: {\n strokeWidth: 2,\n stroke: \"#456\"\n },\n reattachConnections: false,\n scope: \"jsplumb_defaultscope\",\n allowNestedGroups: true\n };\n if (defaults) {\n extend(_this.defaults, defaults);\n }\n extend(_this._initialDefaults, _this.defaults);\n if (_this._initialDefaults[DEFAULT_KEY_PAINT_STYLE] != null) {\n _this._initialDefaults[DEFAULT_KEY_PAINT_STYLE].strokeWidth = _this._initialDefaults[DEFAULT_KEY_PAINT_STYLE].strokeWidth || 2;\n }\n _this.DEFAULT_SCOPE = _this.defaults[DEFAULT_KEY_SCOPE];\n _this.allowNestedGroups = _this._initialDefaults[DEFAULT_KEY_ALLOW_NESTED_GROUPS] !== false;\n _this.router = new LightweightRouter(_assertThisInitialized(_this));\n _this.groupManager = new GroupManager(_assertThisInitialized(_this));\n _this.setContainer(_this._initialDefaults.container);\n return _this;\n }\n _createClass(JsPlumbInstance, [{\n key: \"defaultScope\",\n get: function get() {\n return this.DEFAULT_SCOPE;\n }\n }, {\n key: \"currentZoom\",\n get: function get() {\n return this._zoom;\n }\n }, {\n key: \"areDefaultAnchorsSet\",\n value: function areDefaultAnchorsSet() {\n return this.validAnchorsSpec(this.defaults.anchors);\n }\n }, {\n key: \"validAnchorsSpec\",\n value: function validAnchorsSpec(anchors) {\n return anchors != null && anchors[0] != null && anchors[1] != null;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this._container;\n }\n }, {\n key: \"setZoom\",\n value: function setZoom(z, repaintEverything) {\n this._zoom = z;\n this.fire(EVENT_ZOOM, this._zoom);\n if (repaintEverything) {\n this.repaintEverything();\n }\n return true;\n }\n }, {\n key: \"_idstamp\",\n value: function _idstamp() {\n return \"\" + this._curIdStamp++;\n }\n }, {\n key: \"checkCondition\",\n value: function checkCondition(conditionName, args) {\n var l = this.getListener(conditionName),\n r = true;\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n } catch (e) {\n log(\"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n }\n }, {\n key: \"getId\",\n value: function getId(element, uuid) {\n if (element == null) {\n return null;\n }\n var id = this.getAttribute(element, ATTRIBUTE_MANAGED);\n if (!id || id === \"undefined\") {\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n } else if (arguments.length === 1 || arguments.length === 3 && !arguments[2]) {\n id = \"jsplumb-\" + this._instanceIndex + \"-\" + this._idstamp();\n }\n this.setAttribute(element, ATTRIBUTE_MANAGED, id);\n }\n return id;\n }\n }, {\n key: \"getConnections\",\n value: function getConnections(options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = {\n \"scope\": options\n };\n }\n var scope = options.scope || this.defaultScope,\n scopes = prepareList(this, scope, true),\n sources = prepareList(this, options.source),\n targets = prepareList(this, options.target),\n results = !flat && scopes.length > 1 ? {} : [],\n _addOne = function _addOne(scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n for (var j = 0, jj = this.connections.length; j < jj; j++) {\n var _c2 = this.connections[j],\n sourceId = _c2.proxies && _c2.proxies[0] ? _c2.proxies[0].originalEp.elementId : _c2.sourceId,\n targetId = _c2.proxies && _c2.proxies[1] ? _c2.proxies[1].originalEp.elementId : _c2.targetId;\n if (filterList(scopes, _c2.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(_c2.scope, _c2);\n }\n }\n return results;\n }\n }, {\n key: \"select\",\n value: function select(params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return new ConnectionSelection(this, params.connections || this.getConnections(params, true));\n }\n }, {\n key: \"selectEndpoints\",\n value: function selectEndpoints(params) {\n params = params || {};\n params.scope = params.scope || WILDCARD;\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? WILDCARD : prepareList(this, params.element),\n sources = noElementFilters ? WILDCARD : prepareList(this, params.source),\n targets = noElementFilters ? WILDCARD : prepareList(this, params.target),\n scopes = prepareList(this, params.scope, true);\n var ep = [];\n for (var _el2 in this.endpointsByElement) {\n var either = filterList(elements, _el2, true),\n source = filterList(sources, _el2, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, _el2, true),\n targetMatchExact = targets !== \"*\";\n if (either || source || target) {\n inner: for (var i = 0, ii = this.endpointsByElement[_el2].length; i < ii; i++) {\n var _ep = this.endpointsByElement[_el2][i];\n if (filterList(scopes, _ep.scope, true)) {\n var noMatchSource = sourceMatchExact && sources.length > 0 && !_ep.isSource,\n noMatchTarget = targetMatchExact && targets.length > 0 && !_ep.isTarget;\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n ep.push(_ep);\n }\n }\n }\n }\n return new EndpointSelection(this, ep);\n }\n }, {\n key: \"setContainer\",\n value: function setContainer(c) {\n this._container = c;\n this.fire(EVENT_CONTAINER_CHANGE, this._container);\n }\n }, {\n key: \"_set\",\n value: function _set(c, el, idx) {\n var stTypes = [{\n el: \"source\",\n elId: \"sourceId\"\n }, {\n el: \"target\",\n elId: \"targetId\"\n }];\n var ep,\n _st = stTypes[idx],\n cId = c[_st.elId],\n sid,\n oldEndpoint = c.endpoints[idx];\n var evtParams = {\n index: idx,\n originalEndpoint: oldEndpoint,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c,\n newEndpoint: oldEndpoint\n };\n if (el instanceof Endpoint) {\n ep = el;\n ep.addConnection(c);\n } else {\n sid = this.getId(el);\n if (sid === c[_st.elId]) {\n ep = null;\n } else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n if (ep != null) {\n evtParams.newEndpoint = ep;\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n this.fireMoveEvent(evtParams);\n this._paintConnection(c);\n }\n return evtParams;\n }\n }, {\n key: \"setSource\",\n value: function setSource(connection, el) {\n removeManagedConnection(connection, this._managedElements[connection.sourceId]);\n var p = this._set(connection, el, 0);\n addManagedConnection(connection, this._managedElements[p.newSourceId]);\n }\n }, {\n key: \"setTarget\",\n value: function setTarget(connection, el) {\n removeManagedConnection(connection, this._managedElements[connection.targetId]);\n var p = this._set(connection, el, 1);\n addManagedConnection(connection, this._managedElements[p.newTargetId]);\n }\n }, {\n key: \"setConnectionType\",\n value: function setConnectionType(connection, type, params) {\n connection.setType(type, params);\n this._paintConnection(connection);\n }\n }, {\n key: \"isHoverSuspended\",\n value: function isHoverSuspended() {\n return this.hoverSuspended;\n }\n }, {\n key: \"setSuspendDrawing\",\n value: function setSuspendDrawing(val, repaintAfterwards) {\n var curVal = this._suspendDrawing;\n this._suspendDrawing = val;\n if (val) {\n this._suspendedAt = \"\" + new Date().getTime();\n } else {\n this._suspendedAt = null;\n this.viewport.recomputeBounds();\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n }\n }, {\n key: \"getSuspendedAt\",\n value: function getSuspendedAt() {\n return this._suspendedAt;\n }\n }, {\n key: \"batch\",\n value: function batch(fn, doNotRepaintAfterwards) {\n var _wasSuspended = this._suspendDrawing === true;\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n fn();\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n }\n }, {\n key: \"each\",\n value: function each(spec, fn) {\n if (spec == null) {\n return;\n }\n if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(spec[i]);\n }\n } else {\n fn(spec);\n }\n return this;\n }\n }, {\n key: \"updateOffset\",\n value: function updateOffset(params) {\n var elId = params.elId;\n if (params.recalc) {\n return this.viewport.refreshElement(elId);\n } else {\n return this.viewport.getPosition(elId);\n }\n }\n }, {\n key: \"deleteConnection\",\n value: function deleteConnection(connection, params) {\n if (connection != null && connection.deleted !== true) {\n params = params || {};\n if (params.force || functionChain(true, false, [[connection.endpoints[0], IS_DETACH_ALLOWED, [connection]], [connection.endpoints[1], IS_DETACH_ALLOWED, [connection]], [connection, IS_DETACH_ALLOWED, [connection]], [this, CHECK_CONDITION, [INTERCEPT_BEFORE_DETACH, connection]]])) {\n removeManagedConnection(connection, this._managedElements[connection.sourceId], this._managedElements[connection.targetId]);\n this.fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n var _sourceEndpoint = connection.endpoints[0];\n var targetEndpoint = connection.endpoints[1];\n if (_sourceEndpoint !== params.endpointToIgnore) {\n _sourceEndpoint.detachFromConnection(connection, null, true);\n }\n if (targetEndpoint !== params.endpointToIgnore) {\n targetEndpoint.detachFromConnection(connection, null, true);\n }\n removeWithFunction(this.connections, function (_c) {\n return connection.id === _c.id;\n });\n connection.destroy();\n if (_sourceEndpoint !== params.endpointToIgnore && _sourceEndpoint.deleteOnEmpty && _sourceEndpoint.connections.length === 0) {\n this.deleteEndpoint(_sourceEndpoint);\n }\n if (targetEndpoint !== params.endpointToIgnore && targetEndpoint.deleteOnEmpty && targetEndpoint.connections.length === 0) {\n this.deleteEndpoint(targetEndpoint);\n }\n return true;\n }\n }\n return false;\n }\n }, {\n key: \"deleteEveryConnection\",\n value: function deleteEveryConnection(params) {\n var _this2 = this;\n params = params || {};\n var count = this.connections.length,\n deletedCount = 0;\n this.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _this2.deleteConnection(_this2.connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n }\n }, {\n key: \"deleteConnectionsForElement\",\n value: function deleteConnectionsForElement(el, params) {\n var id = this.getId(el),\n m = this._managedElements[id];\n if (m) {\n var l = m.connections.length;\n for (var i = 0; i < l; i++) {\n this.deleteConnection(m.connections[0], params);\n }\n }\n return this;\n }\n }, {\n key: \"fireDetachEvent\",\n value: function fireDetachEvent(jpc, doFireEvent, originalEvent) {\n var argIsConnection = jpc.id != null,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source,\n target: jpc.target,\n sourceId: jpc.sourceId,\n targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0],\n targetEndpoint: jpc.endpoints[1]\n } : jpc;\n if (doFireEvent) {\n this.fire(EVENT_CONNECTION_DETACHED, params, originalEvent);\n }\n this.fire(EVENT_INTERNAL_CONNECTION_DETACHED, params, originalEvent);\n }\n }, {\n key: \"fireMoveEvent\",\n value: function fireMoveEvent(params, evt) {\n this.fire(EVENT_CONNECTION_MOVED, params, evt);\n }\n }, {\n key: \"manageAll\",\n value: function manageAll(elements, recalc) {\n var nl = isString(elements) ? this.getSelector(this.getContainer(), elements) : elements;\n for (var i = 0; i < nl.length; i++) {\n this.manage(nl[i], null, recalc);\n }\n }\n }, {\n key: \"manage\",\n value: function manage(element, internalId, _recalc) {\n if (this.getAttribute(element, ATTRIBUTE_MANAGED) == null) {\n internalId = internalId || this.getAttribute(element, \"id\") || uuid();\n this.setAttribute(element, ATTRIBUTE_MANAGED, internalId);\n }\n var elId = this.getId(element);\n if (!this._managedElements[elId]) {\n var obj = {\n el: element,\n endpoints: [],\n connections: [],\n rotation: 0,\n data: {}\n };\n this._managedElements[elId] = obj;\n if (this._suspendDrawing) {\n obj.viewportElement = this.viewport.registerElement(elId, true);\n } else {\n obj.viewportElement = this.updateOffset({\n elId: elId,\n recalc: true\n });\n }\n this.fire(EVENT_MANAGE_ELEMENT, {\n el: element\n });\n } else {\n if (_recalc) {\n this._managedElements[elId].viewportElement = this.updateOffset({\n elId: elId,\n timestamp: null,\n recalc: true\n });\n }\n }\n return this._managedElements[elId];\n }\n }, {\n key: \"getManagedData\",\n value: function getManagedData(elementId, dataIdentifier, key) {\n if (this._managedElements[elementId]) {\n var data = this._managedElements[elementId].data[dataIdentifier];\n return data != null ? data[key] : null;\n }\n }\n }, {\n key: \"setManagedData\",\n value: function setManagedData(elementId, dataIdentifier, key, data) {\n if (this._managedElements[elementId]) {\n this._managedElements[elementId].data[dataIdentifier] = this._managedElements[elementId].data[dataIdentifier] || {};\n this._managedElements[elementId].data[dataIdentifier][key] = data;\n }\n }\n }, {\n key: \"getManagedElement\",\n value: function getManagedElement(id) {\n return this._managedElements[id] ? this._managedElements[id].el : null;\n }\n }, {\n key: \"unmanage\",\n value: function unmanage(el, removeElement) {\n var _this3 = this;\n this.removeAllEndpoints(el, true);\n var _one = function _one(_el) {\n var id = _this3.getId(_el);\n _this3.removeAttribute(_el, ATTRIBUTE_MANAGED);\n delete _this3._managedElements[id];\n _this3.viewport.remove(id);\n _this3.fire(EVENT_UNMANAGE_ELEMENT, {\n el: _el,\n id: id\n });\n if (_el && removeElement) {\n _this3._removeElement(_el);\n }\n };\n this._getAssociatedElements(el).map(_one);\n _one(el);\n }\n }, {\n key: \"rotate\",\n value: function rotate(element, rotation, _doNotRepaint) {\n var elementId = this.getId(element);\n if (this._managedElements[elementId]) {\n this._managedElements[elementId].rotation = rotation;\n this.viewport.rotateElement(elementId, rotation);\n if (_doNotRepaint !== true) {\n return this.revalidate(element);\n }\n }\n return {\n c: new Set(),\n e: new Set()\n };\n }\n }, {\n key: \"_getRotation\",\n value: function _getRotation(elementId) {\n var entry = this._managedElements[elementId];\n if (entry != null) {\n return entry.rotation || 0;\n } else {\n return 0;\n }\n }\n }, {\n key: \"_getRotations\",\n value: function _getRotations(elementId) {\n var _this4 = this;\n var rotations = [];\n var entry = this._managedElements[elementId];\n var _oneLevel = function _oneLevel(e) {\n if (e.group != null) {\n var gEntry = _this4._managedElements[e.group];\n if (gEntry != null) {\n rotations.push({\n r: gEntry.viewportElement.r,\n c: gEntry.viewportElement.c\n });\n _oneLevel(gEntry);\n }\n }\n };\n if (entry != null) {\n rotations.push({\n r: entry.viewportElement.r || 0,\n c: entry.viewportElement.c\n });\n _oneLevel(entry);\n }\n return rotations;\n }\n }, {\n key: \"_applyRotations\",\n value: function _applyRotations(point, rotations) {\n var sl = point.slice();\n var current = {\n x: sl[0],\n y: sl[1],\n cr: 0,\n sr: 0\n };\n forEach(rotations, function (rotation) {\n current = rotatePoint(current, rotation.c, rotation.r);\n });\n return current;\n }\n }, {\n key: \"_applyRotationsXY\",\n value: function _applyRotationsXY(point, rotations) {\n forEach(rotations, function (rotation) {\n point = rotatePoint(point, rotation.c, rotation.r);\n });\n return point;\n }\n }, {\n key: \"_internal_newEndpoint\",\n value: function _internal_newEndpoint(params) {\n var _p = extend({}, params);\n var managedElement = this.manage(_p.element);\n _p.elementId = this.getId(_p.element);\n _p.id = \"ep_\" + this._idstamp();\n var ep = new Endpoint(this, _p);\n addManagedEndpoint(managedElement, ep);\n if (params.uuid) {\n this.endpointsByUUID.set(params.uuid, ep);\n }\n addToDictionary(this.endpointsByElement, ep.elementId, ep);\n if (!this._suspendDrawing) {\n this._paintEndpoint(ep, {\n timestamp: this._suspendedAt\n });\n }\n return ep;\n }\n }, {\n key: \"_deriveEndpointAndAnchorSpec\",\n value: function _deriveEndpointAndAnchorSpec(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/),\n eps = null,\n ep = null,\n a = null,\n as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = this.getConnectionType(bits[i]);\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return {\n endpoints: eps ? eps : [ep, ep],\n anchors: as ? as : [a, a]\n };\n }\n }, {\n key: \"revalidate\",\n value: function revalidate(el, timestamp) {\n var elId = this.getId(el);\n this.updateOffset({\n elId: elId,\n recalc: true,\n timestamp: timestamp\n });\n return this.repaint(el);\n }\n }, {\n key: \"repaintEverything\",\n value: function repaintEverything() {\n var timestamp = uuid(),\n elId;\n for (elId in this._managedElements) {\n this.viewport.refreshElement(elId, true);\n }\n this.viewport.recomputeBounds();\n for (elId in this._managedElements) {\n this.repaint(this._managedElements[elId].el, timestamp, true);\n }\n return this;\n }\n }, {\n key: \"setElementPosition\",\n value: function setElementPosition(el, x, y) {\n var id = this.getId(el);\n this.viewport.setPosition(id, x, y);\n return this.repaint(el);\n }\n }, {\n key: \"repaint\",\n value: function repaint(el, timestamp, offsetsWereJustCalculated) {\n var r = {\n c: new Set(),\n e: new Set()\n };\n var _mergeRedraw = function _mergeRedraw(r2) {\n r2.c.forEach(function (c) {\n return r.c.add(c);\n });\n r2.e.forEach(function (e) {\n return r.e.add(e);\n });\n };\n if (!this._suspendDrawing) {\n var id = this.getId(el);\n if (el != null) {\n var repaintEls = this._getAssociatedElements(el);\n if (timestamp == null) {\n timestamp = uuid();\n }\n if (!offsetsWereJustCalculated) {\n for (var i = 0; i < repaintEls.length; i++) {\n this.updateOffset({\n elId: this.getId(repaintEls[i]),\n recalc: true,\n timestamp: timestamp\n });\n }\n }\n _mergeRedraw(this.router.redraw(id, timestamp, null));\n if (repaintEls.length > 0) {\n for (var j = 0; j < repaintEls.length; j++) {\n _mergeRedraw(this.router.redraw(this.getId(repaintEls[j]), timestamp, null));\n }\n }\n }\n }\n return r;\n }\n }, {\n key: \"unregisterEndpoint\",\n value: function unregisterEndpoint(endpoint) {\n var uuid = endpoint.getUuid();\n if (uuid) {\n this.endpointsByUUID[\"delete\"](uuid);\n }\n removeManagedEndpoint(this._managedElements[endpoint.elementId], endpoint);\n var ebe = this.endpointsByElement[endpoint.elementId];\n if (ebe != null) {\n this.endpointsByElement[endpoint.elementId] = ebe.filter(function (e) {\n return e !== endpoint;\n });\n }\n this.fire(EVENT_INTERNAL_ENDPOINT_UNREGISTERED, endpoint);\n }\n }, {\n key: \"_maybePruneEndpoint\",\n value: function _maybePruneEndpoint(endpoint) {\n if (endpoint.deleteOnEmpty && endpoint.connections.length === 0) {\n this.deleteEndpoint(endpoint);\n return true;\n } else {\n return false;\n }\n }\n }, {\n key: \"deleteEndpoint\",\n value: function deleteEndpoint(object) {\n var _this5 = this;\n var endpoint = typeof object === \"string\" ? this.endpointsByUUID.get(object) : object;\n if (endpoint) {\n var proxy = endpoint.proxiedBy;\n var connectionsToDelete = endpoint.connections.slice();\n forEach(connectionsToDelete, function (connection) {\n endpoint.detachFromConnection(connection, null, true);\n });\n this.unregisterEndpoint(endpoint);\n endpoint.destroy();\n forEach(connectionsToDelete, function (connection) {\n _this5.deleteConnection(connection, {\n force: true,\n endpointToIgnore: endpoint\n });\n });\n if (proxy != null) {\n this.deleteEndpoint(proxy);\n }\n }\n return this;\n }\n }, {\n key: \"addEndpoint\",\n value: function addEndpoint(el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = extend({}, referenceParams);\n extend(p, params || {});\n var _p = extend({\n element: el\n }, p);\n return this._internal_newEndpoint(_p);\n }\n }, {\n key: \"addEndpoints\",\n value: function addEndpoints(el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n results.push(this.addEndpoint(el, endpoints[i], referenceParams));\n }\n return results;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this6 = this;\n this.silently(function () {\n _this6.endpointsByElement = {};\n _this6._managedElements = {};\n _this6.endpointsByUUID.clear();\n _this6.viewport.reset();\n _this6.router.reset();\n _this6.groupManager.reset();\n _this6.connections.length = 0;\n });\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.reset();\n this.unbind();\n this.sourceSelectors.length = 0;\n this.targetSelectors.length = 0;\n this._connectionTypes.clear();\n this._endpointTypes.clear();\n }\n }, {\n key: \"getEndpoints\",\n value: function getEndpoints(el) {\n return this.endpointsByElement[this.getId(el)] || [];\n }\n }, {\n key: \"getEndpoint\",\n value: function getEndpoint(uuid) {\n return this.endpointsByUUID.get(uuid);\n }\n }, {\n key: \"setEndpointUuid\",\n value: function setEndpointUuid(endpoint, uuid) {\n if (endpoint.uuid) {\n this.endpointsByUUID[\"delete\"](endpoint.uuid);\n }\n endpoint.uuid = uuid;\n this.endpointsByUUID.set(uuid, endpoint);\n }\n }, {\n key: \"connect\",\n value: function connect(params, referenceParams) {\n try {\n var _p = this._prepareConnectionParams(params, referenceParams),\n jpc = this._newConnection(_p);\n this._finaliseConnection(jpc, _p);\n return jpc;\n } catch (errorMessage) {\n log(errorMessage);\n return;\n }\n }\n }, {\n key: \"_prepareConnectionParams\",\n value: function _prepareConnectionParams(params, referenceParams) {\n var temp = extend({}, params);\n if (referenceParams) {\n extend(temp, referenceParams);\n }\n var _p = temp;\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n }\n if (params.uuids) {\n _p.sourceEndpoint = this.getEndpoint(params.uuids[0]);\n _p.targetEndpoint = this.getEndpoint(params.uuids[1]);\n }\n if (_p.sourceEndpoint != null) {\n if (_p.sourceEndpoint.isFull()) {\n throw ERROR_SOURCE_ENDPOINT_FULL;\n }\n if (!_p.type) {\n _p.type = _p.sourceEndpoint.edgeType;\n }\n if (_p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n if (_p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n } else {\n if (_p.source == null) {\n throw ERROR_SOURCE_DOES_NOT_EXIST;\n }\n }\n if (_p.targetEndpoint != null) {\n if (_p.targetEndpoint.isFull()) {\n throw ERROR_TARGET_ENDPOINT_FULL;\n }\n } else {\n if (_p.target == null) {\n throw ERROR_TARGET_DOES_NOT_EXIST;\n }\n }\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n throw \"Cannot establish connection: scopes do not match\";\n }\n }\n return _p;\n }\n }, {\n key: \"_newConnection\",\n value: function _newConnection(params) {\n params.id = \"con_\" + this._idstamp();\n var c = new Connection(this, params);\n addManagedConnection(c, this._managedElements[c.sourceId], this._managedElements[c.targetId]);\n this._paintConnection(c);\n return c;\n }\n }, {\n key: \"_finaliseConnection\",\n value: function _finaliseConnection(jpc, params, originalEvent) {\n params = params || {};\n if (!jpc.suspendedEndpoint) {\n this.connections.push(jpc);\n }\n jpc.pending = null;\n jpc.endpoints[0].isTemporarySource = false;\n this.repaint(jpc.source);\n var payload = {\n connection: jpc,\n source: jpc.source,\n target: jpc.target,\n sourceId: jpc.sourceId,\n targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0],\n targetEndpoint: jpc.endpoints[1]\n };\n this.fire(EVENT_INTERNAL_CONNECTION, payload, originalEvent);\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n this.fire(EVENT_CONNECTION, payload, originalEvent);\n }\n }\n }, {\n key: \"removeAllEndpoints\",\n value: function removeAllEndpoints(el, recurse) {\n var _this7 = this;\n var _one = function _one(_el) {\n var id = _this7.getId(_el),\n ebe = _this7.endpointsByElement[id],\n i,\n ii;\n if (ebe) {\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _this7.deleteEndpoint(ebe[i]);\n }\n }\n delete _this7.endpointsByElement[id];\n };\n if (recurse) {\n this._getAssociatedElements(el).map(_one);\n }\n _one(el);\n return this;\n }\n }, {\n key: \"_createSourceDefinition\",\n value: function _createSourceDefinition(params, referenceParams) {\n var p = extend({}, referenceParams);\n extend(p, params);\n p.edgeType = p.edgeType || DEFAULT;\n var aae = this._deriveEndpointAndAnchorSpec(p.edgeType);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1;\n var _def = {\n def: extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true,\n endpoint: null\n };\n return _def;\n }\n }, {\n key: \"addSourceSelector\",\n value: function addSourceSelector(selector, params) {\n var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _def = this._createSourceDefinition(params);\n var sel = new ConnectionDragSelector(selector, _def, exclude);\n this.sourceSelectors.push(sel);\n return sel;\n }\n }, {\n key: \"removeSourceSelector\",\n value: function removeSourceSelector(selector) {\n removeWithFunction(this.sourceSelectors, function (s) {\n return s === selector;\n });\n }\n }, {\n key: \"removeTargetSelector\",\n value: function removeTargetSelector(selector) {\n removeWithFunction(this.targetSelectors, function (s) {\n return s === selector;\n });\n }\n }, {\n key: \"addTargetSelector\",\n value: function addTargetSelector(selector, params) {\n var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var _def = this._createTargetDefinition(params);\n var sel = new ConnectionDragSelector(selector, _def, exclude);\n this.targetSelectors.push(sel);\n return sel;\n }\n }, {\n key: \"_createTargetDefinition\",\n value: function _createTargetDefinition(params, referenceParams) {\n var p = extend({}, referenceParams);\n extend(p, params);\n p.edgeType = p.edgeType || DEFAULT;\n var maxConnections = p.maxConnections || -1;\n var _def = {\n def: extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true,\n endpoint: null\n };\n return _def;\n }\n }, {\n key: \"show\",\n value: function show(el, changeEndpoints) {\n return this._setVisible(el, BLOCK, changeEndpoints);\n }\n }, {\n key: \"hide\",\n value: function hide(el, changeEndpoints) {\n return this._setVisible(el, NONE, changeEndpoints);\n }\n }, {\n key: \"_setVisible\",\n value: function _setVisible(el, state, alsoChangeEndpoints) {\n var visible = state === BLOCK;\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function endpointFunc(ep) {\n ep.setVisible(visible, true, true);\n };\n }\n var id = this.getId(el);\n this._operation(el, function (jpc) {\n if (visible && alsoChangeEndpoints) {\n var oidx = jpc.sourceId === id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n } else {\n jpc.setVisible(visible);\n }\n }, endpointFunc);\n return this;\n }\n }, {\n key: \"toggleVisible\",\n value: function toggleVisible(el, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function endpointFunc(ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n this._operation(el, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n }\n }, {\n key: \"_operation\",\n value: function _operation(el, func, endpointFunc) {\n var elId = this.getId(el);\n var endpoints = this.endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n }\n }, {\n key: \"registerConnectionType\",\n value: function registerConnectionType(id, type) {\n this._connectionTypes.set(id, extend({}, type));\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n var fo = convertToFullOverlaySpec(type.overlays[i]);\n to[fo.options.id] = fo;\n }\n this._connectionTypes.get(id).overlays = to;\n }\n }\n }, {\n key: \"registerConnectionTypes\",\n value: function registerConnectionTypes(types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n }\n }, {\n key: \"registerEndpointType\",\n value: function registerEndpointType(id, type) {\n this._endpointTypes.set(id, extend({}, type));\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n var fo = convertToFullOverlaySpec(type.overlays[i]);\n to[fo.options.id] = fo;\n }\n this._endpointTypes.get(id).overlays = to;\n }\n }\n }, {\n key: \"registerEndpointTypes\",\n value: function registerEndpointTypes(types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n }\n }, {\n key: \"getType\",\n value: function getType(id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this.getConnectionType(id) : this.getEndpointType(id);\n }\n }, {\n key: \"getConnectionType\",\n value: function getConnectionType(id) {\n return this._connectionTypes.get(id);\n }\n }, {\n key: \"getEndpointType\",\n value: function getEndpointType(id) {\n return this._endpointTypes.get(id);\n }\n }, {\n key: \"importDefaults\",\n value: function importDefaults(d) {\n for (var i in d) {\n this.defaults[i] = d[i];\n }\n if (this.defaults[DEFAULT_KEY_PAINT_STYLE] != null) {\n this.defaults[DEFAULT_KEY_PAINT_STYLE].strokeWidth = this.defaults[DEFAULT_KEY_PAINT_STYLE].strokeWidth || 2;\n }\n if (d.container) {\n this.setContainer(d.container);\n }\n return this;\n }\n }, {\n key: \"restoreDefaults\",\n value: function restoreDefaults() {\n this.defaults = extend({}, this._initialDefaults);\n return this;\n }\n }, {\n key: \"getManagedElements\",\n value: function getManagedElements() {\n return this._managedElements;\n }\n }, {\n key: \"proxyConnection\",\n value: function proxyConnection(connection, index, proxyEl, endpointGenerator, anchorGenerator) {\n var alreadyProxied = connection.proxies[index] != null,\n proxyEp,\n originalElementId = alreadyProxied ? connection.proxies[index].originalEp.elementId : connection.endpoints[index].elementId,\n originalEndpoint = alreadyProxied ? connection.proxies[index].originalEp : connection.endpoints[index],\n proxyElId = this.getId(proxyEl);\n if (connection.proxies[index]) {\n if (connection.proxies[index].ep.elementId === proxyElId) {\n proxyEp = connection.proxies[index].ep;\n } else {\n connection.proxies[index].ep.detachFromConnection(connection, index);\n proxyEp = this._internal_newEndpoint({\n element: proxyEl,\n endpoint: endpointGenerator(connection, index),\n anchor: anchorGenerator(connection, index),\n parameters: {\n isProxyEndpoint: true\n }\n });\n }\n } else {\n proxyEp = this._internal_newEndpoint({\n element: proxyEl,\n endpoint: endpointGenerator(connection, index),\n anchor: anchorGenerator(connection, index),\n parameters: {\n isProxyEndpoint: true\n }\n });\n }\n proxyEp.deleteOnEmpty = true;\n connection.proxies[index] = {\n ep: proxyEp,\n originalEp: originalEndpoint\n };\n this.sourceOrTargetChanged(originalElementId, proxyElId, connection, proxyEl, index);\n originalEndpoint.detachFromConnection(connection, null, true);\n proxyEp.connections = [connection];\n connection.endpoints[index] = proxyEp;\n originalEndpoint.proxiedBy = proxyEp;\n originalEndpoint.setVisible(false);\n connection.setVisible(true);\n this.revalidate(proxyEl);\n }\n }, {\n key: \"unproxyConnection\",\n value: function unproxyConnection(connection, index) {\n if (connection.proxies == null || connection.proxies[index] == null) {\n return;\n }\n var originalElement = connection.proxies[index].originalEp.element,\n originalElementId = connection.proxies[index].originalEp.elementId,\n proxyElId = connection.proxies[index].ep.elementId;\n connection.endpoints[index] = connection.proxies[index].originalEp;\n delete connection.proxies[index].originalEp.proxiedBy;\n this.sourceOrTargetChanged(proxyElId, originalElementId, connection, originalElement, index);\n connection.proxies[index].ep.detachFromConnection(connection, null);\n connection.proxies[index].originalEp.addConnection(connection);\n if (connection.isVisible()) {\n connection.proxies[index].originalEp.setVisible(true);\n }\n connection.proxies[index] = null;\n if (findWithFunction(connection.proxies, function (p) {\n return p != null;\n }) === -1) {\n connection.proxies.length = 0;\n }\n }\n }, {\n key: \"sourceOrTargetChanged\",\n value: function sourceOrTargetChanged(originalId, newId, connection, newElement, index) {\n if (originalId !== newId) {\n if (index === 0) {\n connection.sourceId = newId;\n connection.source = newElement;\n } else if (index === 1) {\n connection.targetId = newId;\n connection.target = newElement;\n }\n removeManagedConnection(connection, this._managedElements[originalId]);\n addManagedConnection(connection, this._managedElements[newId]);\n }\n }\n }, {\n key: \"getGroup\",\n value:\n function getGroup(groupId) {\n return this.groupManager.getGroup(groupId);\n }\n }, {\n key: \"getGroupFor\",\n value: function getGroupFor(el) {\n return this.groupManager.getGroupFor(el);\n }\n }, {\n key: \"addGroup\",\n value: function addGroup(params) {\n return this.groupManager.addGroup(params);\n }\n }, {\n key: \"addToGroup\",\n value: function addToGroup(group) {\n var _this$groupManager;\n for (var _len = arguments.length, el = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n el[_key - 1] = arguments[_key];\n }\n return (_this$groupManager = this.groupManager).addToGroup.apply(_this$groupManager, [group, false].concat(el));\n }\n }, {\n key: \"collapseGroup\",\n value: function collapseGroup(group) {\n this.groupManager.collapseGroup(group);\n }\n }, {\n key: \"expandGroup\",\n value: function expandGroup(group) {\n this.groupManager.expandGroup(group);\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(group) {\n this.groupManager.toggleGroup(group);\n }\n }, {\n key: \"removeGroup\",\n value: function removeGroup(group, deleteMembers, _manipulateView, _doNotFireEvent) {\n return this.groupManager.removeGroup(group, deleteMembers, _manipulateView, _doNotFireEvent);\n }\n }, {\n key: \"removeAllGroups\",\n value: function removeAllGroups(deleteMembers, _manipulateView) {\n this.groupManager.removeAllGroups(deleteMembers, _manipulateView, false);\n }\n }, {\n key: \"removeFromGroup\",\n value: function removeFromGroup(group, el, _doNotFireEvent) {\n this.groupManager.removeFromGroup(group, _doNotFireEvent, el);\n this._appendElement(el, this.getContainer());\n this.updateOffset({\n recalc: true,\n elId: this.getId(el)\n });\n }\n }, {\n key: \"_paintEndpoint\",\n value: function _paintEndpoint(endpoint, params) {\n function findConnectionToUseForDynamicAnchor(ep) {\n var idx = 0;\n if (params.elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === params.elementWithPrecedence || ep.connections[i].targetId === params.elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n return ep.connections[idx];\n }\n params = params || {};\n var timestamp = params.timestamp,\n recalc = !(params.recalc === false);\n if (!timestamp || endpoint.timestamp !== timestamp) {\n var info = this.viewport.getPosition(endpoint.elementId);\n var xy = params.offset ? {\n x: params.offset.x,\n y: params.offset.y\n } : {\n x: info.x,\n y: info.y\n };\n if (xy != null) {\n var ap = params.anchorLoc;\n if (ap == null) {\n var anchorParams = {\n xy: xy,\n wh: info,\n element: endpoint,\n timestamp: timestamp\n };\n if (recalc && this.router.isDynamicAnchor(endpoint) && endpoint.connections.length > 0) {\n var _c3 = findConnectionToUseForDynamicAnchor(endpoint),\n oIdx = _c3.endpoints[0] === endpoint ? 1 : 0,\n oId = oIdx === 0 ? _c3.sourceId : _c3.targetId,\n oInfo = this.viewport.getPosition(oId);\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = _c3;\n anchorParams.txy = oInfo;\n anchorParams.twh = oInfo;\n anchorParams.tElement = _c3.endpoints[oIdx];\n anchorParams.tRotation = this._getRotations(oId);\n } else if (endpoint.connections.length > 0) {\n anchorParams.connection = endpoint.connections[0];\n }\n anchorParams.rotation = this._getRotations(endpoint.elementId);\n ap = this.router.computeAnchorLocation(endpoint._anchor, anchorParams);\n }\n endpoint.endpoint.compute(ap, this.router.getEndpointOrientation(endpoint), endpoint.paintStyleInUse);\n this.renderEndpoint(endpoint, endpoint.paintStyleInUse);\n endpoint.timestamp = timestamp;\n for (var i in endpoint.overlays) {\n if (endpoint.overlays.hasOwnProperty(i)) {\n var _o = endpoint.overlays[i];\n if (_o.isVisible()) {\n endpoint.overlayPlacements[i] = this.drawOverlay(_o, endpoint.endpoint, endpoint.paintStyleInUse, endpoint.getAbsoluteOverlayPosition(_o));\n this._paintOverlay(_o, endpoint.overlayPlacements[i], {\n xmin: 0,\n ymin: 0\n });\n }\n }\n }\n }\n }\n }\n }, {\n key: \"_paintConnection\",\n value: function _paintConnection(connection, params) {\n if (!this._suspendDrawing && connection.visible !== false) {\n params = params || {};\n var timestamp = params.timestamp;\n if (timestamp != null && timestamp === connection.lastPaintedAt) {\n return;\n }\n if (timestamp == null || timestamp !== connection.lastPaintedAt) {\n this.router.computePath(connection, timestamp);\n var overlayExtents = {\n xmin: Infinity,\n ymin: Infinity,\n xmax: -Infinity,\n ymax: -Infinity\n };\n for (var i in connection.overlays) {\n if (connection.overlays.hasOwnProperty(i)) {\n var _o2 = connection.overlays[i];\n if (_o2.isVisible()) {\n connection.overlayPlacements[i] = this.drawOverlay(_o2, connection.connector, connection.paintStyleInUse, connection.getAbsoluteOverlayPosition(_o2));\n overlayExtents.xmin = Math.min(overlayExtents.xmin, connection.overlayPlacements[i].xmin);\n overlayExtents.xmax = Math.max(overlayExtents.xmax, connection.overlayPlacements[i].xmax);\n overlayExtents.ymin = Math.min(overlayExtents.ymin, connection.overlayPlacements[i].ymin);\n overlayExtents.ymax = Math.max(overlayExtents.ymax, connection.overlayPlacements[i].ymax);\n }\n }\n }\n var lineWidth = parseFloat(\"\" + connection.paintStyleInUse.strokeWidth || \"1\") / 2,\n outlineWidth = parseFloat(\"\" + connection.paintStyleInUse.strokeWidth || \"0\"),\n _extents = {\n xmin: Math.min(connection.connector.bounds.xmin - (lineWidth + outlineWidth), overlayExtents.xmin),\n ymin: Math.min(connection.connector.bounds.ymin - (lineWidth + outlineWidth), overlayExtents.ymin),\n xmax: Math.max(connection.connector.bounds.xmax + (lineWidth + outlineWidth), overlayExtents.xmax),\n ymax: Math.max(connection.connector.bounds.ymax + (lineWidth + outlineWidth), overlayExtents.ymax)\n };\n this.paintConnector(connection.connector, connection.paintStyleInUse, _extents);\n for (var j in connection.overlays) {\n if (connection.overlays.hasOwnProperty(j)) {\n var _p2 = connection.overlays[j];\n if (_p2.isVisible()) {\n this._paintOverlay(_p2, connection.overlayPlacements[j], _extents);\n }\n }\n }\n }\n connection.lastPaintedAt = timestamp;\n }\n }\n }, {\n key: \"_refreshEndpoint\",\n value: function _refreshEndpoint(endpoint) {\n if (!endpoint._anchor.isFloating) {\n if (endpoint.connections.length > 0) {\n this.addEndpointClass(endpoint, this.endpointConnectedClass);\n } else {\n this.removeEndpointClass(endpoint, this.endpointConnectedClass);\n }\n if (endpoint.isFull()) {\n this.addEndpointClass(endpoint, this.endpointFullClass);\n } else {\n this.removeEndpointClass(endpoint, this.endpointFullClass);\n }\n }\n }\n }, {\n key: \"_makeConnector\",\n value: function _makeConnector(connection, name, args) {\n return Connectors.get(connection, name, args);\n }\n }, {\n key: \"addOverlay\",\n value: function addOverlay(component, overlay, doNotRevalidate) {\n component.addOverlay(overlay);\n if (!doNotRevalidate) {\n var relatedElement = component instanceof Endpoint ? component.element : component.source;\n this.revalidate(relatedElement);\n }\n }\n }, {\n key: \"removeOverlay\",\n value: function removeOverlay(component, overlayId) {\n component.removeOverlay(overlayId);\n var relatedElement = component instanceof Endpoint ? component.element : component.source;\n this.revalidate(relatedElement);\n }\n }, {\n key: \"setOutlineColor\",\n value: function setOutlineColor(conn, color) {\n conn.paintStyleInUse.outlineStroke = color;\n this._paintConnection(conn);\n }\n }, {\n key: \"setOutlineWidth\",\n value: function setOutlineWidth(conn, width) {\n conn.paintStyleInUse.outlineWidth = width;\n this._paintConnection(conn);\n }\n }, {\n key: \"setColor\",\n value: function setColor(conn, color) {\n conn.paintStyleInUse.stroke = color;\n this._paintConnection(conn);\n }\n }, {\n key: \"setLineWidth\",\n value: function setLineWidth(conn, width) {\n conn.paintStyleInUse.strokeWidth = width;\n this._paintConnection(conn);\n }\n }, {\n key: \"setLineStyle\",\n value: function setLineStyle(conn, style) {\n if (style.lineWidth != null) {\n conn.paintStyleInUse.strokeWidth = style.lineWidth;\n }\n if (style.outlineWidth != null) {\n conn.paintStyleInUse.outlineWidth = style.outlineWidth;\n }\n if (style.color != null) {\n conn.paintStyleInUse.stroke = style.color;\n }\n if (style.outlineColor != null) {\n conn.paintStyleInUse.outlineStroke = style.outlineColor;\n }\n this._paintConnection(conn);\n }\n }, {\n key: \"getPathData\",\n value:\n function getPathData(connector) {\n var p = \"\";\n for (var i = 0; i < connector.segments.length; i++) {\n p += connector.segments[i].getPath(i === 0);\n p += \" \";\n }\n return p;\n }\n }]);\n return JsPlumbInstance;\n}(EventGenerator);\n\nvar endpointMap = {};\nfunction registerEndpointRenderer(name, fns) {\n endpointMap[name] = fns;\n}\nfunction getPositionOnElement(evt, el, zoom) {\n var jel = el;\n var box = _typeof(el.getBoundingClientRect) !== UNDEFINED ? el.getBoundingClientRect() : {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + pst * zoom,\n left = box.left + scrollLeft - clientLeft + psl * zoom,\n cl = pageLocation(evt),\n w = box.width || jel.offsetWidth * zoom,\n h = box.height || jel.offsetHeight * zoom,\n x = (cl.x - left) / w,\n y = (cl.y - top) / h;\n return {\n x: x,\n y: y\n };\n}\nfunction isSVGElementOverlay(o) {\n return isArrowOverlay(o) || isDiamondOverlay(o) || isPlainArrowOverlay(o);\n}\nfunction setVisible(component, v) {\n if (component.canvas) {\n component.canvas.style.display = v ? \"block\" : \"none\";\n }\n}\nfunction cleanup(component) {\n if (component.canvas) {\n component.canvas.parentNode.removeChild(component.canvas);\n }\n delete component.canvas;\n}\nfunction getEndpointCanvas(ep) {\n return ep.canvas;\n}\nfunction getLabelElement(o) {\n return HTMLElementOverlay.getElement(o);\n}\nfunction getCustomElement(o) {\n return HTMLElementOverlay.getElement(o, o.component, function (c) {\n var el = o.create(c);\n o.instance.addClass(el, o.instance.overlayClass);\n return el;\n });\n}\nfunction groupDragConstrain(desiredLoc, dragEl, constrainRect, size) {\n var x = desiredLoc.x,\n y = desiredLoc.y;\n if (dragEl._jsPlumbParentGroup && dragEl._jsPlumbParentGroup.constrain) {\n x = Math.max(desiredLoc.x, 0);\n y = Math.max(desiredLoc.y, 0);\n x = Math.min(x, constrainRect.w - size.w);\n y = Math.min(y, constrainRect.h - size.h);\n }\n return {\n x: x,\n y: y\n };\n}\nvar BrowserJsPlumbInstance = function (_JsPlumbInstance) {\n _inherits(BrowserJsPlumbInstance, _JsPlumbInstance);\n var _super = _createSuper(BrowserJsPlumbInstance);\n function BrowserJsPlumbInstance(_instanceIndex, defaults) {\n var _this;\n _classCallCheck(this, BrowserJsPlumbInstance);\n _this = _super.call(this, _instanceIndex, defaults);\n _this._instanceIndex = _instanceIndex;\n _defineProperty(_assertThisInitialized(_this), \"containerType\", null);\n _defineProperty(_assertThisInitialized(_this), \"dragSelection\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"dragManager\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorDblClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorDblTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointDblClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayDblClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayDblTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorMouseover\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorMouseout\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointMouseover\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointMouseout\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorContextmenu\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorMousedown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_connectorMouseup\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointMousedown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_endpointMouseup\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayMouseover\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_overlayMouseout\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementClick\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementDblTap\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementMouseenter\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementMouseexit\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementMousemove\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementMouseup\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementMousedown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_elementContextmenu\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"_resizeObserver\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"eventManager\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"draggingClass\", \"jtk-dragging\");\n _defineProperty(_assertThisInitialized(_this), \"elementDraggingClass\", \"jtk-element-dragging\");\n _defineProperty(_assertThisInitialized(_this), \"hoverClass\", \"jtk-hover\");\n _defineProperty(_assertThisInitialized(_this), \"sourceElementDraggingClass\", \"jtk-source-element-dragging\");\n _defineProperty(_assertThisInitialized(_this), \"targetElementDraggingClass\", \"jtk-target-element-dragging\");\n _defineProperty(_assertThisInitialized(_this), \"hoverSourceClass\", \"jtk-source-hover\");\n _defineProperty(_assertThisInitialized(_this), \"hoverTargetClass\", \"jtk-target-hover\");\n _defineProperty(_assertThisInitialized(_this), \"dragSelectClass\", \"jtk-drag-select\");\n _defineProperty(_assertThisInitialized(_this), \"managedElementsSelector\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"elementsDraggable\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"elementDragHandler\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"groupDragOptions\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"elementDragOptions\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"svg\", {\n node: function node(name, attributes) {\n return _node(name, attributes);\n },\n attr: function attr(node, attributes) {\n return _attr(node, attributes);\n },\n pos: function pos(d) {\n return _pos(d);\n }\n });\n defaults = defaults || {};\n _this.containerType = getElementType(_this.getContainer());\n _this.elementsDraggable = defaults && defaults.elementsDraggable !== false;\n _this.managedElementsSelector = defaults ? defaults.managedElementsSelector || SELECTOR_MANAGED_ELEMENT : SELECTOR_MANAGED_ELEMENT;\n _this.eventManager = new EventManager();\n _this.dragSelection = new DragSelection(_assertThisInitialized(_this));\n _this.dragManager = new DragManager(_assertThisInitialized(_this), _this.dragSelection);\n _this.dragManager.addHandler(new EndpointDragHandler(_assertThisInitialized(_this)));\n _this.groupDragOptions = {\n constrainFunction: groupDragConstrain\n };\n _this.dragManager.addHandler(new GroupDragHandler(_assertThisInitialized(_this), _this.dragSelection), _this.groupDragOptions);\n _this.elementDragHandler = new ElementDragHandler(_assertThisInitialized(_this), _this.dragSelection);\n _this.elementDragOptions = defaults && defaults.dragOptions || {};\n _this.dragManager.addHandler(_this.elementDragHandler, _this.elementDragOptions);\n if (defaults && defaults.dragOptions && defaults.dragOptions.filter) {\n _this.dragManager.addFilter(defaults.dragOptions.filter);\n }\n _this._createEventListeners();\n _this._attachEventDelegates();\n if (defaults.resizeObserver !== false) {\n try {\n _this._resizeObserver = new ResizeObserver(function (entries) {\n var updates = entries.filter(function (e) {\n var a = _this.getAttribute(e.target, ATTRIBUTE_MANAGED);\n if (a != null) {\n var v = _this.viewport._elementMap.get(a);\n return v ? v.w !== e.contentRect.width || v.h !== e.contentRect.height : false;\n } else {\n return false;\n }\n });\n updates.forEach(function (el) {\n return _this.revalidate(el.target);\n });\n });\n } catch (e) {\n log(\"WARN: ResizeObserver could not be attached.\");\n }\n }\n return _this;\n }\n _createClass(BrowserJsPlumbInstance, [{\n key: \"fireOverlayMethod\",\n value: function fireOverlayMethod(overlay, event, e) {\n var stem = overlay.component instanceof Connection ? CONNECTION : ENDPOINT;\n var mappedEvent = compoundEvent(stem, event)\n ;\n e._jsPlumbOverlay = overlay;\n overlay.fire(event, {\n e: e,\n overlay: overlay\n });\n this.fire(mappedEvent, overlay.component, e);\n }\n }, {\n key: \"addDragFilter\",\n value: function addDragFilter(filter, exclude) {\n this.dragManager.addFilter(filter, exclude);\n }\n }, {\n key: \"removeDragFilter\",\n value: function removeDragFilter(filter) {\n this.dragManager.removeFilter(filter);\n }\n }, {\n key: \"setDragGrid\",\n value: function setDragGrid(grid) {\n this.dragManager.setOption(this.elementDragHandler, {\n grid: grid\n });\n }\n }, {\n key: \"setDragConstrainFunction\",\n value: function setDragConstrainFunction(constrainFunction) {\n this.dragManager.setOption(this.elementDragHandler, {\n constrainFunction: constrainFunction\n });\n }\n }, {\n key: \"_removeElement\",\n value: function _removeElement(element) {\n element.parentNode && element.parentNode.removeChild(element);\n }\n }, {\n key: \"_appendElement\",\n value: function _appendElement(el, parent) {\n if (parent) {\n parent.appendChild(el);\n }\n }\n }, {\n key: \"_appendElementToGroup\",\n value: function _appendElementToGroup(group, el) {\n this.getGroupContentArea(group).appendChild(el);\n }\n }, {\n key: \"_appendElementToContainer\",\n value: function _appendElementToContainer(el) {\n this._appendElement(el, this.getContainer());\n }\n }, {\n key: \"_getAssociatedElements\",\n value: function _getAssociatedElements(el) {\n var a = [];\n if (el.nodeType !== 3 && el.nodeType !== 8) {\n var els = el.querySelectorAll(SELECTOR_MANAGED_ELEMENT);\n Array.prototype.push.apply(a, els);\n }\n return a.filter(function (_a) {\n return _a.nodeType !== 3 && _a.nodeType !== 8;\n });\n }\n }, {\n key: \"shouldFireEvent\",\n value: function shouldFireEvent(event, value, originalEvent) {\n return true;\n }\n }, {\n key: \"getClass\",\n value: function getClass$1(el) {\n return getClass(el);\n }\n }, {\n key: \"addClass\",\n value: function addClass$1(el, clazz) {\n addClass(el, clazz);\n }\n }, {\n key: \"hasClass\",\n value: function hasClass$1(el, clazz) {\n return hasClass(el, clazz);\n }\n }, {\n key: \"removeClass\",\n value: function removeClass$1(el, clazz) {\n removeClass(el, clazz);\n }\n }, {\n key: \"toggleClass\",\n value: function toggleClass$1(el, clazz) {\n toggleClass(el, clazz);\n }\n }, {\n key: \"setAttribute\",\n value: function setAttribute(el, name, value) {\n el.setAttribute(name, value);\n }\n }, {\n key: \"getAttribute\",\n value: function getAttribute(el, name) {\n return el.getAttribute(name);\n }\n }, {\n key: \"setAttributes\",\n value: function setAttributes(el, atts) {\n for (var i in atts) {\n el.setAttribute(i, atts[i]);\n }\n }\n }, {\n key: \"removeAttribute\",\n value: function removeAttribute(el, attName) {\n el.removeAttribute && el.removeAttribute(attName);\n }\n }, {\n key: \"on\",\n value: function on(el, event, callbackOrSelector, callback) {\n var _this2 = this;\n var _one = function _one(_el) {\n if (callback == null) {\n _this2.eventManager.on(_el, event, callbackOrSelector);\n } else {\n _this2.eventManager.on(_el, event, callbackOrSelector, callback);\n }\n };\n if (isNodeList(el)) {\n forEach(el, function (el) {\n return _one(el);\n });\n } else {\n _one(el);\n }\n return this;\n }\n }, {\n key: \"off\",\n value: function off(el, event, callback) {\n var _this3 = this;\n if (isNodeList(el)) {\n forEach(el, function (_el) {\n return _this3.eventManager.off(_el, event, callback);\n });\n } else {\n this.eventManager.off(el, event, callback);\n }\n return this;\n }\n }, {\n key: \"trigger\",\n value: function trigger(el, event, originalEvent, payload, detail) {\n this.eventManager.trigger(el, event, originalEvent, payload, detail);\n }\n }, {\n key: \"getOffsetRelativeToRoot\",\n value: function getOffsetRelativeToRoot(el) {\n return offsetRelativeToRoot(el);\n }\n }, {\n key: \"getOffset\",\n value: function getOffset(el) {\n var jel = el;\n var container = this.getContainer();\n var out = this.getPosition(jel),\n op = el !== container && jel.offsetParent !== container ? jel.offsetParent : null,\n _maybeAdjustScroll = function _maybeAdjustScroll(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.x -= offsetParent.scrollLeft;\n out.y -= offsetParent.scrollTop;\n }\n };\n while (op != null) {\n out.x += op.offsetLeft;\n out.y += op.offsetTop;\n _maybeAdjustScroll(op);\n op = op.offsetParent === container ? null : op.offsetParent;\n }\n if (container != null && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = jel.offsetParent != null ? this.getStyle(jel.offsetParent, PROPERTY_POSITION) : STATIC,\n p = this.getStyle(jel, PROPERTY_POSITION);\n if (p !== ABSOLUTE && p !== FIXED && pp !== ABSOLUTE && pp !== FIXED) {\n out.x -= container.scrollLeft;\n out.y -= container.scrollTop;\n }\n }\n return out;\n }\n }, {\n key: \"getSize\",\n value: function getSize(el) {\n var _el = el;\n if (_el.offsetWidth != null) {\n return offsetSize(el);\n } else if (_el.width && _el.width.baseVal) {\n return svgWidthHeightSize(_el);\n }\n }\n }, {\n key: \"getPosition\",\n value: function getPosition(el) {\n var _el = el;\n if (_el.offsetLeft != null) {\n return {\n x: parseFloat(_el.offsetLeft),\n y: parseFloat(_el.offsetTop)\n };\n } else if (_el.x && _el.x.baseVal) {\n return svgXYPosition(_el);\n }\n }\n }, {\n key: \"getStyle\",\n value: function getStyle(el, prop) {\n if (_typeof(window.getComputedStyle) !== UNDEFINED) {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n }\n }, {\n key: \"getGroupContentArea\",\n value: function getGroupContentArea(group) {\n var da = this.getSelector(group.el, SELECTOR_GROUP_CONTAINER);\n return da && da.length > 0 ? da[0] : group.el;\n }\n }, {\n key: \"getSelector\",\n value: function getSelector(ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n if (!isString(ctx)) {\n var nodeList = document.createDocumentFragment();\n nodeList.appendChild(ctx);\n return fromArray(nodeList.childNodes);\n }\n sel = fromArray(document.querySelectorAll(ctx));\n } else {\n sel = fromArray(ctx.querySelectorAll(spec));\n }\n return sel;\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(el, p) {\n var jel = el;\n jel.style.left = p.x + \"px\";\n jel.style.top = p.y + \"px\";\n }\n }, {\n key: \"setDraggable\",\n value: function setDraggable(element, draggable) {\n if (draggable) {\n this.removeAttribute(element, ATTRIBUTE_NOT_DRAGGABLE);\n } else {\n this.setAttribute(element, ATTRIBUTE_NOT_DRAGGABLE, TRUE$1);\n }\n }\n }, {\n key: \"isDraggable\",\n value: function isDraggable(el) {\n var d = this.getAttribute(el, ATTRIBUTE_NOT_DRAGGABLE);\n return d == null || d === FALSE$1;\n }\n }, {\n key: \"toggleDraggable\",\n value: function toggleDraggable(el) {\n var state = this.isDraggable(el);\n this.setDraggable(el, !state);\n return !state;\n }\n }, {\n key: \"_createEventListeners\",\n value: function _createEventListeners() {\n var _connClick = function _connClick(event, e) {\n if (!e.defaultPrevented && e._jsPlumbOverlay == null) {\n var connectorElement = findParent(getEventSource(e), SELECTOR_CONNECTOR, this.getContainer(), true);\n this.fire(event, connectorElement.jtk.connector.connection, e);\n }\n };\n this._connectorClick = _connClick.bind(this, EVENT_CONNECTION_CLICK);\n this._connectorDblClick = _connClick.bind(this, EVENT_CONNECTION_DBL_CLICK);\n this._connectorTap = _connClick.bind(this, EVENT_CONNECTION_TAP);\n this._connectorDblTap = _connClick.bind(this, EVENT_CONNECTION_DBL_TAP);\n var _connectorHover = function _connectorHover(state, e) {\n var el = getEventSource(e).parentNode;\n if (el.jtk && el.jtk.connector) {\n var connector = el.jtk.connector;\n var connection = connector.connection;\n this.setConnectorHover(connector, state);\n if (state) {\n this.addClass(connection.source, this.hoverSourceClass);\n this.addClass(connection.target, this.hoverTargetClass);\n } else {\n this.removeClass(connection.source, this.hoverSourceClass);\n this.removeClass(connection.target, this.hoverTargetClass);\n }\n this.fire(state ? EVENT_CONNECTION_MOUSEOVER : EVENT_CONNECTION_MOUSEOUT, el.jtk.connector.connection, e);\n }\n };\n this._connectorMouseover = _connectorHover.bind(this, true);\n this._connectorMouseout = _connectorHover.bind(this, false);\n var _connectorMouseupdown = function _connectorMouseupdown(state, e) {\n var el = getEventSource(e).parentNode;\n if (el.jtk && el.jtk.connector) {\n this.fire(state ? EVENT_CONNECTION_MOUSEUP : EVENT_CONNECTION_MOUSEDOWN, el.jtk.connector.connection, e);\n }\n };\n this._connectorMouseup = _connectorMouseupdown.bind(this, true);\n this._connectorMousedown = _connectorMouseupdown.bind(this, false);\n this._connectorContextmenu = function (e) {\n var el = getEventSource(e).parentNode;\n if (el.jtk && el.jtk.connector) {\n this.fire(EVENT_CONNECTION_CONTEXTMENU, el.jtk.connector.connection, e);\n }\n }.bind(this);\n var _epClick = function _epClick(event, e, endpointElement) {\n if (!e.defaultPrevented && e._jsPlumbOverlay == null) {\n this.fire(event, endpointElement.jtk.endpoint, e);\n }\n };\n this._endpointClick = _epClick.bind(this, EVENT_ENDPOINT_CLICK);\n this._endpointDblClick = _epClick.bind(this, EVENT_ENDPOINT_DBL_CLICK);\n var _endpointHover = function _endpointHover(state, e) {\n var el = getEventSource(e);\n if (el.jtk && el.jtk.endpoint) {\n this.setEndpointHover(el.jtk.endpoint, state);\n this.fire(state ? EVENT_ENDPOINT_MOUSEOVER : EVENT_ENDPOINT_MOUSEOUT, el.jtk.endpoint, e);\n }\n };\n this._endpointMouseover = _endpointHover.bind(this, true);\n this._endpointMouseout = _endpointHover.bind(this, false);\n var _endpointMouseupdown = function _endpointMouseupdown(state, e) {\n var el = getEventSource(e);\n if (el.jtk && el.jtk.endpoint) {\n this.fire(state ? EVENT_ENDPOINT_MOUSEUP : EVENT_ENDPOINT_MOUSEDOWN, el.jtk.endpoint, e);\n }\n };\n this._endpointMouseup = _endpointMouseupdown.bind(this, true);\n this._endpointMousedown = _endpointMouseupdown.bind(this, false);\n var _oClick = function (method, e) {\n var overlayElement = findParent(getEventSource(e), SELECTOR_OVERLAY, this.getContainer(), true);\n var overlay = overlayElement.jtk.overlay;\n if (overlay) {\n this.fireOverlayMethod(overlay, method, e);\n }\n }.bind(this);\n this._overlayClick = _oClick.bind(this, EVENT_CLICK);\n this._overlayDblClick = _oClick.bind(this, EVENT_DBL_CLICK);\n this._overlayTap = _oClick.bind(this, EVENT_TAP);\n this._overlayDblTap = _oClick.bind(this, EVENT_DBL_TAP);\n var _overlayHover = function _overlayHover(state, e) {\n var overlayElement = findParent(getEventSource(e), SELECTOR_OVERLAY, this.getContainer(), true);\n var overlay = overlayElement.jtk.overlay;\n if (overlay) {\n this.setOverlayHover(overlay, state);\n }\n };\n this._overlayMouseover = _overlayHover.bind(this, true);\n this._overlayMouseout = _overlayHover.bind(this, false);\n var _elementClick = function _elementClick(event, e, target) {\n if (!e.defaultPrevented) {\n this.fire(e.detail === 1 ? EVENT_ELEMENT_CLICK : EVENT_ELEMENT_DBL_CLICK, target, e);\n }\n };\n this._elementClick = _elementClick.bind(this, EVENT_ELEMENT_CLICK);\n var _elementTap = function _elementTap(event, e, target) {\n if (!e.defaultPrevented) {\n this.fire(EVENT_ELEMENT_TAP, target, e);\n }\n };\n this._elementTap = _elementTap.bind(this, EVENT_ELEMENT_TAP);\n var _elementDblTap = function _elementDblTap(event, e, target) {\n if (!e.defaultPrevented) {\n this.fire(EVENT_ELEMENT_DBL_TAP, target, e);\n }\n };\n this._elementDblTap = _elementDblTap.bind(this, EVENT_ELEMENT_DBL_TAP);\n var _elementHover = function _elementHover(state, e) {\n this.fire(state ? EVENT_ELEMENT_MOUSE_OVER : EVENT_ELEMENT_MOUSE_OUT, getEventSource(e), e);\n };\n this._elementMouseenter = _elementHover.bind(this, true);\n this._elementMouseexit = _elementHover.bind(this, false);\n this._elementMousemove = function (e) {\n this.fire(EVENT_ELEMENT_MOUSE_MOVE, getEventSource(e), e);\n }.bind(this);\n this._elementMouseup = function (e) {\n this.fire(EVENT_ELEMENT_MOUSE_UP, getEventSource(e), e);\n }.bind(this);\n this._elementMousedown = function (e) {\n this.fire(EVENT_ELEMENT_MOUSE_DOWN, getEventSource(e), e);\n }.bind(this);\n this._elementContextmenu = function (e) {\n this.fire(EVENT_ELEMENT_CONTEXTMENU, getEventSource(e), e);\n }.bind(this);\n }\n }, {\n key: \"_attachEventDelegates\",\n value: function _attachEventDelegates() {\n var currentContainer = this.getContainer();\n this.eventManager.on(currentContainer, EVENT_CLICK, SELECTOR_OVERLAY, this._overlayClick);\n this.eventManager.on(currentContainer, EVENT_DBL_CLICK, SELECTOR_OVERLAY, this._overlayDblClick);\n this.eventManager.on(currentContainer, EVENT_TAP, SELECTOR_OVERLAY, this._overlayTap);\n this.eventManager.on(currentContainer, EVENT_DBL_TAP, SELECTOR_OVERLAY, this._overlayDblTap);\n this.eventManager.on(currentContainer, EVENT_CLICK, SELECTOR_CONNECTOR, this._connectorClick);\n this.eventManager.on(currentContainer, EVENT_DBL_CLICK, SELECTOR_CONNECTOR, this._connectorDblClick);\n this.eventManager.on(currentContainer, EVENT_TAP, SELECTOR_CONNECTOR, this._connectorTap);\n this.eventManager.on(currentContainer, EVENT_DBL_TAP, SELECTOR_CONNECTOR, this._connectorDblTap);\n this.eventManager.on(currentContainer, EVENT_CLICK, SELECTOR_ENDPOINT, this._endpointClick);\n this.eventManager.on(currentContainer, EVENT_DBL_CLICK, SELECTOR_ENDPOINT, this._endpointDblClick);\n this.eventManager.on(currentContainer, EVENT_CLICK, this.managedElementsSelector, this._elementClick);\n this.eventManager.on(currentContainer, EVENT_TAP, this.managedElementsSelector, this._elementTap);\n this.eventManager.on(currentContainer, EVENT_DBL_TAP, this.managedElementsSelector, this._elementDblTap);\n this.eventManager.on(currentContainer, EVENT_MOUSEOVER, SELECTOR_CONNECTOR, this._connectorMouseover);\n this.eventManager.on(currentContainer, EVENT_MOUSEOUT, SELECTOR_CONNECTOR, this._connectorMouseout);\n this.eventManager.on(currentContainer, EVENT_CONTEXTMENU, SELECTOR_CONNECTOR, this._connectorContextmenu);\n this.eventManager.on(currentContainer, EVENT_MOUSEUP, SELECTOR_CONNECTOR, this._connectorMouseup);\n this.eventManager.on(currentContainer, EVENT_MOUSEDOWN, SELECTOR_CONNECTOR, this._connectorMousedown);\n this.eventManager.on(currentContainer, EVENT_MOUSEOVER, SELECTOR_ENDPOINT, this._endpointMouseover);\n this.eventManager.on(currentContainer, EVENT_MOUSEOUT, SELECTOR_ENDPOINT, this._endpointMouseout);\n this.eventManager.on(currentContainer, EVENT_MOUSEUP, SELECTOR_ENDPOINT, this._endpointMouseup);\n this.eventManager.on(currentContainer, EVENT_MOUSEDOWN, SELECTOR_ENDPOINT, this._endpointMousedown);\n this.eventManager.on(currentContainer, EVENT_MOUSEOVER, SELECTOR_OVERLAY, this._overlayMouseover);\n this.eventManager.on(currentContainer, EVENT_MOUSEOUT, SELECTOR_OVERLAY, this._overlayMouseout);\n this.eventManager.on(currentContainer, EVENT_MOUSEOVER, SELECTOR_MANAGED_ELEMENT, this._elementMouseenter);\n this.eventManager.on(currentContainer, EVENT_MOUSEOUT, SELECTOR_MANAGED_ELEMENT, this._elementMouseexit);\n this.eventManager.on(currentContainer, EVENT_MOUSEMOVE, SELECTOR_MANAGED_ELEMENT, this._elementMousemove);\n this.eventManager.on(currentContainer, EVENT_MOUSEUP, SELECTOR_MANAGED_ELEMENT, this._elementMouseup);\n this.eventManager.on(currentContainer, EVENT_MOUSEDOWN, SELECTOR_MANAGED_ELEMENT, this._elementMousedown);\n this.eventManager.on(currentContainer, EVENT_CONTEXTMENU, SELECTOR_MANAGED_ELEMENT, this._elementContextmenu);\n }\n }, {\n key: \"_detachEventDelegates\",\n value: function _detachEventDelegates() {\n var currentContainer = this.getContainer();\n if (currentContainer) {\n this.eventManager.off(currentContainer, EVENT_CLICK, this._connectorClick);\n this.eventManager.off(currentContainer, EVENT_DBL_CLICK, this._connectorDblClick);\n this.eventManager.off(currentContainer, EVENT_TAP, this._connectorTap);\n this.eventManager.off(currentContainer, EVENT_DBL_TAP, this._connectorDblTap);\n this.eventManager.off(currentContainer, EVENT_CLICK, this._endpointClick);\n this.eventManager.off(currentContainer, EVENT_DBL_CLICK, this._endpointDblClick);\n this.eventManager.off(currentContainer, EVENT_CLICK, this._overlayClick);\n this.eventManager.off(currentContainer, EVENT_DBL_CLICK, this._overlayDblClick);\n this.eventManager.off(currentContainer, EVENT_TAP, this._overlayTap);\n this.eventManager.off(currentContainer, EVENT_DBL_TAP, this._overlayDblTap);\n this.eventManager.off(currentContainer, EVENT_CLICK, this._elementClick);\n this.eventManager.off(currentContainer, EVENT_TAP, this._elementTap);\n this.eventManager.off(currentContainer, EVENT_DBL_TAP, this._elementDblTap);\n this.eventManager.off(currentContainer, EVENT_MOUSEOVER, this._connectorMouseover);\n this.eventManager.off(currentContainer, EVENT_MOUSEOUT, this._connectorMouseout);\n this.eventManager.off(currentContainer, EVENT_CONTEXTMENU, this._connectorContextmenu);\n this.eventManager.off(currentContainer, EVENT_MOUSEUP, this._connectorMouseup);\n this.eventManager.off(currentContainer, EVENT_MOUSEDOWN, this._connectorMousedown);\n this.eventManager.off(currentContainer, EVENT_MOUSEOVER, this._endpointMouseover);\n this.eventManager.off(currentContainer, EVENT_MOUSEOUT, this._endpointMouseout);\n this.eventManager.off(currentContainer, EVENT_MOUSEUP, this._endpointMouseup);\n this.eventManager.off(currentContainer, EVENT_MOUSEDOWN, this._endpointMousedown);\n this.eventManager.off(currentContainer, EVENT_MOUSEOVER, this._overlayMouseover);\n this.eventManager.off(currentContainer, EVENT_MOUSEOUT, this._overlayMouseout);\n this.eventManager.off(currentContainer, EVENT_MOUSEENTER, this._elementMouseenter);\n this.eventManager.off(currentContainer, EVENT_MOUSEEXIT, this._elementMouseexit);\n this.eventManager.off(currentContainer, EVENT_MOUSEMOVE, this._elementMousemove);\n this.eventManager.off(currentContainer, EVENT_MOUSEUP, this._elementMouseup);\n this.eventManager.off(currentContainer, EVENT_MOUSEDOWN, this._elementMousedown);\n this.eventManager.off(currentContainer, EVENT_CONTEXTMENU, this._elementContextmenu);\n }\n }\n }, {\n key: \"setContainer\",\n value: function setContainer(newContainer) {\n var _this4 = this;\n if (newContainer === document || newContainer === document.body) {\n throw new Error(\"Cannot set document or document.body as container element\");\n }\n this._detachEventDelegates();\n var dragFilters;\n if (this.dragManager != null) {\n dragFilters = this.dragManager.reset();\n }\n this.setAttribute(newContainer, ATTRIBUTE_CONTAINER, uuid().replace(\"-\", \"\"));\n var currentContainer = this.getContainer();\n if (currentContainer != null) {\n currentContainer.removeAttribute(ATTRIBUTE_CONTAINER);\n var children = fromArray(currentContainer.childNodes).filter(function (cn) {\n return cn != null && (_this4.hasClass(cn, CLASS_CONNECTOR) || _this4.hasClass(cn, CLASS_ENDPOINT) || _this4.hasClass(cn, CLASS_OVERLAY) || cn.getAttribute && cn.getAttribute(ATTRIBUTE_MANAGED) != null);\n });\n forEach(children, function (el) {\n newContainer.appendChild(el);\n });\n }\n _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"setContainer\", this).call(this, newContainer);\n this.containerType = getElementType(newContainer);\n if (this.eventManager != null) {\n this._attachEventDelegates();\n }\n if (this.dragManager != null) {\n this.dragManager.addHandler(new EndpointDragHandler(this));\n this.dragManager.addHandler(new GroupDragHandler(this, this.dragSelection), this.groupDragOptions);\n this.elementDragHandler = new ElementDragHandler(this, this.dragSelection);\n this.dragManager.addHandler(this.elementDragHandler, this.elementDragOptions);\n if (dragFilters != null) {\n this.dragManager.setFilters(dragFilters);\n }\n }\n }\n }, {\n key: \"reset\",\n value: function reset() {\n _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"reset\", this).call(this);\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n var container = this.getContainer();\n var els = container.querySelectorAll([SELECTOR_MANAGED_ELEMENT, SELECTOR_ENDPOINT, SELECTOR_CONNECTOR, SELECTOR_OVERLAY].join(\",\"));\n forEach(els, function (el) {\n return el.parentNode && el.parentNode.removeChild(el);\n });\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this._detachEventDelegates();\n if (this.dragManager != null) {\n this.dragManager.reset();\n }\n this.clearDragSelection();\n _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"unmanage\",\n value: function unmanage(el, removeElement) {\n if (this._resizeObserver != null) {\n this._resizeObserver.unobserve(el);\n }\n this.removeFromDragSelection(el);\n _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"unmanage\", this).call(this, el, removeElement);\n }\n }, {\n key: \"addToDragSelection\",\n value: function addToDragSelection() {\n var _this5 = this;\n for (var _len = arguments.length, el = new Array(_len), _key = 0; _key < _len; _key++) {\n el[_key] = arguments[_key];\n }\n forEach(el, function (_el) {\n return _this5.dragSelection.add(_el);\n });\n }\n }, {\n key: \"clearDragSelection\",\n value: function clearDragSelection() {\n this.dragSelection.clear();\n }\n }, {\n key: \"removeFromDragSelection\",\n value: function removeFromDragSelection() {\n var _this6 = this;\n for (var _len2 = arguments.length, el = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n el[_key2] = arguments[_key2];\n }\n forEach(el, function (_el) {\n return _this6.dragSelection.remove(_el);\n });\n }\n }, {\n key: \"toggleDragSelection\",\n value: function toggleDragSelection() {\n var _this7 = this;\n for (var _len3 = arguments.length, el = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n el[_key3] = arguments[_key3];\n }\n forEach(el, function (_el) {\n return _this7.dragSelection.toggle(_el);\n });\n }\n }, {\n key: \"addToDragGroup\",\n value: function addToDragGroup(spec) {\n var _this$elementDragHand;\n for (var _len4 = arguments.length, els = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n els[_key4 - 1] = arguments[_key4];\n }\n (_this$elementDragHand = this.elementDragHandler).addToDragGroup.apply(_this$elementDragHand, [spec].concat(els));\n }\n }, {\n key: \"removeFromDragGroup\",\n value: function removeFromDragGroup() {\n var _this$elementDragHand2;\n (_this$elementDragHand2 = this.elementDragHandler).removeFromDragGroup.apply(_this$elementDragHand2, arguments);\n }\n }, {\n key: \"setDragGroupState\",\n value: function setDragGroupState(state) {\n var _this$elementDragHand3;\n for (var _len5 = arguments.length, els = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n els[_key5 - 1] = arguments[_key5];\n }\n (_this$elementDragHand3 = this.elementDragHandler).setDragGroupState.apply(_this$elementDragHand3, [state].concat(els));\n }\n }, {\n key: \"clearDragGroup\",\n value: function clearDragGroup(name) {\n this.elementDragHandler.clearDragGroup(name);\n }\n }, {\n key: \"consume\",\n value: function consume$1(e, doNotPreventDefault) {\n consume(e, doNotPreventDefault);\n }\n }, {\n key: \"rotate\",\n value: function rotate(element, rotation, doNotRepaint) {\n var elementId = this.getId(element);\n if (this._managedElements[elementId]) {\n this._managedElements[elementId].el.style.transform = \"rotate(\" + rotation + \"deg)\";\n this._managedElements[elementId].el.style.transformOrigin = \"center center\";\n return _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"rotate\", this).call(this, element, rotation, doNotRepaint);\n }\n return {\n c: new Set(),\n e: new Set()\n };\n }\n }, {\n key: \"addOverlayClass\",\n value:\n function addOverlayClass(o, clazz) {\n if (isLabelOverlay(o)) {\n o.instance.addClass(getLabelElement(o), clazz);\n } else if (isSVGElementOverlay(o)) {\n o.instance.addClass(ensureSVGOverlayPath(o), clazz);\n } else if (isCustomOverlay(o)) {\n o.instance.addClass(getCustomElement(o), clazz);\n } else {\n throw \"Could not add class to overlay of type [\" + o.type + \"]\";\n }\n }\n }, {\n key: \"removeOverlayClass\",\n value: function removeOverlayClass(o, clazz) {\n if (isLabelOverlay(o)) {\n o.instance.removeClass(getLabelElement(o), clazz);\n } else if (isSVGElementOverlay(o)) {\n o.instance.removeClass(ensureSVGOverlayPath(o), clazz);\n } else if (isCustomOverlay(o)) {\n o.instance.removeClass(getCustomElement(o), clazz);\n } else {\n throw \"Could not remove class from overlay of type [\" + o.type + \"]\";\n }\n }\n }, {\n key: \"_paintOverlay\",\n value: function _paintOverlay(o, params, extents) {\n if (isLabelOverlay(o)) {\n getLabelElement(o);\n var XY = o.component.getXY();\n o.canvas.style.left = XY.x + params.d.minx + \"px\";\n o.canvas.style.top = XY.y + params.d.miny + \"px\";\n } else if (isSVGElementOverlay(o)) {\n var path = isNaN(params.d.cxy.x) || isNaN(params.d.cxy.y) ? \"M 0 0\" : \"M\" + params.d.hxy.x + \",\" + params.d.hxy.y + \" L\" + params.d.tail[0].x + \",\" + params.d.tail[0].y + \" L\" + params.d.cxy.x + \",\" + params.d.cxy.y + \" L\" + params.d.tail[1].x + \",\" + params.d.tail[1].y + \" Z\";\n paintSVGOverlay(o, path, params, extents);\n } else if (isCustomOverlay(o)) {\n getCustomElement(o);\n var _XY = o.component.getXY();\n o.canvas.style.left = _XY.x + params.d.minx + \"px\";\n o.canvas.style.top = _XY.y + params.d.miny + \"px\";\n } else {\n throw \"Could not paint overlay of type [\" + o.type + \"]\";\n }\n }\n }, {\n key: \"setOverlayVisible\",\n value: function setOverlayVisible(o, visible) {\n var d = visible ? \"block\" : \"none\";\n function s(el) {\n if (el != null) {\n el.style.display = d;\n }\n }\n if (isLabelOverlay(o)) {\n s(getLabelElement(o));\n } else if (isCustomOverlay(o)) {\n s(getCustomElement(o));\n } else if (isSVGElementOverlay(o)) {\n s(o.path);\n }\n }\n }, {\n key: \"reattachOverlay\",\n value: function reattachOverlay(o, c) {\n if (isLabelOverlay(o)) {\n o.instance._appendElement(getLabelElement(o), this.getContainer());\n } else if (isCustomOverlay(o)) {\n o.instance._appendElement(getCustomElement(o), this.getContainer());\n } else if (isSVGElementOverlay(o)) {\n this._appendElement(ensureSVGOverlayPath(o), c.connector.canvas);\n }\n }\n }, {\n key: \"setOverlayHover\",\n value: function setOverlayHover(o, hover) {\n var canvas;\n if (isLabelOverlay(o)) {\n canvas = getLabelElement(o);\n } else if (isCustomOverlay(o)) {\n canvas = getCustomElement(o);\n } else if (isSVGElementOverlay(o)) {\n canvas = ensureSVGOverlayPath(o);\n }\n if (canvas != null) {\n if (this.hoverClass != null) {\n if (hover) {\n this.addClass(canvas, this.hoverClass);\n } else {\n this.removeClass(canvas, this.hoverClass);\n }\n }\n this.setHover(o.component, hover);\n }\n }\n }, {\n key: \"destroyOverlay\",\n value: function destroyOverlay(o) {\n if (isLabelOverlay(o)) {\n var _el2 = getLabelElement(o);\n _el2.parentNode.removeChild(_el2);\n delete o.canvas;\n delete o.cachedDimensions;\n } else if (isArrowOverlay(o) || isDiamondOverlay(o) || isPlainArrowOverlay(o)) {\n destroySVGOverlay(o);\n } else if (isCustomOverlay(o)) {\n var _el3 = getCustomElement(o);\n _el3.parentNode.removeChild(_el3);\n delete o.canvas;\n delete o.cachedDimensions;\n }\n }\n }, {\n key: \"drawOverlay\",\n value: function drawOverlay(o, component, paintStyle, absolutePosition) {\n if (isLabelOverlay(o) || isCustomOverlay(o)) {\n var td = HTMLElementOverlay._getDimensions(o);\n if (td != null && td.w != null && td.h != null) {\n var cxy = {\n x: 0,\n y: 0\n };\n if (absolutePosition) {\n cxy = {\n x: absolutePosition.x,\n y: absolutePosition.y\n };\n } else if (component instanceof EndpointRepresentation) {\n var locToUse = Array.isArray(o.location) ? o.location : [o.location, o.location];\n cxy = {\n x: locToUse[0] * component.w,\n y: locToUse[1] * component.h\n };\n } else {\n var loc = o.location,\n absolute = false;\n if (isString(o.location) || o.location < 0 || o.location > 1) {\n loc = parseInt(\"\" + o.location, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute);\n }\n var minx = cxy.x - td.w / 2,\n miny = cxy.y - td.h / 2;\n return {\n component: o,\n d: {\n minx: minx,\n miny: miny,\n td: td,\n cxy: cxy\n },\n xmin: minx,\n xmax: minx + td.w,\n ymin: miny,\n ymax: miny + td.h\n };\n } else {\n return {\n xmin: 0,\n xmax: 0,\n ymin: 0,\n ymax: 0\n };\n }\n } else if (isArrowOverlay(o) || isDiamondOverlay(o) || isPlainArrowOverlay(o)) {\n return o.draw(component, paintStyle, absolutePosition);\n } else {\n throw \"Could not draw overlay of type [\" + o.type + \"]\";\n }\n }\n }, {\n key: \"updateLabel\",\n value: function updateLabel(o) {\n if (isFunction(o.label)) {\n var lt = o.label(this);\n if (lt != null) {\n getLabelElement(o).innerText = lt;\n } else {\n getLabelElement(o).innerText = \"\";\n }\n } else {\n if (o.labelText == null) {\n o.labelText = o.label;\n if (o.labelText != null) {\n getLabelElement(o).innerText = o.labelText;\n } else {\n getLabelElement(o).innerText = \"\";\n }\n }\n }\n }\n }, {\n key: \"setHover\",\n value: function setHover(component, hover) {\n component._hover = hover;\n if (component instanceof Endpoint && component.endpoint != null) {\n this.setEndpointHover(component, hover, -1);\n } else if (component instanceof Connection && component.connector != null) {\n this.setConnectorHover(component.connector, hover);\n }\n }\n }, {\n key: \"paintConnector\",\n value: function paintConnector(connector, paintStyle, extents) {\n paintSvgConnector(this, connector, paintStyle, extents);\n }\n }, {\n key: \"setConnectorHover\",\n value: function setConnectorHover(connector, hover, sourceEndpoint) {\n if (hover === false || !this.currentlyDragging && !this.isHoverSuspended()) {\n var canvas = connector.canvas;\n if (canvas != null) {\n if (connector.hoverClass != null) {\n if (hover) {\n this.addClass(canvas, connector.hoverClass);\n } else {\n this.removeClass(canvas, connector.hoverClass);\n }\n }\n if (hover) {\n this.addClass(canvas, this.hoverClass);\n } else {\n this.removeClass(canvas, this.hoverClass);\n }\n }\n if (connector.connection.hoverPaintStyle != null) {\n connector.connection.paintStyleInUse = hover ? connector.connection.hoverPaintStyle : connector.connection.paintStyle;\n if (!this._suspendDrawing) {\n this._paintConnection(connector.connection);\n }\n }\n if (connector.connection.endpoints[0] !== sourceEndpoint) {\n this.setEndpointHover(connector.connection.endpoints[0], hover, 0, true);\n }\n if (connector.connection.endpoints[1] !== sourceEndpoint) {\n this.setEndpointHover(connector.connection.endpoints[1], hover, 1, true);\n }\n }\n }\n }, {\n key: \"destroyConnector\",\n value: function destroyConnector(connection) {\n if (connection.connector != null) {\n cleanup(connection.connector);\n }\n }\n }, {\n key: \"addConnectorClass\",\n value: function addConnectorClass(connector, clazz) {\n if (connector.canvas) {\n this.addClass(connector.canvas, clazz);\n }\n }\n }, {\n key: \"removeConnectorClass\",\n value: function removeConnectorClass(connector, clazz) {\n if (connector.canvas) {\n this.removeClass(connector.canvas, clazz);\n }\n }\n }, {\n key: \"getConnectorClass\",\n value: function getConnectorClass(connector) {\n if (connector.canvas) {\n return connector.canvas.className.baseVal;\n } else {\n return \"\";\n }\n }\n }, {\n key: \"setConnectorVisible\",\n value: function setConnectorVisible(connector, v) {\n setVisible(connector, v);\n }\n }, {\n key: \"applyConnectorType\",\n value: function applyConnectorType(connector, t) {\n if (connector.canvas && t.cssClass) {\n var classes = Array.isArray(t.cssClass) ? t.cssClass : [t.cssClass];\n this.addClass(connector.canvas, classes.join(\" \"));\n }\n }\n }, {\n key: \"addEndpointClass\",\n value: function addEndpointClass(ep, c) {\n var canvas = getEndpointCanvas(ep.endpoint);\n if (canvas != null) {\n this.addClass(canvas, c);\n }\n }\n }, {\n key: \"applyEndpointType\",\n value: function applyEndpointType(ep, t) {\n if (t.cssClass) {\n var canvas = getEndpointCanvas(ep.endpoint);\n if (canvas) {\n var classes = Array.isArray(t.cssClass) ? t.cssClass : [t.cssClass];\n this.addClass(canvas, classes.join(\" \"));\n }\n }\n }\n }, {\n key: \"destroyEndpoint\",\n value: function destroyEndpoint(ep) {\n var anchorClass = this.endpointAnchorClassPrefix + (ep.currentAnchorClass ? \"-\" + ep.currentAnchorClass : \"\");\n this.removeClass(ep.element, anchorClass);\n cleanup(ep.endpoint);\n }\n }, {\n key: \"renderEndpoint\",\n value: function renderEndpoint(ep, paintStyle) {\n var renderer = endpointMap[ep.endpoint.type];\n if (renderer != null) {\n SvgEndpoint.paint(ep.endpoint, renderer, paintStyle);\n } else {\n log(\"jsPlumb: no endpoint renderer found for type [\" + ep.endpoint.type + \"]\");\n }\n }\n }, {\n key: \"removeEndpointClass\",\n value: function removeEndpointClass(ep, c) {\n var canvas = getEndpointCanvas(ep.endpoint);\n if (canvas != null) {\n this.removeClass(canvas, c);\n }\n }\n }, {\n key: \"getEndpointClass\",\n value: function getEndpointClass(ep) {\n var canvas = getEndpointCanvas(ep.endpoint);\n if (canvas != null) {\n return canvas.className;\n } else {\n return \"\";\n }\n }\n }, {\n key: \"setEndpointHover\",\n value: function setEndpointHover(endpoint, hover, endpointIndex, doNotCascade) {\n if (endpoint != null && (hover === false || !this.currentlyDragging && !this.isHoverSuspended())) {\n var canvas = getEndpointCanvas(endpoint.endpoint);\n if (canvas != null) {\n if (endpoint.hoverClass != null) {\n if (hover) {\n this.addClass(canvas, endpoint.hoverClass);\n } else {\n this.removeClass(canvas, endpoint.hoverClass);\n }\n }\n if (endpointIndex === 0 || endpointIndex === 1) {\n var genericHoverClass = endpointIndex === 0 ? this.hoverSourceClass : this.hoverTargetClass;\n if (hover) {\n this.addClass(canvas, genericHoverClass);\n } else {\n this.removeClass(canvas, genericHoverClass);\n }\n }\n }\n if (endpoint.hoverPaintStyle != null) {\n endpoint.paintStyleInUse = hover ? endpoint.hoverPaintStyle : endpoint.paintStyle;\n if (!this._suspendDrawing) {\n this.renderEndpoint(endpoint, endpoint.paintStyleInUse);\n }\n }\n if (!doNotCascade) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n this.setConnectorHover(endpoint.connections[i].connector, hover, endpoint);\n }\n }\n }\n }\n }, {\n key: \"setEndpointVisible\",\n value: function setEndpointVisible(ep, v) {\n setVisible(ep.endpoint, v);\n }\n }, {\n key: \"setGroupVisible\",\n value: function setGroupVisible(group, state) {\n var m = group.el.querySelectorAll(SELECTOR_MANAGED_ELEMENT);\n for (var i = 0; i < m.length; i++) {\n if (state) {\n this.show(m[i], true);\n } else {\n this.hide(m[i], true);\n }\n }\n }\n }, {\n key: \"deleteConnection\",\n value: function deleteConnection(connection, params) {\n if (connection != null && connection.deleted !== true) {\n if (connection.endpoints[0].deleted !== true) {\n this.setEndpointHover(connection.endpoints[0], false, 0, true);\n }\n if (connection.endpoints[1].deleted !== true) {\n this.setEndpointHover(connection.endpoints[1], false, 1, true);\n }\n return _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"deleteConnection\", this).call(this, connection, params);\n } else {\n return false;\n }\n }\n }, {\n key: \"addSourceSelector\",\n value: function addSourceSelector(selector, params, exclude) {\n this.addDragFilter(selector);\n return _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"addSourceSelector\", this).call(this, selector, params, exclude);\n }\n }, {\n key: \"removeSourceSelector\",\n value: function removeSourceSelector(selector) {\n this.removeDragFilter(selector.selector);\n _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"removeSourceSelector\", this).call(this, selector);\n }\n }, {\n key: \"manage\",\n value: function manage(element, internalId, _recalc) {\n if (this.containerType === ElementTypes.SVG && !isSVGElement(element)) {\n throw new Error(\"ERROR: cannot manage non-svg element when container is an SVG element.\");\n }\n var managedElement = _get(_getPrototypeOf(BrowserJsPlumbInstance.prototype), \"manage\", this).call(this, element, internalId, _recalc);\n if (managedElement != null) {\n if (this._resizeObserver != null) {\n this._resizeObserver.observe(managedElement.el);\n }\n }\n return managedElement;\n }\n }]);\n return BrowserJsPlumbInstance;\n}(JsPlumbInstance);\n\nvar CIRCLE = \"circle\";\nvar register$2 = function register() {\n registerEndpointRenderer(DotEndpoint.type, {\n makeNode: function makeNode(ep, style) {\n return _node(CIRCLE, {\n \"cx\": ep.w / 2,\n \"cy\": ep.h / 2,\n \"r\": ep.radius\n });\n },\n updateNode: function updateNode(ep, node) {\n _attr(node, {\n \"cx\": \"\" + ep.w / 2,\n \"cy\": \"\" + ep.h / 2,\n \"r\": \"\" + ep.radius\n });\n }\n });\n};\n\nvar RectangleEndpoint = function (_EndpointRepresentati) {\n _inherits(RectangleEndpoint, _EndpointRepresentati);\n var _super = _createSuper(RectangleEndpoint);\n function RectangleEndpoint(endpoint, params) {\n var _this;\n _classCallCheck(this, RectangleEndpoint);\n _this = _super.call(this, endpoint, params);\n _defineProperty(_assertThisInitialized(_this), \"width\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"height\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", RectangleEndpoint.type);\n params = params || {};\n _this.width = params.width || 10;\n _this.height = params.height || 10;\n return _this;\n }\n _createClass(RectangleEndpoint, null, [{\n key: \"_getParams\",\n value: function _getParams(ep) {\n return {\n width: ep.width,\n height: ep.height\n };\n }\n }]);\n return RectangleEndpoint;\n}(EndpointRepresentation);\n_defineProperty(RectangleEndpoint, \"type\", \"Rectangle\");\nvar RectangleEndpointHandler = {\n type: RectangleEndpoint.type,\n cls: RectangleEndpoint,\n compute: function compute(ep, anchorPoint, orientation, endpointStyle) {\n var width = endpointStyle.width || ep.width,\n height = endpointStyle.height || ep.height,\n x = anchorPoint.curX - width / 2,\n y = anchorPoint.curY - height / 2;\n ep.x = x;\n ep.y = y;\n ep.w = width;\n ep.h = height;\n return [x, y, width, height];\n },\n getParams: function getParams(ep) {\n return {\n width: ep.width,\n height: ep.height\n };\n }\n};\n\nvar RECT = \"rect\";\nvar register$1 = function register() {\n registerEndpointRenderer(RectangleEndpoint.type, {\n makeNode: function makeNode(ep, style) {\n return _node(RECT, {\n \"width\": ep.w,\n \"height\": ep.h\n });\n },\n updateNode: function updateNode(ep, node) {\n _attr(node, {\n \"width\": ep.w,\n \"height\": ep.h\n });\n }\n });\n};\n\nvar BlankEndpoint = function (_EndpointRepresentati) {\n _inherits(BlankEndpoint, _EndpointRepresentati);\n var _super = _createSuper(BlankEndpoint);\n function BlankEndpoint(endpoint, params) {\n var _this;\n _classCallCheck(this, BlankEndpoint);\n _this = _super.call(this, endpoint, params);\n _defineProperty(_assertThisInitialized(_this), \"type\", BlankEndpoint.type);\n return _this;\n }\n return BlankEndpoint;\n}(EndpointRepresentation);\n_defineProperty(BlankEndpoint, \"type\", \"Blank\");\nvar BlankEndpointHandler = {\n type: BlankEndpoint.type,\n cls: BlankEndpoint,\n compute: function compute(ep, anchorPoint, orientation, endpointStyle) {\n ep.x = anchorPoint.curX;\n ep.y = anchorPoint.curY;\n ep.w = 10;\n ep.h = 0;\n return [anchorPoint.curX, anchorPoint.curY, 10, 0];\n },\n getParams: function getParams(ep) {\n return {};\n }\n};\n\nvar BLANK_ATTRIBUTES = {\n \"width\": 10,\n \"height\": 0,\n \"fill\": \"transparent\",\n \"stroke\": \"transparent\"\n};\nvar register = function register() {\n registerEndpointRenderer(BlankEndpoint.type, {\n makeNode: function makeNode(ep, style) {\n return _node(\"rect\", BLANK_ATTRIBUTES);\n },\n updateNode: function updateNode(ep, node) {\n _attr(node, BLANK_ATTRIBUTES);\n }\n });\n};\n\nregister$2();\nregister();\nregister$1();\n\nvar SupportedEdge;\n(function (SupportedEdge) {\n SupportedEdge[SupportedEdge[\"top\"] = 0] = \"top\";\n SupportedEdge[SupportedEdge[\"bottom\"] = 1] = \"bottom\";\n})(SupportedEdge || (SupportedEdge = {}));\nvar DEFAULT_ANCHOR_LOCATIONS = new Map();\nDEFAULT_ANCHOR_LOCATIONS.set(SupportedEdge.top, [AnchorLocations.TopRight, AnchorLocations.TopLeft]);\nDEFAULT_ANCHOR_LOCATIONS.set(SupportedEdge.bottom, [AnchorLocations.BottomRight, AnchorLocations.BottomLeft]);\nvar DEFAULT_LIST_OPTIONS = {\n deriveAnchor: function deriveAnchor(edge, index, ep, conn) {\n return DEFAULT_ANCHOR_LOCATIONS.get(edge)[index];\n }\n};\nvar ATTR_SCROLLABLE_LIST = \"jtk-scrollable-list\";\nvar SELECTOR_SCROLLABLE_LIST = att(ATTR_SCROLLABLE_LIST);\nvar EVENT_SCROLL = \"scroll\";\n\nvar JsPlumbListManager = function () {\n function JsPlumbListManager(instance, params) {\n var _this = this;\n _classCallCheck(this, JsPlumbListManager);\n this.instance = instance;\n _defineProperty(this, \"options\", void 0);\n _defineProperty(this, \"count\", void 0);\n _defineProperty(this, \"lists\", void 0);\n this.count = 0;\n this.lists = {};\n this.options = params || {};\n this.instance.bind(EVENT_MANAGE_ELEMENT, function (p) {\n var scrollableLists = _this.instance.getSelector(p.el, SELECTOR_SCROLLABLE_LIST);\n for (var i = 0; i < scrollableLists.length; i++) {\n _this.addList(scrollableLists[i]);\n }\n });\n this.instance.bind(EVENT_UNMANAGE_ELEMENT, function (p) {\n _this.removeList(p.el);\n });\n this.instance.bind(EVENT_CONNECTION, function (params, evt) {\n if (evt == null) {\n var targetParent = _this.findParentList(params.target);\n if (targetParent != null) {\n targetParent.newConnection(params.connection, params.target, 1);\n }\n var sourceParent = _this.findParentList(params.source);\n if (sourceParent != null) {\n sourceParent.newConnection(params.connection, params.source, 0);\n }\n }\n });\n this.instance.bind(INTERCEPT_BEFORE_DROP, function (p) {\n var el = p.dropEndpoint.element;\n var dropList = _this.findParentList(el);\n return dropList == null || el.offsetTop >= dropList.domElement.scrollTop && el.offsetTop + el.offsetHeight <= dropList.domElement.scrollTop + dropList.domElement.offsetHeight;\n });\n }\n _createClass(JsPlumbListManager, [{\n key: \"addList\",\n value: function addList(el, options) {\n var dp = extend({}, DEFAULT_LIST_OPTIONS);\n extend(dp, this.options);\n options = extend(dp, options || {});\n var id = [this.instance._instanceIndex, this.count++].join(\"_\");\n this.lists[id] = new JsPlumbList(this.instance, el, options, id);\n return this.lists[id];\n }\n }, {\n key: \"getList\",\n value: function getList(el) {\n var listId = this.instance.getAttribute(el, ATTR_SCROLLABLE_LIST);\n if (listId != null) {\n return this.lists[listId];\n }\n }\n }, {\n key: \"removeList\",\n value: function removeList(el) {\n var list = this.getList(el);\n if (list) {\n list.destroy();\n delete this.lists[list.id];\n }\n }\n }, {\n key: \"findParentList\",\n value: function findParentList(el) {\n var parent = el.parentNode,\n container = this.instance.getContainer(),\n parentList;\n while (parent != null && parent !== container && parent !== document) {\n parentList = this.getList(parent);\n if (parentList != null) {\n return parentList;\n }\n parent = parent.parentNode;\n }\n }\n }]);\n return JsPlumbListManager;\n}();\nvar JsPlumbList = function () {\n function JsPlumbList(instance, el, options, id) {\n _classCallCheck(this, JsPlumbList);\n this.instance = instance;\n this.el = el;\n this.options = options;\n this.id = id;\n _defineProperty(this, \"_scrollHandler\", void 0);\n _defineProperty(this, \"domElement\", void 0);\n _defineProperty(this, \"elId\", void 0);\n this.domElement = el;\n this.elId = this.instance.getId(el);\n instance.setAttribute(el, ATTR_SCROLLABLE_LIST, id);\n this._scrollHandler = this.scrollHandler.bind(this);\n this.domElement._jsPlumbScrollHandler = this._scrollHandler;\n instance.on(el, EVENT_SCROLL, this._scrollHandler);\n this._scrollHandler();\n }\n _createClass(JsPlumbList, [{\n key: \"deriveAnchor\",\n value: function deriveAnchor(edge, index, ep, conn) {\n return this.options.anchor ? this.options.anchor : this.options.deriveAnchor(edge, index, ep, conn);\n }\n }, {\n key: \"deriveEndpoint\",\n value: function deriveEndpoint(edge, index, ep, conn) {\n return this.options.deriveEndpoint ? this.options.deriveEndpoint(edge, index, ep, conn) : this.options.endpoint ? this.options.endpoint : ep.endpoint.type;\n }\n }, {\n key: \"newConnection\",\n value: function newConnection(c, el, index) {\n if (el.offsetTop < this.el.scrollTop) {\n this._proxyConnection(el, c, index, SupportedEdge.top);\n } else if (el.offsetTop + el.offsetHeight > this.el.scrollTop + this.domElement.offsetHeight) {\n this._proxyConnection(el, c, index, SupportedEdge.bottom);\n }\n }\n }, {\n key: \"scrollHandler\",\n value: function scrollHandler() {\n var _this2 = this;\n var children = this.instance.getSelector(this.el, SELECTOR_MANAGED_ELEMENT);\n var _loop = function _loop(i) {\n if (children[i].offsetTop < _this2.el.scrollTop) {\n children[i]._jsPlumbProxies = children[i]._jsPlumbProxies || [];\n _this2.instance.select({\n source: children[i]\n }).each(function (c) {\n _this2._proxyConnection(children[i], c, 0, SupportedEdge.top);\n });\n _this2.instance.select({\n target: children[i]\n }).each(function (c) {\n _this2._proxyConnection(children[i], c, 1, SupportedEdge.top);\n });\n }\n else if (children[i].offsetTop + children[i].offsetHeight > _this2.el.scrollTop + _this2.domElement.offsetHeight) {\n children[i]._jsPlumbProxies = children[i]._jsPlumbProxies || [];\n _this2.instance.select({\n source: children[i]\n }).each(function (c) {\n _this2._proxyConnection(children[i], c, 0, SupportedEdge.bottom);\n });\n _this2.instance.select({\n target: children[i]\n }).each(function (c) {\n _this2._proxyConnection(children[i], c, 1, SupportedEdge.bottom);\n });\n } else if (children[i]._jsPlumbProxies) {\n for (var j = 0; j < children[i]._jsPlumbProxies.length; j++) {\n _this2.instance.unproxyConnection(children[i]._jsPlumbProxies[j][0], children[i]._jsPlumbProxies[j][1]);\n }\n delete children[i]._jsPlumbProxies;\n }\n _this2.instance.revalidate(children[i]);\n };\n for (var i = 0; i < children.length; i++) {\n _loop(i);\n }\n }\n }, {\n key: \"_proxyConnection\",\n value: function _proxyConnection(el, conn, index, edge) {\n var _this3 = this;\n this.instance.proxyConnection(conn, index, this.domElement, function (c, index) {\n return _this3.deriveEndpoint(edge, index, conn.endpoints[index], conn);\n }, function (c, index) {\n return _this3.deriveAnchor(edge, index, conn.endpoints[index], conn);\n });\n el._jsPlumbProxies = el._jsPlumbProxies || [];\n el._jsPlumbProxies.push([conn, index]);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.instance.off(this.el, EVENT_SCROLL, this._scrollHandler);\n delete this.domElement._jsPlumbScrollHandler;\n var children = this.instance.getSelector(this.el, SELECTOR_MANAGED_ELEMENT);\n for (var i = 0; i < children.length; i++) {\n if (children[i]._jsPlumbProxies) {\n for (var j = 0; j < children[i]._jsPlumbProxies.length; j++) {\n this.instance.unproxyConnection(children[i]._jsPlumbProxies[j][0], children[i]._jsPlumbProxies[j][1]);\n }\n delete children[i]._jsPlumbProxies;\n }\n }\n }\n }]);\n return JsPlumbList;\n}();\n\nvar VERY_SMALL_VALUE = 0.0000000001;\nfunction gentleRound(n) {\n var f = Math.floor(n),\n r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n } else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n}\nvar ArcSegment = function (_AbstractSegment) {\n _inherits(ArcSegment, _AbstractSegment);\n var _super = _createSuper(ArcSegment);\n function ArcSegment(params) {\n var _this;\n _classCallCheck(this, ArcSegment);\n _this = _super.call(this, params);\n _defineProperty(_assertThisInitialized(_this), \"type\", ArcSegment.segmentType);\n _defineProperty(_assertThisInitialized(_this), \"cx\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cy\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"radius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"anticlockwise\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"startAngle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"endAngle\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"sweep\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"length\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"circumference\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"frac\", void 0);\n _this.cx = params.cx;\n _this.cy = params.cy;\n _this.radius = params.r;\n _this.anticlockwise = params.ac;\n if (params.startAngle && params.endAngle) {\n _this.startAngle = params.startAngle;\n _this.endAngle = params.endAngle;\n _this.x1 = _this.cx + _this.radius * Math.cos(_this.startAngle);\n _this.y1 = _this.cy + _this.radius * Math.sin(_this.startAngle);\n _this.x2 = _this.cx + _this.radius * Math.cos(_this.endAngle);\n _this.y2 = _this.cy + _this.radius * Math.sin(_this.endAngle);\n } else {\n _this.startAngle = _this._calcAngle(_this.x1, _this.y1);\n _this.endAngle = _this._calcAngle(_this.x2, _this.y2);\n }\n if (_this.endAngle < 0) {\n _this.endAngle += TWO_PI;\n }\n if (_this.startAngle < 0) {\n _this.startAngle += TWO_PI;\n }\n var ea = _this.endAngle < _this.startAngle ? _this.endAngle + TWO_PI : _this.endAngle;\n _this.sweep = Math.abs(ea - _this.startAngle);\n if (_this.anticlockwise) {\n _this.sweep = TWO_PI - _this.sweep;\n }\n _this.circumference = 2 * Math.PI * _this.radius;\n _this.frac = _this.sweep / TWO_PI;\n _this.length = _this.circumference * _this.frac;\n _this.extents = {\n xmin: _this.cx - _this.radius,\n xmax: _this.cx + _this.radius,\n ymin: _this.cy - _this.radius,\n ymax: _this.cy + _this.radius\n };\n return _this;\n }\n _createClass(ArcSegment, [{\n key: \"_calcAngle\",\n value: function _calcAngle(_x, _y) {\n return theta({\n x: this.cx,\n y: this.cy\n }, {\n x: _x,\n y: _y\n });\n }\n }, {\n key: \"_calcAngleForLocation\",\n value: function _calcAngleForLocation(segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - s * location;\n } else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n return segment.startAngle + ss * location;\n }\n }\n }, {\n key: \"getPath\",\n value: function getPath(isFirstSegment) {\n var laf = this.sweep > Math.PI ? 1 : 0,\n sf = this.anticlockwise ? 0 : 1;\n return (isFirstSegment ? \"M\" + this.x1 + \" \" + this.y1 + \" \" : \"\") + \"A \" + this.radius + \" \" + this.radius + \" 0 \" + laf + \",\" + sf + \" \" + this.x2 + \" \" + this.y2;\n }\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.length;\n }\n }, {\n key: \"pointOnPath\",\n value: function pointOnPath(location, absolute) {\n if (location === 0) {\n return {\n x: this.x1,\n y: this.y1,\n theta: this.startAngle\n };\n } else if (location === 1) {\n return {\n x: this.x2,\n y: this.y2,\n theta: this.endAngle\n };\n }\n if (absolute) {\n location = location / length;\n }\n var angle = this._calcAngleForLocation(this, location),\n _x = this.cx + this.radius * Math.cos(angle),\n _y = this.cy + this.radius * Math.sin(angle);\n return {\n x: gentleRound(_x),\n y: gentleRound(_y),\n theta: angle\n };\n }\n }, {\n key: \"gradientAtPoint\",\n value: function gradientAtPoint(location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = normal({\n x: this.cx,\n y: this.cy\n }, p);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n }\n }, {\n key: \"pointAlongPathFrom\",\n value: function pointAlongPathFrom(location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / this.circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + dir * arcSpan,\n startX = this.cx + this.radius * Math.cos(startAngle),\n startY = this.cy + this.radius * Math.sin(startAngle);\n return {\n x: startX,\n y: startY\n };\n }\n }]);\n return ArcSegment;\n}(AbstractSegment);\n_defineProperty(ArcSegment, \"segmentType\", \"Arc\");\n\nvar AbstractBezierConnector = function (_AbstractConnector) {\n _inherits(AbstractBezierConnector, _AbstractConnector);\n var _super = _createSuper(AbstractBezierConnector);\n function AbstractBezierConnector(connection, params) {\n var _this;\n _classCallCheck(this, AbstractBezierConnector);\n _this = _super.call(this, connection, params);\n _this.connection = connection;\n _defineProperty(_assertThisInitialized(_this), \"showLoopback\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"curviness\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"margin\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"proximityLimit\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"orientation\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"loopbackRadius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"clockwise\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"isLoopbackCurrently\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"geometry\", null);\n params = params || {};\n _this.showLoopback = params.showLoopback !== false;\n _this.curviness = params.curviness || 10;\n _this.margin = params.margin || 5;\n _this.proximityLimit = params.proximityLimit || 80;\n _this.clockwise = params.orientation && params.orientation === \"clockwise\";\n _this.loopbackRadius = params.loopbackRadius || 25;\n _this.isLoopbackCurrently = false;\n return _this;\n }\n _createClass(AbstractBezierConnector, [{\n key: \"getDefaultStubs\",\n value: function getDefaultStubs() {\n return [0, 0];\n }\n }, {\n key: \"_compute\",\n value: function _compute(paintInfo, p) {\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp.curX - tp.curX),\n _h = Math.abs(sp.curY - tp.curY);\n if (!this.showLoopback || p.sourceEndpoint.elementId !== p.targetEndpoint.elementId) {\n this.isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n this.isLoopbackCurrently = true;\n var x1 = p.sourcePos.curX,\n y1 = p.sourcePos.curY - this.margin,\n cx = x1,\n cy = y1 - this.loopbackRadius,\n _x = cx - this.loopbackRadius,\n _y = cy - this.loopbackRadius;\n _w = 2 * this.loopbackRadius;\n _h = 2 * this.loopbackRadius;\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n this._addSegment(ArcSegment, {\n loopback: true,\n x1: x1 - _x + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: this.loopbackRadius,\n ac: !this.clockwise,\n x2: x1 - _x - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n }\n }, {\n key: \"exportGeometry\",\n value: function exportGeometry() {\n if (this.geometry == null) {\n return null;\n } else {\n return {\n controlPoints: [extend({}, this.geometry.controlPoints[0]), extend({}, this.geometry.controlPoints[1])],\n source: extend({}, this.geometry.source),\n target: extend({}, this.geometry.target)\n };\n }\n }\n }, {\n key: \"transformGeometry\",\n value: function transformGeometry(g, dx, dy) {\n return {\n controlPoints: [{\n x: g.controlPoints[0].x + dx,\n y: g.controlPoints[0].y + dy\n }, {\n x: g.controlPoints[1].x + dx,\n y: g.controlPoints[1].y + dy\n }],\n source: this.transformAnchorPlacement(g.source, dx, dy),\n target: this.transformAnchorPlacement(g.target, dx, dy)\n };\n }\n }, {\n key: \"importGeometry\",\n value: function importGeometry(geometry) {\n if (geometry != null) {\n if (geometry.controlPoints == null || geometry.controlPoints.length != 2) {\n log(\"jsPlumb Bezier: cannot import geometry; controlPoints missing or does not have length 2\");\n this.setGeometry(null, true);\n return false;\n }\n if (geometry.controlPoints[0].x == null || geometry.controlPoints[0].y == null || geometry.controlPoints[1].x == null || geometry.controlPoints[1].y == null) {\n log(\"jsPlumb Bezier: cannot import geometry; controlPoints malformed\");\n this.setGeometry(null, true);\n return false;\n }\n if (geometry.source == null || geometry.source.curX == null || geometry.source.curY == null) {\n log(\"jsPlumb Bezier: cannot import geometry; source missing or malformed\");\n this.setGeometry(null, true);\n return false;\n }\n if (geometry.target == null || geometry.target.curX == null || geometry.target.curY == null) {\n log(\"jsPlumb Bezier: cannot import geometry; target missing or malformed\");\n this.setGeometry(null, true);\n return false;\n }\n this.setGeometry(geometry, false);\n return true;\n } else {\n return false;\n }\n }\n }]);\n return AbstractBezierConnector;\n}(AbstractConnector);\n\nvar Vectors = {\n subtract: function subtract(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n },\n dotProduct: function dotProduct(v1, v2) {\n return v1.x * v2.x + v1.y * v2.y;\n },\n square: function square(v) {\n return Math.sqrt(v.x * v.x + v.y * v.y);\n },\n scale: function scale(v, s) {\n return {\n x: v.x * s,\n y: v.y * s\n };\n }\n};\nvar maxRecursion = 64;\nvar flatnessTolerance = Math.pow(2.0, -maxRecursion - 1);\nfunction distanceFromCurve(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1,\n higherDegree = 2 * degree - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]),\n dist = Vectors.square(v),\n t = 0.0,\n newDist;\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {\n location: t,\n distance: dist\n };\n}\nfunction nearestPointOnCurve(point, curve) {\n var td = distanceFromCurve(point, curve);\n return {\n point: _bezier(curve, curve.length - 1, td.location, null, null),\n location: td.location\n };\n}\nfunction _convertToBezier(point, curve) {\n var degree = curve.length - 1,\n higherDegree = 2 * degree - 1,\n c = [],\n d = [],\n cdTable = [],\n w = [],\n z = [[1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0]];\n for (var i = 0; i <= degree; i++) {\n c[i] = Vectors.subtract(curve[i], point);\n }\n for (var _i = 0; _i <= degree - 1; _i++) {\n d[_i] = Vectors.subtract(curve[_i + 1], curve[_i]);\n d[_i] = Vectors.scale(d[_i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (var _i2 = 0; _i2 <= higherDegree; _i2++) {\n if (!w[_i2]) {\n w[_i2] = [];\n }\n w[_i2].y = 0.0;\n w[_i2].x = parseFloat(\"\" + _i2) / higherDegree;\n }\n var n = degree,\n m = degree - 1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (var _i3 = lb; _i3 <= ub; _i3++) {\n var j = k - _i3;\n w[_i3 + j].y += cdTable[j][_i3] * z[j][_i3];\n }\n }\n return w;\n}\nfunction _findRoots(w, degree, t, depth) {\n var left = [],\n right = [],\n left_count,\n right_count,\n left_t = [],\n right_t = [];\n switch (_getCrossingCount(w, degree)) {\n case 0:\n {\n return 0;\n }\n case 1:\n {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth + 1);\n right_count = _findRoots(right, degree, right_t, depth + 1);\n for (var i = 0; i < left_count; i++) {\n t[i] = left_t[i];\n }\n for (var _i4 = 0; _i4 < right_count; _i4++) {\n t[_i4 + left_count] = right_t[_i4];\n }\n return left_count + right_count;\n}\nfunction _getCrossingCount(curve, degree) {\n var n_crossings = 0,\n sign,\n old_sign;\n sign = old_sign = sgn$1(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = sgn$1(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n}\nfunction _isFlatEnough(curve, degree) {\n var error, intercept_1, intercept_2, left_intercept, right_intercept, a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above) {\n max_distance_above = value;\n } else if (value < max_distance_below) {\n max_distance_below = value;\n }\n }\n a1 = 0.0;\n b1 = 1.0;\n c1 = 0.0;\n a2 = a;\n b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0 / det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a;\n b2 = b;\n c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0 / det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return error < flatnessTolerance ? 1 : 0;\n}\nfunction _computeXIntercept(curve, degree) {\n var XLK = 1.0,\n YLK = 0.0,\n XNM = curve[degree].x - curve[0].x,\n YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0,\n YMK = curve[0].y - 0.0,\n det = XNM * YLK - YNM * XLK,\n detInv = 1.0 / det,\n S = (XNM * YMK - YNM * XMK) * detInv;\n return 0.0 + XLK * S;\n}\nfunction _bezier(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j = 0; j <= degree; j++) {\n temp[0][j] = curve[j];\n }\n for (var i = 1; i <= degree; i++) {\n for (var _j = 0; _j <= degree - i; _j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][_j]) temp[i][_j] = {};\n temp[i][_j].x = (1.0 - t) * temp[i - 1][_j].x + t * temp[i - 1][_j + 1].x;\n temp[i][_j].y = (1.0 - t) * temp[i - 1][_j].y + t * temp[i - 1][_j + 1].y;\n }\n }\n if (left != null) {\n for (var _j2 = 0; _j2 <= degree; _j2++) {\n left[_j2] = temp[_j2][0];\n }\n }\n if (right != null) {\n for (var _j3 = 0; _j3 <= degree; _j3++) {\n right[_j3] = temp[degree - _j3][_j3];\n }\n }\n return temp[degree][0];\n}\nfunction _getLUT(steps, curve) {\n var out = [];\n steps--;\n for (var n = 0; n <= steps; n++) {\n out.push(_computeLookup(n / steps, curve));\n }\n return out;\n}\nfunction _computeLookup(e, curve) {\n var EMPTY_POINT = {\n x: 0,\n y: 0\n };\n if (e === 0) {\n return curve[0];\n }\n var degree = curve.length - 1;\n if (e === 1) {\n return curve[degree];\n }\n var o = curve;\n var s = 1 - e;\n if (degree === 0) {\n return curve[0];\n }\n if (degree === 1) {\n return {\n x: s * o[0].x + e * o[1].x,\n y: s * o[0].y + e * o[1].y\n };\n }\n if (4 > degree) {\n var l = s * s,\n h = e * e,\n u = 0,\n m,\n g,\n f;\n if (degree === 2) {\n o = [o[0], o[1], o[2], EMPTY_POINT];\n m = l;\n g = 2 * (s * e);\n f = h;\n } else if (degree === 3) {\n m = l * s;\n g = 3 * (l * e);\n f = 3 * (s * h);\n u = e * h;\n }\n return {\n x: m * o[0].x + g * o[1].x + f * o[2].x + u * o[3].x,\n y: m * o[0].y + g * o[1].y + f * o[2].y + u * o[3].y\n };\n } else {\n return EMPTY_POINT;\n }\n}\nfunction computeBezierLength(curve) {\n var length = 0;\n if (!isPoint(curve)) {\n var steps = 16;\n var lut = _getLUT(steps, curve);\n for (var i = 0; i < steps - 1; i++) {\n var a = lut[i],\n b = lut[i + 1];\n length += dist(a, b);\n }\n }\n return length;\n}\nvar _curveFunctionCache = new Map();\nfunction _getCurveFunctions(order) {\n var fns = _curveFunctionCache.get(order);\n if (!fns) {\n fns = [];\n var f_term = function f_term() {\n return function (t) {\n return Math.pow(t, order);\n };\n },\n l_term = function l_term() {\n return function (t) {\n return Math.pow(1 - t, order);\n };\n },\n c_term = function c_term(c) {\n return function (t) {\n return c;\n };\n },\n t_term = function t_term() {\n return function (t) {\n return t;\n };\n },\n one_minus_t_term = function one_minus_t_term() {\n return function (t) {\n return 1 - t;\n };\n },\n _termFunc = function _termFunc(terms) {\n return function (t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) {\n p = p * terms[i](t);\n }\n return p;\n };\n };\n fns.push(f_term());\n for (var i = 1; i < order; i++) {\n var terms = [c_term(order)];\n for (var j = 0; j < order - i; j++) {\n terms.push(t_term());\n }\n for (var _j4 = 0; _j4 < i; _j4++) {\n terms.push(one_minus_t_term());\n }\n fns.push(_termFunc(terms));\n }\n fns.push(l_term());\n _curveFunctionCache.set(order, fns);\n }\n return fns;\n}\nfunction pointOnCurve(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0,\n _y = 0;\n for (var i = 0; i < curve.length; i++) {\n _x = _x + curve[i].x * cc[i](location);\n _y = _y + curve[i].y * cc[i](location);\n }\n return {\n x: _x,\n y: _y\n };\n}\nfunction dist(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\nfunction isPoint(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n}\nfunction pointAlongPath(curve, location, distance) {\n if (isPoint(curve)) {\n return {\n point: curve[0],\n location: location\n };\n }\n var prev = pointOnCurve(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n while (tally < Math.abs(distance)) {\n curLoc += 0.005 * direction;\n cur = pointOnCurve(curve, curLoc);\n tally += dist(cur, prev);\n prev = cur;\n }\n return {\n point: cur,\n location: curLoc\n };\n}\nfunction pointAlongCurveFrom(curve, location, distance) {\n return pointAlongPath(curve, location, distance).point;\n}\nfunction locationAlongCurveFrom(curve, location, distance) {\n return pointAlongPath(curve, location, distance).location;\n}\nfunction gradientAtPoint(curve, location) {\n var p1 = pointOnCurve(curve, location),\n p2 = pointOnCurve(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y,\n dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n}\nfunction gradientAtPointAlongPathFrom(curve, location, distance) {\n var p = pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return gradientAtPoint(curve, p.location);\n}\nfunction perpendicularToPathAt(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = pointAlongPath(curve, location, distance),\n m = gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{\n x: p.point.x + x,\n y: p.point.y + y\n }, {\n x: p.point.x - x,\n y: p.point.y - y\n }];\n}\nfunction bezierLineIntersection(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = x1 * (y1 - y2) + y1 * (x2 - x1),\n coeffs = _computeCoefficients(curve),\n p = [a * coeffs[0][0] + b * coeffs[1][0], a * coeffs[0][1] + b * coeffs[1][1], a * coeffs[0][2] + b * coeffs[1][2], a * coeffs[0][3] + b * coeffs[1][3] + c],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n if (r != null) {\n for (var i = 0; i < 3; i++) {\n var _t = r[i],\n t2 = Math.pow(_t, 2),\n t3 = Math.pow(_t, 3),\n x = {\n x: coeffs[0][0] * t3 + coeffs[0][1] * t2 + coeffs[0][2] * _t + coeffs[0][3],\n y: coeffs[1][0] * t3 + coeffs[1][1] * t2 + coeffs[1][2] * _t + coeffs[1][3]\n };\n var s = void 0;\n if (x2 - x1 !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n } else {\n s = (x[1] - y1) / (y2 - y1);\n }\n if (_t >= 0 && _t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n return intersections;\n}\nfunction boxIntersection(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, bezierLineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, bezierLineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, bezierLineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, bezierLineIntersection(x, y + h, x, y, curve));\n return i;\n}\nfunction boundingBoxIntersection(boundingBox, curve) {\n var i = [];\n i.push.apply(i, bezierLineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, bezierLineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, bezierLineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, bezierLineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n}\nfunction _computeCoefficientsForAxis(curve, axis) {\n return [-curve[0][axis] + 3 * curve[1][axis] + -3 * curve[2][axis] + curve[3][axis], 3 * curve[0][axis] - 6 * curve[1][axis] + 3 * curve[2][axis], -3 * curve[0][axis] + 3 * curve[1][axis], curve[0][axis]];\n}\nfunction _computeCoefficients(curve) {\n return [_computeCoefficientsForAxis(curve, \"x\"), _computeCoefficientsForAxis(curve, \"y\")];\n}\nfunction _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3 * B - Math.pow(A, 2)) / 9,\n R = (9 * A * B - 27 * C - 2 * Math.pow(A, 3)) / 54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [0, 0, 0];\n if (D >= 0)\n {\n S = sgn$1(R + Math.sqrt(D)) * Math.pow(Math.abs(R + Math.sqrt(D)), 1 / 3);\n T = sgn$1(R - Math.sqrt(D)) * Math.pow(Math.abs(R - Math.sqrt(D)), 1 / 3);\n t[0] = -A / 3 + (S + T);\n t[1] = -A / 3 - (S + T) / 2;\n t[2] = -A / 3 - (S + T) / 2;\n if (Math.abs(Math.sqrt(3) * (S - T) / 2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n } else\n {\n var th = Math.acos(R / Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2 * Math.sqrt(-Q) * Math.cos(th / 3) - A / 3;\n t[1] = 2 * Math.sqrt(-Q) * Math.cos((th + 2 * Math.PI) / 3) - A / 3;\n t[2] = 2 * Math.sqrt(-Q) * Math.cos((th + 4 * Math.PI) / 3) - A / 3;\n }\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n return t;\n}\n\nvar BezierSegment = function (_AbstractSegment) {\n _inherits(BezierSegment, _AbstractSegment);\n var _super = _createSuper(BezierSegment);\n function BezierSegment(params) {\n var _this;\n _classCallCheck(this, BezierSegment);\n _this = _super.call(this, params);\n _defineProperty(_assertThisInitialized(_this), \"curve\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cp1x\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cp1y\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cp2x\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cp2y\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"length\", 0);\n _defineProperty(_assertThisInitialized(_this), \"type\", BezierSegment.segmentType);\n _this.cp1x = params.cp1x;\n _this.cp1y = params.cp1y;\n _this.cp2x = params.cp2x;\n _this.cp2y = params.cp2y;\n _this.x1 = params.x1;\n _this.x2 = params.x2;\n _this.y1 = params.y1;\n _this.y2 = params.y2;\n _this.curve = [{\n x: _this.x1,\n y: _this.y1\n }, {\n x: _this.cp1x,\n y: _this.cp1y\n }, {\n x: _this.cp2x,\n y: _this.cp2y\n }, {\n x: _this.x2,\n y: _this.y2\n }];\n _this.extents = {\n xmin: Math.min(_this.x1, _this.x2, _this.cp1x, _this.cp2x),\n ymin: Math.min(_this.y1, _this.y2, _this.cp1y, _this.cp2y),\n xmax: Math.max(_this.x1, _this.x2, _this.cp1x, _this.cp2x),\n ymax: Math.max(_this.y1, _this.y2, _this.cp1y, _this.cp2y)\n };\n return _this;\n }\n _createClass(BezierSegment, [{\n key: \"getPath\",\n value: function getPath(isFirstSegment) {\n return (isFirstSegment ? \"M \" + this.x2 + \" \" + this.y2 + \" \" : \"\") + \"C \" + this.cp2x + \" \" + this.cp2y + \" \" + this.cp1x + \" \" + this.cp1y + \" \" + this.x1 + \" \" + this.y1;\n }\n }, {\n key: \"pointOnPath\",\n value: function pointOnPath(location, absolute) {\n location = BezierSegment._translateLocation(this.curve, location, absolute);\n return pointOnCurve(this.curve, location);\n }\n }, {\n key: \"gradientAtPoint\",\n value: function gradientAtPoint$1(location, absolute) {\n location = BezierSegment._translateLocation(this.curve, location, absolute);\n return gradientAtPoint(this.curve, location);\n }\n }, {\n key: \"pointAlongPathFrom\",\n value: function pointAlongPathFrom(location, distance, absolute) {\n location = BezierSegment._translateLocation(this.curve, location, absolute);\n return pointAlongCurveFrom(this.curve, location, distance);\n }\n }, {\n key: \"getLength\",\n value: function getLength() {\n if (this.length == null || this.length === 0) {\n this.length = computeBezierLength(this.curve);\n }\n return this.length;\n }\n }, {\n key: \"findClosestPointOnPath\",\n value: function findClosestPointOnPath(x, y) {\n var p = nearestPointOnCurve({\n x: x,\n y: y\n }, this.curve);\n return {\n d: Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x: p.point.x,\n y: p.point.y,\n l: 1 - p.location,\n s: this,\n x1: null,\n y1: null,\n x2: null,\n y2: null\n };\n }\n }, {\n key: \"lineIntersection\",\n value: function lineIntersection(x1, y1, x2, y2) {\n return bezierLineIntersection(x1, y1, x2, y2, this.curve);\n }\n }], [{\n key: \"_translateLocation\",\n value: function _translateLocation(_curve, location, absolute) {\n if (absolute) {\n location = locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n return location;\n }\n }]);\n return BezierSegment;\n}(AbstractSegment);\n_defineProperty(BezierSegment, \"segmentType\", \"Bezier\");\n\nvar BezierConnector = function (_AbstractBezierConnec) {\n _inherits(BezierConnector, _AbstractBezierConnec);\n var _super = _createSuper(BezierConnector);\n function BezierConnector(connection, params) {\n var _this;\n _classCallCheck(this, BezierConnector);\n _this = _super.call(this, connection, params);\n _this.connection = connection;\n _defineProperty(_assertThisInitialized(_this), \"type\", BezierConnector.type);\n _defineProperty(_assertThisInitialized(_this), \"majorAnchor\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"minorAnchor\", void 0);\n params = params || {};\n _this.majorAnchor = params.curviness || 150;\n _this.minorAnchor = 10;\n return _this;\n }\n _createClass(BezierConnector, [{\n key: \"getCurviness\",\n value: function getCurviness() {\n return this.majorAnchor;\n }\n }, {\n key: \"_findControlPoint\",\n value: function _findControlPoint(point, sourceAnchorPosition, targetAnchorPosition, soo, too) {\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = {\n x: 0,\n y: 0\n };\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.x = sourceAnchorPosition.curX < targetAnchorPosition.curX ? point.x + this.minorAnchor : point.x - this.minorAnchor;\n } else {\n p.x = point.x - this.majorAnchor * soo[0];\n }\n if (soo[1] === 0) {\n p.y = sourceAnchorPosition.curY < targetAnchorPosition.curY ? point.y + this.minorAnchor : point.y - this.minorAnchor;\n } else {\n p.y = point.y + this.majorAnchor * too[1];\n }\n } else {\n if (too[0] === 0) {\n p.x = targetAnchorPosition.curX < sourceAnchorPosition.curX ? point.x + this.minorAnchor : point.x - this.minorAnchor;\n } else {\n p.x = point.x + this.majorAnchor * too[0];\n }\n if (too[1] === 0) {\n p.y = targetAnchorPosition.curY < sourceAnchorPosition.curY ? point.y + this.minorAnchor : point.y - this.minorAnchor;\n } else {\n p.y = point.y + this.majorAnchor * soo[1];\n }\n }\n return p;\n }\n }, {\n key: \"_computeBezier\",\n value: function _computeBezier(paintInfo, p, sp, tp, _w, _h) {\n var _CP,\n _CP2,\n _sx = sp.curX < tp.curX ? _w : 0,\n _sy = sp.curY < tp.curY ? _h : 0,\n _tx = sp.curX < tp.curX ? 0 : _w,\n _ty = sp.curY < tp.curY ? 0 : _h;\n if (this.edited !== true) {\n _CP = this._findControlPoint({\n x: _sx,\n y: _sy\n }, sp, tp, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint({\n x: _tx,\n y: _ty\n }, tp, sp, paintInfo.to, paintInfo.so);\n } else {\n _CP = this.geometry.controlPoints[0];\n _CP2 = this.geometry.controlPoints[1];\n }\n this.geometry = {\n controlPoints: [_CP, _CP2],\n source: p.sourcePos,\n target: p.targetPos\n };\n this._addSegment(BezierSegment, {\n x1: _sx,\n y1: _sy,\n x2: _tx,\n y2: _ty,\n cp1x: _CP.x,\n cp1y: _CP.y,\n cp2x: _CP2.x,\n cp2y: _CP2.y\n });\n }\n }]);\n return BezierConnector;\n}(AbstractBezierConnector);\n_defineProperty(BezierConnector, \"type\", \"Bezier\");\n\nfunction _segment(x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n } else if (x1 <= x2 && y1 <= y2) {\n return 2;\n } else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n}\nfunction _findControlPoint(midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n if (distance <= proximityLimit) {\n return {\n x: midx,\n y: midy\n };\n }\n if (segment === 1) {\n if (sourceEdge.curY <= 0 && targetEdge.curY >= 1) {\n return {\n x: midx + (sourceEdge.x < 0.5 ? -1 * dx : dx),\n y: midy\n };\n } else if (sourceEdge.curX >= 1 && targetEdge.curX <= 0) {\n return {\n x: midx,\n y: midy + (sourceEdge.y < 0.5 ? -1 * dy : dy)\n };\n } else {\n return {\n x: midx + -1 * dx,\n y: midy + -1 * dy\n };\n }\n } else if (segment === 2) {\n if (sourceEdge.curY >= 1 && targetEdge.curY <= 0) {\n return {\n x: midx + (sourceEdge.x < 0.5 ? -1 * dx : dx),\n y: midy\n };\n } else if (sourceEdge.curX >= 1 && targetEdge.curX <= 0) {\n return {\n x: midx,\n y: midy + (sourceEdge.y < 0.5 ? -1 * dy : dy)\n };\n } else {\n return {\n x: midx + dx,\n y: midy + -1 * dy\n };\n }\n } else if (segment === 3) {\n if (sourceEdge.curY >= 1 && targetEdge.curY <= 0) {\n return {\n x: midx + (sourceEdge.x < 0.5 ? -1 * dx : dx),\n y: midy\n };\n } else if (sourceEdge.curX <= 0 && targetEdge.curX >= 1) {\n return {\n x: midx,\n y: midy + (sourceEdge.y < 0.5 ? -1 * dy : dy)\n };\n } else {\n return {\n x: midx + -1 * dx,\n y: midy + -1 * dy\n };\n }\n } else if (segment === 4) {\n if (sourceEdge.curY <= 0 && targetEdge.curY >= 1) {\n return {\n x: midx + (sourceEdge.x < 0.5 ? -1 * dx : dx),\n y: midy\n };\n } else if (sourceEdge.curX <= 0 && targetEdge.curX >= 1) {\n return {\n x: midx,\n y: midy + (sourceEdge.y < 0.5 ? -1 * dy : dy)\n };\n } else {\n return {\n x: midx + dx,\n y: midy + -1 * dy\n };\n }\n }\n}\nvar StateMachineConnector = function (_AbstractBezierConnec) {\n _inherits(StateMachineConnector, _AbstractBezierConnec);\n var _super = _createSuper(StateMachineConnector);\n function StateMachineConnector(connection, params) {\n var _this;\n _classCallCheck(this, StateMachineConnector);\n _this = _super.call(this, connection, params);\n _this.connection = connection;\n _defineProperty(_assertThisInitialized(_this), \"type\", StateMachineConnector.type);\n _defineProperty(_assertThisInitialized(_this), \"_controlPoint\", void 0);\n _this.curviness = params.curviness || 10;\n _this.margin = params.margin || 5;\n _this.proximityLimit = params.proximityLimit || 80;\n _this.clockwise = params.orientation && params.orientation === \"clockwise\";\n return _this;\n }\n _createClass(StateMachineConnector, [{\n key: \"_computeBezier\",\n value: function _computeBezier(paintInfo, params, sp, tp, w, h) {\n var _sx = sp.curX < tp.curX ? 0 : w,\n _sy = sp.curY < tp.curY ? 0 : h,\n _tx = sp.curX < tp.curX ? w : 0,\n _ty = sp.curY < tp.curY ? h : 0;\n if (sp.x === 0) {\n _sx -= this.margin;\n }\n if (sp.x === 1) {\n _sx += this.margin;\n }\n if (sp.y === 0) {\n _sy -= this.margin;\n }\n if (sp.y === 1) {\n _sy += this.margin;\n }\n if (tp.x === 0) {\n _tx -= this.margin;\n }\n if (tp.x === 1) {\n _tx += this.margin;\n }\n if (tp.y === 0) {\n _ty -= this.margin;\n }\n if (tp.y === 1) {\n _ty += this.margin;\n }\n if (this.edited !== true) {\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2));\n this._controlPoint = _findControlPoint(_midx, _midy, segment, params.sourcePos, params.targetPos, this.curviness, this.curviness, distance, this.proximityLimit);\n } else {\n this._controlPoint = this.geometry.controlPoints[0];\n }\n var cp1x, cp2x, cp1y, cp2y;\n cp1x = this._controlPoint.x;\n cp2x = this._controlPoint.x;\n cp1y = this._controlPoint.y;\n cp2y = this._controlPoint.y;\n this.geometry = {\n controlPoints: [this._controlPoint, this._controlPoint],\n source: params.sourcePos,\n target: params.targetPos\n };\n this._addSegment(BezierSegment, {\n x1: _tx,\n y1: _ty,\n x2: _sx,\n y2: _sy,\n cp1x: cp1x,\n cp1y: cp1y,\n cp2x: cp2x,\n cp2y: cp2y\n });\n }\n }]);\n return StateMachineConnector;\n}(AbstractBezierConnector);\n_defineProperty(StateMachineConnector, \"type\", \"StateMachine\");\n\nConnectors.register(BezierConnector.type, BezierConnector);\nConnectors.register(StateMachineConnector.type, StateMachineConnector);\n\nfunction sgn(n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n}\nfunction segmentDirections(segment) {\n return [sgn(segment[2] - segment[0]), sgn(segment[3] - segment[1])];\n}\nfunction segLength(s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n}\nfunction _cloneArray(a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n}\nvar FlowchartConnector = function (_AbstractConnector) {\n _inherits(FlowchartConnector, _AbstractConnector);\n var _super = _createSuper(FlowchartConnector);\n function FlowchartConnector(connection, params) {\n var _this;\n _classCallCheck(this, FlowchartConnector);\n _this = _super.call(this, connection, params);\n _this.connection = connection;\n _defineProperty(_assertThisInitialized(_this), \"type\", FlowchartConnector.type);\n _defineProperty(_assertThisInitialized(_this), \"internalSegments\", []);\n _defineProperty(_assertThisInitialized(_this), \"midpoint\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"alwaysRespectStubs\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"cornerRadius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"lastx\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"lasty\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"lastOrientation\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"loopbackRadius\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"isLoopbackCurrently\", void 0);\n _this.midpoint = params.midpoint == null || isNaN(params.midpoint) ? 0.5 : params.midpoint;\n _this.cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0;\n _this.alwaysRespectStubs = params.alwaysRespectStubs === true;\n _this.lastx = null;\n _this.lasty = null;\n _this.lastOrientation = null;\n _this.loopbackRadius = params.loopbackRadius || 25;\n _this.isLoopbackCurrently = false;\n return _this;\n }\n _createClass(FlowchartConnector, [{\n key: \"getDefaultStubs\",\n value: function getDefaultStubs() {\n return [30, 30];\n }\n }, {\n key: \"addASegment\",\n value: function addASegment(x, y, paintInfo) {\n if (this.lastx === x && this.lasty === y) {\n return;\n }\n var lx = this.lastx == null ? paintInfo.sx : this.lastx,\n ly = this.lasty == null ? paintInfo.sy : this.lasty,\n o = lx === x ? \"v\" : \"h\";\n this.lastx = x;\n this.lasty = y;\n this.internalSegments.push([lx, ly, x, y, o]);\n }\n }, {\n key: \"writeSegments\",\n value: function writeSegments(paintInfo) {\n var current = null,\n next,\n currentDirection,\n nextDirection;\n for (var i = 0; i < this.internalSegments.length - 1; i++) {\n current = current || _cloneArray(this.internalSegments[i]);\n next = _cloneArray(this.internalSegments[i + 1]);\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n if (this.cornerRadius > 0 && current[4] !== next[4]) {\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(this.cornerRadius, minSegLength / 2);\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n var ac = currentDirection[1] === nextDirection[0] && nextDirection[0] === 1 || currentDirection[1] === nextDirection[0] && nextDirection[0] === 0 && currentDirection[0] !== nextDirection[1] || currentDirection[1] === nextDirection[0] && nextDirection[0] === -1,\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = sgnEqual && ac || !sgnEqual && !ac ? next[0] : current[2],\n cy = sgnEqual && ac || !sgnEqual && !ac ? current[3] : next[1];\n this._addSegment(StraightSegment, {\n x1: current[0],\n y1: current[1],\n x2: current[2],\n y2: current[3]\n });\n this._addSegment(ArcSegment, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n } else {\n this._addSegment(StraightSegment, {\n x1: current[0],\n y1: current[1],\n x2: current[2],\n y2: current[3]\n });\n }\n current = next;\n }\n if (next != null) {\n this._addSegment(StraightSegment, {\n x1: next[0],\n y1: next[1],\n x2: next[2],\n y2: next[3]\n });\n }\n }\n }, {\n key: \"_compute\",\n value: function _compute(paintInfo, params) {\n var _this2 = this;\n this.internalSegments.length = 0;\n this.lastx = null;\n this.lasty = null;\n this.lastOrientation = null;\n var commonStubCalculator = function commonStubCalculator(axis) {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function opposite(axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function x() {\n return pi.so[idx] === 1 && (pi.startStubX > pi.endStubX && pi.tx > pi.startStubX || pi.sx > pi.endStubX && pi.tx > pi.sx) || pi.so[idx] === -1 && (pi.startStubX < pi.endStubX && pi.tx < pi.startStubX || pi.sx < pi.endStubX && pi.tx < pi.sx);\n },\n \"y\": function y() {\n return pi.so[idx] === 1 && (pi.startStubY > pi.endStubY && pi.ty > pi.startStubY || pi.sy > pi.endStubY && pi.ty > pi.sy) || pi.so[idx] === -1 && (pi.startStubY < pi.endStubY && pi.ty < pi.startStubY || pi.sy < pi.endStubY && pi.ty < pi.sy);\n }\n };\n if (!_this2.alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n } else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n this.addASegment(stubs[0], stubs[1], paintInfo);\n var midx = paintInfo.startStubX + (paintInfo.endStubX - paintInfo.startStubX) * this.midpoint,\n midy = paintInfo.startStubY + (paintInfo.endStubY - paintInfo.startStubY) * this.midpoint;\n var orientations = {\n x: [0, 1],\n y: [1, 0]\n },\n lineCalculators = {\n perpendicular: function perpendicular(axis, ss, oss, es, oes) {\n var pi = paintInfo,\n sis = {\n x: [[[1, 2, 3, 4], null, [2, 1, 4, 3]], null, [[4, 3, 2, 1], null, [3, 4, 1, 2]]],\n y: [[[3, 2, 1, 4], null, [2, 3, 4, 1]], null, [[4, 1, 2, 3], null, [1, 4, 3, 2]]]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0],\n toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = pi.to[toIdx] === -1 && otherStubs[axis][1] < otherStubs[axis][0] || pi.to[toIdx] === 1 && otherStubs[axis][1] > otherStubs[axis][0],\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n if (pi.segment === segmentIndexes[3] || pi.segment === segmentIndexes[2] && otherFlipped) {\n return midLines[axis];\n } else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n } else if (pi.segment === segmentIndexes[2] && stub2 >= stub1 || pi.segment === segmentIndexes[1] && !otherFlipped) {\n return startToMidToEnd[axis];\n } else if (pi.segment === segmentIndexes[0] || pi.segment === segmentIndexes[1] && otherFlipped) {\n return startToEnd[axis];\n }\n },\n orthogonal: function orthogonal(axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n return {\n \"x\": [[extent, otherStartStub], [extent, otherEndStub], [endStub, otherEndStub]],\n \"y\": [[otherStartStub, extent], [otherEndStub, extent], [otherEndStub, endStub]]\n }[axis];\n },\n opposite: function opposite(axis, ss, oss, es, oes) {\n var pi = paintInfo,\n otherAxis = {\n \"x\": \"y\",\n \"y\": \"x\"\n }[axis],\n dim = {\n \"x\": \"h\",\n \"y\": \"w\"\n }[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + (1 - params.sourceEndpoint._anchor.computedPosition[otherAxis]) * params.sourceInfo[dim] + _this2.maxStub;\n return {\n \"x\": [[ss, _val], [es, _val]],\n \"y\": [[_val, ss], [_val, es]]\n }[axis];\n } else if (!comparator || pi.so[idx] === 1 && ss > es || pi.so[idx] === -1 && ss < es) {\n return {\n \"x\": [[ss, midy], [es, midy]],\n \"y\": [[midx, ss], [midx, es]]\n }[axis];\n } else if (pi.so[idx] === 1 && ss < es || pi.so[idx] === -1 && ss > es) {\n return {\n \"x\": [[midx, pi.sy], [midx, pi.ty]],\n \"y\": [[pi.sx, midy], [pi.tx, midy]]\n }[axis];\n }\n }\n };\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n this.addASegment(p[i][0], p[i][1], paintInfo);\n }\n }\n this.addASegment(stubs[2], stubs[3], paintInfo);\n this.addASegment(paintInfo.tx, paintInfo.ty, paintInfo);\n this.writeSegments(paintInfo);\n }\n }, {\n key: \"transformGeometry\",\n value: function transformGeometry(g, dx, dy) {\n return g;\n }\n }]);\n return FlowchartConnector;\n}(AbstractConnector);\n_defineProperty(FlowchartConnector, \"type\", \"Flowchart\");\n\nConnectors.register(FlowchartConnector.type, FlowchartConnector);\n\nEndpointFactory.registerHandler(DotEndpointHandler);\nEndpointFactory.registerHandler(RectangleEndpointHandler);\nEndpointFactory.registerHandler(BlankEndpointHandler);\nConnectors.register(StraightConnector.type, StraightConnector);\n\nfunction _randomEvent() {\n var x = Math.floor(Math.random() * 2000),\n y = Math.floor(Math.random() * 2000);\n return {\n clientX: x,\n clientY: y,\n screenX: x,\n screenY: y,\n pageX: x,\n pageY: y\n };\n}\nvar _distantPointEvent = {\n clientX: 50000,\n clientY: 50000,\n screenX: 50000,\n screenY: 50000,\n pageX: 50000,\n pageY: 50000\n};\nvar lut = [];\nfor (var i = 0; i < 256; i++) {\n lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n}\nvar VERY_SMALL_NUMBER = 0.00000000001;\nvar BrowserUITestSupport = function () {\n function BrowserUITestSupport(_jsPlumb, ok, equal) {\n _classCallCheck(this, BrowserUITestSupport);\n this._jsPlumb = _jsPlumb;\n this.ok = ok;\n this.equal = equal;\n _defineProperty(this, \"_divs\", []);\n _defineProperty(this, \"mottle\", void 0);\n this.mottle = new EventManager();\n }\n _createClass(BrowserUITestSupport, [{\n key: \"_t\",\n value: function _t(el, evt, x, y) {\n this.mottle.trigger(el, evt, {\n pageX: x,\n pageY: y,\n screenX: x,\n screenY: y,\n clientX: x,\n clientY: y\n });\n }\n }, {\n key: \"addDiv\",\n value: function addDiv(id, parent, className, x, y, w, h) {\n var d1 = document.createElement(\"div\");\n d1.style.position = \"absolute\";\n d1.innerHTML = id;\n if (parent) parent.appendChild(d1);else this._jsPlumb.getContainer().appendChild(d1);\n d1.setAttribute(\"id\", id);\n d1.style.left = (x != null ? x : Math.floor(Math.random() * 1000)) + \"px\";\n d1.style.top = (y != null ? y : Math.floor(Math.random() * 1000)) + \"px\";\n if (className) d1.className = className;\n if (w) d1.style.width = w + \"px\";\n if (h) d1.style.height = h + \"px\";\n this._divs.push(id);\n return d1;\n }\n }, {\n key: \"addDivs\",\n value: function addDivs(ids, parent) {\n for (var _i = 0; _i < ids.length; _i++) {\n this.addDiv(ids[_i], parent);\n }\n }\n }, {\n key: \"assertEndpointCount\",\n value: function assertEndpointCount(el, count) {\n var ep = this._jsPlumb.getEndpoints(el),\n epl = ep ? ep.length : 0;\n this.equal(epl, count, el.getAttribute(\"data-jtk-managed\") + \" has \" + count + (count > 1 || count == 0 ? \" endpoints\" : \" endpoint\"));\n }\n }, {\n key: \"_assertManagedEndpointCount\",\n value: function _assertManagedEndpointCount(el, count) {\n var id = this._jsPlumb.getId(el),\n _mel = this._jsPlumb._managedElements[id];\n this.equal(_mel.endpoints.length, count, id + \" has \" + count + \" endpoints in managed record\");\n }\n }, {\n key: \"_assertManagedConnectionCount\",\n value: function _assertManagedConnectionCount(el, count) {\n var id = this._jsPlumb.getId(el),\n _mel = this._jsPlumb._managedElements[id];\n this.equal(_mel.connections.length, count, id + \" has \" + count + \" connections in managed record\");\n }\n }, {\n key: \"_registerDiv\",\n value: function _registerDiv(div) {\n this._divs.push(div);\n }\n }, {\n key: \"makeDragStartEvt\",\n value: function makeDragStartEvt(el) {\n var e = this.makeEvent(el),\n c = this._jsPlumb.getContainer();\n e.clientX += c.offsetLeft;\n e.screenX += c.offsetLeft;\n e.pageX += c.offsetLeft;\n e.clientY += c.offsetTop;\n e.screenY += c.offsetTop;\n e.pageY += c.offsetTop;\n return e;\n }\n }, {\n key: \"getAttribute\",\n value: function getAttribute(el, att) {\n return el.getAttribute(att);\n }\n }, {\n key: \"dragNodeBy\",\n value: function dragNodeBy(el, x, y, events) {\n events = events || {};\n if (events.before) events.before();\n var downEvent = this.makeEvent(el);\n this._jsPlumb.trigger(el, EVENT_MOUSEDOWN, downEvent);\n if (events.beforeMouseMove) {\n events.beforeMouseMove();\n }\n this._t(document, EVENT_MOUSEMOVE, downEvent.pageX + x, downEvent.pageY + y);\n if (events.beforeMouseUp) {\n events.beforeMouseUp();\n }\n this.mottle.trigger(document, EVENT_MOUSEUP, null);\n if (events.after) events.after();\n }\n }, {\n key: \"dragNodeTo\",\n value: function dragNodeTo(el, x, y, events) {\n events = events || {};\n var size = this._jsPlumb.viewport.getPosition(this._jsPlumb.getId(el));\n if (events.before) events.before();\n var downEvent = this.makeEvent(el);\n this._jsPlumb.trigger(el, EVENT_MOUSEDOWN, downEvent);\n var cb = this._jsPlumb.getContainer().getBoundingClientRect();\n if (events.beforeMouseMove) {\n events.beforeMouseMove();\n }\n this._t(document, EVENT_MOUSEMOVE, cb.x + x + size.w / 2, cb.y + y + size.h / 2);\n if (events.beforeMouseUp) {\n events.beforeMouseUp();\n }\n this.mottle.trigger(document, EVENT_MOUSEUP, null);\n if (events.after) events.after();\n }\n }, {\n key: \"dragToGroup\",\n value: function dragToGroup(el, targetGroupId, events) {\n var targetGroup = this._jsPlumb.getGroup(targetGroupId);\n var tgo = this._jsPlumb.viewport.getPosition(targetGroup.elId),\n tx = tgo.x + tgo.w / 2,\n ty = tgo.y + tgo.h / 2;\n this.dragNodeTo(el, tx, ty, events);\n }\n }, {\n key: \"aSyncDragNodeBy\",\n value: function aSyncDragNodeBy(el, x, y, events) {\n var _this = this;\n events = events || {};\n if (events.before) {\n events.before();\n }\n var downEvent = this.makeEvent(el);\n this._jsPlumb.trigger(el, EVENT_MOUSEDOWN, downEvent);\n if (events.beforeMouseMove) {\n events.beforeMouseMove();\n }\n setTimeout(function () {\n _this._t(document, EVENT_MOUSEMOVE, downEvent.pageX + x, downEvent.pageY + y);\n if (events.beforeMouseUp) {\n events.beforeMouseUp();\n }\n setTimeout(function () {\n _this.mottle.trigger(document, EVENT_MOUSEUP, null);\n if (events.after) {\n events.after();\n }\n }, 45);\n }, 45);\n }\n }, {\n key: \"dragANodeAround\",\n value: function dragANodeAround(el, functionToAssertWhileDragging, assertMessage) {\n this._jsPlumb.trigger(el, EVENT_MOUSEDOWN, this.makeEvent(el));\n var steps = Math.random() * 50;\n for (var _i2 = 0; _i2 < steps; _i2++) {\n var evt = _randomEvent();\n el.style.left = evt.screenX + \"px\";\n el.style.top = evt.screenY + \"px\";\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, evt);\n }\n if (functionToAssertWhileDragging) {\n this.ok(functionToAssertWhileDragging(), assertMessage || \"while dragging assert\");\n }\n this._jsPlumb.trigger(document, EVENT_MOUSEUP, _distantPointEvent);\n }\n }, {\n key: \"dragConnection\",\n value: function dragConnection(d1, d2, mouseUpOnTarget, events) {\n var el1 = this.getCanvas(d1),\n el2 = this.getCanvas(d2);\n var e1 = this.makeEvent(el1),\n e2 = this.makeEvent(el2);\n events = events || {};\n var conns = this._jsPlumb.select().length;\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n if (events.beforeMouseMove) {\n events.beforeMouseMove();\n }\n this._jsPlumb.trigger(mouseUpOnTarget ? el2 : document, EVENT_MOUSEMOVE, e2);\n if (events.beforeMouseUp) {\n events.beforeMouseUp();\n }\n this._jsPlumb.trigger(mouseUpOnTarget ? el2 : document, EVENT_MOUSEUP, e2);\n return this._jsPlumb.select().get(conns);\n }\n }, {\n key: \"aSyncDragConnection\",\n value: function aSyncDragConnection(d1, d2, events) {\n var _this2 = this;\n events = events || {};\n var el1 = this.getCanvas(d1),\n el2 = this.getCanvas(d2);\n var e1 = this.makeEvent(el1),\n e2 = this.makeEvent(el2);\n var conns = this._jsPlumb.select().length;\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n setTimeout(function () {\n if (events.beforeMouseMove) {\n events.beforeMouseMove();\n }\n _this2._jsPlumb.trigger(document, EVENT_MOUSEMOVE, e2);\n setTimeout(function () {\n if (events.beforeMouseUp) {\n events.beforeMouseUp();\n }\n _this2._jsPlumb.trigger(el2, EVENT_MOUSEUP, e2);\n if (events.after) {\n events.after(_this2._jsPlumb.select().get(conns));\n }\n }, 5);\n }, 5);\n }\n }, {\n key: \"dragAndAbortConnection\",\n value: function dragAndAbortConnection(d1) {\n var el1 = this.getCanvas(d1);\n var e1 = this.makeEvent(el1);\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, _distantPointEvent);\n this._jsPlumb.trigger(document, EVENT_MOUSEUP, _distantPointEvent);\n }\n }, {\n key: \"detachConnection\",\n value: function detachConnection(e, events) {\n events = events || {};\n var el1 = this.getEndpointCanvas(e);\n var e1 = this.makeEvent(el1);\n events.before && events.before();\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n events.beforeMouseMove && events.beforeMouseMove();\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, _distantPointEvent);\n events.beforeMouseUp && events.beforeMouseUp();\n this._jsPlumb.trigger(document, EVENT_MOUSEUP, _distantPointEvent);\n events.after && events.after();\n }\n }, {\n key: \"detachAndReattachConnection\",\n value: function detachAndReattachConnection(e, events) {\n events = events || {};\n var el1 = this.getEndpointCanvas(e);\n var e1 = this.makeEvent(el1);\n events.before && events.before();\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n events.beforeMouseMove && events.beforeMouseMove();\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, _distantPointEvent);\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, e1);\n events.beforeMouseUp && events.beforeMouseUp();\n this._jsPlumb.trigger(document, EVENT_MOUSEUP, e1);\n events.after && events.after();\n }\n }, {\n key: \"detachConnectionByTarget\",\n value: function detachConnectionByTarget(c, events) {\n this.detachConnection(c.endpoints[1], events);\n }\n }, {\n key: \"relocateTarget\",\n value: function relocateTarget(conn, newEl, events) {\n this.relocate(conn, 1, newEl, events);\n }\n }, {\n key: \"relocate\",\n value: function relocate(conn, idx, newEl, events) {\n events = events || {};\n newEl = this.getCanvas(newEl);\n var el1 = this.getEndpointCanvas(conn.endpoints[idx]);\n var e1 = this.makeEvent(el1);\n var e2 = this.makeEvent(newEl);\n events.before && events.before();\n this._jsPlumb.trigger(el1, EVENT_MOUSEDOWN, e1);\n events.beforeMouseMove && events.beforeMouseMove();\n this._jsPlumb.trigger(document, EVENT_MOUSEMOVE, e2);\n events.beforeMouseUp && events.beforeMouseUp();\n this._jsPlumb.trigger(newEl, EVENT_MOUSEUP, e2);\n events.after && events.after();\n }\n }, {\n key: \"relocateSource\",\n value: function relocateSource(conn, newEl, events) {\n this.relocate(conn, 0, newEl, events);\n }\n }, {\n key: \"makeEvent\",\n value: function makeEvent(el) {\n var b = el.getBoundingClientRect();\n var l = b.x + b.width / 2,\n t = b.y + b.height / 2;\n return {\n clientX: l,\n clientY: t,\n screenX: l,\n screenY: t,\n pageX: l,\n pageY: t\n };\n }\n }, {\n key: \"getCanvas\",\n value: function getCanvas(epOrEl) {\n if (epOrEl.endpoint) {\n return this.getEndpointCanvas(epOrEl);\n } else {\n return epOrEl;\n }\n }\n }, {\n key: \"getEndpointCanvas\",\n value: function getEndpointCanvas(ep) {\n return ep.endpoint.canvas;\n }\n }, {\n key: \"getConnectionCanvas\",\n value: function getConnectionCanvas(c) {\n return c.connector.canvas;\n }\n }, {\n key: \"getEndpointCanvasPosition\",\n value: function getEndpointCanvasPosition(ep) {\n var c = this.getEndpointCanvas(ep);\n return {\n x: parseInt(c.style.left, 10),\n y: parseInt(c.style.top, 10),\n w: c.getAttribute(\"width\"),\n h: c.getAttribute(\"height\")\n };\n }\n }, {\n key: \"within\",\n value: function within(val, target, msg) {\n this.ok(Math.abs(val - target) < VERY_SMALL_NUMBER, msg + \"[expected: \" + target + \" got \" + val + \"] [diff:\" + Math.abs(val - target) + \"]\");\n }\n }, {\n key: \"assertManagedEndpointCount\",\n value: function assertManagedEndpointCount(el, count) {\n var id = this._jsPlumb.getId(el),\n _mel = this._jsPlumb._managedElements[id];\n this.equal(_mel.endpoints.length, count, id + \" has \" + count + \" endpoints in managed record\");\n }\n }, {\n key: \"assertManagedConnectionCount\",\n value: function assertManagedConnectionCount(el, count) {\n var id = this._jsPlumb.getId(el),\n _mel = this._jsPlumb._managedElements[id];\n this.equal(_mel.connections.length, count, id + \" has \" + count + \" connections in managed record\");\n }\n }, {\n key: \"fireEventOnEndpoint\",\n value: function fireEventOnEndpoint(ep) {\n var canvas = this.getEndpointCanvas(ep);\n for (var _i3 = 0; _i3 < (arguments.length <= 1 ? 0 : arguments.length - 1); _i3++) {\n this._jsPlumb.trigger(canvas, _i3 + 1 < 1 || arguments.length <= _i3 + 1 ? undefined : arguments[_i3 + 1]);\n }\n }\n }, {\n key: \"fireEventOnElement\",\n value: function fireEventOnElement(e) {\n for (var _i4 = 0; _i4 < (arguments.length <= 1 ? 0 : arguments.length - 1); _i4++) {\n this._jsPlumb.trigger(e, _i4 + 1 < 1 || arguments.length <= _i4 + 1 ? undefined : arguments[_i4 + 1]);\n }\n }\n }, {\n key: \"fireEventOnConnection\",\n value: function fireEventOnConnection(connection) {\n var canvas = this.getConnectionCanvas(connection);\n for (var _len = arguments.length, events = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n this.fireEventOnElement.apply(this, [canvas].concat(events));\n }\n }, {\n key: \"clickOnConnection\",\n value: function clickOnConnection(connection) {\n this.fireEventOnConnection(connection, EVENT_CLICK);\n }\n }, {\n key: \"dblClickOnConnection\",\n value: function dblClickOnConnection(connection) {\n this.fireEventOnConnection(connection, EVENT_DBL_CLICK);\n }\n }, {\n key: \"tapOnConnection\",\n value: function tapOnConnection(connection) {\n this.fireEventOnConnection(connection, EVENT_MOUSEDOWN);\n this.fireEventOnConnection(connection, EVENT_MOUSEUP);\n }\n }, {\n key: \"dblTapOnConnection\",\n value: function dblTapOnConnection(connection) {\n this.fireEventOnConnection(connection, EVENT_MOUSEDOWN);\n this.fireEventOnConnection(connection, EVENT_MOUSEUP);\n this.fireEventOnConnection(connection, EVENT_MOUSEDOWN);\n this.fireEventOnConnection(connection, EVENT_MOUSEUP);\n }\n }, {\n key: \"clickOnElement\",\n value: function clickOnElement(element, clickCount) {\n this._jsPlumb.trigger(element, EVENT_CLICK, null, null, clickCount == null ? 1 : clickCount);\n }\n }, {\n key: \"dblClickOnElement\",\n value: function dblClickOnElement(element) {\n this._jsPlumb.trigger(element, EVENT_DBL_CLICK);\n }\n }, {\n key: \"tapOnElement\",\n value: function tapOnElement(element) {\n this._jsPlumb.trigger(element, EVENT_MOUSEDOWN);\n this._jsPlumb.trigger(element, EVENT_MOUSEUP);\n }\n }, {\n key: \"dblTapOnElement\",\n value: function dblTapOnElement(element) {\n this._jsPlumb.trigger(element, EVENT_MOUSEDOWN);\n this._jsPlumb.trigger(element, EVENT_MOUSEUP);\n this._jsPlumb.trigger(element, EVENT_MOUSEDOWN);\n this._jsPlumb.trigger(element, EVENT_MOUSEUP);\n }\n }, {\n key: \"getOverlayCanvas\",\n value: function getOverlayCanvas(overlay) {\n return overlay.canvas || overlay.path;\n }\n }, {\n key: \"fireEventOnOverlay\",\n value: function fireEventOnOverlay(connection, overlayId, event) {\n var overlay = connection.getOverlay(overlayId);\n var canvas = this.getOverlayCanvas(overlay);\n this._jsPlumb.trigger(canvas, event);\n }\n }, {\n key: \"clickOnOverlay\",\n value: function clickOnOverlay(connection, overlayId) {\n this.fireEventOnOverlay(connection, overlayId, EVENT_CLICK);\n }\n }, {\n key: \"dblClickOnOverlay\",\n value: function dblClickOnOverlay(connection, overlayId) {\n this.fireEventOnOverlay(connection, overlayId, EVENT_DBL_CLICK);\n }\n }, {\n key: \"tapOnOverlay\",\n value: function tapOnOverlay(connection, overlayId) {\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEDOWN);\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEUP);\n }\n }, {\n key: \"dblTapOnOverlay\",\n value: function dblTapOnOverlay(connection, overlayId) {\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEDOWN);\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEUP);\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEDOWN);\n this.fireEventOnOverlay(connection, overlayId, EVENT_MOUSEUP);\n }\n }, {\n key: \"cleanup\",\n value: function cleanup() {\n var container = this._jsPlumb.getContainer();\n this._jsPlumb.destroy();\n for (var _i5 in this._divs) {\n var d = document.getElementById(this._divs[_i5]);\n d && d.parentNode.removeChild(d);\n }\n this._divs.length = 0;\n var connCount = this._jsPlumb.select().length,\n epCount = this._jsPlumb.selectEndpoints().length,\n epElCount = container.querySelectorAll(\".jtk-endpoint\").length,\n connElCount = container.querySelectorAll(\".jtk-connector\").length;\n for (var k in container.__ta) {\n for (var kk in container.__ta[k]) {\n throw \"Container event bindings not empty for key \" + k;\n }\n }\n if (connCount > 0) throw \"there are connections in the data model!\";\n if (epCount > 0) throw \"there are endpoints in the data model!\";\n if (epElCount > 0) {\n throw \"there are \" + epElCount + \" endpoints left in the dom!\";\n }\n if (connElCount > 0) {\n throw \"there are \" + connElCount + \" connections left in the dom!\";\n }\n }\n }, {\n key: \"makeContent\",\n value: function makeContent(s) {\n var d = document.createElement(\"div\");\n d.innerHTML = s;\n return d.firstChild;\n }\n }, {\n key: \"length\",\n value: function length(obj) {\n var c = 0;\n for (var _i6 in obj) {\n if (obj.hasOwnProperty(_i6)) {\n c++;\n }\n }\n return c;\n }\n }, {\n key: \"head\",\n value: function head(obj) {\n for (var _i7 in obj) {\n return obj[_i7];\n }\n }\n }, {\n key: \"uuid\",\n value: function uuid$1() {\n return uuid();\n }\n }]);\n return BrowserUITestSupport;\n}();\n\nfunction createTestSupportInstance(instance, ok, equal) {\n return new BrowserUITestSupport(instance, ok, equal);\n}\nfunction createTestSupportInstanceQUnit(instance) {\n return new BrowserUITestSupport(instance, QUnit.ok, QUnit.equal);\n}\n\nvar _jsPlumbInstanceIndex = 0;\nfunction getInstanceIndex() {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n}\nfunction newInstance(defaults) {\n return new BrowserJsPlumbInstance(getInstanceIndex(), defaults);\n}\nfunction ready(f) {\n var _do = function _do() {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof document.body !== \"undefined\" && document.body != null) {\n f();\n } else {\n setTimeout(_do, 9);\n }\n };\n _do();\n}\n\nexport { ABSOLUTE, ADD_CLASS_ACTION, ATTRIBUTE_CONTAINER, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_CONTENT, ATTRIBUTE_JTK_ENABLED, ATTRIBUTE_JTK_SCOPE, ATTRIBUTE_MANAGED, ATTRIBUTE_NOT_DRAGGABLE, ATTRIBUTE_SCOPE, ATTRIBUTE_SCOPE_PREFIX, ATTRIBUTE_TABINDEX, ATTR_SCROLLABLE_LIST, AbstractBezierConnector, AbstractConnector, AbstractSegment, AnchorLocations, ArcSegment, ArrowOverlay, BLOCK, BOTTOM, BezierConnector, BezierSegment, BlankEndpoint, BlankEndpointHandler, BrowserJsPlumbInstance, BrowserUITestSupport, CHECK_CONDITION, CHECK_DROP_ALLOWED, CLASS_CONNECTED, CLASS_CONNECTOR, CLASS_CONNECTOR_OUTLINE, CLASS_DELEGATED_DRAGGABLE, CLASS_DRAGGABLE, CLASS_DRAGGED, CLASS_DRAG_ACTIVE, CLASS_DRAG_CONTAINER, CLASS_DRAG_HOVER, CLASS_ENDPOINT, CLASS_ENDPOINT_ANCHOR_PREFIX, CLASS_ENDPOINT_CONNECTED, CLASS_ENDPOINT_DROP_ALLOWED, CLASS_ENDPOINT_DROP_FORBIDDEN, CLASS_ENDPOINT_FLOATING, CLASS_ENDPOINT_FULL, CLASS_GHOST_PROXY, CLASS_GROUP_COLLAPSED, CLASS_GROUP_EXPANDED, CLASS_OVERLAY, CONNECTION, Collicat, Component, Connection, ConnectionDragSelector, ConnectionSelection, Connectors, ContainmentType, CustomOverlay, DEFAULT, DEFAULT_KEY_ALLOW_NESTED_GROUPS, DEFAULT_KEY_ANCHOR, DEFAULT_KEY_ANCHORS, DEFAULT_KEY_CONNECTIONS_DETACHABLE, DEFAULT_KEY_CONNECTION_OVERLAYS, DEFAULT_KEY_CONNECTOR, DEFAULT_KEY_CONTAINER, DEFAULT_KEY_ENDPOINT, DEFAULT_KEY_ENDPOINTS, DEFAULT_KEY_ENDPOINT_HOVER_STYLE, DEFAULT_KEY_ENDPOINT_HOVER_STYLES, DEFAULT_KEY_ENDPOINT_OVERLAYS, DEFAULT_KEY_ENDPOINT_STYLE, DEFAULT_KEY_ENDPOINT_STYLES, DEFAULT_KEY_HOVER_CLASS, DEFAULT_KEY_HOVER_PAINT_STYLE, DEFAULT_KEY_LIST_STYLE, DEFAULT_KEY_MAX_CONNECTIONS, DEFAULT_KEY_PAINT_STYLE, DEFAULT_KEY_REATTACH_CONNECTIONS, DEFAULT_KEY_SCOPE, DEFAULT_LIST_OPTIONS, DiamondOverlay, DotEndpoint, DotEndpointHandler, Drag, DragManager, ELEMENT, ELEMENT_DIV, EMPTY_BOUNDS, ENDPOINT, ERROR_SOURCE_DOES_NOT_EXIST, ERROR_SOURCE_ENDPOINT_FULL, ERROR_TARGET_DOES_NOT_EXIST, ERROR_TARGET_ENDPOINT_FULL, EVENT_ANCHOR_CHANGED, EVENT_BEFORE_START, EVENT_CLICK, EVENT_CONNECTION, EVENT_CONNECTION_ABORT, EVENT_CONNECTION_CLICK, EVENT_CONNECTION_CONTEXTMENU, EVENT_CONNECTION_DBL_CLICK, EVENT_CONNECTION_DBL_TAP, EVENT_CONNECTION_DETACHED, EVENT_CONNECTION_DRAG, EVENT_CONNECTION_MOUSEDOWN, EVENT_CONNECTION_MOUSEOUT, EVENT_CONNECTION_MOUSEOVER, EVENT_CONNECTION_MOUSEUP, EVENT_CONNECTION_MOVED, EVENT_CONNECTION_TAP, EVENT_CONTAINER_CHANGE, EVENT_CONTEXTMENU, EVENT_DBL_CLICK, EVENT_DBL_TAP, EVENT_DRAG, EVENT_DRAG_MOVE, EVENT_DRAG_START, EVENT_DRAG_STOP, EVENT_DROP, EVENT_ELEMENT_CLICK, EVENT_ELEMENT_CONTEXTMENU, EVENT_ELEMENT_DBL_CLICK, EVENT_ELEMENT_DBL_TAP, EVENT_ELEMENT_MOUSE_DOWN, EVENT_ELEMENT_MOUSE_MOVE, EVENT_ELEMENT_MOUSE_OUT, EVENT_ELEMENT_MOUSE_OVER, EVENT_ELEMENT_MOUSE_UP, EVENT_ELEMENT_TAP, EVENT_ENDPOINT_CLICK, EVENT_ENDPOINT_DBL_CLICK, EVENT_ENDPOINT_DBL_TAP, EVENT_ENDPOINT_MOUSEDOWN, EVENT_ENDPOINT_MOUSEOUT, EVENT_ENDPOINT_MOUSEOVER, EVENT_ENDPOINT_MOUSEUP, EVENT_ENDPOINT_REPLACED, EVENT_ENDPOINT_TAP, EVENT_FOCUS, EVENT_GROUP_ADDED, EVENT_GROUP_COLLAPSE, EVENT_GROUP_EXPAND, EVENT_GROUP_MEMBER_ADDED, EVENT_GROUP_MEMBER_REMOVED, EVENT_GROUP_REMOVED, EVENT_INTERNAL_CONNECTION, EVENT_INTERNAL_CONNECTION_DETACHED, EVENT_INTERNAL_ENDPOINT_UNREGISTERED, EVENT_MANAGE_ELEMENT, EVENT_MAX_CONNECTIONS, EVENT_MOUSEDOWN, EVENT_MOUSEENTER, EVENT_MOUSEEXIT, EVENT_MOUSEMOVE, EVENT_MOUSEOUT, EVENT_MOUSEOVER, EVENT_MOUSEUP, EVENT_NESTED_GROUP_ADDED, EVENT_NESTED_GROUP_REMOVED, EVENT_OUT, EVENT_OVER, EVENT_REVERT, EVENT_SCROLL, EVENT_START, EVENT_STOP, EVENT_TAP, EVENT_TOUCHEND, EVENT_TOUCHMOVE, EVENT_TOUCHSTART, EVENT_UNMANAGE_ELEMENT, EVENT_ZOOM, ElementDragHandler, ElementTypes, Endpoint, EndpointFactory, EndpointRepresentation, EndpointSelection, EventGenerator, EventManager, FALSE$1 as FALSE, FIXED, FlowchartConnector, GroupManager, INTERCEPT_BEFORE_DETACH, INTERCEPT_BEFORE_DRAG, INTERCEPT_BEFORE_DROP, INTERCEPT_BEFORE_START_DETACH, IS_DETACH_ALLOWED, JsPlumbInstance, JsPlumbList, JsPlumbListManager, KEY_CONNECTION_OVERLAYS, LEFT, LabelOverlay, LightweightFloatingAnchor, LightweightRouter, NONE, OptimisticEventGenerator, Overlay, OverlayFactory, PROPERTY_POSITION, PerimeterAnchorShapes, PlainArrowOverlay, PositioningStrategies, REDROP_POLICY_ANY, REDROP_POLICY_ANY_SOURCE, REDROP_POLICY_ANY_SOURCE_OR_TARGET, REDROP_POLICY_ANY_TARGET, REDROP_POLICY_STRICT, REMOVE_CLASS_ACTION, RIGHT, RectangleEndpoint, RectangleEndpointHandler, SELECTOR_CONNECTOR, SELECTOR_ENDPOINT, SELECTOR_GROUP, SELECTOR_GROUP_CONTAINER, SELECTOR_MANAGED_ELEMENT, SELECTOR_OVERLAY, SELECTOR_SCROLLABLE_LIST, SOURCE, SOURCE_INDEX, STATIC, StateMachineConnector, StraightConnector, StraightSegment, SupportedEdge, TARGET, TARGET_INDEX, TOP, TRUE$1 as TRUE, TWO_PI, UIGroup, UINode, UNDEFINED, Viewport, WILDCARD, X_AXIS_FACES, Y_AXIS_FACES, _createPerimeterAnchor, _removeTypeCssHelper, _updateHoverStyle, add, addClass, addToDictionary, addToList, addWithFunction, arraysEqual, att, bezierLineIntersection, boundingBoxIntersection, boxIntersection, classList, clone, cls, compoundEvent, computeBezierLength, consume, convertToFullOverlaySpec, createElement, createElementNS, createFloatingAnchor, createTestSupportInstance, createTestSupportInstanceQUnit, dist, distanceFromCurve, each, encloses, extend, fastTrim, filterList, filterNull, findAllWithFunction, findParent, findWithFunction, fixPrecision, forEach, fromArray, functionChain, getAllWithFunction, getClass, getDefaultFace, getElementPosition, getElementSize, getElementType, getEventSource, getFromSetWithFunction, getPageLocation, getPositionOnElement, getTouch, getWithFunction, getsert, gradient, gradientAtPoint, gradientAtPointAlongPathFrom, groupDragConstrain, hasClass, insertSorted, intersects, isArrayLike, isArrowOverlay, isAssignableFrom, isBoolean, isContinuous, isCustomOverlay, isDate, isDiamondOverlay, isDynamic, isEdgeSupported, isEmpty, _isFloating as isFloating, isFullOverlaySpec, isFunction, isInsideParent, isLabelOverlay, isMouseDevice, isNamedFunction, isNodeList, isNumber, isObject, isPlainArrowOverlay, isPoint, isSVGElement, isString, isTouchDevice, lineIntersection, lineLength, lineRectangleIntersection, locationAlongCurveFrom, log, logEnabled, makeLightweightAnchorFromSpec, map, matchesSelector$1 as matchesSelector, merge, nearestPointOnCurve, newInstance, normal, objectsEqual, offsetRelativeToRoot, offsetSize, onDocumentReady, pageLocation, perpendicularLineTo, perpendicularToPathAt, pointAlongCurveFrom, pointAlongPath, pointOnCurve, pointOnLine, populate, quadrant, ready, registerEndpointRenderer, remove, removeClass, removeWithFunction, replace, rotateAnchorOrientation, rotatePoint, setForceMouseEvents, setForceTouchEvents, setToArray, sgn$1 as sgn, snapToGrid, subtract, suggest, svg, svgWidthHeightSize, svgXYPosition, theta, toggleClass, touchCount, touches, uuid, wrap };\n","import AnimEvent from \"anim-event\"\nimport { newInstance, FlowchartConnector, BlankEndpoint } from \"@jsplumb/browser-ui\"\n\nimport ApplicationController from '../application_controller'\n\nexport default class extends ApplicationController {\n static targets = [\n \"trigger\",\n \"dropzone\",\n \"parent\",\n \"branchInput\",\n \"removedInput\",\n ]\n\n static values = {\n endId: { type: String, default: \"end-connector\" },\n branch: String,\n line: String,\n persisted: { type: Boolean, default: false },\n child: String,\n root: Boolean,\n }\n\n initialize() {\n this.onWindowSizeChange = this.onWindowSizeChange.bind(this)\n this.instance = newInstance({\n container: document.getElementById('drawing_parent'),\n })\n\n window.dispatchEvent(\n new CustomEvent(\"step:connected\", {\n detail: {\n replaceWith: this.element.id,\n target: this.lineValue,\n branch: this.branchValue || \"branchless\",\n persisted: this.persistedValue,\n },\n })\n )\n\n window.dispatchEvent(\n new CustomEvent(\"step:becomes-parent\", {\n detail: {\n target: this.childValue,\n parentId: this.element.id,\n },\n })\n )\n }\n\n connect() {\n super.connect()\n if(!this.areWeTestingWithJest) {\n window.addEventListener(\"resize\", AnimEvent.add(this.onWindowSizeChange))\n }\n\n this.notifyOtherStepsToRepositionLines()\n }\n\n disconnect() {\n AnimEvent.remove(this.onWindowSizeChange)\n window.removeEventListener(\"resize\", this.onWindowSizeChange)\n\n window.dispatchEvent(\n new CustomEvent(\"step:removed\", {\n detail: {\n target: this.lineValue,\n branch: this.branchValue,\n child: this.childValue,\n parent: this.hasParentTarget ? this.parentTarget.value : \"\",\n kind: this.kind\n },\n bubbles: true,\n })\n )\n\n super.disconnect()\n }\n\n updateParentReference({ detail }) {\n if (detail.target === this.element.id) {\n this.parentTarget.value = this.lineValue = detail.parentId\n }\n }\n\n togglePane() {\n setTimeout(() => {\n window.dispatchEvent(\n new CustomEvent(\"step:toggle\", {\n bubbles: true,\n cancelable: true,\n detail: `${this.element.id}_pane`,\n })\n )\n\n this.triggerTarget.classList.toggle(\"halo--active\")\n }, 1)\n }\n\n showPane({ detail }) {\n if (detail === this.element.id) {\n setTimeout(() => {\n window.dispatchEvent(\n new CustomEvent(\"step:show\", {\n bubbles: true,\n cancelable: true,\n detail: `${this.element.id}_pane`,\n })\n )\n this.triggerTarget.classList.add(\"halo--active\")\n }, 1)\n }\n }\n\n hidePane(e) {\n if (\n e?.target !== this.triggerTarget &&\n document\n .getElementById(`${this.element.id}_pane`)\n ?.contains(e?.target) === false\n ) {\n window.dispatchEvent(\n new CustomEvent(\"step:hide\", {\n bubbles: true,\n cancelable: true,\n detail: `${this.element.id}_pane`,\n })\n )\n this.triggerTarget.classList.remove(\"halo--active\")\n }\n }\n\n notifyOtherStepsToRepositionLines() {\n window.dispatchEvent(new CustomEvent(\"step:reposition-line\"))\n }\n\n draw(\n from,\n to,\n { fromOptions, toOptions, lineOptions = this.flowchartConnectorLineOptions }\n ) {\n if(this.areWeTestingWithJest) return\n\n const start = this.instance.addEndpoint(from, fromOptions)\n\n const end = this.instance.addEndpoint(to, toOptions)\n\n return this.instance.connect({\n source: start,\n target: end,\n connector: lineOptions,\n })\n }\n\n blankEndpoint(anchor) {\n let object = {\n endpoint: BlankEndpoint.type,\n }\n\n if (anchor) {\n object.anchor = anchor\n }\n\n return object\n }\n\n get hasChildStep() {\n return this.stepTypes.includes(\n document.getElementById(this.childValue)?.dataset.controller\n )\n }\n\n get stepTypes() {\n return [\"step--condition\", \"step--wait\", \"step--message\", \"automation--question\", \"automation--property\"]\n }\n\n get flowchartConnectorLineOptions() {\n return {\n type: FlowchartConnector.type,\n options: {\n cornerRadius: 10,\n stub: [1, 0],\n midpoint: 0.1,\n alwaysRespectStubs: true,\n },\n }\n }\n\n getFirstAncestorOfType(queries, { startFrom } = {}) {\n if (!Array.isArray(queries)) {\n queries = [queries];\n }\n\n let currentElement = startFrom || this.element.parentElement;\n\n while (currentElement) {\n for (const query of queries) {\n if (currentElement.matches(query)) {\n return currentElement;\n }\n }\n currentElement = currentElement.parentElement;\n }\n\n return null;\n }\n\n lineValueChanged() {\n if(this.lineValue) {\n this.element.setAttribute('data-parent-id', this.lineValue)\n this.element.setAttribute('data-parent', this.lineValue)\n }\n }\n\n get inBranch() {\n return this.branchValue === \"in_branch\"\n }\n\n get insideEdgeBranch() {\n return this.element.closest(\"[data-controller='step--branch']\")\n ?.dataset[\"step-BranchEdgeValue\"] === \"true\"\n }\n\n get areWeTestingWithJest() {\n const isBrowser = typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs\n\n if(isBrowser) {\n return false\n } else {\n return process.env.JEST_WORKER_ID !== undefined;\n }\n }\n\n get isLastStep() {\n return (\n this.branchValue === \"branchless\" && !this.childValue && !this.rootValue\n )\n }\n}\n"],"names":["MSPF","KEEP_LOOP","tasks","requestAnim","callback","cancelAnim","requestID","lastFrameTime","step","called","next","task","event","indexOfTasks","listener","index","AnimEvent","iRemove","_typeof","obj","_classCallCheck","instance","Constructor","_defineProperties","target","props","i","descriptor","_createClass","protoProps","staticProps","_defineProperty","key","value","_inherits","subClass","superClass","_setPrototypeOf","_getPrototypeOf","o","p","_isNativeReflectConstruct","_assertThisInitialized","self","_possibleConstructorReturn","call","_createSuper","Derived","hasNativeReflectConstruct","Super","result","NewTarget","_superPropBase","object","property","_get","receiver","base","desc","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","_arrayLikeToArray","iter","_i","_arr","_n","_d","_s","_e","err","minLen","len","arr2","filterList","list","missingIsFalse","extend","o1","o2","keys","_o1","_o2","isNumber","n","isString","isBoolean","isObject","isDate","isFunction","clone","a","_b","c","j","merge","b","collations","overwrites","cMap","ar","oMap","functionChain","successValue","failValue","fns","populate","model","values","functionPrefix","doNotExpandFunctions","getValue","fromString","matches","val","_val","_one","d","r","s","forEach","f","findWithFunction","findAllWithFunction","predicate","getWithFunction","idx","getAllWithFunction","indexes","getFromSetWithFunction","out","t","setToArray","removeWithFunction","fromArray","remove","l","v","addToDictionary","map","insertAtStart","suggest","item","insertAtHead","lut$1","i$1","uuid","d0","d1","d2","d3","rotatePoint","point","center","rotation","radial","cr","sr","fastTrim","str","ws","each","fn","_i2","_i3","log","_len","args","_key","msg","sgn$1","x","wrap","wrappedFunction","newFunction","returnOnThisValue","getsert","valueGenerator","isAssignableFrom","cls","proto","insertSorted","array","comparator","sortDescending","flip","min","max","matchesSelector$1","el","selector","ctx","possibles","consume","e","doNotPreventDefault","findParent","container","matchOnElementAlso","getEventSource","_setClassName","cn","classList","cl","_getClassName","_classManip","classesToAdd","classesToRemove","cta","ctr","className","curClasses","_oneSet","add","classes","isNodeList","getClass","addClass","clazz","parts","part","hasClass","removeClass","toggleClass","_this","createElement","tag","style","atts","createElementNS","ns","offsetRelativeToRoot","box","body","docElem","scrollTop","scrollLeft","clientTop","clientLeft","top","left","offsetSize","svgWidthHeightSize","svgXYPosition","getElementPosition","pc","ec","z","getElementSize","ElementTypes","getElementType","isSVGElement","_len2","_key2","att","_len3","attName","_key3","an","SOURCE","TARGET","BLOCK","NONE","ABSOLUTE","FIXED","STATIC","ATTRIBUTE_GROUP","ATTRIBUTE_MANAGED","ATTRIBUTE_NOT_DRAGGABLE","ATTRIBUTE_TABINDEX","ATTRIBUTE_SCOPE","ATTRIBUTE_SCOPE_PREFIX","CHECK_CONDITION","CHECK_DROP_ALLOWED","CLASS_CONNECTOR","CLASS_CONNECTOR_OUTLINE","CLASS_CONNECTED","CLASS_ENDPOINT","CLASS_ENDPOINT_CONNECTED","CLASS_ENDPOINT_FULL","CLASS_ENDPOINT_FLOATING","CLASS_ENDPOINT_DROP_ALLOWED","CLASS_ENDPOINT_DROP_FORBIDDEN","CLASS_ENDPOINT_ANCHOR_PREFIX","CLASS_GROUP_COLLAPSED","CLASS_GROUP_EXPANDED","CLASS_OVERLAY","EVENT_ANCHOR_CHANGED","EVENT_CONNECTION","EVENT_INTERNAL_CONNECTION","EVENT_CONNECTION_DETACHED","EVENT_CONNECTION_MOVED","EVENT_CONTAINER_CHANGE","EVENT_ENDPOINT_REPLACED","EVENT_INTERNAL_ENDPOINT_UNREGISTERED","EVENT_INTERNAL_CONNECTION_DETACHED","EVENT_MANAGE_ELEMENT","EVENT_GROUP_ADDED","EVENT_GROUP_COLLAPSE","EVENT_GROUP_EXPAND","EVENT_GROUP_MEMBER_ADDED","EVENT_GROUP_MEMBER_REMOVED","EVENT_GROUP_REMOVED","EVENT_MAX_CONNECTIONS","EVENT_NESTED_GROUP_ADDED","EVENT_NESTED_GROUP_REMOVED","EVENT_UNMANAGE_ELEMENT","EVENT_ZOOM","IS_DETACH_ALLOWED","INTERCEPT_BEFORE_DRAG","INTERCEPT_BEFORE_DROP","INTERCEPT_BEFORE_DETACH","INTERCEPT_BEFORE_START_DETACH","SELECTOR_MANAGED_ELEMENT","ERROR_SOURCE_ENDPOINT_FULL","ERROR_TARGET_ENDPOINT_FULL","ERROR_SOURCE_DOES_NOT_EXIST","ERROR_TARGET_DOES_NOT_EXIST","KEY_CONNECTION_OVERLAYS","svgAttributeMap","STROKE_DASHARRAY","DASHSTYLE","FILL","STROKE","STROKE_WIDTH","LINE_WIDTH","ELEMENT_SVG","ELEMENT_PATH","_attr","node","attributes","_node","name","_pos","_applyStyles","parent","sep","styleToUse","_appendAtIndex","svg","path","compoundEvent","stem","subevent","ATTRIBUTE_CONTAINER","ATTRIBUTE_GROUP_CONTENT","ATTRIBUTE_JTK_ENABLED","ATTRIBUTE_JTK_SCOPE","ENDPOINT","ELEMENT","CONNECTION","ELEMENT_DIV","EVENT_CLICK","EVENT_CONTEXTMENU","EVENT_DBL_CLICK","EVENT_DBL_TAP","EVENT_FOCUS","EVENT_MOUSEDOWN","EVENT_MOUSEENTER","EVENT_MOUSEEXIT","EVENT_MOUSEMOVE","EVENT_MOUSEUP","EVENT_MOUSEOUT","EVENT_MOUSEOVER","EVENT_TAP","EVENT_TOUCHSTART","EVENT_TOUCHEND","EVENT_TOUCHMOVE","EVENT_DRAG_MOVE","EVENT_DRAG_STOP","EVENT_DRAG_START","EVENT_REVERT","EVENT_CONNECTION_ABORT","EVENT_CONNECTION_DRAG","EVENT_ELEMENT_CLICK","EVENT_ELEMENT_DBL_CLICK","EVENT_ELEMENT_DBL_TAP","EVENT_ELEMENT_MOUSE_OUT","EVENT_ELEMENT_MOUSE_OVER","EVENT_ELEMENT_MOUSE_MOVE","EVENT_ELEMENT_MOUSE_UP","EVENT_ELEMENT_MOUSE_DOWN","EVENT_ELEMENT_CONTEXTMENU","EVENT_ELEMENT_TAP","EVENT_ENDPOINT_CLICK","EVENT_ENDPOINT_DBL_CLICK","EVENT_ENDPOINT_MOUSEOUT","EVENT_ENDPOINT_MOUSEOVER","EVENT_ENDPOINT_MOUSEUP","EVENT_ENDPOINT_MOUSEDOWN","EVENT_CONNECTION_CLICK","EVENT_CONNECTION_DBL_CLICK","EVENT_CONNECTION_DBL_TAP","EVENT_CONNECTION_MOUSEOUT","EVENT_CONNECTION_MOUSEOVER","EVENT_CONNECTION_MOUSEUP","EVENT_CONNECTION_MOUSEDOWN","EVENT_CONNECTION_CONTEXTMENU","EVENT_CONNECTION_TAP","PROPERTY_POSITION","SELECTOR_CONNECTOR","SELECTOR_ENDPOINT","SELECTOR_GROUP","SELECTOR_GROUP_CONTAINER","SELECTOR_OVERLAY","PerimeterAnchorShapes","AnchorLocations","noSuchPoint","EMPTY_BOUNDS","AbstractSegment","params","y","x1","y1","x2","y2","w","h","UNDEFINED","DEFAULT","TRUE$1","FALSE$1","WILDCARD","_touchMap","_tapProfiles2","_touch","pageX","pageY","screenX","screenY","clientX","clientY","_touchList","_touchAndList","matchesSelector","_t","_pi","doCompute","guid","isTouchDevice","isMouseDevice","touchMap","PAGE","SCREEN","CLIENT","_genLoc","prefix","ts","touches","getTouch","pageLocation","screenLocation","clientLocation","touchCount","_bind","type","originalFn","options","_store","_unbind","_each$1","_el","_unstore","entries","g","NOT_SELECTOR_REGEX","_curryChildFilter","children","evt","nc","sel","m","_fn","done","pathInfo","registerExtraFunction","newFn","DefaultHandler","tfn","_tapProfiles","meeHelper","TapHandler","clickThreshold","dblClickThreshold","tt","down","finished","clearSingle","clearDouble","up","currentTarget","tc","eventId","pLoop","ds","MouseEnterExitHandler","activeElements","over","EventManager","jel","_c","_f","originalEvent","payload","detail","originalIsMouse","eventToBind","bindingAMouseEvent","pl","sl","_decorate","_evt","eventGenerators","touchList","init","ite","evtName","segmentMultipliers","inverseSegmentMultipliers","TWO_PI","gradient","p1","p2","normal","lineLength","quadrant","theta","intersects","r1","r2","a1","a2","b1","b2","pointOnLine","fromPoint","toPoint","distance","segmentMultiplier","perpendicularLineTo","length","theta2","snapToGrid","pos","grid","thresholdX","thresholdY","_dx","_dxl","_dxt","_dy","_dyl","_dyt","findDelegateElement","parentElement","childElement","currentParent","_assignId","isInsideParent","ss","leftEdge","rightEdge","topEdge","bottomEdge","findMatchingSelector","availableSelectors","draggableId","exclude","EVENT_START","EVENT_BEFORE_START","EVENT_DRAG","EVENT_DROP","EVENT_OVER","EVENT_OUT","EVENT_STOP","ATTRIBUTE_DRAGGABLE","DEFAULT_GRID_X","DEFAULT_GRID_Y","TRUE","FALSE","_classes","PositioningStrategies","positionerSetters","positionerGetters","sizeSetters","sizeGetters","_events","_devNull","_each","_inputFilter","collicat","Base","manager","scopes","getConstrainingRectangle","ContainmentType","Drag","_Base","_super","dragEl","currentScrollValues","dsx","dsy","dx","dy","_z","isNotRightClick","eventTarget","match","initial","_p2","dispatchResult","_pos2","_z2","desiredLoc","cPos","gp","retrieveOriginalElement","force","positions","dPos","_this$resolveGrid","tx","ty","_constrainRect","_size","rv","_exclude","_this2","atStart","DEFAULT_INPUTS","DEFAULT_INPUT_FILTER_SELECTOR","Collicat","_p","_p3","CLASS_DRAG_SELECTED","DragSelection","_this3","vp","off","currentPosition","originalPosition","_this4","op","constrainRect","_this5","orig","id","_this6","CLASS_DELEGATED_DRAGGABLE","CLASS_DRAGGABLE","CLASS_DRAG_CONTAINER","CLASS_GHOST_PROXY","CLASS_DRAG_ACTIVE","CLASS_DRAGGED","CLASS_DRAG_HOVER","DragManager","dragSelection","handler","dragOptions","handlerBeforeStart","padding","filterToAdd","filter","filters","currentFilters","handlerAndOptions","decodeDragGroupSpec","spec","isActiveDragGroupMember","dragGroup","details","getAncestors","ancestors","ElementDragHandler","_dragSelection","dropGroup","targetGroup","intersectingElement","currentGroup","_this$_currentDragGro","elementsToProcess","addElementToProcess","currentPos","offset","pp","wasInGroup","isInOriginalGroup","parentOffset","orphanedPosition","originalElement","groupLoc","drag","finalPos","elSize","ui","bounds","findIntersectingGroups","ancestorsOfIntersectingGroups","elBounds","k","group","parentGroupOffset","contentArea","caOffset","ancestorOffset","elOffset","cont","nd","descendants","dragGroupMemberSpec","isNotInAGroup","membersAreDroppable","isGhostOrNotConstrained","elementGroup","groupEl","groupElId","boundingRect","groupLocation","elId","dragStartReturn","els","member","active","_this7","elementIds","_this8","doNotTransferToAncestor","isDefinitelyNotInsideParent","endpointMap$1","endpointComputers","handlers","EndpointFactory","ep","epr","endpoint","anchorPoint","orientation","endpointStyle","eph","EndpointRepresentation","_opposites","_clockwiseOptions","_antiClockwiseOptions","FaceValues","TOP","LEFT","RIGHT","BOTTOM","X_AXIS_FACES","Y_AXIS_FACES","LightweightFloatingAnchor","element","elementId","opposites","clockwiseOptions","antiClockwiseOptions","getDefaultFace","_isFaceAvailable","face","_secondBest","edge","_lastChoice","isEdgeSupported","verifyFace","secondBest","lastChoice","_top","_bottom","_left","_right","_topLeft","_topRight","_bottomLeft","_bottomRight","_center","namedValues","namedContinuousValues","getNamedAnchor","_createPerimeterAnchor","_createAnchor","_a","_createContinuousAnchor","locations","createFloatingAnchor","PROPERTY_CURRENT_FACE","faces","ca","isPrimitiveAnchorSpec","sa","makeLightweightAnchorFromSpec","_spec","aSpec","circleGenerator","anchorCount","current","_path","segments","anchorsPerFace","_computeFace","fractionalLength","ox","oy","shapeGenerator","rectangleGenerator","diamondGenerator","triangleGenerator","rotate$1","points","amountInDegrees","_x","_y","anchorGenerators","shape","da","aa","ConnectionDragSelector","def","REDROP_POLICY_STRICT","enabled","REDROP_POLICY_ANY","REDROP_POLICY_ANY_SOURCE","REDROP_POLICY_ANY_TARGET","REDROP_POLICY_ANY_SOURCE_OR_TARGET","_makeFloatingEndpoint","referenceCanvas","sourceElement","sourceElementId","floatingAnchor","actualEndpoint","selectorFilter","_instance","negate","ok","SELECTOR_DRAG_ACTIVE_OR_HOVER","SOURCE_SELECTOR_UNIQUE_ENDPOINT_DATA","EndpointDragHandler","child","sourceEl","sourceSelector","elxy","getPositionOnElement","tempEndpointParams","scopeFromElement","extractedParameters","sourceCount","maybeAnchorSpec","_originalAnchor","anchorSpecToUse","existingUniqueEndpoint","ipco","ips","scope","data","anchorIdx","_continue","beforeDrag","canvasElement","endpointToFloat","aae","isSourceDrag","matchingEndpoints","candidate","sourceDef","sSel","targetZones","targetDefs","tSel","targetDef","maxConnections","dragSelector","targetZonesSelector","_this$_shouldStartDra","_this$_shouldStartDra2","beforeStartParams","floatingElementSize","newDropTarget","_cont","bb","existingConnection","matchingSelectors","suspendedEndpoint","dropEndpoint","_doContinue","jpc","targetDefinition","targetElement","eps","anchorsToUse","anchorFromDef","anchorFromPositionFinder","dropAnchor","tpayload","otherEndpointIdx","otherEndpoint","optionalData","suspendedElementId","_toDelete","info","conn","GroupDragHandler","_ElementDragHandler","newEl","HTMLElementOverlay","overlay","component","elementCreator","forceRefresh","EventGenerator","ret","_gone","eventOrListener","forEvent","_EventGenerator","OptimisticEventGenerator","convertToFullOverlaySpec","Overlay","_event","newLocation","_l","overlayMap","OverlayFactory","LabelOverlay","_Overlay","isLabelOverlay","_splitType","_mapType","typeId","CONNECTOR","MERGE_STRATEGY_OVERRIDE","CSS_CLASS","DEFAULT_TYPE_KEY","ANCHOR","ANCHORS","_internalLabelOverlayId","_internalLabelOverlayClass","TYPE_ITEM_OVERLAY","LOCATION_ATTRIBUTE","ACTION_ADD","ACTION_REMOVE","_applyTypes","td","defType","tid","overrides","_removeTypeCssHelper","_updateHoverStyle","mergedHoverStyle","_makeLabelOverlay","_params","mergedParams","_processOverlay","_newOverlay","oa","Component","oo","defaultOverlayKey","defaultOverlays","fo","connection","sourceId","targetId","_somethingAdded","keep","existing","xy","action","cascade","locationAttribute","loc","ids","overlayId","dontCleanup","overlays","lo","ll","_params2","typeParameters","Endpoint","_Component","anchorParamsToUse","ac","oldAnchorClass","anchorClass","anchor","currentAnchor","anchorParams","transientDetach","count","doNotChangeConnections","doNotNotifyOtherEndpoint","oIdx","typeMap","found","allowed","endpointArgs","fep","_ep","TYPE_ITEM_ANCHORS","TYPE_ITEM_CONNECTOR","prepareEndpoint","es","ehs","u","Connection","sourceAnchor","targetAnchor","_detachable","_reattach","initialPaintStyle","initialTimestamp","_types","isSource","detachable","reattach","_connector","_anchors","connectorSpec","connectorArgs","connector","co","doNotRepaint","doNotChangeListenerComponent","previous","previousClasses","endpointDef","ebe","_idx","_new","ensureSVGOverlayPath","paintSVGOverlay","extents","destroySVGOverlay","_o","SVGElementOverlay","SvgComponent","paintStyle","wh","attrs","paintSvgConnector","getConnectorElement","outlineStyle","outlineWidth","outlineStrokeWidth","cany","SvgEndpoint","canvas","AbstractConnector","internal","curLoc","location","absolute","inSegmentProportion","segment","swapX","swapY","so","to","noSourceOrientation","noTargetOrientation","oIndex","v1","v2","sx","sy","oProduct","segBounds","seg","DEFAULT_WIDTH","DEFAULT_LENGTH","ArrowOverlay","currentConnectionPaintStyle","absolutePosition","hxy","mid","txy","tail","cxy","fromLoc","_","__","stroke","fill","lineWidth","isArrowOverlay","DiamondOverlay","_ArrowOverlay","isDiamondOverlay","PlainArrowOverlay","isPlainArrowOverlay","CustomOverlay","isCustomOverlay","DEFAULT_KEY_ALLOW_NESTED_GROUPS","DEFAULT_KEY_PAINT_STYLE","DEFAULT_KEY_SCOPE","DotEndpoint","_EndpointRepresentati","DotEndpointHandler","lw","UINode","UIGroup","_UINode","endpointIndex","doNotFireEvent","dragArea","__el","manipulateDOM","doNotUpdateConnections","uiNode","orphanedPositions","newPosition","entry","elpos","cpos","cg","GroupManager","sourceGroup","originalGroup","newEndpoint","newElement","newGroup","connMap","otherConnMap","groupId","abort","deleteMembers","manipulateView","actualGroup","newPositions","_g","members","childMembers","c1","c2","processed","gs","gt","oneSet","otherEl","esg","esgcp","et","etg","etgcp","parentEl","collapsedConnectionIds","_collapseSet","conns","collapsedGroup","collapsedIds","_expandSet","_expandNestedGroup","ignoreCollapsedStateForNested","isGroup","droppingGroup","handleDroppedConnections","oidx","proxiedElement","possibleAncestor","childGroups","possibleDescendant","ancestor","SelectionBase","label","suspend","EndpointSelection","_SelectionBase","ConnectionSelection","Transaction","EMPTY_POSITION","rotate","_point","p3","p4","xmin","xmax","ymin","ymax","entryComparator","arrayEntry","reverseEntryComparator","_updateElementIndex","_clearElementIndex","Viewport","updatedElement","doNotRecalculateBounds","width","height","me","size","_edgeSortFunctions","_placeAnchorsOnLine","connections","horizontal","otherMultiplier","reverse","sizeInAxis","sizeInOtherAxis","other","xp","yp","rotated","_rightAndBottomSort","_leftAndTopSort","edgeSortFunctions","isContinuous","_isFloating","isDynamic","getCurrentLocation","LightweightRouter","cx","cy","targetRotation","ax","ay","acx","acy","twh","minIdx","minDist","timestamp","_getCurrentLocation","_getCurrentLocation2","currentLoc","_getCurrentLocation3","_getCurrentLocation4","currentIdx","_this$_anchorSelector","_this$_anchorSelector2","newIdx","newLoc","_anchorLists","cd","placeSomeAnchors","unsortedConnections","isHorizontal","sc","anchors","weAreSource","lists","order","aBoolean","otherElId","edgeId","connsToPaint","endpointsToPaint","endpointId","listToAddTo","listToRemoveFrom","rIdx","insertIdx","listsForElement","total","eId","sourceInfo","targetInfo","sE","tE","sAnchorP","tAnchorP","anchorLoc","offsetToUI","connectionsToPaint","anchorsToUpdate","orientationCache","anEndpoint","sourceContinuous","targetContinuous","oKey","sd","sourceRotation","otherAnchor","Orientation","candidates","midpoints","types","dim","_midpoints$types$i","axis","FACES","sf","tf","_axisIndices","axisIndices","ais","bis","ait","bit","sourceEdge","targetEdge","overrideLock","coords","l1","l2","connectorMap","Connectors","StraightSegment","_AbstractSegment","isFirstSegment","farAwayPoint","_x1","_y1","fractionInSegment","q","_x2","_y2","m2","m1","X","Y","StraightConnector","_AbstractConnector","paintInfo","_scopeMatch","e1","e2","s1","s2","prepareList","input","doNotGetIds","_resolveId","_r","addManagedEndpoint","managedElement","removeManagedEndpoint","addManagedConnection","targetEl","removeManagedConnection","targetCount","JsPlumbInstance","_instanceIndex","defaults","repaintEverything","conditionName","flat","sources","targets","results","_addOne","jj","_c2","noElementFilters","elements","_el2","either","source","sourceMatchExact","targetMatchExact","inner","ii","noMatchSource","noMatchTarget","stTypes","_st","cId","sid","oldEndpoint","evtParams","repaintAfterwards","curVal","doNotRepaintAfterwards","_wasSuspended","_sourceEndpoint","targetEndpoint","deletedCount","doFireEvent","argIsConnection","recalc","nl","internalId","_recalc","dataIdentifier","removeElement","_doNotRepaint","rotations","_oneLevel","gEntry","dontPrependDefault","bits","as","offsetsWereJustCalculated","_mergeRedraw","repaintEls","proxy","connectionsToDelete","referenceParams","endpoints","errorMessage","temp","recurse","_def","changeEndpoints","state","alsoChangeEndpoints","visible","endpointFunc","func","retVal","typeDescriptor","proxyEl","endpointGenerator","anchorGenerator","alreadyProxied","proxyEp","originalElementId","originalEndpoint","proxyElId","originalId","newId","_this$groupManager","_manipulateView","_doNotFireEvent","findConnectionToUseForDynamicAnchor","ap","_c3","oId","oInfo","overlayExtents","_extents","doNotRevalidate","relatedElement","color","endpointMap","registerEndpointRenderer","zoom","pst","psl","isSVGElementOverlay","setVisible","cleanup","getEndpointCanvas","getLabelElement","getCustomElement","groupDragConstrain","BrowserJsPlumbInstance","_JsPlumbInstance","updates","mappedEvent","constrainFunction","callbackOrSelector","_maybeAdjustScroll","offsetParent","prop","nodeList","draggable","_connClick","connectorElement","_connectorHover","_connectorMouseupdown","_epClick","endpointElement","_endpointHover","_endpointMouseupdown","_oClick","method","overlayElement","_overlayHover","_elementClick","_elementTap","_elementDblTap","_elementHover","currentContainer","newContainer","dragFilters","_this$elementDragHand","_len4","_key4","_this$elementDragHand2","_this$elementDragHand3","_len5","_key5","XY","_XY","hover","_el3","locToUse","minx","miny","lt","sourceEndpoint","renderer","doNotCascade","genericHoverClass","CIRCLE","register$2","RectangleEndpoint","RectangleEndpointHandler","RECT","register$1","BlankEndpoint","BlankEndpointHandler","BLANK_ATTRIBUTES","register","SupportedEdge","DEFAULT_ANCHOR_LOCATIONS","DEFAULT_LIST_OPTIONS","ATTR_SCROLLABLE_LIST","SELECTOR_SCROLLABLE_LIST","EVENT_SCROLL","JsPlumbListManager","scrollableLists","targetParent","sourceParent","dropList","dp","JsPlumbList","listId","parentList","_loop","VERY_SMALL_VALUE","gentleRound","ArcSegment","ea","laf","angle","arcSpan","dir","startAngle","startX","startY","AbstractBezierConnector","sp","tp","_w","_h","geometry","Vectors","maxRecursion","flatnessTolerance","distanceFromCurve","curve","_convertToBezier","degree","higherDegree","numSolutions","_findRoots","dist","newDist","_bezier","nearestPointOnCurve","cdTable","row","column","lb","ub","depth","right","left_count","right_count","left_t","right_t","_getCrossingCount","_isFlatEnough","_computeXIntercept","_i4","n_crossings","sign","old_sign","error","intercept_1","intercept_2","left_intercept","right_intercept","det","dInv","max_distance_above","max_distance_below","XLK","YLK","XNM","YNM","XMK","YMK","detInv","S","_j","_j2","_j3","_getLUT","steps","_computeLookup","EMPTY_POINT","computeBezierLength","isPoint","lut","_curveFunctionCache","_getCurveFunctions","f_term","l_term","c_term","t_term","one_minus_t_term","_termFunc","terms","_j4","pointOnCurve","cc","pointAlongPath","prev","tally","direction","cur","pointAlongCurveFrom","locationAlongCurveFrom","gradientAtPoint","bezierLineIntersection","coeffs","_computeCoefficients","_cubicRoots","intersections","t2","t3","_computeCoefficientsForAxis","A","B","C","Q","R","D","T","th","BezierSegment","_curve","BezierConnector","_AbstractBezierConnec","sourceAnchorPosition","targetAnchorPosition","soo","too","perpendicular","_CP","_CP2","_sx","_sy","_tx","_ty","_segment","_findControlPoint","midx","midy","proximityLimit","StateMachineConnector","_midx","_midy","cp1x","cp2x","cp1y","cp2y","sgn","segmentDirections","segLength","_cloneArray","FlowchartConnector","lx","ly","currentDirection","nextDirection","minSegLength","radiusToUse","sgny","sgnx","sgnEqual","commonStubCalculator","stubCalculators","pi","areInProximity","stubs","oss","oes","orientations","lineCalculators","sis","midLines","linesToEnd","startToEnd","startToMidToEnd","otherStubs","soIdx","toIdx","_so","_to","otherFlipped","stub1","stub2","segmentIndexes","startStub","otherStartStub","endStub","otherEndStub","extent","otherAxis","_randomEvent","_distantPointEvent","VERY_SMALL_NUMBER","BrowserUITestSupport","_jsPlumb","equal","epl","_mel","div","events","downEvent","cb","targetGroupId","tgo","functionToAssertWhileDragging","assertMessage","mouseUpOnTarget","el1","el2","epOrEl","clickCount","_i5","connCount","epCount","epElCount","connElCount","kk","_i6","_i7","_jsPlumbInstanceIndex","getInstanceIndex","newInstance","LineController","ApplicationController","from","fromOptions","toOptions","lineOptions","start","end","queries","startFrom","currentElement","query","define_process_env_default","__publicField"],"mappings":"6NAWA,IAAIA,GAAO,IAAO,GAElBC,GAAY,IASZC,GAAQ,CAAE,EAENC,GAAc,OAAO,uBAAyB,OAAO,0BAA4B,OAAO,6BAA+B,OAAO,yBAA2B,SAAUC,EAAU,CAC/K,OAAO,WAAWA,EAAUJ,EAAI,CAClC,EACIK,GAAa,OAAO,sBAAwB,OAAO,yBAA2B,OAAO,4BAA8B,OAAO,wBAA0B,SAAUC,EAAW,CAC3K,OAAO,aAAaA,CAAS,CAC/B,EAEIC,GAAgB,KAAK,IAAK,EAC1BD,GAEJ,SAASE,IAAO,CACd,IAAIC,EAAQC,EAERJ,KACFD,GAAW,KAAK,OAAQC,EAAS,EACjCA,GAAY,MAGdJ,GAAM,QAAQ,SAAUS,EAAM,CAC5B,IAAIC,GAEAA,EAAQD,EAAK,SACfA,EAAK,MAAQ,KAEbA,EAAK,SAASC,CAAK,EACnBH,EAAS,GAEf,CAAG,EAEGA,GACFF,GAAgB,KAAK,IAAK,EAC1BG,EAAO,IACE,KAAK,MAAQH,GAAgBN,KAEtCS,EAAO,IAGLA,IACFJ,GAAYH,GAAY,KAAK,OAAQK,EAAI,EAE7C,CAEA,SAASK,GAAaC,EAAU,CAC9B,IAAIC,EAAQ,GACZ,OAAAb,GAAM,KAAK,SAAUS,EAAM,EAAG,CAC5B,OAAIA,EAAK,WAAaG,GAC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