diff --git a/docs/scripts/bundle.js b/docs/scripts/bundle.js index e2d7b6f..56804d8 100644 --- a/docs/scripts/bundle.js +++ b/docs/scripts/bundle.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={150:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// NAMESPACE OBJECT: ./src/index.ts\nvar src_namespaceObject = {};\n__webpack_require__.r(src_namespaceObject);\n__webpack_require__.d(src_namespaceObject, {\n Axis: () => (Axis),\n IsometricCanvas: () => (IsometricCanvas),\n IsometricCircle: () => (IsometricCircle),\n IsometricGroup: () => (IsometricGroup),\n IsometricPath: () => (IsometricPath),\n IsometricRectangle: () => (IsometricRectangle),\n IsometricText: () => (IsometricText),\n LineCap: () => (LineCap),\n LineJoin: () => (LineJoin),\n PlaneView: () => (PlaneView)\n});\n\n// EXTERNAL MODULE: ./node_modules/.pnpm/google-code-prettify@1.0.5/node_modules/google-code-prettify/bin/run_prettify.min.js\nvar run_prettify_min = __webpack_require__(966);\n;// CONCATENATED MODULE: ./src/@constants/index.ts\nvar SVG_NAMESPACE = \'http://www.w3.org/2000/svg\';\nvar SVG_ELEMENTS;\n(function (SVG_ELEMENTS) {\n SVG_ELEMENTS["svg"] = "svg";\n SVG_ELEMENTS["group"] = "g";\n SVG_ELEMENTS["path"] = "path";\n SVG_ELEMENTS["rect"] = "rect";\n SVG_ELEMENTS["text"] = "text";\n SVG_ELEMENTS["tspan"] = "tspan";\n SVG_ELEMENTS["pattern"] = "pattern";\n SVG_ELEMENTS["image"] = "image";\n SVG_ELEMENTS["animate"] = "animate";\n SVG_ELEMENTS["animateTransform"] = "animateTransform";\n})(SVG_ELEMENTS || (SVG_ELEMENTS = {}));\nvar SVG_PROPERTIES;\n(function (SVG_PROPERTIES) {\n SVG_PROPERTIES["viewBox"] = "viewBox";\n})(SVG_PROPERTIES || (SVG_PROPERTIES = {}));\nvar DECIMALS = 6;\nvar SQRT3 = +(Math.sqrt(3).toFixed(DECIMALS));\nvar HSQRT3 = +((Math.sqrt(3) / 2).toFixed(DECIMALS));\nvar DEFAULT_WIDTH = 640;\nvar DEFAULT_HEIGHT = 480;\nvar N = \'(-?\\\\d+(?:\\\\.\\\\d+)?|-?\\\\.\\\\d+)\';\nvar S = \'\\\\s*\';\nvar SS = \'\\\\s+\';\nvar POINT = "".concat(N).concat(SS).concat(N).concat(SS).concat(N);\nvar CURVE = "".concat(POINT).concat(SS).concat(POINT);\nvar COMMANDS_REGEXP = new RegExp("(?:(M|L)".concat(S).concat(POINT).concat(S, "|(C)").concat(S).concat(CURVE, ")").concat(S), \'g\');\nvar SCALE = Math.sqrt(3 / 2);\nvar ROT_60 = Math.PI / 3;\nvar ROT_45 = Math.PI / 4;\nvar ROT_CMA = Math.atan(Math.SQRT2);\nvar Colors;\n(function (Colors) {\n Colors["white"] = "white";\n Colors["black"] = "black";\n})(Colors || (Colors = {}));\nvar LineCap;\n(function (LineCap) {\n LineCap["butt"] = "butt";\n LineCap["square"] = "square";\n LineCap["round"] = "round";\n})(LineCap || (LineCap = {}));\nvar LineJoin;\n(function (LineJoin) {\n LineJoin["miter"] = "miter";\n LineJoin["round"] = "round";\n LineJoin["bevel"] = "bevel";\n})(LineJoin || (LineJoin = {}));\nvar Command;\n(function (Command) {\n Command["move"] = "move";\n Command["line"] = "line";\n Command["curve"] = "curve";\n})(Command || (Command = {}));\nvar PlaneView;\n(function (PlaneView) {\n PlaneView["FRONT"] = "FRONT";\n PlaneView["SIDE"] = "SIDE";\n PlaneView["TOP"] = "TOP";\n})(PlaneView || (PlaneView = {}));\nvar Axis;\n(function (Axis) {\n Axis["RIGHT"] = "RIGHT";\n Axis["LEFT"] = "LEFT";\n Axis["TOP"] = "TOP";\n})(Axis || (Axis = {}));\nvar Typeof;\n(function (Typeof) {\n Typeof["UNDEFINED"] = "undefined";\n Typeof["NUMBER"] = "number";\n})(Typeof || (Typeof = {}));\nvar EVENTS;\n(function (EVENTS) {\n EVENTS["MOUSE_MOVE"] = "mousemove";\n EVENTS["MOUSE_DOWN"] = "mousedown";\n EVENTS["MOUSE_UP"] = "mouseup";\n EVENTS["TOUCH_START"] = "touchstart";\n EVENTS["TOUCH_MOVE"] = "touchmove";\n EVENTS["TOUCH_END"] = "touchend";\n})(EVENTS || (EVENTS = {}));\nvar ORIGIN;\n(function (ORIGIN) {\n ORIGIN["CENTER"] = "center";\n ORIGIN["LEFT"] = "left";\n ORIGIN["RIGHT"] = "right";\n ORIGIN["TOP"] = "top";\n ORIGIN["BOTTOM"] = "bottom";\n})(ORIGIN || (ORIGIN = {}));\n\n;// CONCATENATED MODULE: ./src/@utils/math.ts\n\nvar round = function (n, d) {\n var exp = Math.pow(10, d);\n return Math.round(n * exp) / exp;\n};\nvar radian = function (a) { return a * Math.PI / 180; };\nvar sincos = function (r) { return ({\n sin: round(Math.sin(r), DECIMALS),\n cos: round(Math.cos(r), DECIMALS)\n}); };\nvar getPointsDiff = function (pointA, pointB) { return ({\n x: pointA.x - pointB.x,\n y: pointA.y - pointB.y\n}); };\nvar getPointsDistance = function (pointA, pointB) {\n var diff = getPointsDiff(pointA, pointB);\n return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));\n};\nvar translatePoint = function (point, angle, distance) { return ({\n x: point.x + Math.cos(angle) * distance,\n y: point.y + Math.sin(angle) * distance\n}); };\nvar rotate = function (point, center, angle) {\n var diff = getPointsDiff(point, center);\n var x = diff.x * Math.cos(angle) - diff.y * Math.sin(angle);\n var y = diff.x * Math.sin(angle) + diff.y * Math.cos(angle);\n return {\n x: center.x + x,\n y: center.y + y\n };\n};\nvar getPointsAngle = function (pointA, pointB) {\n var diff = getPointsDiff(pointB, pointA);\n return Math.atan2(diff.y, diff.x);\n};\nvar getOrientation = function (p1, p2, p3) {\n var value = (p2.y - p1.y) * (p3.x - p2.x) - (p2.x - p1.x) * (p3.y - p2.y);\n return value >= 0 ? 0 : 1;\n};\nvar getPointFromIsometricPoint = function (centerX, centerY, point, scale) {\n return {\n x: round(centerX + (point.r - point.l) * scale * HSQRT3, DECIMALS),\n y: round(centerY + ((point.r + point.l) / 2 - point.t) * scale, DECIMALS)\n };\n};\nvar getTopPlanePointFromCoordinates = function (x, y) {\n var XHSQRT3 = x / HSQRT3;\n var right = (y * 2 + XHSQRT3) / 2;\n var left = right - XHSQRT3;\n return {\n right: right,\n left: left\n };\n};\nvar getFrontPlanePointFromCoordinates = function (x, y) {\n var left = -x / HSQRT3;\n var top = left / 2 - y;\n return {\n left: left,\n top: top\n };\n};\nvar getSidePlanePointFromCoordinates = function (x, y) {\n var right = x / HSQRT3;\n var top = right / 2 - y;\n return {\n right: right,\n top: top\n };\n};\nvar getEllipsisSpecs = function (pointA, pointB, control) {\n var diff = getPointsDiff(pointB, pointA);\n var center = { x: pointA.x + diff.x / 2, y: pointA.y + diff.y / 2 };\n var P = rotate(pointB, center, Math.PI / 2);\n var D = { x: P.x + (control.x - P.x) / 2, y: P.y + (control.y - P.y) / 2 };\n var radius = getPointsDistance(D, center);\n var U = translatePoint(D, getPointsAngle(D, P), radius);\n var V = translatePoint(D, getPointsAngle(D, control), radius);\n return [\n round(getPointsDistance(control, U), DECIMALS),\n round(getPointsDistance(control, V), DECIMALS),\n round(getPointsAngle(center, V) * 180 / Math.PI, DECIMALS)\n ];\n};\nvar randomId = function () { return Math.random().toString(16).slice(2); };\nvar uuid = function () { return Array.from(Array(3)).map(function () { return randomId(); }).join(\'-\'); };\n\n;// CONCATENATED MODULE: ./src/@utils/matrix.ts\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\nvar multiplyMatrix = function (m1, m2) { return (m1.map(function (row, i) { return (m2[0].map(function (_, j) {\n return row.reduce(function (acc, _, n) {\n return acc + m1[i][n] * m2[n][j];\n }, 0);\n})); })); };\nvar multiplyMatrices = function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n var matrix = m[0];\n for (var i = 1; i < m.length; i++) {\n matrix = multiplyMatrix(matrix, m[i]);\n }\n return matrix;\n};\nvar rotateX = function (r) {\n var sc = sincos(r);\n return [\n [1, 0, 0],\n [0, sc.cos, -sc.sin],\n [0, sc.sin, sc.cos]\n ];\n};\nvar rotateY = function (r) {\n var sc = sincos(r);\n return [\n [sc.cos, 0, sc.sin],\n [0, 1, 0],\n [-sc.sin, 0, sc.cos]\n ];\n};\nvar rotateZ = function (r) {\n var sc = sincos(r);\n return [\n [sc.cos, -sc.sin, 0],\n [sc.sin, sc.cos, 0],\n [0, 0, 1]\n ];\n};\nvar topMatrix = multiplyMatrices(rotateX(ROT_CMA), rotateZ(-ROT_45));\nvar frontMatrix = multiplyMatrices(rotateZ(-ROT_60), rotateX(ROT_CMA), rotateZ(ROT_45));\nvar sideMatrix = multiplyMatrices(rotateZ(ROT_60), rotateX(ROT_CMA), rotateZ(-ROT_45));\nvar rotationToRotationMatrix = function (view, rotation) {\n var value = radian(rotation.value);\n switch (view) {\n case PlaneView.TOP: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateZ(value);\n case Axis.LEFT:\n return rotateX(-value);\n case Axis.RIGHT:\n return rotateY(value);\n default:\n return null;\n }\n }\n case PlaneView.FRONT: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateY(value);\n case Axis.LEFT:\n return rotateX(value);\n case Axis.RIGHT:\n return rotateZ(value);\n default:\n return null;\n }\n }\n case PlaneView.SIDE: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateY(value);\n case Axis.LEFT:\n return rotateZ(value);\n case Axis.RIGHT:\n return rotateX(-value);\n default:\n return null;\n }\n }\n default:\n return null;\n }\n};\nvar getViewMatrix = function (planeView, rotation) {\n var rotationMatrices = [];\n var rotationMatrix = rotation\n ? rotationToRotationMatrix(planeView, rotation)\n : null;\n if (rotationMatrix)\n rotationMatrices.push(rotationMatrix);\n switch (planeView) {\n case PlaneView.TOP: {\n return multiplyMatrices.apply(void 0, __spreadArray([topMatrix], rotationMatrices, false));\n }\n case PlaneView.FRONT: {\n return multiplyMatrices.apply(void 0, __spreadArray([frontMatrix], rotationMatrices, false));\n }\n case PlaneView.SIDE: {\n return multiplyMatrices.apply(void 0, __spreadArray([sideMatrix], rotationMatrices, false));\n }\n }\n return null;\n};\n\n;// CONCATENATED MODULE: ./src/@utils/svg.ts\nvar svg_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\nvar addSVGProperties = function (svg, props) {\n Object.keys(props).forEach(function (prop) {\n svg.setAttributeNS(null, prop, props[prop]);\n });\n};\nvar getCommandsWithStart = function (commands) {\n return commands.length === 0 || commands[0].command === Command.move\n ? svg_spreadArray([], commands, true) : svg_spreadArray([\n {\n command: Command.move,\n point: { r: 0, l: 0, t: 0 }\n }\n ], commands, true);\n};\nvar getSVGPath = function (commands, centerX, centerY, scale, autoclose) {\n var drawCommands = getCommandsWithStart(commands);\n var svgPaths = drawCommands.map(function (c, index) {\n var point = getPointFromIsometricPoint(centerX, centerY, c.point, scale);\n switch (c.command) {\n case Command.move:\n return "M".concat(point.x, " ").concat(point.y);\n case Command.line:\n return "L".concat(point.x, " ").concat(point.y);\n case Command.curve: {\n var start = getPointFromIsometricPoint(centerX, centerY, commands[index - 1].point, scale);\n var control = getPointFromIsometricPoint(centerX, centerY, c.control, scale);\n var ellipsisSpecs = getEllipsisSpecs(start, point, control);\n var sweepFlag = getOrientation(start, control, point);\n return "A ".concat(ellipsisSpecs[0], " ").concat(ellipsisSpecs[1], " ").concat(ellipsisSpecs[2], " 0 ").concat(sweepFlag, " ").concat(point.x, " ").concat(point.y);\n }\n }\n });\n if (svgPaths.length) {\n var pathEnd = autoclose ? \'z\' : \'\';\n return "".concat(svgPaths.join(\' \').trim()).concat(pathEnd);\n }\n return \'\';\n};\nvar parseDrawCommands = function (commands) {\n var commandsArray = [];\n var array;\n while ((array = COMMANDS_REGEXP.exec(commands)) !== null) {\n var command = array[5] || array[1];\n switch (command) {\n case \'M\':\n commandsArray.push({\n command: Command.move,\n point: { r: +array[2], l: +array[3], t: +array[4] }\n });\n break;\n case \'L\':\n commandsArray.push({\n command: Command.line,\n point: { r: +array[2], l: +array[3], t: +array[4] }\n });\n break;\n case \'C\':\n commandsArray.push({\n command: Command.curve,\n control: { r: +array[6], l: +array[7], t: +array[8] },\n point: { r: +array[9], l: +array[10], t: +array[11] }\n });\n }\n }\n return commandsArray;\n};\nvar translateCommandPoints = function (commands, right, left, top) {\n commands.forEach(function (command) {\n command.point.r += right;\n command.point.l += left;\n command.point.t += top;\n if (command.control) {\n command.control.r += right;\n command.control.l += left;\n command.control.t += top;\n }\n });\n};\nvar getTextureCorner = function (commands, centerX, centerY, scale) {\n var corner = {\n x: Number.MAX_SAFE_INTEGER,\n y: Number.MAX_SAFE_INTEGER\n };\n getCommandsWithStart(commands)\n .forEach(function (c) {\n var point = getPointFromIsometricPoint(centerX, centerY, c.point, scale);\n if (point.x < corner.x ||\n (point.x === corner.x &&\n point.y < corner.y)) {\n corner.x = point.x;\n corner.y = point.y;\n }\n });\n return corner;\n};\nvar isSVGProperty = function (property) {\n return [\n \'fillColor\',\n \'fillOpacity\',\n \'strokeColor\',\n \'strokeOpacity\',\n \'strokeWidth\'\n ].includes(property);\n};\nvar getSVGProperty = function (property) {\n return {\n fillColor: \'fill\',\n fillOpacity: \'fill-opacity\',\n strokeColor: \'stroke\',\n strokeOpacity: \'stroke-opacity\',\n strokeWidth: \'stroke-width\'\n }[property];\n};\nfunction addEventListenerToElement(element, listeners, event, callback, useCapture) {\n var listener = {\n fn: callback,\n fnBind: callback.bind(this)\n };\n listeners.push(listener);\n element.addEventListener(event, listener.fnBind, useCapture);\n}\nfunction removeEventListenerFromElement(element, listeners, event, callback, useCapture) {\n var listener;\n listeners.find(function (ln, index) {\n if (ln.fn === callback) {\n listener = listeners.splice(index, 1)[0];\n return true;\n }\n });\n if (listener) {\n element.removeEventListener(event, listener.fnBind, useCapture);\n }\n}\nvar getPatternTransform = function (corner, planeView, scale, rotation) {\n var matrix = getViewMatrix(planeView, rotation);\n var transform = "translate(".concat(corner.x, " ").concat(corner.y, ")");\n if (matrix) {\n var m1 = round(matrix[0][0], DECIMALS);\n var m2 = round(matrix[1][0], DECIMALS);\n var m3 = round(matrix[0][1], DECIMALS);\n var m4 = round(matrix[1][1], DECIMALS);\n transform += " matrix(".concat(m1, ",").concat(m2, ",").concat(m3, ",").concat(m4, ",0,0)");\n transform += " scale(".concat(round(SCALE * (scale || 1), DECIMALS), ")");\n }\n else if (scale) {\n transform += " scale(".concat(round(scale, DECIMALS), ")");\n }\n return transform;\n};\nvar elementHasSVGParent = function (element) {\n if (element.parentNode) {\n if (element.parentNode.constructor.name === \'SVGSVGElement\') {\n return true;\n }\n return elementHasSVGParent(element.parentNode);\n }\n return false;\n};\n\n;// CONCATENATED MODULE: ./src/@store/index.ts\nvar Store = (function () {\n function Store(width, height, scale) {\n this.sizes = {\n centerX: width / 2,\n centerY: height / 2,\n height: height,\n width: width,\n scale: scale\n };\n }\n Object.defineProperty(Store.prototype, "width", {\n get: function () {\n return this.sizes.width;\n },\n set: function (value) {\n this.sizes.width = value;\n this.sizes.centerX = value / 2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "height", {\n get: function () {\n return this.sizes.height;\n },\n set: function (value) {\n this.sizes.height = value;\n this.sizes.centerY = value / 2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "scale", {\n get: function () {\n return this.sizes.scale;\n },\n set: function (value) {\n this.sizes.scale = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "centerX", {\n get: function () {\n return this.sizes.centerX;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "centerY", {\n get: function () {\n return this.sizes.centerY;\n },\n enumerable: false,\n configurable: true\n });\n return Store;\n}());\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricStore/IsometricStore.ts\nvar IsometricStore = (function () {\n function IsometricStore() {\n }\n Object.defineProperty(IsometricStore.prototype, "data", {\n get: function () {\n return this.dataStore;\n },\n set: function (store) {\n this.dataStore = store;\n },\n enumerable: false,\n configurable: true\n });\n return IsometricStore;\n}());\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricStore/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricElementAbstract/IsometricElementAbstract.ts\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricElementAbstract = (function (_super) {\n __extends(IsometricElementAbstract, _super);\n function IsometricElementAbstract(svgElement) {\n var _this = _super.call(this) || this;\n _this.listeners = [];\n _this.element = document.createElementNS(SVG_NAMESPACE, svgElement);\n return _this;\n }\n IsometricElementAbstract.prototype.getElement = function () {\n return this.element;\n };\n IsometricElementAbstract.prototype.addEventListener = function (event, callback, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n addEventListenerToElement.call(this, this.element, this.listeners, event, callback, useCapture);\n return this;\n };\n IsometricElementAbstract.prototype.removeEventListener = function (event, callback, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n removeEventListenerFromElement(this.element, this.listeners, event, callback, useCapture);\n return this;\n };\n return IsometricElementAbstract;\n}(IsometricStore));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricElementAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricGraphicAbstract/IsometricGraphicAbstract.ts\nvar IsometricGraphicAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar defaultObjectProps = {\n fillColor: Colors.white,\n fillOpacity: 1,\n strokeColor: Colors.black,\n strokeDashArray: [],\n strokeLinecap: LineCap.butt,\n strokeLinejoin: LineJoin.round,\n strokeOpacity: 1,\n strokeWidth: 1\n};\nvar IsometricGraphicAbstract = (function (_super) {\n IsometricGraphicAbstract_extends(IsometricGraphicAbstract, _super);\n function IsometricGraphicAbstract(props, svgElement) {\n var _this = _super.call(this, svgElement) || this;\n _this.props = __assign(__assign({}, defaultObjectProps), props);\n _this.animations = [];\n if (_this.props.texture) {\n _this.createTexture(_this.props.texture);\n }\n addSVGProperties(_this.element, {\n \'fill\': _this.props.texture\n ? "url(#".concat(_this.patternId, ") ").concat(_this.fillColor)\n : _this.fillColor,\n \'fill-opacity\': "".concat(_this.fillOpacity),\n \'stroke\': _this.strokeColor,\n \'stroke-dasharray\': _this.strokeDashArray.join(\' \'),\n \'stroke-linecap\': _this.strokeLinecap,\n \'stroke-linejoin\': _this.strokeLinejoin,\n \'stroke-opacity\': "".concat(_this.strokeOpacity),\n \'stroke-width\': "".concat(_this.strokeWidth)\n });\n return _this;\n }\n IsometricGraphicAbstract.prototype.createTexture = function (texture) {\n this.patternId = uuid();\n this.pattern = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.pattern);\n addSVGProperties(this.pattern, {\n \'id\': this.patternId,\n \'preserveAspectRatio\': \'none\',\n \'patternUnits\': \'userSpaceOnUse\'\n });\n var image = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.image);\n addSVGProperties(image, {\n \'href\': texture.url,\n \'x\': \'0\',\n \'y\': \'0\',\n \'preserveAspectRatio\': \'none\'\n });\n if (texture.pixelated) {\n addSVGProperties(image, {\n \'style\': \'image-rendering: pixelated\'\n });\n }\n this.pattern.appendChild(image);\n };\n IsometricGraphicAbstract.prototype._updateTexture = function () {\n var image = this.pattern.firstChild;\n if (this.props.texture.url &&\n image.getAttribute(\'href\') !== this.props.texture.url) {\n addSVGProperties(image, {\n \'href\': this.props.texture.url\n });\n }\n if (this.props.texture.pixelated) {\n addSVGProperties(image, {\n \'style\': \'image-rendering: pixelated\'\n });\n }\n else {\n image.removeAttribute(\'style\');\n }\n this.update();\n };\n IsometricGraphicAbstract.prototype.addAnimationBasicProperties = function (attributeName, animation) {\n addSVGProperties(animation.element, {\n repeatCount: "".concat(animation.repeat || \'indefinite\'),\n attributeName: attributeName,\n dur: "".concat(animation.duration || 1, "s")\n });\n };\n IsometricGraphicAbstract.prototype.updateAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (isNativeSVGProperty) {\n var property = getSVGProperty(animation.property);\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(property, animation);\n if (animation.values) {\n addSVGProperties(animation.element, {\n values: Array.isArray(animation.values)\n ? animation.values.map(function (value) { return "".concat(value); }).join(\';\')\n : "".concat(animation.values)\n });\n }\n else {\n addSVGProperties(animation.element, {\n from: "".concat(animation.from),\n to: "".concat(animation.to)\n });\n }\n }\n });\n this.updateSubClassAnimations();\n };\n IsometricGraphicAbstract.prototype.updatePatternTransform = function (corner, planeView) {\n var _a, _b, _c;\n if (this.props.texture) {\n var height = this.props.texture.height\n ? "".concat(this.props.texture.height * this.data.scale)\n : \'100%\';\n var width = this.props.texture.width\n ? "".concat(this.props.texture.width * this.data.scale)\n : \'100%\';\n var shift = getPointFromIsometricPoint(0, 0, {\n r: ((_a = this.props.texture.shift) === null || _a === void 0 ? void 0 : _a.right) || 0,\n l: ((_b = this.props.texture.shift) === null || _b === void 0 ? void 0 : _b.left) || 0,\n t: ((_c = this.props.texture.shift) === null || _c === void 0 ? void 0 : _c.top) || 0\n }, this.data.scale);\n var transform = getPatternTransform({\n x: round(corner.x + shift.x, DECIMALS),\n y: round(corner.y + shift.y, DECIMALS)\n }, this.props.texture.planeView || planeView, this.props.texture.scale, this.props.texture.rotation);\n addSVGProperties(this.pattern, {\n \'patternTransform\': transform,\n \'height\': height,\n \'width\': width\n });\n addSVGProperties(this.pattern.firstChild, {\n \'height\': height,\n \'width\': width\n });\n }\n };\n Object.defineProperty(IsometricGraphicAbstract.prototype, "fillColor", {\n get: function () {\n return this.props.fillColor;\n },\n set: function (value) {\n this.props.fillColor = value;\n addSVGProperties(this.element, {\n \'fill\': this.props.texture\n ? "url(#".concat(this.patternId, ") ").concat(this.fillColor)\n : this.fillColor\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "fillOpacity", {\n get: function () {\n return this.props.fillOpacity;\n },\n set: function (value) {\n this.props.fillOpacity = value;\n addSVGProperties(this.element, { \'fill-opacity\': "".concat(this.fillOpacity) });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "texture", {\n get: function () {\n return this.props.texture;\n },\n set: function (value) {\n var hasTexture = !!this.props.texture;\n this.props.texture = value;\n if (hasTexture) {\n this._updateTexture();\n }\n else {\n this.createTexture(this.props.texture);\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeColor", {\n get: function () {\n return this.props.strokeColor;\n },\n set: function (value) {\n this.props.strokeColor = value;\n addSVGProperties(this.element, { \'stroke\': this.strokeColor });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeDashArray", {\n get: function () {\n return this.props.strokeDashArray;\n },\n set: function (value) {\n this.props.strokeDashArray = value;\n addSVGProperties(this.element, { \'stroke-dasharray\': this.strokeDashArray.join(\' \') });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeLinecap", {\n get: function () {\n return this.props.strokeLinecap;\n },\n set: function (value) {\n this.props.strokeLinecap = LineCap[value];\n addSVGProperties(this.element, { \'stroke-linecap\': this.strokeLinecap });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeLinejoin", {\n get: function () {\n return this.props.strokeLinejoin;\n },\n set: function (value) {\n this.props.strokeLinejoin = LineJoin[value];\n addSVGProperties(this.element, { \'stroke-linejoin\': this.strokeLinejoin });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeOpacity", {\n get: function () {\n return this.props.strokeOpacity;\n },\n set: function (value) {\n this.props.strokeOpacity = value;\n addSVGProperties(this.element, { \'stroke-opacity\': "".concat(this.strokeOpacity) });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeWidth", {\n get: function () {\n return this.props.strokeWidth;\n },\n set: function (value) {\n this.props.strokeWidth = value;\n addSVGProperties(this.element, { \'stroke-width\': "".concat(this.strokeWidth) });\n },\n enumerable: false,\n configurable: true\n });\n IsometricGraphicAbstract.prototype.getPattern = function () {\n return this.pattern;\n };\n IsometricGraphicAbstract.prototype.updateTexture = function (value) {\n var hasTexture = !!this.props.texture;\n if (hasTexture || value.url) {\n var shift = value.shift, rotation = value.rotation, newProps = __rest(value, ["shift", "rotation"]);\n this.props.texture = hasTexture\n ? __assign(__assign({}, this.props.texture), newProps) : __assign({}, newProps);\n if (shift) {\n this.props.texture.shift = __assign(__assign({}, (this.props.texture.shift || {})), shift);\n }\n if (rotation) {\n this.props.texture.rotation = rotation;\n }\n if (hasTexture) {\n this._updateTexture();\n }\n else {\n this.createTexture(this.props.texture);\n this.update();\n }\n }\n return this;\n };\n IsometricGraphicAbstract.prototype.addAnimation = function (animation) {\n this.animations.push(__assign({}, animation));\n this.update();\n return this;\n };\n IsometricGraphicAbstract.prototype.removeAnimationByIndex = function (index) {\n if (index >= 0 && index < this.animations.length) {\n var animation = this.animations.splice(index, 1)[0];\n if (animation.element && animation.element.parentNode) {\n animation.element.parentNode.removeChild(animation.element);\n }\n }\n return this;\n };\n IsometricGraphicAbstract.prototype.removeAnimations = function () {\n var animations = this.animations.splice(0);\n animations.forEach(function (animation) {\n if (animation.element && animation.element.parentNode) {\n animation.element.parentNode.removeChild(animation.element);\n }\n });\n return this;\n };\n return IsometricGraphicAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricGraphicAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricContainerAbstract/IsometricContainerAbstract.ts\nvar IsometricContainerAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricContainerAbstract = (function (_super) {\n IsometricContainerAbstract_extends(IsometricContainerAbstract, _super);\n function IsometricContainerAbstract(svgElement) {\n var _this = _super.call(this, svgElement) || this;\n _this._children = [];\n return _this;\n }\n IsometricContainerAbstract.prototype.getChildIndex = function (child) {\n return this._children.indexOf(child);\n };\n IsometricContainerAbstract.prototype.throwChildError = function () {\n throw new Error(\'You cannot provide a child that is not a children of the container\');\n };\n IsometricContainerAbstract.prototype.removeSVGChild = function (child) {\n var svgChild = child.getElement();\n if (child instanceof IsometricGraphicAbstract) {\n var svgPatternChild = child.getPattern();\n if (svgPatternChild && svgPatternChild.parentNode) {\n this.element.removeChild(svgPatternChild);\n }\n }\n if (svgChild.parentNode) {\n this.element.removeChild(svgChild);\n }\n };\n IsometricContainerAbstract.prototype.insertPattern = function (pattern) {\n if (pattern) {\n this.element.insertBefore(pattern, this.element.firstChild);\n }\n };\n Object.defineProperty(IsometricContainerAbstract.prototype, "children", {\n get: function () {\n return this._children;\n },\n enumerable: false,\n configurable: true\n });\n IsometricContainerAbstract.prototype.update = function () {\n var _this = this;\n if (elementHasSVGParent(this.element)) {\n this._children.forEach(function (child) {\n child.data = _this.data;\n child.update();\n });\n }\n return this;\n };\n IsometricContainerAbstract.prototype.clear = function () {\n var _this = this;\n var children = this._children.splice(0);\n children.forEach(function (child) {\n _this.removeSVGChild(child);\n });\n return this;\n };\n IsometricContainerAbstract.prototype.addChild = function (child) {\n child.data = this.data;\n this._children.push(child);\n if (child instanceof IsometricGraphicAbstract) {\n this.insertPattern(child.getPattern());\n }\n this.element.appendChild(child.getElement());\n child.update();\n return this;\n };\n IsometricContainerAbstract.prototype.addChildren = function () {\n var _this = this;\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments[_i];\n }\n children.forEach(function (child) { return _this.addChild(child); });\n return this;\n };\n IsometricContainerAbstract.prototype.removeChild = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this._children.splice(childIndex, 1);\n this.removeSVGChild(child);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.removeChildren = function () {\n var _this = this;\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments[_i];\n }\n children.forEach(function (child) {\n var childIndex = _this.getChildIndex(child);\n if (childIndex === -1) {\n _this.throwChildError();\n }\n _this.removeChild(child);\n });\n return this;\n };\n IsometricContainerAbstract.prototype.removeChildByIndex = function (index) {\n if (index >= 0 && index < this._children.length) {\n var child = this._children.splice(index, 1)[0];\n this.removeSVGChild(child);\n }\n return this;\n };\n IsometricContainerAbstract.prototype.setChildIndex = function (child, index) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n index = Math.min(Math.max(0, index), this._children.length - 1);\n var movedElement = child.getElement();\n var replacedElement = this._children[index].getElement();\n if (this._children[index] !== child) {\n this._children.splice(childIndex, 1);\n this._children.splice(index, 0, child);\n if (childIndex > index) {\n this.element.insertBefore(movedElement, replacedElement);\n }\n else {\n if (replacedElement.nextSibling) {\n this.element.insertBefore(movedElement, replacedElement.nextSibling);\n }\n else {\n this.element.appendChild(movedElement);\n }\n }\n }\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.bringChildToFront = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this.setChildIndex(child, this._children.length - 1);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.bringChildForward = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n if (childIndex < this._children.length - 1) {\n this.setChildIndex(child, childIndex + 1);\n }\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.sendChildToBack = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this.setChildIndex(child, 0);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.sendChildBackward = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n if (childIndex > 0) {\n this.setChildIndex(child, childIndex - 1);\n }\n return this;\n }\n this.throwChildError();\n };\n return IsometricContainerAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricContainerAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCanvas/IsometricCanvas.ts\nvar IsometricCanvas_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricCanvas_assign = (undefined && undefined.__assign) || function () {\n IsometricCanvas_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricCanvas_assign.apply(this, arguments);\n};\n\n\n\n\nvar defaultProps = {\n container: \'body\',\n backgroundColor: Colors.white,\n scale: 1,\n height: DEFAULT_HEIGHT,\n width: DEFAULT_WIDTH\n};\nvar IsometricCanvas = (function (_super) {\n IsometricCanvas_extends(IsometricCanvas, _super);\n function IsometricCanvas(props) {\n var _a;\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, SVG_ELEMENTS.svg) || this;\n _this.props = IsometricCanvas_assign(IsometricCanvas_assign({}, defaultProps), props);\n _this.isAnimated = true;\n _this.data = new Store(_this.props.width, _this.props.height, _this.props.scale);\n addSVGProperties(_this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(_this.data.width, " ").concat(_this.data.height),\n _a.width = "".concat(_this.data.width, "px"),\n _a.height = "".concat(_this.data.height, "px"),\n _a));\n _this.background = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.rect);\n addSVGProperties(_this.background, {\n fill: _this.backgroundColor,\n x: \'0\',\n y: \'0\',\n width: "".concat(_this.data.width, "px"),\n height: "".concat(_this.data.height, "px")\n });\n _this.element.appendChild(_this.background);\n var containerElement = typeof _this.props.container === \'string\'\n ? document.querySelector(_this.props.container)\n : _this.props.container;\n containerElement.appendChild(_this.element);\n return _this;\n }\n IsometricCanvas.prototype.getSVGCode = function () {\n return this.element.outerHTML;\n };\n Object.defineProperty(IsometricCanvas.prototype, "backgroundColor", {\n get: function () {\n return this.props.backgroundColor;\n },\n set: function (value) {\n this.props.backgroundColor = value;\n addSVGProperties(this.background, { fill: this.backgroundColor });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "scale", {\n get: function () {\n return this.data.scale;\n },\n set: function (value) {\n this.data.scale = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "height", {\n get: function () {\n return this.data.height;\n },\n set: function (value) {\n var _a;\n this.data.height = value;\n addSVGProperties(this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(this.data.width, " ").concat(this.data.height),\n _a.height = "".concat(this.data.height, "px"),\n _a));\n addSVGProperties(this.background, {\n height: "".concat(this.data.height, "px")\n });\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "width", {\n get: function () {\n return this.data.width;\n },\n set: function (value) {\n var _a;\n this.data.width = value;\n addSVGProperties(this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(this.data.width, " ").concat(this.data.height),\n _a.width = "".concat(this.data.width, "px"),\n _a));\n addSVGProperties(this.background, {\n width: "".concat(this.data.width, "px")\n });\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "animated", {\n get: function () {\n return this.isAnimated;\n },\n enumerable: false,\n configurable: true\n });\n IsometricCanvas.prototype.pauseAnimations = function () {\n var svg = this.element;\n if (typeof svg.pauseAnimations === \'function\') {\n svg.pauseAnimations();\n }\n this.isAnimated = false;\n return this;\n };\n IsometricCanvas.prototype.resumeAnimations = function () {\n var svg = this.element;\n if (typeof svg.unpauseAnimations === \'function\') {\n svg.unpauseAnimations();\n }\n this.isAnimated = true;\n return this;\n };\n return IsometricCanvas;\n}(IsometricContainerAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCanvas/index.ts\n\n\n\n;// CONCATENATED MODULE: ./src/@utils/other.ts\nvar applyMixins = function (BaseClass, constructor) {\n Object.getOwnPropertyNames(constructor.prototype).forEach(function (name) {\n Object.defineProperty(BaseClass.prototype, name, Object.getOwnPropertyDescriptor(constructor.prototype, name));\n });\n};\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/constants.ts\nvar NO_LIMITS = [\n Number.MIN_SAFE_INTEGER,\n Number.MAX_SAFE_INTEGER\n];\nvar DRAG_EVENT;\n(function (DRAG_EVENT) {\n DRAG_EVENT["DRAG_START"] = "dragstart";\n DRAG_EVENT["DRAG"] = "drag";\n DRAG_EVENT["DRAG_END"] = "dragend";\n})(DRAG_EVENT || (DRAG_EVENT = {}));\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/IsometricDraggableAbstract.ts\nvar IsometricDraggableAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricDraggableAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricDraggableAbstract_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricDraggableAbstract_assign.apply(this, arguments);\n};\nvar IsometricDraggableAbstract_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\nvar _isBrowser = typeof window !== Typeof.UNDEFINED;\nvar _requestAnimationFrame = _isBrowser\n ? (window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.msRequestAnimationFrame)\n : null;\nvar _dragStoreDefault = {\n right: 0,\n left: 0,\n top: 0,\n x: 0,\n y: 0\n};\nvar isMouseEvent = function (event) { return \'clientX\' in event; };\nvar getClientCoords = function (event) {\n if (event instanceof Event) {\n if (isMouseEvent(event)) {\n return {\n clientX: event.clientX,\n clientY: event.clientY\n };\n }\n return {\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY\n };\n }\n return event;\n};\nvar IsometricDraggableAbstract = (function (_super) {\n IsometricDraggableAbstract_extends(IsometricDraggableAbstract, _super);\n function IsometricDraggableAbstract() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n IsometricDraggableAbstract.prototype.setup = function () {\n this.startDrag = this.startDrag.bind(this);\n this.stopDrag = this.stopDrag.bind(this);\n this.moveElement = this.moveElement.bind(this);\n this.dropElement = this.dropElement.bind(this);\n this.animate = this.animate.bind(this);\n if (typeof this._bounds === Typeof.UNDEFINED) {\n this._bounds = false;\n }\n if (typeof this._dragStore === Typeof.UNDEFINED) {\n this._dragStore = _dragStoreDefault;\n }\n if (typeof this._coords === Typeof.UNDEFINED) {\n this._coords = {};\n }\n };\n IsometricDraggableAbstract.prototype.betweenBounds = function (value, bounds) {\n var orderedBounds = IsometricDraggableAbstract_spreadArray([], bounds, true).sort();\n return round(Math.min(Math.max(value, orderedBounds[0]), orderedBounds[1]), DECIMALS);\n };\n IsometricDraggableAbstract.prototype.getRight = function (value) {\n var bounds = this._bounds && this._bounds.right || NO_LIMITS;\n return this.betweenBounds(this._dragStore.right + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getLeft = function (value) {\n var bounds = this._bounds && this._bounds.left || NO_LIMITS;\n return this.betweenBounds(this._dragStore.left + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getTop = function (value) {\n var bounds = this._bounds && this._bounds.top || NO_LIMITS;\n return this.betweenBounds(this._dragStore.top + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getFixedCoordinates = function (coords) {\n var _this = this;\n return Object.entries(coords).reduce(function (acc, entry) {\n var fixedCoords = IsometricDraggableAbstract_assign({}, acc);\n switch (entry[0]) {\n case \'right\':\n fixedCoords.right = _this.getRight(entry[1]);\n break;\n case \'left\':\n fixedCoords.left = _this.getLeft(entry[1]);\n break;\n default:\n fixedCoords.top = _this.getTop(entry[1]);\n }\n return fixedCoords;\n }, {});\n };\n IsometricDraggableAbstract.prototype.dispatchEvent = function (eventType) {\n var dragEvent = new CustomEvent(eventType, {\n cancelable: eventType === DRAG_EVENT.DRAG,\n detail: {\n right: this._coords.right || this.right,\n left: this._coords.left || this.left,\n top: this._coords.top || this.top\n }\n });\n this.element.dispatchEvent(dragEvent);\n return dragEvent;\n };\n IsometricDraggableAbstract.prototype.animate = function () {\n if (this._update) {\n if (!this._prevented) {\n if (typeof this._coords.right === Typeof.NUMBER) {\n this.right = this._coords.right;\n }\n if (typeof this._coords.left === Typeof.NUMBER) {\n this.left = this._coords.left;\n }\n if (typeof this._coords.top === Typeof.NUMBER) {\n this.top = this._coords.top;\n }\n }\n _requestAnimationFrame(this.animate);\n }\n };\n IsometricDraggableAbstract.prototype.startDrag = function (event) {\n event.preventDefault();\n var _a = getClientCoords(event), clientX = _a.clientX, clientY = _a.clientY;\n this._dragStore.x = clientX;\n this._dragStore.y = clientY;\n this._dragStore.right = this.right;\n this._dragStore.left = this.left;\n this._dragStore.top = this.top;\n this._update = true;\n this.moveElement({ clientX: clientX, clientY: clientY });\n this.element.addEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.addEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n document.addEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.addEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n _requestAnimationFrame(this.animate);\n };\n IsometricDraggableAbstract.prototype.moveElement = function (event) {\n var _a = getClientCoords(event), clientX = _a.clientX, clientY = _a.clientY;\n var diffX = clientX - this._dragStore.x;\n var diffY = clientY - this._dragStore.y;\n if (this._drag === PlaneView.TOP) {\n this._coords = this.getFixedCoordinates(getTopPlanePointFromCoordinates(diffX, diffY));\n }\n else if (this._drag === PlaneView.FRONT) {\n this._coords = this.getFixedCoordinates(getFrontPlanePointFromCoordinates(diffX, diffY));\n }\n else {\n this._coords = this.getFixedCoordinates(getSidePlanePointFromCoordinates(diffX, diffY));\n }\n var dragEvent;\n if (event instanceof Event) {\n event.preventDefault();\n if (!this._dragging) {\n this.dispatchEvent(DRAG_EVENT.DRAG_START);\n }\n this._dragging = true;\n dragEvent = this.dispatchEvent(DRAG_EVENT.DRAG);\n }\n this._prevented = !!(dragEvent && dragEvent.defaultPrevented);\n };\n IsometricDraggableAbstract.prototype.dropElement = function () {\n this._update = false;\n this._dragging = false;\n this.element.removeEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.removeEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n document.removeEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.removeEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n this.dispatchEvent(DRAG_EVENT.DRAG_END);\n };\n IsometricDraggableAbstract.prototype.beginDrag = function () {\n this.element.addEventListener(EVENTS.TOUCH_START, this.startDrag, true);\n this.element.addEventListener(EVENTS.MOUSE_DOWN, this.startDrag, true);\n };\n IsometricDraggableAbstract.prototype.stopDrag = function () {\n this.element.removeEventListener(EVENTS.TOUCH_START, this.startDrag, true);\n this.element.removeEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.removeEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n this.element.removeEventListener(EVENTS.MOUSE_DOWN, this.startDrag, true);\n document.removeEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.removeEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n };\n Object.defineProperty(IsometricDraggableAbstract.prototype, "right", {\n get: function () {\n return this.props.right;\n },\n set: function (value) {\n if (this.props.right !== value) {\n this.props.right = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "left", {\n get: function () {\n return this.props.left;\n },\n set: function (value) {\n if (this.props.left !== value) {\n this.props.left = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "top", {\n get: function () {\n return this.props.top;\n },\n set: function (value) {\n if (this.props.top !== value) {\n this.props.top = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "drag", {\n get: function () {\n return this._drag || false;\n },\n set: function (value) {\n if (typeof this._drag === Typeof.UNDEFINED) {\n this.setup();\n }\n this._drag = value;\n if (_isBrowser) {\n this.stopDrag();\n this.beginDrag();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "bounds", {\n get: function () {\n return this._bounds || false;\n },\n set: function (value) {\n this._bounds = value;\n var boundsRight = this._bounds && this._bounds.right || NO_LIMITS;\n var boundsLeft = this._bounds && this._bounds.left || NO_LIMITS;\n var boundsTop = this._bounds && this._bounds.top || NO_LIMITS;\n this.right = this.betweenBounds(this.right, boundsRight);\n this.left = this.betweenBounds(this.left, boundsLeft);\n this.top = this.betweenBounds(this.top, boundsTop);\n },\n enumerable: false,\n configurable: true\n });\n return IsometricDraggableAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricGroup/IsometricGroup.ts\nvar IsometricGroup_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricGroup_assign = (undefined && undefined.__assign) || function () {\n IsometricGroup_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricGroup_assign.apply(this, arguments);\n};\n\n\n\n\n\n\nvar IsometricGroup_defaultProps = {\n right: 0,\n left: 0,\n top: 0,\n};\nvar IsometricGroup = (function (_super) {\n IsometricGroup_extends(IsometricGroup, _super);\n function IsometricGroup(props) {\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, SVG_ELEMENTS.group) || this;\n _this.props = IsometricGroup_assign(IsometricGroup_assign({}, IsometricGroup_defaultProps), props);\n return _this;\n }\n IsometricGroup.prototype.update = function () {\n if (elementHasSVGParent(this.element)) {\n var point = getPointFromIsometricPoint(0, 0, {\n r: this.props.right,\n l: this.props.left,\n t: this.props.top\n }, this.data.scale);\n addSVGProperties(this.element, {\n transform: "translate(".concat(point.x, ", ").concat(point.y, ")")\n });\n }\n return _super.prototype.update.call(this);\n };\n return IsometricGroup;\n}(IsometricContainerAbstract));\n\napplyMixins(IsometricGroup, IsometricDraggableAbstract);\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricGroup/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricPathAbstract/IsometricPathAbstract.ts\nvar IsometricPathAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar IsometricPathAbstract = (function (_super) {\n IsometricPathAbstract_extends(IsometricPathAbstract, _super);\n function IsometricPathAbstract(props, svgElement) {\n return _super.call(this, props, svgElement) || this;\n }\n IsometricPathAbstract.prototype.updateGraphic = function (planeView, autoclose) {\n if (autoclose === void 0) { autoclose = true; }\n if (elementHasSVGParent(this.element)) {\n var commands = this.getCommands();\n var corner = getTextureCorner(commands, this.data.centerX, this.data.centerY, this.data.scale);\n addSVGProperties(this.element, {\n d: getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, autoclose)\n });\n this.updatePatternTransform(corner, planeView);\n this.updateAnimations();\n }\n };\n return IsometricPathAbstract;\n}(IsometricGraphicAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricPathAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricShapeAbstract/IsometricShapeAbstract.ts\nvar IsometricShapeAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricShapeAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricShapeAbstract_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricShapeAbstract_assign.apply(this, arguments);\n};\n\n\n\n\n\nvar IsometricShapeAbstract_defaultProps = {\n right: 0,\n left: 0,\n top: 0,\n};\nvar IsometricShapeAbstract = (function (_super) {\n IsometricShapeAbstract_extends(IsometricShapeAbstract, _super);\n function IsometricShapeAbstract(props) {\n return _super.call(this, IsometricShapeAbstract_assign(IsometricShapeAbstract_assign({}, IsometricShapeAbstract_defaultProps), props), SVG_ELEMENTS.path) || this;\n }\n IsometricShapeAbstract.prototype.update = function () {\n this.updateGraphic(this.planeView);\n return this;\n };\n IsometricShapeAbstract.prototype.clear = function () {\n addSVGProperties(this.element, {\n d: \'\'\n });\n return this;\n };\n Object.defineProperty(IsometricShapeAbstract.prototype, "planeView", {\n get: function () {\n return this.props.planeView;\n },\n set: function (value) {\n this.props.planeView = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n return IsometricShapeAbstract;\n}(IsometricPathAbstract));\n\napplyMixins(IsometricShapeAbstract, IsometricDraggableAbstract);\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricShapeAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricRectangle/IsometricRectangle.ts\nvar IsometricRectangle_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricRectangle_assign = (undefined && undefined.__assign) || function () {\n IsometricRectangle_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricRectangle_assign.apply(this, arguments);\n};\nvar IsometricRectangle_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\nvar IsometricRectangle = (function (_super) {\n IsometricRectangle_extends(IsometricRectangle, _super);\n function IsometricRectangle(props) {\n var _this = this;\n var height = props.height, width = props.width, rest = IsometricRectangle_rest(props, ["height", "width"]);\n _this = _super.call(this, rest) || this;\n _this._width = width;\n _this._height = height;\n return _this;\n }\n IsometricRectangle.prototype.getCommands = function (args) {\n var right = (args === null || args === void 0 ? void 0 : args.right) || this.right;\n var left = (args === null || args === void 0 ? void 0 : args.left) || this.left;\n var top = (args === null || args === void 0 ? void 0 : args.top) || this.top;\n var width = (args === null || args === void 0 ? void 0 : args.width) || this.width;\n var height = (args === null || args === void 0 ? void 0 : args.height) || this.height;\n var commands = [{ command: Command.move, point: { r: 0, l: 0, t: 0 } }];\n switch (this.planeView) {\n case PlaneView.FRONT:\n commands.push({ command: Command.line, point: { r: 0, l: width, t: 0 } }, { command: Command.line, point: { r: 0, l: width, t: height } }, { command: Command.line, point: { r: 0, l: 0, t: height } });\n break;\n case PlaneView.SIDE:\n commands.push({ command: Command.line, point: { r: width, l: 0, t: 0 } }, { command: Command.line, point: { r: width, l: 0, t: height } }, { command: Command.line, point: { r: 0, l: 0, t: height } });\n break;\n case PlaneView.TOP:\n commands.push({ command: Command.line, point: { r: width, l: 0, t: 0 } }, { command: Command.line, point: { r: width, l: height, t: 0 } }, { command: Command.line, point: { r: 0, l: height, t: 0 } });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricRectangle.prototype.getRectanglePath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricRectangle.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n var props_1 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n width: _this.width,\n height: _this.height\n };\n if (Object.prototype.hasOwnProperty.call(props_1, animation.property)) {\n var property_1 = animation.property;\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = {\n values: animation.values.map(function (value) {\n var modifiedArgs = IsometricRectangle_assign({}, props_1);\n modifiedArgs[property_1] = +value;\n return _this.getRectanglePath(modifiedArgs);\n }).join(\';\')\n };\n }\n else {\n var modifiedArgs = IsometricRectangle_assign({}, props_1);\n modifiedArgs[property_1] = +animation.values;\n properties = {\n values: _this.getRectanglePath(modifiedArgs)\n };\n }\n }\n else {\n var fromArgs = IsometricRectangle_assign({}, props_1);\n var toArgs = IsometricRectangle_assign({}, props_1);\n fromArgs[property_1] = +animation.from;\n toArgs[property_1] = +animation.to;\n properties = {\n from: _this.getRectanglePath(fromArgs),\n to: _this.getRectanglePath(toArgs)\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n }\n });\n };\n Object.defineProperty(IsometricRectangle.prototype, "width", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricRectangle.prototype, "height", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricRectangle.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricRectangle;\n}(IsometricShapeAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricRectangle/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCircle/IsometricCircle.ts\nvar IsometricCircle_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricCircle_assign = (undefined && undefined.__assign) || function () {\n IsometricCircle_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricCircle_assign.apply(this, arguments);\n};\nvar IsometricCircle_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\nvar IsometricCircle = (function (_super) {\n IsometricCircle_extends(IsometricCircle, _super);\n function IsometricCircle(props) {\n var _this = this;\n var radius = props.radius, rest = IsometricCircle_rest(props, ["radius"]);\n _this = _super.call(this, rest) || this;\n _this._radius = radius;\n return _this;\n }\n IsometricCircle.prototype.getCommands = function (args) {\n var right = (args === null || args === void 0 ? void 0 : args.right) || this.right;\n var left = (args === null || args === void 0 ? void 0 : args.left) || this.left;\n var top = (args === null || args === void 0 ? void 0 : args.top) || this.top;\n var radius = (args === null || args === void 0 ? void 0 : args.radius) || this.radius;\n var commands = [];\n switch (this.planeView) {\n case PlaneView.FRONT:\n commands.push({\n command: Command.move,\n point: { r: 0, l: radius, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: -radius, t: 0 },\n control: { r: 0, l: 0, t: -radius }\n }, {\n command: Command.curve,\n point: { r: 0, l: radius, t: 0 },\n control: { r: 0, l: 0, t: radius }\n });\n break;\n case PlaneView.SIDE:\n commands.push({\n command: Command.move,\n point: { r: -radius, l: 0, t: 0 }\n }, {\n command: Command.curve,\n point: { r: radius, l: 0, t: 0 },\n control: { r: 0, l: 0, t: -radius }\n }, {\n command: Command.curve,\n point: { r: -radius, l: 0, t: 0 },\n control: { r: 0, l: 0, t: radius }\n });\n break;\n case PlaneView.TOP:\n commands.push({\n command: Command.move,\n point: { r: 0, l: radius, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: -radius, t: 0 },\n control: { r: radius, l: 0, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: radius, t: 0 },\n control: { r: -radius, l: 0, t: 0 }\n });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricCircle.prototype.getCirclePath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricCircle.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n var props_1 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n radius: _this.radius\n };\n if (Object.prototype.hasOwnProperty.call(props_1, animation.property)) {\n var property_1 = animation.property;\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = {\n values: animation.values.map(function (value) {\n var modifiedArgs = IsometricCircle_assign({}, props_1);\n modifiedArgs[property_1] = +value;\n return _this.getCirclePath(modifiedArgs);\n }).join(\';\')\n };\n }\n else {\n var modifiedArgs = IsometricCircle_assign({}, props_1);\n modifiedArgs[property_1] = +animation.values;\n properties = {\n values: _this.getCirclePath(modifiedArgs)\n };\n }\n }\n else {\n var fromArgs = IsometricCircle_assign({}, props_1);\n var toArgs = IsometricCircle_assign({}, props_1);\n fromArgs[property_1] = +animation.from;\n toArgs[property_1] = +animation.to;\n properties = {\n from: _this.getCirclePath(fromArgs),\n to: _this.getCirclePath(toArgs)\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n }\n });\n };\n Object.defineProperty(IsometricCircle.prototype, "radius", {\n get: function () {\n return this._radius;\n },\n set: function (value) {\n this._radius = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricCircle.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricCircle;\n}(IsometricShapeAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCircle/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricPath/IsometricPath.ts\nvar IsometricPath_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricPath = (function (_super) {\n IsometricPath_extends(IsometricPath, _super);\n function IsometricPath(props) {\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, props, SVG_ELEMENTS.path) || this;\n _this.getPathFromCommands = function (commands) { return getSVGPath(parseDrawCommands(commands), _this.data.centerX, _this.data.centerY, _this.data.scale, _this._autoclose); };\n _this.commands = [];\n _this._autoclose = \'autoclose\' in props\n ? props.autoclose\n : true;\n return _this;\n }\n IsometricPath.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n if (animation.property === \'path\') {\n var properties = void 0;\n if (animation.values) {\n properties = {\n values: Array.isArray(animation.values)\n ? animation.values.map(function (value) {\n return _this.getPathFromCommands("".concat(value));\n }).join(\';\')\n : _this.getPathFromCommands("".concat(animation.values))\n };\n }\n else {\n properties = {\n from: _this.getPathFromCommands("".concat(animation.from)),\n to: _this.getPathFromCommands("".concat(animation.to))\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n });\n };\n IsometricPath.prototype.getCommands = function () {\n return this.commands;\n };\n Object.defineProperty(IsometricPath.prototype, "autoclose", {\n get: function () {\n return this._autoclose;\n },\n set: function (value) {\n this._autoclose = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricPath.prototype.update = function () {\n this.updateGraphic(undefined, this.autoclose);\n return this;\n };\n IsometricPath.prototype.clear = function () {\n this.commands.splice(0);\n addSVGProperties(this.element, {\n d: \'\'\n });\n return this;\n };\n IsometricPath.prototype.moveTo = function (right, left, top) {\n this.commands.push({\n command: Command.move,\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.lineTo = function (right, left, top) {\n this.commands.push({\n command: Command.line,\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.curveTo = function (controlRight, controlLeft, controlTop, right, left, top) {\n this.commands.push({\n command: Command.curve,\n control: { r: controlRight, l: controlLeft, t: controlTop },\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.mt = function (right, left, top) {\n return this.moveTo(right, left, top);\n };\n IsometricPath.prototype.lt = function (right, left, top) {\n return this.lineTo(right, left, top);\n };\n IsometricPath.prototype.ct = function (controlRight, controlLeft, controlTop, right, left, top) {\n return this.curveTo(controlRight, controlLeft, controlTop, right, left, top);\n };\n IsometricPath.prototype.draw = function (commands) {\n this.commands = parseDrawCommands(commands);\n this.update();\n return this;\n };\n IsometricPath.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricPath;\n}(IsometricPathAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricPath/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricText/IsometricText.ts\nvar IsometricText_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricText_assign = (undefined && undefined.__assign) || function () {\n IsometricText_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricText_assign.apply(this, arguments);\n};\nvar IsometricText_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar IsometricText = (function (_super) {\n IsometricText_extends(IsometricText, _super);\n function IsometricText(props) {\n var _a;\n var _this = this;\n var planeView = props.planeView, _b = props.text, text = _b === void 0 ? \'\' : _b, _c = props.fontFamily, fontFamily = _c === void 0 ? \'Arial\' : _c, _d = props.fontSize, fontSize = _d === void 0 ? 12 : _d, _e = props.fontStyle, fontStyle = _e === void 0 ? \'normal\' : _e, _f = props.fontWeight, fontWeight = _f === void 0 ? \'normal\' : _f, _g = props.origin, origin = _g === void 0 ? [\'center\', \'center\'] : _g, _h = props.right, right = _h === void 0 ? 0 : _h, _j = props.left, left = _j === void 0 ? 0 : _j, _k = props.top, top = _k === void 0 ? 0 : _k, _l = props.rotation, rotation = _l === void 0 ? 0 : _l, _m = props.selectable, selectable = _m === void 0 ? true : _m, rest = IsometricText_rest(props, ["planeView", "text", "fontFamily", "fontSize", "fontStyle", "fontWeight", "origin", "right", "left", "top", "rotation", "selectable"]);\n _this = _super.call(this, rest, SVG_ELEMENTS.group) || this;\n _this._originHash = (_a = {},\n _a[ORIGIN.CENTER] = \'middle\',\n _a[ORIGIN.LEFT] = \'start\',\n _a[ORIGIN.RIGHT] = \'end\',\n _a[ORIGIN.TOP] = \'hanging\',\n _a[ORIGIN.BOTTOM] = \'baseline\',\n _a);\n _this.commonAnimationAttributes = {\n attributeName: \'transform\',\n attributeType: \'XML\',\n additive: \'sum\',\n fill: \'freeze\'\n };\n _this.getMatrixTransform = function (props) {\n var transformMatrix = getPatternTransform(_this.getPositionTransform(props), _this.planeView, 1);\n return "".concat(transformMatrix, " rotate(").concat(_this.rotation, ")");\n };\n _this._textElement = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.text);\n _this._tspan = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.tspan);\n _this._textElement.appendChild(_this._tspan);\n _this.element.appendChild(_this._textElement);\n _this.planeView = planeView;\n _this.fontFamily = fontFamily;\n _this.fontSize = fontSize;\n _this.fontStyle = fontStyle;\n _this.fontWeight = fontWeight;\n _this.selectable = selectable;\n _this.origin = origin;\n _this.right = right;\n _this.left = left;\n _this.top = top;\n _this.rotation = rotation;\n _this.text = text;\n return _this;\n }\n IsometricText.prototype.getPositionTransform = function (props, fromCenter) {\n if (fromCenter === void 0) { fromCenter = true; }\n return getPointFromIsometricPoint(fromCenter\n ? this.data.centerX\n : 0, fromCenter\n ? this.data.centerY\n : 0, {\n r: props.right,\n l: props.left,\n t: props.top\n }, this.data.scale);\n };\n IsometricText.prototype.updateSubClassAnimations = function () {\n var _this = this;\n var props = {\n right: 0,\n left: 0,\n top: 0,\n rotation: 0,\n };\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n if (Object.prototype.hasOwnProperty.call(props, animation.property)) {\n var property_1 = animation.property;\n var isRotation_1 = property_1 === \'rotation\';\n var commonProps = IsometricText_assign(IsometricText_assign({}, _this.commonAnimationAttributes), { type: isRotation_1\n ? \'rotate\'\n : \'translate\', begin: \'indefinite\' });\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = IsometricText_assign({ values: animation.values.map(function (value) {\n if (isRotation_1) {\n return "".concat(value);\n }\n else {\n var modifiedArgs = IsometricText_assign({}, props);\n modifiedArgs[property_1] = +value - _this[property_1];\n var coords = _this.getPositionTransform(modifiedArgs, false);\n return "".concat(coords.x, ",").concat(coords.y);\n }\n }).join(\';\') }, commonProps);\n }\n else {\n if (isRotation_1) {\n properties = IsometricText_assign({ values: "".concat(animation.values) }, commonProps);\n }\n else {\n var modifiedArgs = IsometricText_assign({}, props);\n modifiedArgs[property_1] = +animation.values - _this[property_1];\n var coords = _this.getPositionTransform(modifiedArgs, false);\n properties = IsometricText_assign({ values: "".concat(coords.x, ",").concat(coords.y) }, commonProps);\n }\n }\n }\n else {\n if (isRotation_1) {\n properties = IsometricText_assign({ from: "".concat(animation.from), to: "".concat(animation.to) }, commonProps);\n }\n else {\n var fromArgs = IsometricText_assign({}, props);\n var toArgs = IsometricText_assign({}, props);\n fromArgs[property_1] = +animation.from - _this[property_1];\n toArgs[property_1] = +animation.to - _this[property_1];\n var coordsFrom = _this.getPositionTransform(fromArgs, false);\n var coordsTo = _this.getPositionTransform(toArgs, false);\n properties = IsometricText_assign({ from: "".concat(coordsFrom.x, ",").concat(coordsFrom.y), to: "".concat(coordsTo.x, ",").concat(coordsTo.y) }, commonProps);\n }\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animateTransform);\n }\n _this.addAnimationBasicProperties(\'transform\', animation);\n addSVGProperties(animation.element, properties);\n if (!animation.element.parentNode) {\n if (isRotation_1) {\n _this._textElement.appendChild(animation.element);\n }\n else {\n _this.element.appendChild(animation.element);\n }\n }\n window.requestAnimationFrame(function () {\n animation.element.beginElement();\n });\n }\n }\n });\n };\n IsometricText.prototype.update = function () {\n if (elementHasSVGParent(this.element)) {\n var transform = this.getMatrixTransform({\n right: this.right,\n left: this.left,\n top: this.top\n });\n addSVGProperties(this._textElement, { transform: transform });\n this._tspan.textContent = this._text;\n this.updatePatternTransform({ x: 0, y: 0 }, this.planeView);\n this.updateAnimations();\n }\n return this;\n };\n IsometricText.prototype.clear = function () {\n this.text = \'\';\n this.update();\n return this;\n };\n Object.defineProperty(IsometricText.prototype, "text", {\n get: function () {\n return this._text;\n },\n set: function (value) {\n this._text = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "planeView", {\n get: function () {\n return this._planeView;\n },\n set: function (value) {\n this._planeView = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontFamily", {\n get: function () {\n return this._fontFamily;\n },\n set: function (value) {\n this._fontFamily = value;\n addSVGProperties(this._tspan, {\n \'font-family\': this._fontFamily\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontSize", {\n get: function () {\n return this._fontSize;\n },\n set: function (value) {\n this._fontSize = value;\n addSVGProperties(this._tspan, {\n \'font-size\': "".concat(this._fontSize, "px")\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontStyle", {\n get: function () {\n return this._fontStyle;\n },\n set: function (value) {\n this._fontStyle = value;\n addSVGProperties(this._tspan, {\n \'font-style\': "".concat(this._fontStyle)\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontWeight", {\n get: function () {\n return this._fontWeight;\n },\n set: function (value) {\n this._fontWeight = value;\n addSVGProperties(this._tspan, {\n \'font-weight\': "".concat(this._fontWeight)\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "selectable", {\n get: function () {\n return this._selectable;\n },\n set: function (value) {\n this._selectable = value;\n if (this._selectable) {\n this._textElement.removeAttribute(\'style\');\n }\n else {\n addSVGProperties(this._textElement, {\n style: [\n \'-webkit-user-select\',\n \'-moz-user-select\',\n \'-ms-user-select\',\n \'user-select\',\n \'pointer-events\'\n ].map(function (decl) { return "".concat(decl, ": none"); }).join(\';\')\n });\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "origin", {\n get: function () {\n return this._origin;\n },\n set: function (value) {\n this._origin = value;\n var _a = this._origin, textAnchor = _a[0], alignmentBaseline = _a[1];\n addSVGProperties(this._tspan, {\n \'text-anchor\': this._originHash[textAnchor],\n \'alignment-baseline\': this._originHash[alignmentBaseline]\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "right", {\n get: function () {\n return this._right;\n },\n set: function (value) {\n if (this._right !== value) {\n this._right = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "left", {\n get: function () {\n return this._left;\n },\n set: function (value) {\n if (this._left !== value) {\n this._left = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "top", {\n get: function () {\n return this._top;\n },\n set: function (value) {\n if (this._top !== value) {\n this._top = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "rotation", {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n return IsometricText;\n}(IsometricGraphicAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricText/index.ts\n\n\n;// CONCATENATED MODULE: ./src/index.ts\n\n\n\n\n\n\n\n\n;// CONCATENATED MODULE: ./demo/demo1/index.js\n/* harmony default export */ const demo1 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricRectangle, PlaneView } = IsometricModule;\n\n function toggleColor() {\n this.fillColor = this.fillColor === \'white\' ? \'#EEE\' : \'white\';\n }\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonProps = {height: 1, width: 1};\n const topPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.TOP});\n const rightPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.FRONT});\n const leftPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.SIDE});\n\n topPiece.top = 1;\n topPiece.addEventListener(\'click\', toggleColor, true);\n\n rightPiece.right = 1;\n rightPiece.addEventListener(\'click\', toggleColor, true);\n\n leftPiece.left = 1;\n leftPiece.addEventListener(\'click\', toggleColor, true);\n\n cube\n .addChild(topPiece)\n .addChild(rightPiece)\n .addChild(leftPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/demo2/index.js\n/* harmony default export */ const demo2 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, PlaneView } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonProps = {height: 1, width: 1};\n\n const duration = 3;\n\n const rectangleAnimationProps = {\n property: \'height\',\n duration,\n values: [1, 0.5, 1]\n };\n\n const colorAnimationProps = {\n property: \'fillColor\',\n duration,\n values: [\'#FFF\', \'#DDD\', \'#FFF\']\n };\n\n const topPiece = new IsometricPath();\n const rightPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.FRONT, right: 1});\n const leftPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.SIDE, left: 1});\n\n topPiece\n .moveTo(0, 0, 1)\n .lineTo(1, 0, 1)\n .lineTo(1, 1, 1)\n .lineTo(0, 1, 1);\n\n topPiece\n .addAnimation({\n property: \'path\',\n duration,\n values: [\n \'M0 0 1 L1 0 1 L1 1 1 L0 1 1\',\n \'M0 0 0.5 L1 0 0.5 L1 1 0.5 L0 1 0.5\',\n \'M0 0 1 L1 0 1 L1 1 1 L0 1 1\'\n ]\n })\n .addAnimation(colorAnimationProps);\n\n rightPiece\n .addAnimation(rectangleAnimationProps)\n .addAnimation(colorAnimationProps);\n\n leftPiece\n .addAnimation(rectangleAnimationProps)\n .addAnimation(colorAnimationProps);\n\n cube.addEventListener(\'click\', function() {\n if (this.animated) {\n this.pauseAnimations();\n } else {\n this.resumeAnimations();\n }\n });\n\n cube.addChildren(topPiece, rightPiece, leftPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/images/block_side.png\nconst block_side_namespaceObject = __webpack_require__.p + "images/block_side.png";\n;// CONCATENATED MODULE: ./demo/images/block_top.png\nconst block_top_namespaceObject = __webpack_require__.p + "images/block_top.png";\n;// CONCATENATED MODULE: ./demo/demo3/index.js\n\n\n\n/* harmony default export */ const demo3 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricRectangle, IsometricText, PlaneView } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const rectangleCommonProps = { height: 1, width: 1 };\n\n const textCommonProps = {\n fontSize: 15,\n fillColor: \'#666\',\n strokeWidth: 0,\n right: 0.5,\n left: 0.5,\n top: 0.5,\n selectable: false\n };\n\n const pieces = [PlaneView.TOP, PlaneView.FRONT, PlaneView.SIDE].map((view, index) => {\n return {\n face: new IsometricRectangle({...rectangleCommonProps, planeView: view}),\n label: new IsometricText({...textCommonProps, planeView: view}),\n property: [\'top\', \'right\', \'left\'][index]\n };\n });\n\n pieces.forEach((piece) => {\n\n const { face, label, property } = piece;\n\n face[property] = 1;\n label[property] = 1;\n label.text = `${property.toUpperCase()} 0º`;\n\n face.addEventListener(\'click\', () => {\n const rotation = label.rotation + 45;\n label.rotation = rotation === 360 ? 0 : rotation;\n label.text = label.text.replace(/\\d+/, label.rotation);\n });\n\n cube.addChild(piece.face);\n cube.addChild(piece.label);\n });\n\n});\n;// CONCATENATED MODULE: ./demo/demo4/index.js\n/* harmony default export */ const demo4 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricGroup, IsometricPath } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const bottomT = new IsometricPath();\n const bottomR = new IsometricPath();\n const bottomL = new IsometricPath();\n\n const topT = new IsometricPath();\n const topR = new IsometricPath();\n const topL = new IsometricPath();\n\n bottomT.mt(0, 0, .5).lt(1, 0, .5).lt(1, 1, .5).lt(0, 1, .5);\n bottomR.mt(1, 0, .5).lt(1, 0, 0).lt(1, 1, 0).lt(1, 1, .5);\n bottomL.mt(1, 1, .5).lt(1, 1, 0).lt(0, 1, 0).lt(0, 1, .5);\n\n topT.mt(.25, .25, 1).lt(.75, .25, 1).lt(.75, .75, .75).lt(.25, .75, .75);\n topR.mt(.75, .25, 1).lt(.75, .75, .75).lt(.75, .75, .25).lt(.75, .25, .25);\n topL.mt(.75, .75, .75).lt(.25, .75, .75).lt(.25, .75, .25).lt(.75, .75, .25);\n\n const bottomPiece = new IsometricGroup();\n const topPiece = new IsometricGroup();\n topPiece.top = .25;\n\n bottomPiece.addChildren(bottomT, bottomR, bottomL);\n topPiece.addChildren(topT, topR, topL);\n\n let flip = true;\n\n topPiece.addEventListener(\'click\', function() {\n if (this.right) {\n this.right = 0;\n return;\n }\n this.right = flip ? 0.25 : -0.25;\n flip = !flip;\n });\n\n isometric.addChildren(bottomPiece, topPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/demo5/index.js\n/* harmony default export */ const demo5 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const right = new IsometricPath();\n const top1 = new IsometricPath();\n const top2 = new IsometricPath();\n const top3 = new IsometricPath();\n const top4 = new IsometricPath();\n const left1 = new IsometricPath();\n const left2 = new IsometricPath();\n\n // M r l t (Move to right left top)\n // L r l t (Line to right left top)\n // C cr cl ct r l t (Curve to control-right control-left control-top right left top)\n right.draw(\'M1 0 0 L1 1 0 L1 1 0.25 L1 0.5 0.25 L1 0.5 1 L1 0 1\');\n top1.draw(\'M0.25 0.5 1 C0.5 0.5 0.75 0.75 0.5 1 L0.75 0 1 C0.5 0 0.75 0.25 0 1 L0.25 0.5 1\');\n top2.draw(\'M1 0 1 L0.75 0 1 L0.75 0.5 1 L1 0.5 1 L1 0 1 M0 0 1 L0.25 0 1 L0.25 0.5 1 L0 0.5 1 L0 0 1\');\n top3.draw(\'M0 0.5 0.5 L0.5 0.5 0.5 L0.5 1 0.5 L0 1 0.5\');\n top4.draw(\'M0.5 0.5 0.5 L1 0.5 0.25 L1 1 0.25 L0.5 1 0.5\');\n left1.draw(\'M0 0.5 1 L0 0.5 0.5 L0.5 0.5 0.5 L1 0.5 0.25 L1 0.5 1 L0.75 0.5 1 C0.5 0.5 0.75 0.25 0.5 1 L0 0.5 1\');\n left2.draw(\'M0 1 0.5 L0.5 1 0.5 L1 1 0.25 L1 1 0 L0 1 0\');\n\n isometric.addChildren(right, top1, top2, top3, top4, left1, left2);\n\n});\n;// CONCATENATED MODULE: ./demo/demo6/index.js\n/* harmony default export */ const demo6 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const under = new IsometricPath({ fillColor: \'#EEE\' });\n const top = new IsometricPath();\n const right = new IsometricPath();\n const left = new IsometricPath();\n\n under\n .mt(0, 0, 1)\n .mt(0.25, 0, 1).ct(0.5, 0, 0.75, 0.75, 0, 1).lt(1, 0, 1)\n .lt(1, 0, 0.75).ct(0.75, 0, 0.5, 1, 0, 0.25).lt(1, 0, 0)\n .lt(1, 0.25, 0).ct(0.75, 0.5, 0, 1, 0.75, 0).lt(1, 1, 0)\n .lt(0.75, 1, 0).ct(0.5, 0.75, 0, 0.25, 1, 0).lt(0, 1, 0)\n .lt(0, 1, 0.25).ct(0, 0.75, 0.5, 0, 1, 0.75).lt(0, 1, 1)\n .lt(0, 0.75, 1).ct(0, 0.5, 0.75, 0, 0.25, 1).lt(0, 0, 1);\n\n top\n .mt(0, 0, 1)\n .lt(0.25, 0, 1).ct(0.5, 0.25, 1, 0.75, 0, 1).lt(1, 0, 1)\n .lt(1, 0.25, 1).ct(0.75, 0.5, 1, 1, 0.75, 1).lt(1, 1, 1)\n .lt(0.75, 1, 1).ct(0.5, 0.75, 1, 0.25, 1, 1).lt(0, 1, 1)\n .lt(0, 0.75, 1).ct(0.25, 0.5, 1, 0, 0.25, 1).lt(0, 0, 1);\n\n right\n .mt(1, 0, 1)\n .lt(1, 0, 0.75).ct(1, 0.25, 0.5, 1, 0, 0.25).lt(1, 0, 0)\n .lt(1, 0.25, 0).ct(1, 0.5, 0.25, 1, 0.75, 0).lt(1, 1, 0)\n .lt(1, 1, 0.25).ct(1, 0.75, 0.5, 1, 1, 0.75).lt(1, 1, 1)\n .lt(1, 0.75, 1).ct(1, 0.5, 0.75, 1, 0.25, 1).lt(1, 0, 1);\n\n left\n .mt(1, 1, 1)\n .lt(1, 1, 0.75).ct(0.75, 1, 0.5, 1, 1, 0.25).lt(1, 1, 0)\n .lt(0.75, 1, 0).ct(0.5, 1, 0.25, 0.25, 1, 0).lt(0, 1, 0)\n .lt(0, 1, 0.25).ct(0.25, 1, 0.5, 0, 1, 0.75).lt(0, 1, 1)\n .lt(0.25, 1, 1).ct(0.5, 1, 0.75, 0.75, 1, 1).lt(1, 1, 1);\n\n cube.addChildren(under, top, right, left);\n\n});\n;// CONCATENATED MODULE: ./demo/demo7/index.js\n/* harmony default export */ const demo7 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricGroup, IsometricRectangle, PlaneView } = IsometricModule;\n\n const canvas = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 20,\n width: 500,\n height: 320\n });\n\n function resetPlanes() {\n cube.right = cube.left = cube.top = 0;\n planeTop.fillOpacity = planeRight.fillOpacity = planeLeft.fillOpacity = 0.25;\n }\n\n function changePlane() {\n resetPlanes();\n this.fillOpacity = 1;\n cube.drag = this.planeView;\n }\n\n const planeProps = { height: 6, width: 6, fillOpacity: 0.25 };\n const planeTop = new IsometricRectangle({ ...planeProps, planeView: PlaneView.TOP, fillOpacity: 1 });\n const planeRight = new IsometricRectangle({ ...planeProps, planeView: PlaneView.FRONT });\n const planeLeft = new IsometricRectangle({ ...planeProps, planeView: PlaneView.SIDE });\n\n const cubeProps = { height: 1, width: 1 };\n const cubeTop = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.TOP, top: 1 });\n const cubeRight = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.FRONT, right: 1 });\n const cubeLeft = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.SIDE, left: 1 });\n\n const cube = new IsometricGroup();\n\n const bounds = [0, 5];\n cube.drag = \'TOP\';\n cube.bounds = { top: bounds, right: bounds, left: bounds };\n\n planeTop.addEventListener(\'click\', changePlane, true);\n planeRight.addEventListener(\'click\', changePlane, true);\n planeLeft.addEventListener(\'click\', changePlane, true);\n\n cube.addChildren(cubeTop, cubeRight, cubeLeft);\n canvas.addChildren(planeTop, planeRight, planeLeft, cube);\n\n});\n;// CONCATENATED MODULE: ./demo/demo8/index.js\n\n\n\n/* harmony default export */ const demo8 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, PlaneView, Axis } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#8AAA3F\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonTextureProps = {\n height: 1,\n width: 1,\n pixelated: true\n };\n\n const textureSides = {\n url: \'images/block_side.png\',\n ...commonTextureProps\n };\n\n const textureTop = {\n url: \'images/block_top.png\',\n planeView: PlaneView.TOP,\n rotation: {\n axis: Axis.LEFT,\n value: 26.5650\n },\n ...commonTextureProps\n };\n\n const side = new IsometricPath({\n texture: {\n planeView: PlaneView.SIDE,\n ...textureSides\n }\n });\n\n const front = new IsometricRectangle({\n planeView: PlaneView.FRONT,\n height: 0.5,\n width: 1,\n texture: textureSides\n });\n\n const chop = new IsometricPath({\n texture: textureTop\n });\n\n side.draw(\'M1 1 0 L1 1 0.5 L0 1 1 L0 1 0\');\n chop.draw(\'M1 1 0.5 L0 1 1 L0 0 1 L1 0 0.5\');\n\n side.left = 1;\n front.right = 1;\n\n isometric.addChildren(side, front, chop);\n\n});\n;// CONCATENATED MODULE: ./demo/demo.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst functioToString = (fn) => {\n const article = document.createElement(\'article\');\n const pre = document.createElement(\'pre\');\n article.classList.add(\'function-container\');\n pre.classList.add(\'prettyprint\');\n article.appendChild(pre);\n pre.innerHTML = fn.toString();\n return article;\n};\n\nconst demos = new Map([\n [\'demo1\', demo1],\n [\'demo2\', demo2],\n [\'demo3\', demo3],\n [\'demo4\', demo4],\n [\'demo5\', demo5],\n [\'demo6\', demo6],\n [\'demo7\', demo7],\n [\'demo8\', demo8],\n]);\n\ndocument.addEventListener(\'DOMContentLoaded\', function () {\n\n demos.forEach((module, div) => {\n const demo = document.getElementById(div);\n const container = document.createElement(\'div\');\n const wrapper = document.createElement(\'div\');\n\n container.classList.add(\'demo-container\');\n wrapper.classList.add(\'demo-wrapper\');\n\n module(src_namespaceObject, wrapper);\n container.appendChild(wrapper);\n demo.appendChild(container);\n demo.appendChild(functioToString(module));\n });\n\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUwLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBTztBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsb0NBQW9DO0FBQzlCO0FBQ1A7QUFDQTtBQUNBLENBQUMsd0NBQXdDO0FBQ2xDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ087QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsQ0FBQyx3QkFBd0I7QUFDbEI7QUFDUDtBQUNBO0FBQ0E7QUFDQ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7XG4gICAgICAgICAgICBzd2l0Y2ggKHJvdGF0aW9uLmF4aXMpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuVE9QOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWih2YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLkxFRlQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVYKC12YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLlJJR0hUOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdG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HtcbiAgICAgICAgdmFyIHBhdGhFbmQgPSBhdXRvY2xvc2UgPyAneicgOiAnJztcbiAgICAgICAgcmV0dXJuIFwiXCIuY29uY2F0KHN2Z1BhdGhzLmpvaW4oJyAnKS50cmltKCkpLmNvbmNhdChwYXRoRW5kKTtcbiAgICB9XG4gICAgcmV0dXJuICcnO1xufTtcbmV4cG9ydCB2YXIgcGFyc2VEcmF3Q29tbWFuZHMgPSBmdW5jdGlvbiAoY29tbWFuZHMpIHtcbiAgICB2YXIgY29tbWFuZHNBcnJheSA9IFtdO1xuICAgIHZhciBhcnJheTtcbiAgICB3aGlsZSAoKGFycmF5ID0gQ09NTUFORFNfUkVHRVhQLmV4ZWMoY29tbWFuZHMpKSAhPT0gbnVsbCkge1xuICAgICAgICB2YXIgY29tbWFuZCA9IGFycmF5WzVdIHx8IGFycmF5WzFdO1xuICAgICAgICBzd2l0Y2ggKGNvbW1hbmQpIHtcbiAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzQXJyYXkucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQubW92ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogK2FycmF5WzJdLCBsOiArYXJyYXlbM10sIHQ6ICthcnJheVs0XSB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdMJzpcbiAgICAgICAgICAgICAgICBjb21tYW5kc0FycmF5LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVsyXSwgbDogK2FycmF5WzNdLCB0OiArYXJyYXlbNF0gfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgICAgICAgY29tbWFuZHNBcnJheS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiArYXJyYXlbNl0sIGw6ICthcnJheVs3XSwgdDogK2FycmF5WzhdIH0sXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVs5XSwgbDogK2FycmF5WzEwXSwgdDogK2FycmF5WzExXSB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGNvbW1hbmRzQXJyYXk7XG59O1xuZXhwb3J0IHZhciB0cmFuc2xhdGVDb21tYW5kUG9pbnRzID0gZnVuY3Rpb24gKGNvbW1hbmRzLCByaWdodCwgbGVmdCwgdG9wKSB7XG4gICAgY29tbWFuZHMuZm9yRWFjaChmdW5jdGlvbiAoY29tbWFuZCkge1xuICAgICAgICBjb21tYW5kLnBvaW50LnIgKz0gcmlnaHQ7XG4gICAgICAgIGNvbW1hbmQucG9pbnQubCArPSBsZWZ0O1xuICAgICAgICBjb21tYW5kLnBvaW50LnQgKz0gdG9wO1xuICAgICAgICBpZiAoY29tbWFuZC5jb250cm9sKSB7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wuciArPSByaWdodDtcbiAgICAgICAgICAgIGNvbW1hbmQuY29udHJvbC5sICs9IGxlZnQ7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wudCArPSB0b3A7XG4gICAgICAgIH1cbiAgICB9KTtcbn07XG5leHBvcnQgdmFyIGdldFRleHR1cmVDb3JuZXIgPSBmdW5jdGlvbiAoY29tbWFuZHMsIGNlbnRlclgsIGNlbnRlclksIHNjYWxlKSB7XG4gICAgdmFyIGNvcm5lciA9IHtcbiAgICAgICAgeDogTnVtYmVyLk1BWF9TQUZFX0lOVEVHRVIsXG4gICAgICAgIHk6IE51bWJlci5NQVhfU0FG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Xplcy5oZWlnaHQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNpemVzLmhlaWdodCA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy5zaXplcy5jZW50ZXJZID0gdmFsdWUgLyAyO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFN0b3JlLnByb3RvdHlwZSwgXCJzY2FsZVwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuc2l6ZXMuc2NhbGU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNpemVzLnNjYWxlID0gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3RvcmUucHJvdG90eXBlLCBcImNlbnRlclhcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnNpemVzLmNlbnRlclg7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3RvcmUucHJvdG90eXBlLCBcImNlbnRlcllcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnNpemVzLmNlbnRlclk7XG4gICAgICAgIH0sXG4gICAgICAgIGVud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FTlRTLmltYWdlKTtcbiAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhpbWFnZSwge1xuICAgICAgICAgICAgJ2hyZWYnOiB0ZXh0dXJlLnVybCxcbiAgICAgICAgICAgICd4JzogJzAnLFxuICAgICAgICAgICAgJ3knOiAnMCcsXG4gICAgICAgICAgICAncHJlc2VydmVBc3BlY3RSYXRpbyc6ICdub25lJ1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKHRleHR1cmUucGl4ZWxhdGVkKSB7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGltYWdlLCB7XG4gICAgICAgICAgICAgICAgJ3N0eWxlJzogJ2ltYWdlLXJlbmRlcmluZzogcGl4ZWxhdGVkJ1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5wYXR0ZXJuLmFwcGVuZENoaWxkKGltYWdlKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUuX3VwZGF0ZVRleHR1cmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBpbWFnZSA9IHRoaXMucGF0dGVybi5maXJzdENoaWxkO1xuICAgICAgICBpZiAodGhpcy5wcm9wcy50ZXh0dXJlLnVybCAmJlxuICAgICAgICAgICAgaW1hZ2UuZ2V0QXR0cmlidXRlKCdocmVmJykgIT09IHRoaXMucHJvcHMudGV4dHVyZS51cmwpIHtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoaW1hZ2UsIHtcbiAgICAgICAgICAgICAgICAnaHJlZic6IHRoaXMucHJvcHMudGV4dHVyZS51cmxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnByb3BzLnRleHR1cmUucGl4ZWxhdGVkKSB7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGltYWdlLCB7XG4gICAgICAgICAgICAgICAgJ3N0eWxlJzogJ2ltYW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uaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKHByb3BlcnR5LCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgIGlmIChhbmltYXRpb24udmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogQXJyYXkuaXNBcnJheShhbmltYXRpb24udmFsdWVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gYW5pbWF0aW9uLnZhbHVlcy5tYXAoZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBcIlwiLmNvbmNhdCh2YWx1ZSk7IH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcylcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiBcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSksXG4gICAgICAgICAgICAgICAgICAgICAgICB0bzogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnRvKVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnVwZGF0ZVN1YkNsYXNzQW5pbWF0aW9ucygpO1xuICAgIH07XG4gICAgSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3RvdHlwZS51cGRhdGVQYXR0ZXJuVHJhbnNmb3JtID0gZnVuY3Rpb24gKGNvcm5lciwgcGxhbmVWaWV3KSB7XG4gICAgICAgIHZhciBfYSwgX2IsIF9jO1xuICAgICAgICBpZiAodGhpcy5wcm9wcy50ZXh0dXJlKSB7XG4gICAgICAgICAgICB2YXIgaGVpZ2h0ID0gdGhpcy5wcm9wcy50ZXh0dXJlLmhlaWdodFxuICAgICAgICAgICAgICAgID8gXCJcIi5jb25jYXQodGhpcy5wcm9wcy50ZXh0dXJlLmhlaWdodCAqIHRoaXMuZGF0YS5zY2FsZSlcbiAgICAgICAgICAgICAgICA6ICcxMDAlJztcbiAgICAgICAgICAgIHZhciB3aWR0aCA9IHRoaXMucHJvcHMudGV4dHVyZS53aWR0aFxuICAgICAgICAgICAgICAgID8gXCJcIi5jb25jYXQodGhpcy5wcm9wcy50ZXh0dXJlLndpZHRoICogdGhpcy5kYXRhLnNjYWxlKVxuICAgICAgICAgICAgICAgIDogJzEwMCUnO1xuICAgICAgICAgICAgdmFyIHNoaWZ0ID0gZ2V0UG9pbnRGcm9tSXNvbWV0cmljUG9pbnQoMCwgMCwge1xuICAgICAgICAgICAgICAgIHI6ICgoX2EgPSB0aGlzLnByb3BzLnRleHR1cmUuc2hpZnQpID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5yaWdod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RpZXModGhpcy5lbGVtZW50LCB7ICdmaWxsLW9wYWNpdHknOiBcIlwiLmNvbmNhdCh0aGlzLmZpbGxPcGFjaXR5KSB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNHcmFwaGljQWJzdHJhY3QucHJvdG90eXBlLCBcInRleHR1cmVcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByb3BzLnRleHR1cmU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgaGFzVGV4dHVyZSA9ICEhdGhpcy5wcm9wcy50ZXh0dXJlO1xuICAgICAgICAgICAgdGhpcy5wcm9wcy50ZXh0dXJlID0gdmFsdWU7XG4gICAgICAgICAgICBpZiAoaGFzVGV4dHVyZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0ZVRleHR1cmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlVGV4dHVyZSh0aGlzLnByb3BzLnRleHR1cmUpO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3RvdHlwZSwgXCJzdHJva2VDb2xvclwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuI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4XSAhPT0gY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9jaGlsZHJlbi5zcGxpY2UoY2hpbGRJbmRleCwgMSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fY2hpbGRyZW4uc3BsaWNlKGluZGV4LCAwLCBjaGlsZCk7XG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkSW5kZXggPiBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuaW5zZXJ0QmVmb3JlKG1vdmVkRWxlbWVudCwgcmVwbGFjZWRFbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXBsYWNlZEVsZW1lbnQubmV4dFNpYmxpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZWxlbWVudC5pbnNlcnRCZWZvcmUobW92ZWRFbGVtZW50LCByZXBsYWNlZEVsZW1lbnQubmV4dFNpYmxpbmcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKG1vdmVkRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm93Q2hpbGRFcnJvcigpO1xuICAgIH07XG4gICAgSXNvbWV0cmljQ29udGFpbmVyQWJzdHJhY3QucHJvdG90eXBlLmJyaW5nQ2hpbGRUb0Zyb250ID0gZnVuY3Rpb24gKGNoaWxkKSB7XG4gICAgICAgIHZhciBjaGlsZEluZGV4ID0gdGhpcy5nZXRDaGlsZEluZGV4KGNoaWxkKTtcbiAgICAgICAgaWYgKGNoaWxkSW5kZXggPiAtMSkge1xuICAgICAgICAgICAgdGhpcy5zZXRDaGlsZEluZGV4KGNoaWxkLCB0aGlzLl9jaGlsZHJlbi5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudGhyb3dDaGlsZEVycm9yKCk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cGUuYnJpbmdDaGlsZEZvcndhcmQgPSBmdW5jdGlvbiAoY2hpbGQpIHtcbiAgICAgICAgdmFyIGNoaWxkSW5kZXggPSB0aGlzLmdldENoaWxkSW5kZXgoY2hpbGQpO1xuICAgICAgICBpZiAoY2hpbGRJbmRleCA+IC0xKSB7XG4gICAgICAgICAgICBpZiAoY2hpbGRJbmRleCA8IHRoaXMuX2NoaWxkcmVuLmxlbmd0aCAtIDEpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNldENoaWxkSW5kZXgoY2hpbGQsIGNoaWxkSW5kZXggKyAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudGhyb3dDaGlsZEVycm9yKCk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cGUuc2VuZENoaWxkVG9CYWNrID0gZnVuY3Rpb24gKGNoaWxkKSB7XG4gICAgICAgIHZhciBjaGlsZEluZGV4ID0gdGhpcy5nZXRDaGlsZEluZGV4KGNoaWxkKTtcbiAgICAgICAgaWYgKGNoaWxkSW5kZXggPiAtMSkge1xuICAgICAgICAgICAgdGhpcy5zZXRDaGlsZEluZGV4KGNoaWxkLCAwKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudGhyb3dDaGlsZEVycm9yKCk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cG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AgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGZpeGVkQ29vcmRzLnRvcCA9IF90aGlzLmdldFRvcChlbnRyeVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZml4ZWRDb29yZHM7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50VHlwZSkge1xuICAgICAgICB2YXIgZHJhZ0V2ZW50ID0gbmV3IEN1c3RvbUV2ZW50KGV2ZW50VHlwZSwge1xuICAgICAgICAgICAgY2FuY2VsYWJsZTogZXZlbnRUeXBlID09PSBEUkFHX0VWRU5ULkRSQUcsXG4gICAgICAgICAgICBkZXRhaWw6IHtcbiAgICAgICAgICAgICAgICByaWdodDogdGhpcy5fY29vcmRzLnJpZ2h0IHx8IHRoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgbGVmdDogdGhpcy5fY29vcmRzLmxlZnQgfHwgdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgIHRvcDogdGhpcy5fY29vcmRzLnRvcCB8fCB0aGlzLnRvcFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5lbGVtZW50LmRpc3BhdGNoRXZlbnQoZHJhZ0V2ZW50KTtcbiAgICAgICAgcmV0dXJuIGRyYWdFdmVudDtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5hbmltYXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5fdXBkYXRlKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX3ByZXZlbnRlZCkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLnJpZ2h0ID09PSBUeXBlb2YuTlVNQkVSKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmlnaHQgPSB0aGlzLl9jb29yZHMucmlnaHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLmxlZnQgPT09IFR5cGVvZi5OVU1CRVIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sZWZ0ID0gdGhpcy5fY29vcmRzLmxlZnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLnRvcCA9PT0gVHlwZW9mLk5VTUJFUikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRvcCA9IHRoaXMuX2Nvb3Jkcy50b3A7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX3JlcXVlc3RBbmltYXRpb25GcmFtZSh0aGlzLmFuaW1hdGUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBJc29tZXRyaWNEcmFnZ2FibGVBYnN0cmFjdC5wcm90b3R5cGUuc3RhcnREcmFnID0gZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHZhciBfYSA9IGdldENsaWVudENvb3JkcyhldmVudCksIGNsaWVudFggPSBfYS5jbGllbnRYLCBjbGllbnRZID0gX2EuY2xpZW50WTtcbiAgICAgICAgdGhpcy5fZHJhZ1N0b3JlLnggPSBjbGllbnRYO1xuICAgICAgICB0aGlzLl9kcmFnU3RvcmUueSA9IGNsaWVudFk7XG4gICAgICAgIHRoaXMuX2RyYWdTdG9yZS5yaWdodCA9IHRoaXMucmlnaHQ7XG4gICAgICAgIHRoaXMuX2RyYWdTdG9yZS5sZWZ0ID0gdGhpcy5sZWZ0O1xuICAgICAgICB0aGlzLl9kcmFnU3RvcmUudG9wID0gdGhpcy50b3A7XG4gICAgICAgIHRoaXMuX3VwZGF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BlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZSwgXCJsZWZ0XCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcm9wcy5sZWZ0O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJvcHMubGVmdCAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLmxlZnQgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZSwgXCJ0b3BcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByb3BzLnRvcDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3BzLnRvcCAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnRvcCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9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eSA9IGlzU1ZHUHJvcGVydHkoYW5pbWF0aW9uLnByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmICghaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIHZhciBwcm9wc18xID0ge1xuICAgICAgICAgICAgICAgICAgICByaWdodDogX3RoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgICAgIGxlZnQ6IF90aGlzLmxlZnQsXG4gICAgICAgICAgICAgICAgICAgIHRvcDogX3RoaXMudG9wLFxuICAgICAgICAgICAgICAgICAgICB3aWR0aDogX3RoaXMud2lkdGgsXG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDogX3RoaXMuaGVpZ2h0XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzXzEsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICt2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5nZXRSZWN0YW5nbGVQYXRoKG1vZGlmaWVkQXJncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogX3RoaXMuZ2V0UmVjdGFuZ2xlUGF0aChtb2RpZmllZEFyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b0FyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG87XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IF90aGlzLmdldFJlY3RhbmdsZVBhdGgoZnJvbUFyZ3MpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBfdGhpcy5nZXRSZWN0YW5nbGVQYXRoKHRvQXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCdkJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNSZWN0YW5nbGUucHJvdG90eXBlLCBcIndpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd2lkdGg7XG4gICAgIC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mFzc2lnbiB8fCBmdW5jdGlvbih0KSB7XG4gICAgICAgIGZvciAodmFyIHMsIGkgPSAxLCBuID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgcyA9IGFyZ3VtZW50c1tpXTtcbiAgICAgICAgICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSlcbiAgICAgICAgICAgICAgICB0W3BdID0gc1twXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdDtcbiAgICB9O1xuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xufTtcbnZhciBfX3Jlc3QgPSAodGhpcyAmJiB0aGlzLl9fcmVzdCkgfHwgZnVuY3Rpb24gKHMsIGUpIHtcbiAgICB2YXIgdCA9IHt9O1xuICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSAmJiBlLmluZGV4T2YocCkgPCAwKVxuICAgICAgICB0W3BdID0gc1twXTtcbiAgICBpZiAocyAhPSBudWxsICYmIHR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzID09PSBcImZ1bmN0aW9uXCIpXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBwID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhzKTsgaSA8IHAubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcbiAgICAgICAgICAgICAgICB0W3BbaV1dID0gc1twW2ldXTtcbiAgICAgICAgfVxuICAgIHJldHVybiB0O1xufTtcbmltcG9ydCB7IENvbW1hbmQsIFBsYW5lVmlldywgU1ZH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Q7XG4gICAgICAgIHZhciB0b3AgPSAoYXJncyA9PT0gbnVsbCB8fCBhcmdzID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhcmdzLnRvcCkgfHwgdGhpcy50b3A7XG4gICAgICAgIHZhciByYWRpdXMgPSAoYXJncyA9PT0gbnVsbCB8fCBhcmdzID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhcmdzLnJhZGl1cykgfHwgdGhpcy5yYWRpdXM7XG4gICAgICAgIHZhciBjb21tYW5kcyA9IFtdO1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhbmVWaWV3KSB7XG4gICAgICAgICAgICBjYXNlIFBsYW5lVmlldy5GUk9OVDpcbiAgICAgICAgICAgICAgICBjb21tYW5kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5tb3ZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiByYWRpdXMsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogLXJhZGl1cywgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IDAsIGw6IDAsIHQ6IC1yYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogMCwgbDogMCwgdDogcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6XG4gICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQubW92ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogLXJhZGl1cywgbDogMCwgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiByYWRpdXMsIGw6IDAsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiAtcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IC1yYWRpdXMsIGw6IDAsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiByYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuVE9QOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLm1vdmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IHJhZGl1cywgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiAtcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogcmFkaXVzLCBsOiAwLCB0OiAwIH1cbiAgICAgICAgICAgICAgICB9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ICAgICAgICAgICAgICAgIHJpZ2h0OiBfdGhpcy5yaWdodCxcbiAgICAgICAgICAgICAgICAgICAgbGVmdDogX3RoaXMubGVmdCxcbiAgICAgICAgICAgICAgICAgICAgdG9wOiBfdGhpcy50b3AsXG4gICAgICAgICAgICAgICAgICAgIHJhZGl1czogX3RoaXMucmFkaXVzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzXzEsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICt2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5nZXRDaXJjbGVQYXRoKG1vZGlmaWVkQXJncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogX3RoaXMuZ2V0Q2lyY2xlUGF0aChtb2RpZmllZEFyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b0FyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG87XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IF90aGlzLmdldENpcmNsZVBhdGgoZnJvbUFyZ3MpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBfdGhpcy5nZXRDaXJjbGVQYXRoKHRvQXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCdkJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNDaXJjbGUucHJvdG90eXBlLCBcInJhZGl1c1wiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3JhZGl1cztcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX3JhZGl1cyA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZV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1hbmRzKGNvbW1hbmRzKSwgX3RoaXMuZGF0YS5jZW50ZXJYLCBfdGhpcy5kYXRhLmNlbnRlclksIF90aGlzLmRhdGEuc2NhbGUsIF90aGlzLl9hdXRvY2xvc2UpOyB9O1xuICAgICAgICBfdGhpcy5jb21tYW5kcyA9IFtdO1xuICAgICAgICBfdGhpcy5fYXV0b2Nsb3NlID0gJ2F1dG9jbG9zZScgaW4gcHJvcHNcbiAgICAgICAgICAgID8gcHJvcHMuYXV0b2Nsb3NlXG4gICAgICAgICAgICA6IHRydWU7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgSXNvbWV0cmljUGF0aC5wcm90b3R5cGUudXBkYXRlU3ViQ2xhc3NBbmltYXRpb25zID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnByb3BlcnR5ID09PSAncGF0aCcpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBBcnJheS5pc0FycmF5KGFuaW1hdGlvbi52YWx1ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQodmFsdWUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcykpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogX3RoaXMuZ2V0UGF0aEZyb21Db21tYW5kcyhcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG86IF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQoYW5pbWF0aW9uLnRvKSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCdkJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCBwcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbi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cy5wbGFuZVZpZXcgPSBwbGFuZVZpZXc7XG4gICAgICAgIF90aGlzLmZvbnRGYW1pbHkgPSBmb250RmFtaWx5O1xuICAgICAgICBfdGhpcy5mb250U2l6ZSA9IGZvbnRTaXplO1xuICAgICAgICBfdGhpcy5mb250U3R5bGUgPSBmb250U3R5bGU7XG4gICAgICAgIF90aGlzLmZvbnRXZWlnaHQgPSBmb250V2VpZ2h0O1xuICAgICAgICBfdGhpcy5zZWxlY3RhYmxlID0gc2VsZWN0YWJsZTtcbiAgICAgICAgX3RoaXMub3JpZ2luID0gb3JpZ2luO1xuICAgICAgICBfdGhpcy5yaWdodCA9IHJpZ2h0O1xuICAgICAgICBfdGhpcy5sZWZ0ID0gbGVmdDtcbiAgICAgICAgX3RoaXMudG9wID0gdG9wO1xuICAgICAgICBfdGhpcy5yb3RhdGlvbiA9IHJvdGF0aW9uO1xuICAgICAgICBfdGhpcy50ZXh0ID0gdGV4dDtcbiAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgIH1cbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS5nZXRQb3NpdGlvblRyYW5zZm9ybSA9IGZ1bmN0aW9uIChwcm9wcywgZnJvbUNlbnRlcikge1xuICAgICAgICBpZiAoZnJvbUNlbnRlciA9PT0gdm9pZCAwKSB7IGZyb21DZW50ZXIgPSB0cnVlOyB9XG4gICAgICAgIHJldHVybiBnZXRQb2ludEZyb21Jc29tZXRyaWNQb2ludChmcm9tQ2VudGVyXG4gICAgICAgICAgICA/IHRoaXMuZGF0YS5jZW50ZXJYXG4gICAgICAgICAgICA6IDAsIGZyb21DZW50ZXJcbiAgICAgICAgICAgID8gdGhpcy5kYXRhLmNlbnRlcllcbiAgICAgICAgICAgIDogMCwge1xuICAgICAgICAgICAgcjogcHJvcHMucmlnaHQsXG4gICAgICAgICAgICBsOiBwcm9wcy5sZWZ0LFxuICAgICAgICAgICAgdDogcHJvcHMudG9wXG4gICAgICAgIH0sIHRoaXMuZGF0YS5zY2FsZSk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS51cGRhdGVTdWJDbGFzc0FuaW1hdGlvbnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBwcm9wcyA9IHtcbiAgICAgICAgICAgIHJpZ2h0OiAwLFxuICAgICAgICAgICAgbGVmdDogMCxcbiAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgIHJvdGF0aW9uOiAwLFxuICAgICAgICB9O1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICB2YXIgaXNOYXRpdmVTVkdQcm9wZXJ0eSA9IGlzU1ZHUHJvcGVydHkoYW5pbWF0aW9uLnByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmICghaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocHJvcHMsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpc1JvdGF0aW9uXzEgPSBwcm9wZXJ0eV8xID09PSAncm90YXRpb24nO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29tbW9uUHJvcHMgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgX3RoaXMuY29tbW9uQW5pbWF0aW9uQXR0cmlidXRlcyksIHsgdHlwZTogaXNSb3RhdGlvbl8xXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncm90YXRlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RyYW5zbGF0ZScsIGJlZ2luOiAnaW5kZWZpbml0ZScgfSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcIlwiLmNvbmNhdCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArdmFsdWUgLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzID0gX3RoaXMuZ2V0UG9zaXRpb25UcmFuc2Zvcm0obW9kaWZpZWRBcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiXCIuY29uY2F0KGNvb3Jkcy54LCBcIixcIikuY29uY2F0KGNvb3Jkcy55KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignOycpIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBcIlwiLmNvbmNhdChhbmltYXRpb24udmFsdWVzKSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK2FuaW1hdGlvbi52YWx1ZXMgLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKG1vZGlmaWVkQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyB2YWx1ZXM6IFwiXCIuY29uY2F0KGNvb3Jkcy54LCBcIixcIikuY29uY2F0KGNvb3Jkcy55KSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IGZyb206IFwiXCIuY29uY2F0KGFuaW1hdGlvbi5mcm9tKSwgdG86IFwiXCIuY29uY2F0KGFuaW1hdGlvbi50bykgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21BcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9BcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbSAtIF90aGlzW3Byb3BlcnR5XzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG8gLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzRnJvbSA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKGZyb21BcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3Jkc1RvID0gX3RoaXMuZ2V0UG9zaXRpb25UcmFuc2Zvcm0odG9BcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgZnJvbTogXCJcIi5jb25jYXQoY29vcmRzRnJvbS54LCBcIixcIikuY29uY2F0KGNvb3Jkc0Zyb20ueSksIHRvOiBcIlwiLmNvbmNhdChjb29yZHNUby54LCBcIixcIikuY29uY2F0KGNvb3Jkc1RvLnkpIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZVRyYW5zZm9ybSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCd0cmFuc2Zvcm0nLCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCBwcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNSb3RhdGlvbl8xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3RleHRFbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQuYmVnaW5FbGVtZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS51cGRhdGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmIChlbGVtZW50SGFzU1ZHUGFyZW50KHRoaXMuZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHZhciB0cmFuc2Zvcm0gPSB0aGlzLmdldE1hdHJpeFRyYW5zZm9ybSh7XG4gICAgICAgICAgICAgICAgcmlnaHQ6IHRoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgbGVmdDogdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgIHRvcDogdGhpcy50b3BcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90ZXh0RWxlbWVudCwgeyB0cmFuc2Zvcm06IHRyYW5zZm9ybSB9KTtcbiAgICAgICAgICAgIHRoaXMuX3RzcGFuLnRleHRDb250ZW50ID0gdGhpcy5fdGV4dDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlUGF0dGVyblRyYW5zZm9ybSh7IHg6IDAsIHk6IDAgfSwgdGhpcy5wbGFuZVZpZXcpO1xuICAgICAgICAgICAgdGhpcy51cGRhdGVBbmltYXRpb25zKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS5jbGVhciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy50ZXh0ID0gJyc7XG4gICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInRleHRcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICA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ICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90ZXh0RWxlbWVudCwge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZTogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJy13ZWJraXQtdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJy1tb3otdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJy1tcy11c2VyLXNlbGVjdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BvaW50ZXItZXZlbnRzJ1xuICAgICAgICAgICAgICAgICAgICBdLm1hcChmdW5jdGlvbiAoZGVjbCkgeyByZXR1cm4gXCJcIi5jb25jYXQoZGVjbCwgXCI6IG5vbmVcIik7IH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcIm9yaWdpblwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX29yaWdpbjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX29yaWdpbiA9IHZhbHVlO1xuICAgICAgICAgICAgdmFyIF9hID0gdGhpcy5fb3JpZ2luLCB0ZXh0QW5jaG9yID0gX2FbMF0sIGFsaWdubWVudEJhc2VsaW5lID0gX2FbMV07XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuX3RzcGFuLCB7XG4gICAgICAgICAgICAgICAgJ3RleHQtYW5jaG9yJzogdGhpcy5fb3JpZ2luSGFzaFt0ZXh0QW5jaG9yXSxcbiAgICAgICAgICAgICAgICAnYWxpZ25tZW50LWJhc2VsaW5lJzogdGhpcy5fb3JpZ2luSGFzaFthbGlnbm1lbnRCYXNlbGluZV1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInJpZ2h0XCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcmlnaHQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5fcmlnaHQgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcmlnaHQgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcImxlZnRcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9sZWZ0O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX2xlZnQgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGVmdCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwidG9wXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdG9wO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX3RvcCAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl90b3AgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInJvdGF0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcm90YXRpb247XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5fcm90YXRpb24gIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcm90YXRpb24gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxl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OiIifQ==\n//# sourceURL=webpack-internal:///150\n')},966:(module,exports)=>{eval('var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(){var r=null;\n(function(){function X(e){function j(){try{J.doScroll("left")}catch(e){P(j,50);return}w("poll")}function w(j){if(!(j.type=="readystatechange"&&x.readyState!="complete")&&((j.type=="load"?n:x)[z](i+j.type,w,!1),!m&&(m=!0)))e.call(n,j.type||j)}var Y=x.addEventListener,m=!1,C=!0,t=Y?"addEventListener":"attachEvent",z=Y?"removeEventListener":"detachEvent",i=Y?"":"on";if(x.readyState=="complete")e.call(n,"lazy");else{if(x.createEventObject&&J.doScroll){try{C=!n.frameElement}catch(A){}C&&j()}x[t](i+"DOMContentLoaded",\nw,!1);x[t](i+"readystatechange",w,!1);n[t](i+"load",w,!1)}}function Q(){S&&X(function(){var e=K.length;$(e?function(){for(var j=0;j=0;){var M=A[m],T=M.src.match(/^[^#?]*\\/run_prettify\\.js(\\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D=\n[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]-\na[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*]|\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\\\d+|\\\\[^\\dux]|\\(\\?[!:=]|[()^]|[^()[\\\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y,\ng),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\\S\\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\'\'(?:[^\'\\\\]|\\\\[\\S\\s]|\'\'?(?=[^\']))*(?:\'\'\'|$)|"""(?:[^"\\\\]|\\\\[\\S\\s]|""?(?=[^"]))*(?:"""|$)|\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$))/,\nr,"\'\\""]):a.multiLineStrings?d.push(["str",/^(?:\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$)|`(?:[^\\\\`]|\\\\[\\S\\s])*(?:`|$))/,r,"\'\\"`"]):d.push(["str",/^(?:\'(?:[^\\n\\r\'\\\\]|\\\\.)*(?:\'|$)|"(?:[^\\n\\r"\\\\]|\\\\.)*(?:"|$))/,r,"\\"\'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\\b|[^\\n\\r]*)/,\nr,"#"]),h.push(["str",/^<(?:(?:(?:\\.\\.\\/)*|\\/?)(?:[\\w-]+(?:\\/[\\w-]+)+)?[\\w-]+\\.h(?:h|pp|\\+\\+)?|[a-z]\\w*)>/,r])):d.push(["com",/^#[^\\n\\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\\/\\/[^\\n\\r]*/,r]),h.push(["com",/^\\/\\*[\\S\\s]*?(?:\\*\\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\\n\\r")?".":"[\\\\S\\\\s]";h.push(["lang-regex",RegExp("^(?:^^\\\\.?|[+-]|[!=]=?=?|\\\\#|%=?|&&?=?|\\\\(|\\\\*=?|[+\\\\-]=|->|\\\\/=?|::?|<>?>?=?|,|;|\\\\?|@|\\\\[|~|{|\\\\^\\\\^?=?|\\\\|\\\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\\\s*("+\n("/(?=[^/*"+b+"])(?:[^/\\\\x5B\\\\x5C"+b+"]|\\\\x5C"+e+"|\\\\x5B(?:[^\\\\x5C\\\\x5D"+b+"]|\\\\x5C"+e+")*(?:\\\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\\s,]+/g,"|")+")\\\\b"),r]);d.push(["pln",/^\\s+/,r," \\r\\n\\t\\u00a0"]);b="^.[^\\\\s\\\\w.$@\'\\"`/\\\\\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\\w$@]*|\\w+_t\\b)/,r],["pln",/^[$_a-z][\\w$@]*/i,r],["lit",/^(?:0x[\\da-f]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+-]?\\d+)?)[a-z]*/i,\nr,"0123456789"],["pln",/^\\\\[\\S\\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}}\nfunction e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\\s)nocode(?:\\s|$)/,m=/\\r\\n?|\\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],\n"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],\nL=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],\nN=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,\nS=/\\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\\!--[\\S\\s]*?(?:--\\>|$)/],["lang-",/^<\\?([\\S\\s]+?)(?:\\?>|$)/],["lang-",/^<%([\\S\\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",\n/^]*>([\\S\\s]+?)<\\/xmp\\b[^>]*>/i],["lang-js",/^]*>([\\S\\s]*?)(<\\/script\\b[^>]*>)/i],["lang-css",/^]*>([\\S\\s]*?)(<\\/style\\b[^>]*>)/i],["lang-in.tag",/^(<\\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\\s+/,r," \\t\\r\\n"],["atv",/^(?:"[^"]*"?|\'[^\']*\'?)/,r,"\\"\'"]],[["tag",/^^<\\/?[a-z](?:[\\w-.:]*\\w)?|\\/?>$/i],["atn",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],["lang-uq.val",/^=\\s*([^\\s"\'>]*(?:[^\\s"\'/>]|\\/(?=\\s)))/],["pun",/^[/<->]+/],\n["lang-js",/^on\\w+\\s*=\\s*"([^"]+)"/i],["lang-js",/^on\\w+\\s*=\\s*\'([^\']+)\'/i],["lang-js",/^on\\w+\\s*=\\s*([^\\s"\'>]+)/i],["lang-css",/^style\\s*=\\s*"([^"]+)"/i],["lang-css",/^style\\s*=\\s*\'([^\']+)\'/i],["lang-css",/^style\\s*=\\s*([^\\s"\'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\\S\\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}),\n["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N,\nhashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);\ni(C([],[["str",/^[\\S\\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML},\nprettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p{for(var C in g)__webpack_require__.o(g,C)&&!__webpack_require__.o(I,C)&&Object.defineProperty(I,C,{enumerable:!0,get:g[C]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(I){if("object"==typeof window)return window}}(),__webpack_require__.o=(I,g)=>Object.prototype.hasOwnProperty.call(I,g),__webpack_require__.r=I=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})},(()=>{var I;__webpack_require__.g.importScripts&&(I=__webpack_require__.g.location+"");var g=__webpack_require__.g.document;if(!I&&g&&(g.currentScript&&(I=g.currentScript.src),!I)){var C=g.getElementsByTagName("script");if(C.length)for(var t=C.length-1;t>-1&&(!I||!/^http(s?):/.test(I));)I=C[t--].src}if(!I)throw new Error("Automatic publicPath is not supported in this browser");I=I.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=I+"../"})();var __webpack_exports__=__webpack_require__(150),__webpack_export_target__=window;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var __webpack_modules__={807:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// NAMESPACE OBJECT: ./src/index.ts\nvar src_namespaceObject = {};\n__webpack_require__.r(src_namespaceObject);\n__webpack_require__.d(src_namespaceObject, {\n Axis: () => (Axis),\n IsometricCanvas: () => (IsometricCanvas),\n IsometricCircle: () => (IsometricCircle),\n IsometricGroup: () => (IsometricGroup),\n IsometricPath: () => (IsometricPath),\n IsometricRectangle: () => (IsometricRectangle),\n IsometricText: () => (IsometricText),\n LineCap: () => (LineCap),\n LineJoin: () => (LineJoin),\n PlaneView: () => (PlaneView)\n});\n\n// EXTERNAL MODULE: ./node_modules/.pnpm/google-code-prettify@1.0.5/node_modules/google-code-prettify/bin/run_prettify.min.js\nvar run_prettify_min = __webpack_require__(966);\n;// CONCATENATED MODULE: ./src/@constants/index.ts\nvar SVG_NAMESPACE = \'http://www.w3.org/2000/svg\';\nvar SVG_ELEMENTS;\n(function (SVG_ELEMENTS) {\n SVG_ELEMENTS["svg"] = "svg";\n SVG_ELEMENTS["group"] = "g";\n SVG_ELEMENTS["path"] = "path";\n SVG_ELEMENTS["rect"] = "rect";\n SVG_ELEMENTS["text"] = "text";\n SVG_ELEMENTS["tspan"] = "tspan";\n SVG_ELEMENTS["pattern"] = "pattern";\n SVG_ELEMENTS["image"] = "image";\n SVG_ELEMENTS["animate"] = "animate";\n SVG_ELEMENTS["animateTransform"] = "animateTransform";\n})(SVG_ELEMENTS || (SVG_ELEMENTS = {}));\nvar SVG_PROPERTIES;\n(function (SVG_PROPERTIES) {\n SVG_PROPERTIES["viewBox"] = "viewBox";\n})(SVG_PROPERTIES || (SVG_PROPERTIES = {}));\nvar DECIMALS = 6;\nvar SQRT3 = +(Math.sqrt(3).toFixed(DECIMALS));\nvar HSQRT3 = +((Math.sqrt(3) / 2).toFixed(DECIMALS));\nvar DEFAULT_WIDTH = 640;\nvar DEFAULT_HEIGHT = 480;\nvar N = \'(-?\\\\d+(?:\\\\.\\\\d+)?|-?\\\\.\\\\d+)\';\nvar S = \'\\\\s*\';\nvar SS = \'\\\\s+\';\nvar POINT = "".concat(N).concat(SS).concat(N).concat(SS).concat(N);\nvar CURVE = "".concat(POINT).concat(SS).concat(POINT);\nvar COMMANDS_REGEXP = new RegExp("(?:(M|L)".concat(S).concat(POINT).concat(S, "|(C)").concat(S).concat(CURVE, ")").concat(S), \'g\');\nvar SCALE = Math.sqrt(3 / 2);\nvar ROT_60 = Math.PI / 3;\nvar ROT_45 = Math.PI / 4;\nvar ROT_CMA = Math.atan(Math.SQRT2);\nvar Colors;\n(function (Colors) {\n Colors["white"] = "white";\n Colors["black"] = "black";\n})(Colors || (Colors = {}));\nvar LineCap;\n(function (LineCap) {\n LineCap["butt"] = "butt";\n LineCap["square"] = "square";\n LineCap["round"] = "round";\n})(LineCap || (LineCap = {}));\nvar LineJoin;\n(function (LineJoin) {\n LineJoin["miter"] = "miter";\n LineJoin["round"] = "round";\n LineJoin["bevel"] = "bevel";\n})(LineJoin || (LineJoin = {}));\nvar Command;\n(function (Command) {\n Command["move"] = "move";\n Command["line"] = "line";\n Command["curve"] = "curve";\n})(Command || (Command = {}));\nvar PlaneView;\n(function (PlaneView) {\n PlaneView["FRONT"] = "FRONT";\n PlaneView["SIDE"] = "SIDE";\n PlaneView["TOP"] = "TOP";\n})(PlaneView || (PlaneView = {}));\nvar Axis;\n(function (Axis) {\n Axis["RIGHT"] = "RIGHT";\n Axis["LEFT"] = "LEFT";\n Axis["TOP"] = "TOP";\n})(Axis || (Axis = {}));\nvar Typeof;\n(function (Typeof) {\n Typeof["UNDEFINED"] = "undefined";\n Typeof["NUMBER"] = "number";\n})(Typeof || (Typeof = {}));\nvar EVENTS;\n(function (EVENTS) {\n EVENTS["MOUSE_MOVE"] = "mousemove";\n EVENTS["MOUSE_DOWN"] = "mousedown";\n EVENTS["MOUSE_UP"] = "mouseup";\n EVENTS["TOUCH_START"] = "touchstart";\n EVENTS["TOUCH_MOVE"] = "touchmove";\n EVENTS["TOUCH_END"] = "touchend";\n})(EVENTS || (EVENTS = {}));\nvar ORIGIN;\n(function (ORIGIN) {\n ORIGIN["CENTER"] = "center";\n ORIGIN["LEFT"] = "left";\n ORIGIN["RIGHT"] = "right";\n ORIGIN["TOP"] = "top";\n ORIGIN["BOTTOM"] = "bottom";\n})(ORIGIN || (ORIGIN = {}));\n\n;// CONCATENATED MODULE: ./src/@utils/math.ts\n\nvar round = function (n, d) {\n var exp = Math.pow(10, d);\n return Math.round(n * exp) / exp;\n};\nvar radian = function (a) { return a * Math.PI / 180; };\nvar sincos = function (r) { return ({\n sin: round(Math.sin(r), DECIMALS),\n cos: round(Math.cos(r), DECIMALS)\n}); };\nvar getPointsDiff = function (pointA, pointB) { return ({\n x: pointA.x - pointB.x,\n y: pointA.y - pointB.y\n}); };\nvar getPointsDistance = function (pointA, pointB) {\n var diff = getPointsDiff(pointA, pointB);\n return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));\n};\nvar translatePoint = function (point, angle, distance) { return ({\n x: point.x + Math.cos(angle) * distance,\n y: point.y + Math.sin(angle) * distance\n}); };\nvar rotate = function (point, center, angle) {\n var diff = getPointsDiff(point, center);\n var x = diff.x * Math.cos(angle) - diff.y * Math.sin(angle);\n var y = diff.x * Math.sin(angle) + diff.y * Math.cos(angle);\n return {\n x: center.x + x,\n y: center.y + y\n };\n};\nvar getPointsAngle = function (pointA, pointB) {\n var diff = getPointsDiff(pointB, pointA);\n return Math.atan2(diff.y, diff.x);\n};\nvar getOrientation = function (p1, p2, p3) {\n var value = (p2.y - p1.y) * (p3.x - p2.x) - (p2.x - p1.x) * (p3.y - p2.y);\n return value >= 0 ? 0 : 1;\n};\nvar getPointFromIsometricPoint = function (centerX, centerY, point, scale) {\n return {\n x: round(centerX + (point.r - point.l) * scale * HSQRT3, DECIMALS),\n y: round(centerY + ((point.r + point.l) / 2 - point.t) * scale, DECIMALS)\n };\n};\nvar getTopPlanePointFromCoordinates = function (x, y) {\n var XHSQRT3 = x / HSQRT3;\n var right = (y * 2 + XHSQRT3) / 2;\n var left = right - XHSQRT3;\n return {\n right: right,\n left: left\n };\n};\nvar getFrontPlanePointFromCoordinates = function (x, y) {\n var left = -x / HSQRT3;\n var top = left / 2 - y;\n return {\n left: left,\n top: top\n };\n};\nvar getSidePlanePointFromCoordinates = function (x, y) {\n var right = x / HSQRT3;\n var top = right / 2 - y;\n return {\n right: right,\n top: top\n };\n};\nvar getEllipsisSpecs = function (pointA, pointB, control) {\n var diff = getPointsDiff(pointB, pointA);\n var center = { x: pointA.x + diff.x / 2, y: pointA.y + diff.y / 2 };\n var P = rotate(pointB, center, Math.PI / 2);\n var D = { x: P.x + (control.x - P.x) / 2, y: P.y + (control.y - P.y) / 2 };\n var radius = getPointsDistance(D, center);\n var U = translatePoint(D, getPointsAngle(D, P), radius);\n var V = translatePoint(D, getPointsAngle(D, control), radius);\n return [\n round(getPointsDistance(control, U), DECIMALS),\n round(getPointsDistance(control, V), DECIMALS),\n round(getPointsAngle(center, V) * 180 / Math.PI, DECIMALS)\n ];\n};\nvar randomId = function () { return Math.random().toString(16).slice(2); };\nvar uuid = function () { return Array.from(Array(3)).map(function () { return randomId(); }).join(\'-\'); };\n\n;// CONCATENATED MODULE: ./src/@utils/matrix.ts\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\nvar multiplyMatrix = function (m1, m2) { return (m1.map(function (row, i) { return (m2[0].map(function (_, j) {\n return row.reduce(function (acc, _, n) {\n return acc + m1[i][n] * m2[n][j];\n }, 0);\n})); })); };\nvar multiplyMatrices = function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n var matrix = m[0];\n for (var i = 1; i < m.length; i++) {\n matrix = multiplyMatrix(matrix, m[i]);\n }\n return matrix;\n};\nvar rotateX = function (r) {\n var sc = sincos(r);\n return [\n [1, 0, 0],\n [0, sc.cos, -sc.sin],\n [0, sc.sin, sc.cos]\n ];\n};\nvar rotateY = function (r) {\n var sc = sincos(r);\n return [\n [sc.cos, 0, sc.sin],\n [0, 1, 0],\n [-sc.sin, 0, sc.cos]\n ];\n};\nvar rotateZ = function (r) {\n var sc = sincos(r);\n return [\n [sc.cos, -sc.sin, 0],\n [sc.sin, sc.cos, 0],\n [0, 0, 1]\n ];\n};\nvar topMatrix = multiplyMatrices(rotateX(ROT_CMA), rotateZ(-ROT_45));\nvar frontMatrix = multiplyMatrices(rotateZ(-ROT_60), rotateX(ROT_CMA), rotateZ(ROT_45));\nvar sideMatrix = multiplyMatrices(rotateZ(ROT_60), rotateX(ROT_CMA), rotateZ(-ROT_45));\nvar rotationToRotationMatrix = function (view, rotation) {\n var value = radian(rotation.value);\n switch (view) {\n case PlaneView.TOP: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateZ(value);\n case Axis.LEFT:\n return rotateX(-value);\n case Axis.RIGHT:\n return rotateY(value);\n default:\n return null;\n }\n }\n case PlaneView.FRONT: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateY(value);\n case Axis.LEFT:\n return rotateX(value);\n case Axis.RIGHT:\n return rotateZ(value);\n default:\n return null;\n }\n }\n case PlaneView.SIDE: {\n switch (rotation.axis) {\n case Axis.TOP:\n return rotateY(value);\n case Axis.LEFT:\n return rotateZ(value);\n case Axis.RIGHT:\n return rotateX(-value);\n default:\n return null;\n }\n }\n default:\n return null;\n }\n};\nvar getViewMatrix = function (planeView, rotation) {\n var rotationMatrices = [];\n var rotationMatrix = rotation\n ? rotationToRotationMatrix(planeView, rotation)\n : null;\n if (rotationMatrix)\n rotationMatrices.push(rotationMatrix);\n switch (planeView) {\n case PlaneView.TOP: {\n return multiplyMatrices.apply(void 0, __spreadArray([topMatrix], rotationMatrices, false));\n }\n case PlaneView.FRONT: {\n return multiplyMatrices.apply(void 0, __spreadArray([frontMatrix], rotationMatrices, false));\n }\n case PlaneView.SIDE: {\n return multiplyMatrices.apply(void 0, __spreadArray([sideMatrix], rotationMatrices, false));\n }\n }\n return null;\n};\n\n;// CONCATENATED MODULE: ./src/@utils/svg.ts\nvar svg_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\nvar addSVGProperties = function (svg, props) {\n Object.keys(props).forEach(function (prop) {\n svg.setAttributeNS(null, prop, props[prop]);\n });\n};\nvar getCommandsWithStart = function (commands) {\n return commands.length === 0 || commands[0].command === Command.move\n ? svg_spreadArray([], commands, true) : svg_spreadArray([\n {\n command: Command.move,\n point: { r: 0, l: 0, t: 0 }\n }\n ], commands, true);\n};\nvar getSVGPath = function (commands, centerX, centerY, scale, autoclose) {\n var drawCommands = getCommandsWithStart(commands);\n var svgPaths = drawCommands.map(function (c, index) {\n var point = getPointFromIsometricPoint(centerX, centerY, c.point, scale);\n switch (c.command) {\n case Command.move:\n return "M".concat(point.x, " ").concat(point.y);\n case Command.line:\n return "L".concat(point.x, " ").concat(point.y);\n case Command.curve: {\n var start = getPointFromIsometricPoint(centerX, centerY, commands[index - 1].point, scale);\n var control = getPointFromIsometricPoint(centerX, centerY, c.control, scale);\n var ellipsisSpecs = getEllipsisSpecs(start, point, control);\n var sweepFlag = getOrientation(start, control, point);\n return "A ".concat(ellipsisSpecs[0], " ").concat(ellipsisSpecs[1], " ").concat(ellipsisSpecs[2], " 0 ").concat(sweepFlag, " ").concat(point.x, " ").concat(point.y);\n }\n }\n });\n if (svgPaths.length) {\n var pathEnd = autoclose ? \'z\' : \'\';\n return "".concat(svgPaths.join(\' \').trim()).concat(pathEnd);\n }\n return \'\';\n};\nvar parseDrawCommands = function (commands) {\n var commandsArray = [];\n var array;\n while ((array = COMMANDS_REGEXP.exec(commands)) !== null) {\n var command = array[5] || array[1];\n switch (command) {\n case \'M\':\n commandsArray.push({\n command: Command.move,\n point: { r: +array[2], l: +array[3], t: +array[4] }\n });\n break;\n case \'L\':\n commandsArray.push({\n command: Command.line,\n point: { r: +array[2], l: +array[3], t: +array[4] }\n });\n break;\n case \'C\':\n commandsArray.push({\n command: Command.curve,\n control: { r: +array[6], l: +array[7], t: +array[8] },\n point: { r: +array[9], l: +array[10], t: +array[11] }\n });\n }\n }\n return commandsArray;\n};\nvar translateCommandPoints = function (commands, right, left, top) {\n commands.forEach(function (command) {\n command.point.r += right;\n command.point.l += left;\n command.point.t += top;\n if (command.control) {\n command.control.r += right;\n command.control.l += left;\n command.control.t += top;\n }\n });\n};\nvar getTextureCorner = function (commands, centerX, centerY, scale) {\n var corner = {\n x: Number.MAX_SAFE_INTEGER,\n y: Number.MAX_SAFE_INTEGER\n };\n getCommandsWithStart(commands)\n .forEach(function (c) {\n var point = getPointFromIsometricPoint(centerX, centerY, c.point, scale);\n if (point.x < corner.x ||\n (point.x === corner.x &&\n point.y < corner.y)) {\n corner.x = point.x;\n corner.y = point.y;\n }\n });\n return corner;\n};\nvar isSVGProperty = function (property) {\n return [\n \'fillColor\',\n \'fillOpacity\',\n \'strokeColor\',\n \'strokeOpacity\',\n \'strokeWidth\'\n ].includes(property);\n};\nvar getSVGProperty = function (property) {\n return {\n fillColor: \'fill\',\n fillOpacity: \'fill-opacity\',\n strokeColor: \'stroke\',\n strokeOpacity: \'stroke-opacity\',\n strokeWidth: \'stroke-width\'\n }[property];\n};\nfunction addEventListenerToElement(element, listeners, event, callback, useCapture) {\n var listener = {\n fn: callback,\n fnBind: callback.bind(this)\n };\n listeners.push(listener);\n element.addEventListener(event, listener.fnBind, useCapture);\n}\nfunction removeEventListenerFromElement(element, listeners, event, callback, useCapture) {\n var listener;\n listeners.find(function (ln, index) {\n if (ln.fn === callback) {\n listener = listeners.splice(index, 1)[0];\n return true;\n }\n });\n if (listener) {\n element.removeEventListener(event, listener.fnBind, useCapture);\n }\n}\nvar getPatternTransform = function (corner, planeView, scale, rotation) {\n var matrix = getViewMatrix(planeView, rotation);\n var transform = "translate(".concat(corner.x, " ").concat(corner.y, ")");\n if (matrix) {\n var m1 = round(matrix[0][0], DECIMALS);\n var m2 = round(matrix[1][0], DECIMALS);\n var m3 = round(matrix[0][1], DECIMALS);\n var m4 = round(matrix[1][1], DECIMALS);\n transform += " matrix(".concat(m1, ",").concat(m2, ",").concat(m3, ",").concat(m4, ",0,0)");\n transform += " scale(".concat(round(SCALE * (scale || 1), DECIMALS), ")");\n }\n else if (scale) {\n transform += " scale(".concat(round(scale, DECIMALS), ")");\n }\n return transform;\n};\nvar elementHasSVGParent = function (element) {\n if (element.parentNode) {\n if (element.parentNode.constructor.name === \'SVGSVGElement\') {\n return true;\n }\n return elementHasSVGParent(element.parentNode);\n }\n return false;\n};\n\n;// CONCATENATED MODULE: ./src/@store/index.ts\nvar Store = (function () {\n function Store(width, height, scale) {\n this.sizes = {\n centerX: width / 2,\n centerY: height / 2,\n height: height,\n width: width,\n scale: scale\n };\n }\n Object.defineProperty(Store.prototype, "width", {\n get: function () {\n return this.sizes.width;\n },\n set: function (value) {\n this.sizes.width = value;\n this.sizes.centerX = value / 2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "height", {\n get: function () {\n return this.sizes.height;\n },\n set: function (value) {\n this.sizes.height = value;\n this.sizes.centerY = value / 2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "scale", {\n get: function () {\n return this.sizes.scale;\n },\n set: function (value) {\n this.sizes.scale = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "centerX", {\n get: function () {\n return this.sizes.centerX;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Store.prototype, "centerY", {\n get: function () {\n return this.sizes.centerY;\n },\n enumerable: false,\n configurable: true\n });\n return Store;\n}());\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricStore/IsometricStore.ts\nvar IsometricStore = (function () {\n function IsometricStore() {\n }\n Object.defineProperty(IsometricStore.prototype, "data", {\n get: function () {\n return this.dataStore;\n },\n set: function (store) {\n this.dataStore = store;\n },\n enumerable: false,\n configurable: true\n });\n return IsometricStore;\n}());\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricStore/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricElementAbstract/IsometricElementAbstract.ts\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricElementAbstract = (function (_super) {\n __extends(IsometricElementAbstract, _super);\n function IsometricElementAbstract(svgElement) {\n var _this = _super.call(this) || this;\n _this.listeners = [];\n _this.element = document.createElementNS(SVG_NAMESPACE, svgElement);\n return _this;\n }\n IsometricElementAbstract.prototype.getElement = function () {\n return this.element;\n };\n IsometricElementAbstract.prototype.addEventListener = function (event, callback, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n addEventListenerToElement.call(this, this.element, this.listeners, event, callback, useCapture);\n return this;\n };\n IsometricElementAbstract.prototype.removeEventListener = function (event, callback, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n removeEventListenerFromElement(this.element, this.listeners, event, callback, useCapture);\n return this;\n };\n return IsometricElementAbstract;\n}(IsometricStore));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricElementAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricGraphicAbstract/IsometricGraphicAbstract.ts\nvar IsometricGraphicAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar defaultObjectProps = {\n fillColor: Colors.white,\n fillOpacity: 1,\n strokeColor: Colors.black,\n strokeDashArray: [],\n strokeLinecap: LineCap.butt,\n strokeLinejoin: LineJoin.round,\n strokeOpacity: 1,\n strokeWidth: 1\n};\nvar IsometricGraphicAbstract = (function (_super) {\n IsometricGraphicAbstract_extends(IsometricGraphicAbstract, _super);\n function IsometricGraphicAbstract(props, svgElement) {\n var _this = _super.call(this, svgElement) || this;\n _this.props = __assign(__assign({}, defaultObjectProps), props);\n _this.animations = [];\n if (_this.props.texture) {\n _this.createTexture(_this.props.texture);\n }\n addSVGProperties(_this.element, {\n \'fill\': _this.props.texture\n ? "url(#".concat(_this.patternId, ") ").concat(_this.fillColor)\n : _this.fillColor,\n \'fill-opacity\': "".concat(_this.fillOpacity),\n \'stroke\': _this.strokeColor,\n \'stroke-dasharray\': _this.strokeDashArray.join(\' \'),\n \'stroke-linecap\': _this.strokeLinecap,\n \'stroke-linejoin\': _this.strokeLinejoin,\n \'stroke-opacity\': "".concat(_this.strokeOpacity),\n \'stroke-width\': "".concat(_this.strokeWidth)\n });\n return _this;\n }\n IsometricGraphicAbstract.prototype.createTexture = function (texture) {\n this.patternId = uuid();\n this.pattern = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.pattern);\n addSVGProperties(this.pattern, {\n \'id\': this.patternId,\n \'preserveAspectRatio\': \'none\',\n \'patternUnits\': \'userSpaceOnUse\'\n });\n var image = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.image);\n addSVGProperties(image, {\n \'href\': texture.url,\n \'x\': \'0\',\n \'y\': \'0\',\n \'preserveAspectRatio\': \'none\'\n });\n if (texture.pixelated) {\n addSVGProperties(image, {\n \'style\': \'image-rendering: pixelated\'\n });\n }\n this.pattern.appendChild(image);\n };\n IsometricGraphicAbstract.prototype._updateTexture = function () {\n var image = this.pattern.firstChild;\n if (this.props.texture.url &&\n image.getAttribute(\'href\') !== this.props.texture.url) {\n addSVGProperties(image, {\n \'href\': this.props.texture.url\n });\n }\n if (this.props.texture.pixelated) {\n addSVGProperties(image, {\n \'style\': \'image-rendering: pixelated\'\n });\n }\n else {\n image.removeAttribute(\'style\');\n }\n this.update();\n };\n IsometricGraphicAbstract.prototype.addAnimationBasicProperties = function (attributeName, animation) {\n addSVGProperties(animation.element, {\n repeatCount: "".concat(animation.repeat || \'indefinite\'),\n attributeName: attributeName,\n dur: "".concat(animation.duration || 1, "s")\n });\n };\n IsometricGraphicAbstract.prototype.updateAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (isNativeSVGProperty) {\n var property = getSVGProperty(animation.property);\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(property, animation);\n if (animation.values) {\n addSVGProperties(animation.element, {\n values: Array.isArray(animation.values)\n ? animation.values.map(function (value) { return "".concat(value); }).join(\';\')\n : "".concat(animation.values)\n });\n }\n else {\n addSVGProperties(animation.element, {\n from: "".concat(animation.from),\n to: "".concat(animation.to)\n });\n }\n }\n });\n this.updateSubClassAnimations();\n };\n IsometricGraphicAbstract.prototype.updatePatternTransform = function (corner, planeView) {\n var _a, _b, _c;\n if (this.props.texture) {\n var height = this.props.texture.height\n ? "".concat(this.props.texture.height * this.data.scale)\n : \'100%\';\n var width = this.props.texture.width\n ? "".concat(this.props.texture.width * this.data.scale)\n : \'100%\';\n var shift = getPointFromIsometricPoint(0, 0, {\n r: ((_a = this.props.texture.shift) === null || _a === void 0 ? void 0 : _a.right) || 0,\n l: ((_b = this.props.texture.shift) === null || _b === void 0 ? void 0 : _b.left) || 0,\n t: ((_c = this.props.texture.shift) === null || _c === void 0 ? void 0 : _c.top) || 0\n }, this.data.scale);\n var transform = getPatternTransform({\n x: round(corner.x + shift.x, DECIMALS),\n y: round(corner.y + shift.y, DECIMALS)\n }, this.props.texture.planeView || planeView, this.props.texture.scale, this.props.texture.rotation);\n addSVGProperties(this.pattern, {\n \'patternTransform\': transform,\n \'height\': height,\n \'width\': width\n });\n addSVGProperties(this.pattern.firstChild, {\n \'height\': height,\n \'width\': width\n });\n }\n };\n Object.defineProperty(IsometricGraphicAbstract.prototype, "fillColor", {\n get: function () {\n return this.props.fillColor;\n },\n set: function (value) {\n this.props.fillColor = value;\n addSVGProperties(this.element, {\n \'fill\': this.props.texture\n ? "url(#".concat(this.patternId, ") ").concat(this.fillColor)\n : this.fillColor\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "fillOpacity", {\n get: function () {\n return this.props.fillOpacity;\n },\n set: function (value) {\n this.props.fillOpacity = value;\n addSVGProperties(this.element, { \'fill-opacity\': "".concat(this.fillOpacity) });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "texture", {\n get: function () {\n return this.props.texture;\n },\n set: function (value) {\n var hasTexture = !!this.props.texture;\n this.props.texture = value;\n if (hasTexture) {\n this._updateTexture();\n }\n else {\n this.createTexture(this.props.texture);\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeColor", {\n get: function () {\n return this.props.strokeColor;\n },\n set: function (value) {\n this.props.strokeColor = value;\n addSVGProperties(this.element, { \'stroke\': this.strokeColor });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeDashArray", {\n get: function () {\n return this.props.strokeDashArray;\n },\n set: function (value) {\n this.props.strokeDashArray = value;\n addSVGProperties(this.element, { \'stroke-dasharray\': this.strokeDashArray.join(\' \') });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeLinecap", {\n get: function () {\n return this.props.strokeLinecap;\n },\n set: function (value) {\n this.props.strokeLinecap = LineCap[value];\n addSVGProperties(this.element, { \'stroke-linecap\': this.strokeLinecap });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeLinejoin", {\n get: function () {\n return this.props.strokeLinejoin;\n },\n set: function (value) {\n this.props.strokeLinejoin = LineJoin[value];\n addSVGProperties(this.element, { \'stroke-linejoin\': this.strokeLinejoin });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeOpacity", {\n get: function () {\n return this.props.strokeOpacity;\n },\n set: function (value) {\n this.props.strokeOpacity = value;\n addSVGProperties(this.element, { \'stroke-opacity\': "".concat(this.strokeOpacity) });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricGraphicAbstract.prototype, "strokeWidth", {\n get: function () {\n return this.props.strokeWidth;\n },\n set: function (value) {\n this.props.strokeWidth = value;\n addSVGProperties(this.element, { \'stroke-width\': "".concat(this.strokeWidth) });\n },\n enumerable: false,\n configurable: true\n });\n IsometricGraphicAbstract.prototype.getPattern = function () {\n return this.pattern;\n };\n IsometricGraphicAbstract.prototype.updateTexture = function (value) {\n var hasTexture = !!this.props.texture;\n if (hasTexture || value.url) {\n var shift = value.shift, rotation = value.rotation, newProps = __rest(value, ["shift", "rotation"]);\n this.props.texture = hasTexture\n ? __assign(__assign({}, this.props.texture), newProps) : __assign({}, newProps);\n if (shift) {\n this.props.texture.shift = __assign(__assign({}, (this.props.texture.shift || {})), shift);\n }\n if (rotation) {\n this.props.texture.rotation = rotation;\n }\n if (hasTexture) {\n this._updateTexture();\n }\n else {\n this.createTexture(this.props.texture);\n this.update();\n }\n }\n return this;\n };\n IsometricGraphicAbstract.prototype.addAnimation = function (animation) {\n this.animations.push(__assign({}, animation));\n this.update();\n return this;\n };\n IsometricGraphicAbstract.prototype.removeAnimationByIndex = function (index) {\n if (index >= 0 && index < this.animations.length) {\n var animation = this.animations.splice(index, 1)[0];\n if (animation.element && animation.element.parentNode) {\n animation.element.parentNode.removeChild(animation.element);\n }\n }\n return this;\n };\n IsometricGraphicAbstract.prototype.removeAnimations = function () {\n var animations = this.animations.splice(0);\n animations.forEach(function (animation) {\n if (animation.element && animation.element.parentNode) {\n animation.element.parentNode.removeChild(animation.element);\n }\n });\n return this;\n };\n return IsometricGraphicAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricGraphicAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricContainerAbstract/IsometricContainerAbstract.ts\nvar IsometricContainerAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricContainerAbstract = (function (_super) {\n IsometricContainerAbstract_extends(IsometricContainerAbstract, _super);\n function IsometricContainerAbstract(svgElement) {\n var _this = _super.call(this, svgElement) || this;\n _this._children = [];\n return _this;\n }\n IsometricContainerAbstract.prototype.getChildIndex = function (child) {\n return this._children.indexOf(child);\n };\n IsometricContainerAbstract.prototype.throwChildError = function () {\n throw new Error(\'You cannot provide a child that is not a children of the container\');\n };\n IsometricContainerAbstract.prototype.removeSVGChild = function (child) {\n var svgChild = child.getElement();\n if (child instanceof IsometricGraphicAbstract) {\n var svgPatternChild = child.getPattern();\n if (svgPatternChild && svgPatternChild.parentNode) {\n this.element.removeChild(svgPatternChild);\n }\n }\n if (svgChild.parentNode) {\n this.element.removeChild(svgChild);\n }\n };\n IsometricContainerAbstract.prototype.insertPattern = function (pattern) {\n if (pattern) {\n this.element.insertBefore(pattern, this.element.firstChild);\n }\n };\n Object.defineProperty(IsometricContainerAbstract.prototype, "children", {\n get: function () {\n return this._children;\n },\n enumerable: false,\n configurable: true\n });\n IsometricContainerAbstract.prototype.update = function () {\n var _this = this;\n if (elementHasSVGParent(this.element)) {\n this._children.forEach(function (child) {\n child.data = _this.data;\n child.update();\n });\n }\n return this;\n };\n IsometricContainerAbstract.prototype.clear = function () {\n var _this = this;\n var children = this._children.splice(0);\n children.forEach(function (child) {\n _this.removeSVGChild(child);\n });\n return this;\n };\n IsometricContainerAbstract.prototype.addChild = function (child) {\n child.data = this.data;\n this._children.push(child);\n if (child instanceof IsometricGraphicAbstract) {\n this.insertPattern(child.getPattern());\n }\n this.element.appendChild(child.getElement());\n child.update();\n return this;\n };\n IsometricContainerAbstract.prototype.addChildren = function () {\n var _this = this;\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments[_i];\n }\n children.forEach(function (child) { return _this.addChild(child); });\n return this;\n };\n IsometricContainerAbstract.prototype.removeChild = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this._children.splice(childIndex, 1);\n this.removeSVGChild(child);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.removeChildren = function () {\n var _this = this;\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments[_i];\n }\n children.forEach(function (child) {\n var childIndex = _this.getChildIndex(child);\n if (childIndex === -1) {\n _this.throwChildError();\n }\n _this.removeChild(child);\n });\n return this;\n };\n IsometricContainerAbstract.prototype.removeChildByIndex = function (index) {\n if (index >= 0 && index < this._children.length) {\n var child = this._children.splice(index, 1)[0];\n this.removeSVGChild(child);\n }\n return this;\n };\n IsometricContainerAbstract.prototype.setChildIndex = function (child, index) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n index = Math.min(Math.max(0, index), this._children.length - 1);\n var movedElement = child.getElement();\n var replacedElement = this._children[index].getElement();\n if (this._children[index] !== child) {\n this._children.splice(childIndex, 1);\n this._children.splice(index, 0, child);\n if (childIndex > index) {\n this.element.insertBefore(movedElement, replacedElement);\n }\n else {\n if (replacedElement.nextSibling) {\n this.element.insertBefore(movedElement, replacedElement.nextSibling);\n }\n else {\n this.element.appendChild(movedElement);\n }\n }\n }\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.bringChildToFront = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this.setChildIndex(child, this._children.length - 1);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.bringChildForward = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n if (childIndex < this._children.length - 1) {\n this.setChildIndex(child, childIndex + 1);\n }\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.sendChildToBack = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n this.setChildIndex(child, 0);\n return this;\n }\n this.throwChildError();\n };\n IsometricContainerAbstract.prototype.sendChildBackward = function (child) {\n var childIndex = this.getChildIndex(child);\n if (childIndex > -1) {\n if (childIndex > 0) {\n this.setChildIndex(child, childIndex - 1);\n }\n return this;\n }\n this.throwChildError();\n };\n return IsometricContainerAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricContainerAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCanvas/IsometricCanvas.ts\nvar IsometricCanvas_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricCanvas_assign = (undefined && undefined.__assign) || function () {\n IsometricCanvas_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricCanvas_assign.apply(this, arguments);\n};\n\n\n\n\nvar defaultProps = {\n container: \'body\',\n backgroundColor: Colors.white,\n scale: 1,\n height: DEFAULT_HEIGHT,\n width: DEFAULT_WIDTH\n};\nvar IsometricCanvas = (function (_super) {\n IsometricCanvas_extends(IsometricCanvas, _super);\n function IsometricCanvas(props) {\n var _a;\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, SVG_ELEMENTS.svg) || this;\n _this.props = IsometricCanvas_assign(IsometricCanvas_assign({}, defaultProps), props);\n _this.isAnimated = true;\n _this.data = new Store(_this.props.width, _this.props.height, _this.props.scale);\n addSVGProperties(_this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(_this.data.width, " ").concat(_this.data.height),\n _a.width = "".concat(_this.data.width, "px"),\n _a.height = "".concat(_this.data.height, "px"),\n _a));\n _this.background = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.rect);\n addSVGProperties(_this.background, {\n fill: _this.backgroundColor,\n x: \'0\',\n y: \'0\',\n width: "".concat(_this.data.width, "px"),\n height: "".concat(_this.data.height, "px")\n });\n _this.element.appendChild(_this.background);\n var containerElement = typeof _this.props.container === \'string\'\n ? document.querySelector(_this.props.container)\n : _this.props.container;\n containerElement.appendChild(_this.element);\n return _this;\n }\n IsometricCanvas.prototype.getSVGCode = function () {\n return this.element.outerHTML;\n };\n Object.defineProperty(IsometricCanvas.prototype, "backgroundColor", {\n get: function () {\n return this.props.backgroundColor;\n },\n set: function (value) {\n this.props.backgroundColor = value;\n addSVGProperties(this.background, { fill: this.backgroundColor });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "scale", {\n get: function () {\n return this.data.scale;\n },\n set: function (value) {\n this.data.scale = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "height", {\n get: function () {\n return this.data.height;\n },\n set: function (value) {\n var _a;\n this.data.height = value;\n addSVGProperties(this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(this.data.width, " ").concat(this.data.height),\n _a.height = "".concat(this.data.height, "px"),\n _a));\n addSVGProperties(this.background, {\n height: "".concat(this.data.height, "px")\n });\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "width", {\n get: function () {\n return this.data.width;\n },\n set: function (value) {\n var _a;\n this.data.width = value;\n addSVGProperties(this.element, (_a = {},\n _a[SVG_PROPERTIES.viewBox] = "0 0 ".concat(this.data.width, " ").concat(this.data.height),\n _a.width = "".concat(this.data.width, "px"),\n _a));\n addSVGProperties(this.background, {\n width: "".concat(this.data.width, "px")\n });\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricCanvas.prototype, "animated", {\n get: function () {\n return this.isAnimated;\n },\n enumerable: false,\n configurable: true\n });\n IsometricCanvas.prototype.pauseAnimations = function () {\n var svg = this.element;\n if (typeof svg.pauseAnimations === \'function\') {\n svg.pauseAnimations();\n }\n this.isAnimated = false;\n return this;\n };\n IsometricCanvas.prototype.resumeAnimations = function () {\n var svg = this.element;\n if (typeof svg.unpauseAnimations === \'function\') {\n svg.unpauseAnimations();\n }\n this.isAnimated = true;\n return this;\n };\n return IsometricCanvas;\n}(IsometricContainerAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCanvas/index.ts\n\n\n\n;// CONCATENATED MODULE: ./src/@utils/other.ts\nvar applyMixins = function (BaseClass, constructor) {\n Object.getOwnPropertyNames(constructor.prototype).forEach(function (name) {\n Object.defineProperty(BaseClass.prototype, name, Object.getOwnPropertyDescriptor(constructor.prototype, name));\n });\n};\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/constants.ts\nvar NO_LIMITS = [\n Number.MIN_SAFE_INTEGER,\n Number.MAX_SAFE_INTEGER\n];\nvar DRAG_EVENT;\n(function (DRAG_EVENT) {\n DRAG_EVENT["DRAG_START"] = "dragstart";\n DRAG_EVENT["DRAG"] = "drag";\n DRAG_EVENT["DRAG_END"] = "dragend";\n})(DRAG_EVENT || (DRAG_EVENT = {}));\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/IsometricDraggableAbstract.ts\nvar IsometricDraggableAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricDraggableAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricDraggableAbstract_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricDraggableAbstract_assign.apply(this, arguments);\n};\nvar IsometricDraggableAbstract_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\nvar _isBrowser = typeof window !== Typeof.UNDEFINED;\nvar _requestAnimationFrame = _isBrowser\n ? (window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.msRequestAnimationFrame)\n : null;\nvar _dragStoreDefault = {\n right: 0,\n left: 0,\n top: 0,\n x: 0,\n y: 0\n};\nvar isMouseEvent = function (event) { return \'clientX\' in event; };\nvar getClientCoords = function (event) {\n if (event instanceof Event) {\n if (isMouseEvent(event)) {\n return {\n clientX: event.clientX,\n clientY: event.clientY\n };\n }\n return {\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY\n };\n }\n return event;\n};\nvar IsometricDraggableAbstract = (function (_super) {\n IsometricDraggableAbstract_extends(IsometricDraggableAbstract, _super);\n function IsometricDraggableAbstract() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n IsometricDraggableAbstract.prototype.setup = function () {\n this.startDrag = this.startDrag.bind(this);\n this.stopDrag = this.stopDrag.bind(this);\n this.moveElement = this.moveElement.bind(this);\n this.dropElement = this.dropElement.bind(this);\n this.animate = this.animate.bind(this);\n if (typeof this._bounds === Typeof.UNDEFINED) {\n this._bounds = false;\n }\n if (typeof this._dragStore === Typeof.UNDEFINED) {\n this._dragStore = _dragStoreDefault;\n }\n if (typeof this._coords === Typeof.UNDEFINED) {\n this._coords = {};\n }\n };\n IsometricDraggableAbstract.prototype.betweenBounds = function (value, bounds) {\n var orderedBounds = IsometricDraggableAbstract_spreadArray([], bounds, true).sort();\n return round(Math.min(Math.max(value, orderedBounds[0]), orderedBounds[1]), DECIMALS);\n };\n IsometricDraggableAbstract.prototype.getRight = function (value) {\n var bounds = this._bounds && this._bounds.right || NO_LIMITS;\n return this.betweenBounds(this._dragStore.right + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getLeft = function (value) {\n var bounds = this._bounds && this._bounds.left || NO_LIMITS;\n return this.betweenBounds(this._dragStore.left + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getTop = function (value) {\n var bounds = this._bounds && this._bounds.top || NO_LIMITS;\n return this.betweenBounds(this._dragStore.top + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getFixedCoordinates = function (coords) {\n var _this = this;\n return Object.entries(coords).reduce(function (acc, entry) {\n var fixedCoords = IsometricDraggableAbstract_assign({}, acc);\n switch (entry[0]) {\n case \'right\':\n fixedCoords.right = _this.getRight(entry[1]);\n break;\n case \'left\':\n fixedCoords.left = _this.getLeft(entry[1]);\n break;\n default:\n fixedCoords.top = _this.getTop(entry[1]);\n }\n return fixedCoords;\n }, {});\n };\n IsometricDraggableAbstract.prototype.dispatchEvent = function (eventType) {\n var dragEvent = new CustomEvent(eventType, {\n cancelable: eventType === DRAG_EVENT.DRAG,\n detail: {\n right: this._coords.right || this.right,\n left: this._coords.left || this.left,\n top: this._coords.top || this.top\n }\n });\n this.element.dispatchEvent(dragEvent);\n return dragEvent;\n };\n IsometricDraggableAbstract.prototype.animate = function () {\n if (this._update) {\n if (!this._prevented) {\n if (typeof this._coords.right === Typeof.NUMBER) {\n this.right = this._coords.right;\n }\n if (typeof this._coords.left === Typeof.NUMBER) {\n this.left = this._coords.left;\n }\n if (typeof this._coords.top === Typeof.NUMBER) {\n this.top = this._coords.top;\n }\n }\n _requestAnimationFrame(this.animate);\n }\n };\n IsometricDraggableAbstract.prototype.startDrag = function (event) {\n event.preventDefault();\n var _a = getClientCoords(event), clientX = _a.clientX, clientY = _a.clientY;\n this._dragStore.x = clientX;\n this._dragStore.y = clientY;\n this._dragStore.right = this.right;\n this._dragStore.left = this.left;\n this._dragStore.top = this.top;\n this._update = true;\n this.moveElement({ clientX: clientX, clientY: clientY });\n this.element.addEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.addEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n document.addEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.addEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n _requestAnimationFrame(this.animate);\n };\n IsometricDraggableAbstract.prototype.moveElement = function (event) {\n var _a = getClientCoords(event), clientX = _a.clientX, clientY = _a.clientY;\n var diffX = clientX - this._dragStore.x;\n var diffY = clientY - this._dragStore.y;\n if (this._drag === PlaneView.TOP) {\n this._coords = this.getFixedCoordinates(getTopPlanePointFromCoordinates(diffX, diffY));\n }\n else if (this._drag === PlaneView.FRONT) {\n this._coords = this.getFixedCoordinates(getFrontPlanePointFromCoordinates(diffX, diffY));\n }\n else {\n this._coords = this.getFixedCoordinates(getSidePlanePointFromCoordinates(diffX, diffY));\n }\n var dragEvent;\n if (event instanceof Event) {\n event.preventDefault();\n if (!this._dragging) {\n this.dispatchEvent(DRAG_EVENT.DRAG_START);\n }\n this._dragging = true;\n dragEvent = this.dispatchEvent(DRAG_EVENT.DRAG);\n }\n this._prevented = !!(dragEvent && dragEvent.defaultPrevented);\n };\n IsometricDraggableAbstract.prototype.dropElement = function () {\n this._update = false;\n this._dragging = false;\n this.element.removeEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.removeEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n document.removeEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.removeEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n this.dispatchEvent(DRAG_EVENT.DRAG_END);\n };\n IsometricDraggableAbstract.prototype.beginDrag = function () {\n this.element.addEventListener(EVENTS.TOUCH_START, this.startDrag, true);\n this.element.addEventListener(EVENTS.MOUSE_DOWN, this.startDrag, true);\n };\n IsometricDraggableAbstract.prototype.stopDrag = function () {\n this.element.removeEventListener(EVENTS.TOUCH_START, this.startDrag, true);\n this.element.removeEventListener(EVENTS.TOUCH_MOVE, this.moveElement, true);\n this.element.removeEventListener(EVENTS.TOUCH_END, this.dropElement, true);\n this.element.removeEventListener(EVENTS.MOUSE_DOWN, this.startDrag, true);\n document.removeEventListener(EVENTS.MOUSE_MOVE, this.moveElement, true);\n document.removeEventListener(EVENTS.MOUSE_UP, this.dropElement, true);\n };\n Object.defineProperty(IsometricDraggableAbstract.prototype, "right", {\n get: function () {\n return this.props.right;\n },\n set: function (value) {\n if (this.props.right !== value) {\n this.props.right = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "left", {\n get: function () {\n return this.props.left;\n },\n set: function (value) {\n if (this.props.left !== value) {\n this.props.left = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "top", {\n get: function () {\n return this.props.top;\n },\n set: function (value) {\n if (this.props.top !== value) {\n this.props.top = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "drag", {\n get: function () {\n return this._drag || false;\n },\n set: function (value) {\n if (typeof this._drag === Typeof.UNDEFINED) {\n this.setup();\n }\n this._drag = value;\n if (_isBrowser) {\n this.stopDrag();\n this.beginDrag();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricDraggableAbstract.prototype, "bounds", {\n get: function () {\n return this._bounds || false;\n },\n set: function (value) {\n this._bounds = value;\n var boundsRight = this._bounds && this._bounds.right || NO_LIMITS;\n var boundsLeft = this._bounds && this._bounds.left || NO_LIMITS;\n var boundsTop = this._bounds && this._bounds.top || NO_LIMITS;\n this.right = this.betweenBounds(this.right, boundsRight);\n this.left = this.betweenBounds(this.left, boundsLeft);\n this.top = this.betweenBounds(this.top, boundsTop);\n },\n enumerable: false,\n configurable: true\n });\n return IsometricDraggableAbstract;\n}(IsometricElementAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricDraggableAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricGroup/IsometricGroup.ts\nvar IsometricGroup_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricGroup_assign = (undefined && undefined.__assign) || function () {\n IsometricGroup_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricGroup_assign.apply(this, arguments);\n};\n\n\n\n\n\n\nvar IsometricGroup_defaultProps = {\n right: 0,\n left: 0,\n top: 0,\n};\nvar IsometricGroup = (function (_super) {\n IsometricGroup_extends(IsometricGroup, _super);\n function IsometricGroup(props) {\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, SVG_ELEMENTS.group) || this;\n _this.props = IsometricGroup_assign(IsometricGroup_assign({}, IsometricGroup_defaultProps), props);\n return _this;\n }\n IsometricGroup.prototype.update = function () {\n if (elementHasSVGParent(this.element)) {\n var point = getPointFromIsometricPoint(0, 0, {\n r: this.props.right,\n l: this.props.left,\n t: this.props.top\n }, this.data.scale);\n addSVGProperties(this.element, {\n transform: "translate(".concat(point.x, ", ").concat(point.y, ")")\n });\n }\n return _super.prototype.update.call(this);\n };\n return IsometricGroup;\n}(IsometricContainerAbstract));\n\napplyMixins(IsometricGroup, IsometricDraggableAbstract);\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricGroup/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricPathAbstract/IsometricPathAbstract.ts\nvar IsometricPathAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar IsometricPathAbstract = (function (_super) {\n IsometricPathAbstract_extends(IsometricPathAbstract, _super);\n function IsometricPathAbstract(props, svgElement) {\n return _super.call(this, props, svgElement) || this;\n }\n IsometricPathAbstract.prototype.updateGraphic = function (planeView, autoclose) {\n if (autoclose === void 0) { autoclose = true; }\n if (elementHasSVGParent(this.element)) {\n var commands = this.getCommands();\n var corner = getTextureCorner(commands, this.data.centerX, this.data.centerY, this.data.scale);\n addSVGProperties(this.element, {\n d: getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, autoclose)\n });\n this.updatePatternTransform(corner, planeView);\n this.updateAnimations();\n }\n };\n return IsometricPathAbstract;\n}(IsometricGraphicAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricPathAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricShapeAbstract/IsometricShapeAbstract.ts\nvar IsometricShapeAbstract_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricShapeAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricShapeAbstract_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricShapeAbstract_assign.apply(this, arguments);\n};\n\n\n\n\n\nvar IsometricShapeAbstract_defaultProps = {\n right: 0,\n left: 0,\n top: 0,\n};\nvar IsometricShapeAbstract = (function (_super) {\n IsometricShapeAbstract_extends(IsometricShapeAbstract, _super);\n function IsometricShapeAbstract(props) {\n return _super.call(this, IsometricShapeAbstract_assign(IsometricShapeAbstract_assign({}, IsometricShapeAbstract_defaultProps), props), SVG_ELEMENTS.path) || this;\n }\n IsometricShapeAbstract.prototype.update = function () {\n this.updateGraphic(this.planeView);\n return this;\n };\n IsometricShapeAbstract.prototype.clear = function () {\n addSVGProperties(this.element, {\n d: \'\'\n });\n return this;\n };\n Object.defineProperty(IsometricShapeAbstract.prototype, "planeView", {\n get: function () {\n return this.props.planeView;\n },\n set: function (value) {\n this.props.planeView = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n return IsometricShapeAbstract;\n}(IsometricPathAbstract));\n\napplyMixins(IsometricShapeAbstract, IsometricDraggableAbstract);\n\n;// CONCATENATED MODULE: ./src/@classes/abstract/IsometricShapeAbstract/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricRectangle/IsometricRectangle.ts\nvar IsometricRectangle_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricRectangle_assign = (undefined && undefined.__assign) || function () {\n IsometricRectangle_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricRectangle_assign.apply(this, arguments);\n};\nvar IsometricRectangle_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\nvar IsometricRectangle = (function (_super) {\n IsometricRectangle_extends(IsometricRectangle, _super);\n function IsometricRectangle(props) {\n var _this = this;\n var height = props.height, width = props.width, rest = IsometricRectangle_rest(props, ["height", "width"]);\n _this = _super.call(this, rest) || this;\n _this._width = width;\n _this._height = height;\n return _this;\n }\n IsometricRectangle.prototype.getCommands = function (args) {\n var right = (args === null || args === void 0 ? void 0 : args.right) || this.right;\n var left = (args === null || args === void 0 ? void 0 : args.left) || this.left;\n var top = (args === null || args === void 0 ? void 0 : args.top) || this.top;\n var width = (args === null || args === void 0 ? void 0 : args.width) || this.width;\n var height = (args === null || args === void 0 ? void 0 : args.height) || this.height;\n var commands = [{ command: Command.move, point: { r: 0, l: 0, t: 0 } }];\n switch (this.planeView) {\n case PlaneView.FRONT:\n commands.push({ command: Command.line, point: { r: 0, l: width, t: 0 } }, { command: Command.line, point: { r: 0, l: width, t: height } }, { command: Command.line, point: { r: 0, l: 0, t: height } });\n break;\n case PlaneView.SIDE:\n commands.push({ command: Command.line, point: { r: width, l: 0, t: 0 } }, { command: Command.line, point: { r: width, l: 0, t: height } }, { command: Command.line, point: { r: 0, l: 0, t: height } });\n break;\n case PlaneView.TOP:\n commands.push({ command: Command.line, point: { r: width, l: 0, t: 0 } }, { command: Command.line, point: { r: width, l: height, t: 0 } }, { command: Command.line, point: { r: 0, l: height, t: 0 } });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricRectangle.prototype.getRectanglePath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricRectangle.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n var props_1 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n width: _this.width,\n height: _this.height\n };\n if (Object.prototype.hasOwnProperty.call(props_1, animation.property)) {\n var property_1 = animation.property;\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = {\n values: animation.values.map(function (value) {\n var modifiedArgs = IsometricRectangle_assign({}, props_1);\n modifiedArgs[property_1] = +value;\n return _this.getRectanglePath(modifiedArgs);\n }).join(\';\')\n };\n }\n else {\n var modifiedArgs = IsometricRectangle_assign({}, props_1);\n modifiedArgs[property_1] = +animation.values;\n properties = {\n values: _this.getRectanglePath(modifiedArgs)\n };\n }\n }\n else {\n var fromArgs = IsometricRectangle_assign({}, props_1);\n var toArgs = IsometricRectangle_assign({}, props_1);\n fromArgs[property_1] = +animation.from;\n toArgs[property_1] = +animation.to;\n properties = {\n from: _this.getRectanglePath(fromArgs),\n to: _this.getRectanglePath(toArgs)\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n }\n });\n };\n Object.defineProperty(IsometricRectangle.prototype, "width", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricRectangle.prototype, "height", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricRectangle.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricRectangle;\n}(IsometricShapeAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricRectangle/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCircle/IsometricCircle.ts\nvar IsometricCircle_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricCircle_assign = (undefined && undefined.__assign) || function () {\n IsometricCircle_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricCircle_assign.apply(this, arguments);\n};\nvar IsometricCircle_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\nvar IsometricCircle = (function (_super) {\n IsometricCircle_extends(IsometricCircle, _super);\n function IsometricCircle(props) {\n var _this = this;\n var radius = props.radius, rest = IsometricCircle_rest(props, ["radius"]);\n _this = _super.call(this, rest) || this;\n _this._radius = radius;\n return _this;\n }\n IsometricCircle.prototype.getCommands = function (args) {\n var right = (args === null || args === void 0 ? void 0 : args.right) || this.right;\n var left = (args === null || args === void 0 ? void 0 : args.left) || this.left;\n var top = (args === null || args === void 0 ? void 0 : args.top) || this.top;\n var radius = (args === null || args === void 0 ? void 0 : args.radius) || this.radius;\n var commands = [];\n switch (this.planeView) {\n case PlaneView.FRONT:\n commands.push({\n command: Command.move,\n point: { r: 0, l: radius, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: -radius, t: 0 },\n control: { r: 0, l: 0, t: -radius }\n }, {\n command: Command.curve,\n point: { r: 0, l: radius, t: 0 },\n control: { r: 0, l: 0, t: radius }\n });\n break;\n case PlaneView.SIDE:\n commands.push({\n command: Command.move,\n point: { r: -radius, l: 0, t: 0 }\n }, {\n command: Command.curve,\n point: { r: radius, l: 0, t: 0 },\n control: { r: 0, l: 0, t: -radius }\n }, {\n command: Command.curve,\n point: { r: -radius, l: 0, t: 0 },\n control: { r: 0, l: 0, t: radius }\n });\n break;\n case PlaneView.TOP:\n commands.push({\n command: Command.move,\n point: { r: 0, l: radius, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: -radius, t: 0 },\n control: { r: radius, l: 0, t: 0 }\n }, {\n command: Command.curve,\n point: { r: 0, l: radius, t: 0 },\n control: { r: -radius, l: 0, t: 0 }\n });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricCircle.prototype.getCirclePath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricCircle.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n var props_1 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n radius: _this.radius\n };\n if (Object.prototype.hasOwnProperty.call(props_1, animation.property)) {\n var property_1 = animation.property;\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = {\n values: animation.values.map(function (value) {\n var modifiedArgs = IsometricCircle_assign({}, props_1);\n modifiedArgs[property_1] = +value;\n return _this.getCirclePath(modifiedArgs);\n }).join(\';\')\n };\n }\n else {\n var modifiedArgs = IsometricCircle_assign({}, props_1);\n modifiedArgs[property_1] = +animation.values;\n properties = {\n values: _this.getCirclePath(modifiedArgs)\n };\n }\n }\n else {\n var fromArgs = IsometricCircle_assign({}, props_1);\n var toArgs = IsometricCircle_assign({}, props_1);\n fromArgs[property_1] = +animation.from;\n toArgs[property_1] = +animation.to;\n properties = {\n from: _this.getCirclePath(fromArgs),\n to: _this.getCirclePath(toArgs)\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n }\n });\n };\n Object.defineProperty(IsometricCircle.prototype, "radius", {\n get: function () {\n return this._radius;\n },\n set: function (value) {\n this._radius = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricCircle.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricCircle;\n}(IsometricShapeAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricCircle/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricPath/IsometricPath.ts\nvar IsometricPath_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar IsometricPath = (function (_super) {\n IsometricPath_extends(IsometricPath, _super);\n function IsometricPath(props) {\n if (props === void 0) { props = {}; }\n var _this = _super.call(this, props, SVG_ELEMENTS.path) || this;\n _this.getPathFromCommands = function (commands) { return getSVGPath(parseDrawCommands(commands), _this.data.centerX, _this.data.centerY, _this.data.scale, _this._autoclose); };\n _this.commands = [];\n _this._autoclose = \'autoclose\' in props\n ? props.autoclose\n : true;\n return _this;\n }\n IsometricPath.prototype.updateSubClassAnimations = function () {\n var _this = this;\n this.animations.forEach(function (animation) {\n if (animation.property === \'path\') {\n var properties = void 0;\n if (animation.values) {\n properties = {\n values: Array.isArray(animation.values)\n ? animation.values.map(function (value) {\n return _this.getPathFromCommands("".concat(value));\n }).join(\';\')\n : _this.getPathFromCommands("".concat(animation.values))\n };\n }\n else {\n properties = {\n from: _this.getPathFromCommands("".concat(animation.from)),\n to: _this.getPathFromCommands("".concat(animation.to))\n };\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animate);\n }\n if (!animation.element.parentNode) {\n _this.element.appendChild(animation.element);\n }\n _this.addAnimationBasicProperties(\'d\', animation);\n addSVGProperties(animation.element, properties);\n }\n });\n };\n IsometricPath.prototype.getCommands = function () {\n return this.commands;\n };\n Object.defineProperty(IsometricPath.prototype, "autoclose", {\n get: function () {\n return this._autoclose;\n },\n set: function (value) {\n this._autoclose = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricPath.prototype.update = function () {\n this.updateGraphic(undefined, this.autoclose);\n return this;\n };\n IsometricPath.prototype.clear = function () {\n this.commands.splice(0);\n addSVGProperties(this.element, {\n d: \'\'\n });\n return this;\n };\n IsometricPath.prototype.moveTo = function (right, left, top) {\n this.commands.push({\n command: Command.move,\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.lineTo = function (right, left, top) {\n this.commands.push({\n command: Command.line,\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.curveTo = function (controlRight, controlLeft, controlTop, right, left, top) {\n this.commands.push({\n command: Command.curve,\n control: { r: controlRight, l: controlLeft, t: controlTop },\n point: { r: right, l: left, t: top }\n });\n this.update();\n return this;\n };\n IsometricPath.prototype.mt = function (right, left, top) {\n return this.moveTo(right, left, top);\n };\n IsometricPath.prototype.lt = function (right, left, top) {\n return this.lineTo(right, left, top);\n };\n IsometricPath.prototype.ct = function (controlRight, controlLeft, controlTop, right, left, top) {\n return this.curveTo(controlRight, controlLeft, controlTop, right, left, top);\n };\n IsometricPath.prototype.draw = function (commands) {\n this.commands = parseDrawCommands(commands);\n this.update();\n return this;\n };\n IsometricPath.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricPath;\n}(IsometricPathAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricPath/index.ts\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricText/IsometricText.ts\nvar IsometricText_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar IsometricText_assign = (undefined && undefined.__assign) || function () {\n IsometricText_assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return IsometricText_assign.apply(this, arguments);\n};\nvar IsometricText_rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar IsometricText = (function (_super) {\n IsometricText_extends(IsometricText, _super);\n function IsometricText(props) {\n var _a;\n var _this = this;\n var planeView = props.planeView, _b = props.text, text = _b === void 0 ? \'\' : _b, _c = props.fontFamily, fontFamily = _c === void 0 ? \'Arial\' : _c, _d = props.fontSize, fontSize = _d === void 0 ? 12 : _d, _e = props.fontStyle, fontStyle = _e === void 0 ? \'normal\' : _e, _f = props.fontWeight, fontWeight = _f === void 0 ? \'normal\' : _f, _g = props.origin, origin = _g === void 0 ? [\'center\', \'center\'] : _g, _h = props.right, right = _h === void 0 ? 0 : _h, _j = props.left, left = _j === void 0 ? 0 : _j, _k = props.top, top = _k === void 0 ? 0 : _k, _l = props.rotation, rotation = _l === void 0 ? 0 : _l, _m = props.selectable, selectable = _m === void 0 ? true : _m, rest = IsometricText_rest(props, ["planeView", "text", "fontFamily", "fontSize", "fontStyle", "fontWeight", "origin", "right", "left", "top", "rotation", "selectable"]);\n _this = _super.call(this, rest, SVG_ELEMENTS.group) || this;\n _this._originHash = (_a = {},\n _a[ORIGIN.CENTER] = \'middle\',\n _a[ORIGIN.LEFT] = \'start\',\n _a[ORIGIN.RIGHT] = \'end\',\n _a[ORIGIN.TOP] = \'hanging\',\n _a[ORIGIN.BOTTOM] = \'baseline\',\n _a);\n _this.commonAnimationAttributes = {\n attributeName: \'transform\',\n attributeType: \'XML\',\n additive: \'sum\',\n fill: \'freeze\'\n };\n _this.getMatrixTransform = function (props) {\n var transformMatrix = getPatternTransform(_this.getPositionTransform(props), _this.planeView, 1);\n return "".concat(transformMatrix, " rotate(").concat(_this.rotation, ")");\n };\n _this._textElement = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.text);\n _this._tspan = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.tspan);\n _this._textElement.appendChild(_this._tspan);\n _this.element.appendChild(_this._textElement);\n _this.planeView = planeView;\n _this.fontFamily = fontFamily;\n _this.fontSize = fontSize;\n _this.fontStyle = fontStyle;\n _this.fontWeight = fontWeight;\n _this.selectable = selectable;\n _this.origin = origin;\n _this.right = right;\n _this.left = left;\n _this.top = top;\n _this.rotation = rotation;\n _this.text = text;\n return _this;\n }\n IsometricText.prototype.getPositionTransform = function (props, fromCenter) {\n if (fromCenter === void 0) { fromCenter = true; }\n return getPointFromIsometricPoint(fromCenter\n ? this.data.centerX\n : 0, fromCenter\n ? this.data.centerY\n : 0, {\n r: props.right,\n l: props.left,\n t: props.top\n }, this.data.scale);\n };\n IsometricText.prototype.updateSubClassAnimations = function () {\n var _this = this;\n var props = {\n right: 0,\n left: 0,\n top: 0,\n rotation: 0,\n };\n this.animations.forEach(function (animation) {\n var isNativeSVGProperty = isSVGProperty(animation.property);\n if (!isNativeSVGProperty) {\n if (Object.prototype.hasOwnProperty.call(props, animation.property)) {\n var property_1 = animation.property;\n var isRotation_1 = property_1 === \'rotation\';\n var commonProps = IsometricText_assign(IsometricText_assign({}, _this.commonAnimationAttributes), { type: isRotation_1\n ? \'rotate\'\n : \'translate\', begin: \'indefinite\' });\n var properties = void 0;\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = IsometricText_assign({ values: animation.values.map(function (value) {\n if (isRotation_1) {\n return "".concat(value);\n }\n else {\n var modifiedArgs = IsometricText_assign({}, props);\n modifiedArgs[property_1] = +value - _this[property_1];\n var coords = _this.getPositionTransform(modifiedArgs, false);\n return "".concat(coords.x, ",").concat(coords.y);\n }\n }).join(\';\') }, commonProps);\n }\n else {\n if (isRotation_1) {\n properties = IsometricText_assign({ values: "".concat(animation.values) }, commonProps);\n }\n else {\n var modifiedArgs = IsometricText_assign({}, props);\n modifiedArgs[property_1] = +animation.values - _this[property_1];\n var coords = _this.getPositionTransform(modifiedArgs, false);\n properties = IsometricText_assign({ values: "".concat(coords.x, ",").concat(coords.y) }, commonProps);\n }\n }\n }\n else {\n if (isRotation_1) {\n properties = IsometricText_assign({ from: "".concat(animation.from), to: "".concat(animation.to) }, commonProps);\n }\n else {\n var fromArgs = IsometricText_assign({}, props);\n var toArgs = IsometricText_assign({}, props);\n fromArgs[property_1] = +animation.from - _this[property_1];\n toArgs[property_1] = +animation.to - _this[property_1];\n var coordsFrom = _this.getPositionTransform(fromArgs, false);\n var coordsTo = _this.getPositionTransform(toArgs, false);\n properties = IsometricText_assign({ from: "".concat(coordsFrom.x, ",").concat(coordsFrom.y), to: "".concat(coordsTo.x, ",").concat(coordsTo.y) }, commonProps);\n }\n }\n if (!animation.element) {\n animation.element = document.createElementNS(SVG_NAMESPACE, SVG_ELEMENTS.animateTransform);\n }\n _this.addAnimationBasicProperties(\'transform\', animation);\n addSVGProperties(animation.element, properties);\n if (!animation.element.parentNode) {\n if (isRotation_1) {\n _this._textElement.appendChild(animation.element);\n }\n else {\n _this.element.appendChild(animation.element);\n }\n }\n window.requestAnimationFrame(function () {\n animation.element.beginElement();\n });\n }\n }\n });\n };\n IsometricText.prototype.update = function () {\n if (elementHasSVGParent(this.element)) {\n var transform = this.getMatrixTransform({\n right: this.right,\n left: this.left,\n top: this.top\n });\n addSVGProperties(this._textElement, { transform: transform });\n this._tspan.textContent = this._text;\n this.updatePatternTransform({ x: 0, y: 0 }, this.planeView);\n this.updateAnimations();\n }\n return this;\n };\n IsometricText.prototype.clear = function () {\n this.text = \'\';\n this.update();\n return this;\n };\n Object.defineProperty(IsometricText.prototype, "text", {\n get: function () {\n return this._text;\n },\n set: function (value) {\n this._text = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "planeView", {\n get: function () {\n return this._planeView;\n },\n set: function (value) {\n this._planeView = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontFamily", {\n get: function () {\n return this._fontFamily;\n },\n set: function (value) {\n this._fontFamily = value;\n addSVGProperties(this._tspan, {\n \'font-family\': this._fontFamily\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontSize", {\n get: function () {\n return this._fontSize;\n },\n set: function (value) {\n this._fontSize = value;\n addSVGProperties(this._tspan, {\n \'font-size\': "".concat(this._fontSize, "px")\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontStyle", {\n get: function () {\n return this._fontStyle;\n },\n set: function (value) {\n this._fontStyle = value;\n addSVGProperties(this._tspan, {\n \'font-style\': "".concat(this._fontStyle)\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "fontWeight", {\n get: function () {\n return this._fontWeight;\n },\n set: function (value) {\n this._fontWeight = value;\n addSVGProperties(this._tspan, {\n \'font-weight\': "".concat(this._fontWeight)\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "selectable", {\n get: function () {\n return this._selectable;\n },\n set: function (value) {\n this._selectable = value;\n if (this._selectable) {\n this._textElement.removeAttribute(\'style\');\n }\n else {\n addSVGProperties(this._textElement, {\n style: [\n \'-webkit-user-select\',\n \'-moz-user-select\',\n \'-ms-user-select\',\n \'user-select\',\n \'pointer-events\'\n ].map(function (decl) { return "".concat(decl, ": none"); }).join(\';\')\n });\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "origin", {\n get: function () {\n return this._origin;\n },\n set: function (value) {\n this._origin = value;\n var _a = this._origin, textAnchor = _a[0], alignmentBaseline = _a[1];\n addSVGProperties(this._tspan, {\n \'text-anchor\': this._originHash[textAnchor],\n \'alignment-baseline\': this._originHash[alignmentBaseline]\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "right", {\n get: function () {\n return this._right;\n },\n set: function (value) {\n if (this._right !== value) {\n this._right = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "left", {\n get: function () {\n return this._left;\n },\n set: function (value) {\n if (this._left !== value) {\n this._left = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "top", {\n get: function () {\n return this._top;\n },\n set: function (value) {\n if (this._top !== value) {\n this._top = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricText.prototype, "rotation", {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n return IsometricText;\n}(IsometricGraphicAbstract));\n\n\n;// CONCATENATED MODULE: ./src/@classes/public/IsometricText/index.ts\n\n\n;// CONCATENATED MODULE: ./src/index.ts\n\n\n\n\n\n\n\n\n;// CONCATENATED MODULE: ./demo/demo1/index.js\n/* harmony default export */ const demo1 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricRectangle, PlaneView } = IsometricModule;\n\n function toggleColor() {\n this.fillColor = this.fillColor === \'white\' ? \'#EEE\' : \'white\';\n }\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonProps = {height: 1, width: 1};\n const topPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.TOP});\n const rightPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.FRONT});\n const leftPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.SIDE});\n\n topPiece.top = 1;\n topPiece.addEventListener(\'click\', toggleColor, true);\n\n rightPiece.right = 1;\n rightPiece.addEventListener(\'click\', toggleColor, true);\n\n leftPiece.left = 1;\n leftPiece.addEventListener(\'click\', toggleColor, true);\n\n cube\n .addChild(topPiece)\n .addChild(rightPiece)\n .addChild(leftPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/demo2/index.js\n/* harmony default export */ const demo2 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, PlaneView } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonProps = {height: 1, width: 1};\n\n const duration = 3;\n\n const rectangleAnimationProps = {\n property: \'height\',\n duration,\n values: [1, 0.5, 1]\n };\n\n const colorAnimationProps = {\n property: \'fillColor\',\n duration,\n values: [\'#FFF\', \'#DDD\', \'#FFF\']\n };\n\n const topPiece = new IsometricPath();\n const rightPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.FRONT, right: 1});\n const leftPiece = new IsometricRectangle({...commonProps, planeView: PlaneView.SIDE, left: 1});\n\n topPiece\n .moveTo(0, 0, 1)\n .lineTo(1, 0, 1)\n .lineTo(1, 1, 1)\n .lineTo(0, 1, 1);\n\n topPiece\n .addAnimation({\n property: \'path\',\n duration,\n values: [\n \'M0 0 1 L1 0 1 L1 1 1 L0 1 1\',\n \'M0 0 0.5 L1 0 0.5 L1 1 0.5 L0 1 0.5\',\n \'M0 0 1 L1 0 1 L1 1 1 L0 1 1\'\n ]\n })\n .addAnimation(colorAnimationProps);\n\n rightPiece\n .addAnimation(rectangleAnimationProps)\n .addAnimation(colorAnimationProps);\n\n leftPiece\n .addAnimation(rectangleAnimationProps)\n .addAnimation(colorAnimationProps);\n\n cube.addEventListener(\'click\', function() {\n if (this.animated) {\n this.pauseAnimations();\n } else {\n this.resumeAnimations();\n }\n });\n\n cube.addChildren(topPiece, rightPiece, leftPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/images/block_side.png\nconst block_side_namespaceObject = __webpack_require__.p + "images/block_side.png";\n;// CONCATENATED MODULE: ./demo/images/block_top.png\nconst block_top_namespaceObject = __webpack_require__.p + "images/block_top.png";\n;// CONCATENATED MODULE: ./demo/demo3/index.js\n\n\n\n/* harmony default export */ const demo3 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricRectangle, IsometricText, PlaneView } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const rectangleCommonProps = { height: 1, width: 1 };\n\n const textCommonProps = {\n fontSize: 15,\n fillColor: \'#666\',\n strokeWidth: 0,\n right: 0.5,\n left: 0.5,\n top: 0.5,\n selectable: false\n };\n\n const pieces = [PlaneView.TOP, PlaneView.FRONT, PlaneView.SIDE].map((view, index) => {\n return {\n face: new IsometricRectangle({...rectangleCommonProps, planeView: view}),\n label: new IsometricText({...textCommonProps, planeView: view}),\n property: [\'top\', \'right\', \'left\'][index]\n };\n });\n\n pieces.forEach((piece) => {\n\n const { face, label, property } = piece;\n\n face[property] = 1;\n label[property] = 1;\n label.text = `${property.toUpperCase()} 0º`;\n\n face.addEventListener(\'click\', () => {\n const rotation = label.rotation + 45;\n label.rotation = rotation === 360 ? 0 : rotation;\n label.text = label.text.replace(/\\d+/, label.rotation);\n });\n\n cube.addChild(piece.face);\n cube.addChild(piece.label);\n });\n\n});\n;// CONCATENATED MODULE: ./demo/demo4/index.js\n/* harmony default export */ const demo4 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricGroup, IsometricPath } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const bottomT = new IsometricPath();\n const bottomR = new IsometricPath();\n const bottomL = new IsometricPath();\n\n const topT = new IsometricPath();\n const topR = new IsometricPath();\n const topL = new IsometricPath();\n\n bottomT.mt(0, 0, .5).lt(1, 0, .5).lt(1, 1, .5).lt(0, 1, .5);\n bottomR.mt(1, 0, .5).lt(1, 0, 0).lt(1, 1, 0).lt(1, 1, .5);\n bottomL.mt(1, 1, .5).lt(1, 1, 0).lt(0, 1, 0).lt(0, 1, .5);\n\n topT.mt(.25, .25, 1).lt(.75, .25, 1).lt(.75, .75, .75).lt(.25, .75, .75);\n topR.mt(.75, .25, 1).lt(.75, .75, .75).lt(.75, .75, .25).lt(.75, .25, .25);\n topL.mt(.75, .75, .75).lt(.25, .75, .75).lt(.25, .75, .25).lt(.75, .75, .25);\n\n const bottomPiece = new IsometricGroup();\n const topPiece = new IsometricGroup();\n topPiece.top = .25;\n\n bottomPiece.addChildren(bottomT, bottomR, bottomL);\n topPiece.addChildren(topT, topR, topL);\n\n let flip = true;\n\n topPiece.addEventListener(\'click\', function() {\n if (this.right) {\n this.right = 0;\n return;\n }\n this.right = flip ? 0.25 : -0.25;\n flip = !flip;\n });\n\n isometric.addChildren(bottomPiece, topPiece);\n\n});\n;// CONCATENATED MODULE: ./demo/demo5/index.js\n/* harmony default export */ const demo5 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const right = new IsometricPath();\n const top1 = new IsometricPath();\n const top2 = new IsometricPath();\n const top3 = new IsometricPath();\n const top4 = new IsometricPath();\n const left1 = new IsometricPath();\n const left2 = new IsometricPath();\n\n // M r l t (Move to right left top)\n // L r l t (Line to right left top)\n // C cr cl ct r l t (Curve to control-right control-left control-top right left top)\n right.draw(\'M1 0 0 L1 1 0 L1 1 0.25 L1 0.5 0.25 L1 0.5 1 L1 0 1\');\n top1.draw(\'M0.25 0.5 1 C0.5 0.5 0.75 0.75 0.5 1 L0.75 0 1 C0.5 0 0.75 0.25 0 1 L0.25 0.5 1\');\n top2.draw(\'M1 0 1 L0.75 0 1 L0.75 0.5 1 L1 0.5 1 L1 0 1 M0 0 1 L0.25 0 1 L0.25 0.5 1 L0 0.5 1 L0 0 1\');\n top3.draw(\'M0 0.5 0.5 L0.5 0.5 0.5 L0.5 1 0.5 L0 1 0.5\');\n top4.draw(\'M0.5 0.5 0.5 L1 0.5 0.25 L1 1 0.25 L0.5 1 0.5\');\n left1.draw(\'M0 0.5 1 L0 0.5 0.5 L0.5 0.5 0.5 L1 0.5 0.25 L1 0.5 1 L0.75 0.5 1 C0.5 0.5 0.75 0.25 0.5 1 L0 0.5 1\');\n left2.draw(\'M0 1 0.5 L0.5 1 0.5 L1 1 0.25 L1 1 0 L0 1 0\');\n\n isometric.addChildren(right, top1, top2, top3, top4, left1, left2);\n\n});\n;// CONCATENATED MODULE: ./demo/demo6/index.js\n/* harmony default export */ const demo6 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath } = IsometricModule;\n\n const cube = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const under = new IsometricPath({ fillColor: \'#EEE\' });\n const top = new IsometricPath();\n const right = new IsometricPath();\n const left = new IsometricPath();\n\n under\n .mt(0, 0, 1)\n .mt(0.25, 0, 1).ct(0.5, 0, 0.75, 0.75, 0, 1).lt(1, 0, 1)\n .lt(1, 0, 0.75).ct(0.75, 0, 0.5, 1, 0, 0.25).lt(1, 0, 0)\n .lt(1, 0.25, 0).ct(0.75, 0.5, 0, 1, 0.75, 0).lt(1, 1, 0)\n .lt(0.75, 1, 0).ct(0.5, 0.75, 0, 0.25, 1, 0).lt(0, 1, 0)\n .lt(0, 1, 0.25).ct(0, 0.75, 0.5, 0, 1, 0.75).lt(0, 1, 1)\n .lt(0, 0.75, 1).ct(0, 0.5, 0.75, 0, 0.25, 1).lt(0, 0, 1);\n\n top\n .mt(0, 0, 1)\n .lt(0.25, 0, 1).ct(0.5, 0.25, 1, 0.75, 0, 1).lt(1, 0, 1)\n .lt(1, 0.25, 1).ct(0.75, 0.5, 1, 1, 0.75, 1).lt(1, 1, 1)\n .lt(0.75, 1, 1).ct(0.5, 0.75, 1, 0.25, 1, 1).lt(0, 1, 1)\n .lt(0, 0.75, 1).ct(0.25, 0.5, 1, 0, 0.25, 1).lt(0, 0, 1);\n\n right\n .mt(1, 0, 1)\n .lt(1, 0, 0.75).ct(1, 0.25, 0.5, 1, 0, 0.25).lt(1, 0, 0)\n .lt(1, 0.25, 0).ct(1, 0.5, 0.25, 1, 0.75, 0).lt(1, 1, 0)\n .lt(1, 1, 0.25).ct(1, 0.75, 0.5, 1, 1, 0.75).lt(1, 1, 1)\n .lt(1, 0.75, 1).ct(1, 0.5, 0.75, 1, 0.25, 1).lt(1, 0, 1);\n\n left\n .mt(1, 1, 1)\n .lt(1, 1, 0.75).ct(0.75, 1, 0.5, 1, 1, 0.25).lt(1, 1, 0)\n .lt(0.75, 1, 0).ct(0.5, 1, 0.25, 0.25, 1, 0).lt(0, 1, 0)\n .lt(0, 1, 0.25).ct(0.25, 1, 0.5, 0, 1, 0.75).lt(0, 1, 1)\n .lt(0.25, 1, 1).ct(0.5, 1, 0.75, 0.75, 1, 1).lt(1, 1, 1);\n\n cube.addChildren(under, top, right, left);\n\n});\n;// CONCATENATED MODULE: ./demo/demo7/index.js\n/* harmony default export */ const demo7 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricGroup, IsometricRectangle, PlaneView } = IsometricModule;\n\n const canvas = new IsometricCanvas({\n container,\n backgroundColor: \'#CCC\',\n scale: 20,\n width: 500,\n height: 320\n });\n\n function resetPlanes() {\n cube.right = cube.left = cube.top = 0;\n planeTop.fillOpacity = planeRight.fillOpacity = planeLeft.fillOpacity = 0.25;\n }\n\n function changePlane() {\n resetPlanes();\n this.fillOpacity = 1;\n cube.drag = this.planeView;\n }\n\n const planeProps = { height: 6, width: 6, fillOpacity: 0.25 };\n const planeTop = new IsometricRectangle({ ...planeProps, planeView: PlaneView.TOP, fillOpacity: 1 });\n const planeRight = new IsometricRectangle({ ...planeProps, planeView: PlaneView.FRONT });\n const planeLeft = new IsometricRectangle({ ...planeProps, planeView: PlaneView.SIDE });\n\n const cubeProps = { height: 1, width: 1 };\n const cubeTop = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.TOP, top: 1 });\n const cubeRight = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.FRONT, right: 1 });\n const cubeLeft = new IsometricRectangle({ ...cubeProps, planeView: PlaneView.SIDE, left: 1 });\n\n const cube = new IsometricGroup();\n\n const bounds = [0, 5];\n cube.drag = \'TOP\';\n cube.bounds = { top: bounds, right: bounds, left: bounds };\n\n planeTop.addEventListener(\'click\', changePlane, true);\n planeRight.addEventListener(\'click\', changePlane, true);\n planeLeft.addEventListener(\'click\', changePlane, true);\n\n cube.addChildren(cubeTop, cubeRight, cubeLeft);\n canvas.addChildren(planeTop, planeRight, planeLeft, cube);\n\n});\n;// CONCATENATED MODULE: ./demo/demo8/index.js\n\n\n\n/* harmony default export */ const demo8 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, PlaneView, Axis } = IsometricModule;\n\n const isometric = new IsometricCanvas({\n container,\n backgroundColor: \'#8AAA3F\',\n scale: 120,\n width: 500,\n height: 320\n });\n\n const commonTextureProps = {\n height: 1,\n width: 1,\n pixelated: true\n };\n\n const textureSides = {\n url: \'images/block_side.png\',\n ...commonTextureProps\n };\n\n const textureTop = {\n url: \'images/block_top.png\',\n planeView: PlaneView.TOP,\n rotation: {\n axis: Axis.LEFT,\n value: 26.5650\n },\n ...commonTextureProps\n };\n\n const side = new IsometricPath({\n texture: {\n planeView: PlaneView.SIDE,\n ...textureSides\n }\n });\n\n const front = new IsometricRectangle({\n planeView: PlaneView.FRONT,\n height: 0.5,\n width: 1,\n texture: textureSides\n });\n\n const chop = new IsometricPath({\n texture: textureTop\n });\n\n side.draw(\'M1 1 0 L1 1 0.5 L0 1 1 L0 1 0\');\n chop.draw(\'M1 1 0.5 L0 1 1 L0 0 1 L1 0 0.5\');\n\n side.left = 1;\n front.right = 1;\n\n isometric.addChildren(side, front, chop);\n\n});\n;// CONCATENATED MODULE: ./demo/demo.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst functioToString = (fn) => {\n const article = document.createElement(\'article\');\n const pre = document.createElement(\'pre\');\n article.classList.add(\'function-container\');\n pre.classList.add(\'prettyprint\');\n article.appendChild(pre);\n pre.innerHTML = fn.toString();\n return article;\n};\n\nconst demos = new Map([\n [\'demo1\', demo1],\n [\'demo2\', demo2],\n [\'demo3\', demo3],\n [\'demo4\', demo4],\n [\'demo5\', demo5],\n [\'demo6\', demo6],\n [\'demo7\', demo7],\n [\'demo8\', demo8],\n]);\n\ndocument.addEventListener(\'DOMContentLoaded\', function () {\n\n demos.forEach((module, div) => {\n const demo = document.getElementById(div);\n const container = document.createElement(\'div\');\n const wrapper = document.createElement(\'div\');\n\n container.classList.add(\'demo-container\');\n wrapper.classList.add(\'demo-wrapper\');\n\n module(src_namespaceObject, wrapper);\n container.appendChild(wrapper);\n demo.appendChild(container);\n demo.appendChild(functioToString(module));\n });\n\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODA3LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBTztBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsb0NBQW9DO0FBQzlCO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RfQ01BKSwgcm90YXRlWigtUk9UXzQ1KSk7XG52YXIgcm90YXRpb25Ub1JvdGF0aW9uTWF0cml4ID0gZnVuY3Rpb24gKHZpZXcsIHJvdGF0aW9uKSB7XG4gICAgdmFyIHZhbHVlID0gcmFkaWFuKHJvdGF0aW9uLnZhbHVlKTtcbiAgICBzd2l0Y2ggKHZpZXcpIHtcbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuVE9QOiB7XG4gICAgICAgICAgICBzd2l0Y2ggKHJvdGF0aW9uLmF4aXMpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuVE9QOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWih2YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLkxFRlQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVYKC12YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLlJJR0hUOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgoLXZhbHVlKTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxufTtcbmV4cG9ydCB2YXIgZ2V0Vmlld01hdHJpeCA9IGZ1bmN0aW9uIChwbGFuZVZpZXcsIHJvdGF0aW9uKSB7XG4gICAgdmFyIHJvdGF0aW9uTWF0cmljZXMgPSBbXTtcbiAgICB2YXIgcm90YXRpb25NYXRyaXggPSByb3RhdGlvblxuICAgICAgICA/IHJvdGF0aW9uVG9Sb3RhdGlvbk1hdHJpeChwbGFuZVZpZXcsIHJvdGF0aW9uKVxuICAgICAgICA6IG51bGw7XG4gICAgaWYgKHJvdGF0aW9uTWF0cml4KVxuICAgICAgICByb3RhdGlvbk1hdHJpY2VzLnB1c2gocm90YXRpb25NYXRyaXgpO1xuICAgIHN3aXRjaCAocGxhbmVWaWV3KSB7XG4gICAgICAgIGNhc2UgUGxhbmVWaWV3LlRPUDoge1xuICAgICAgICAgICAgcmV0dXJ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mF5LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVsyXSwgbDogK2FycmF5WzNdLCB0OiArYXJyYXlbNF0gfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgICAgICAgY29tbWFuZHNBcnJheS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiArYXJyYXlbNl0sIGw6ICthcnJheVs3XSwgdDogK2FycmF5WzhdIH0sXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVs5XSwgbDogK2FycmF5WzEwXSwgdDogK2FycmF5WzExXSB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGNvbW1hbmRzQXJyYXk7XG59O1xuZXhwb3J0IHZhciB0cmFuc2xhdGVDb21tYW5kUG9pbnRzID0gZnVuY3Rpb24gKGNvbW1hbmRzLCByaWdodCwgbGVmdCwgdG9wKSB7XG4gICAgY29tbWFuZHMuZm9yRWFjaChmdW5jdGlvbiAoY29tbWFuZCkge1xuICAgICAgICBjb21tYW5kLnBvaW50LnIgKz0gcmlnaHQ7XG4gICAgICAgIGNvbW1hbmQucG9pbnQubCArPSBsZWZ0O1xuICAgICAgICBjb21tYW5kLnBvaW50LnQgKz0gdG9wO1xuICAgICAgICBpZiAoY29tbWFuZC5jb250cm9sKSB7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wuciArPSByaWdodDtcbiAgICAgICAgICAgIGNvbW1hbmQuY29udHJvbC5sICs9IGxlZnQ7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wudCArPSB0b3A7XG4gICAgICAgIH1cbiAgICB9KTtcbn07XG5leHBvcnQgdmFyIGdldFRleHR1cmVDb3JuZXIgPSBmdW5jdGlvbiAoY29tbWFuZHMsIGNlbnRlclgsIGNlbnRlclksIHNjYWxlKSB7XG4gICAgdmFyIGNvcm5lciA9IHtcbiAgICAgICAgeDogTnVtYmVyLk1BWF9TQUZFX0lOVEVHRVIsXG4gICAgICAgIHk6IE51bWJlci5NQVhfU0FGRV9JTlRFR0VSXG4gICAgfTtcbiAgICBnZXRDb21tYW5kc1dpdGhTdGFydChjb21tYW5kcylcbiAgICAgICAgLmZvckVhY2goZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gZ2V0UG9pbnRGcm9tSXNvbWV0cmljUG9pbnQoY2VudGVyWCwgY2VudGVyWSwgYy5wb2ludCwgc2NhbGUpO1xuICAgICAgICBpZiAocG9pbnQueCA8IGNvcm5lci54IHx8XG4gICAgICAgICAgICAocG9pbnQueCA9PT0gY29ybmVyLnggJiZcbiAgICAgICAgICAgICAgICBwb2ludC55IDwgY29ybmVyLnkpKSB7XG4gICAgICAgICAgICBjb3JuZXIueCA9IHBvaW50Lng7XG4gICAgICAgICAgICBjb3JuZXIueSA9IHBvaW50Lnk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gY29ybmVyO1xufTtcbmV4cG9ydCB2YXIgaXNTVkdQcm9wZXJ0eSA9IGZ1bmN0aW9uIChwcm9wZXJ0eSkge1xuICAgIHJldHVybiBbXG4gICAgICAgICdmaWxsQ29sb3InLFxuICAgICAgICAnZmlsbE9wYWNpdHknLFxuICAgICAgICAnc3Ryb2tlQ29sb3InLFxuICAgICAgICAnc3Ryb2tlT3BhY2l0eScsXG4gICAgICAgICdzdHJva2VXaWR0aCdcbiAgICBdLmluY2x1ZGVzKHByb3BlcnR5KTtcbn07XG5leHBvcnQgdmFyIGdldFNWR1Byb3BlcnR5ID0gZnVuY3Rpb24gKHByb3BlcnR5KSB7XG4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gfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShTdG9yZS5wcm90b3R5cGUsIFwiaGVpZ2h0XCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zaXplcy5oZWlnaHQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNpemVzLmhlaWdodCA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy5zaXplcy5jZW50ZXJZID0gdmFsdWUgLyAyO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFN0b3JlLnByb3RvdHlwZSwgXCJzY2FsZVwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuc2l6ZXMuc2NhbGU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNpemVzLnNjYWxlID0gdmFsdWU7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoU3RvcmUucHJvdG90eXBlLCBcImNlbnRlclhcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnNpemVzLmNlbnRlclg7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IG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uY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICAgICAgdmFyIGlzTmF0aXZlU1ZHUHJvcGVydHkgPSBpc1NWR1Byb3BlcnR5KGFuaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICBpZiAoaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0eSA9IGdldFNWR1Byb3BlcnR5KGFuaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKHByb3BlcnR5LCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgIGlmIChhbmltYXRpb24udmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogQXJyYXkuaXNBcnJheShhbmltYXRpb24udmFsdWVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gYW5pbWF0aW9uLnZhbHVlcy5tYXAoZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBcIlwiLmNvbmNhdCh2YWx1ZSk7IH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcylcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiBcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSksXG4gICAgICAgICAgICAgICAgICAgICAgICB0bzogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnRvKVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnVwZGF0ZVN1YkNsYXNzQW5pbWF0aW9ucygpO1xuICAgIH07XG4gICAgSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3RvdHlwZS51cGRhdGVQYXR0ZXJuVHJhbnNmb3JtID0gZnVuY3Rpb24gKGNvcm5lciwgcGxhbmVWaWV3KSB7XG4gICAgICAgIHZhciBfYSwgX2IsIF9jO1xuICAgICAgICBpZiAodGhpcy5wcm9wcy50ZXh0dXJlKSB7XG4gICAgICAgICAgICB2YXIgaGVpZ2h0ID0gdGhpcy5wcm9wcy50ZXh0dXJlLmhlaWdodFxuICAgICAgICAgICAgICAgID8gXCJcIi5jb25jYXQodGhpcy5wcm9wcy50ZXh0dXJlLmhlaWdodCAqIHRoaXMuZGF0YS5zY2FsZSlcbiAgICAgICAgICAgICAgICA6ICcxMDAlJztcbiAgICAgICAgICAgIHZhciB3aWR0aCA9IHRoaXMucHJvcHMudGV4dHVyZS53aWR0aFxuICAgICAgICAgICAgICAgID8gXCJcIi5jb25jYXQodGhpcy5wcm9wcy50ZXh0dXJlLndpZHRoICogdGhpcy5kYXRhLnNjY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GVpZ2h0LFxuICAgICAgICAgICAgICAgICd3aWR0aCc6IHdpZHRoXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5wYXR0ZXJuLmZpcnN0Q2hpbGQsIHtcbiAgICAgICAgICAgICAgICAnaGVpZ2h0JzogaGVpZ2h0LFxuICAgICAgICAgICAgICAgICd3aWR0aCc6IHdpZHRoXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUsIFwiZmlsbENvbG9yXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcm9wcy5maWxsQ29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnByb3BzLmZpbGxDb2xvciA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLmVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAnZmlsbCc6IHRoaXMucHJvcHMudGV4dHVyZVxuICAgICAgICAgICAgICAgICAgICA/IFwidXJsKCNcIi5jb25jYXQodGhpcy5wYXR0ZXJuSWQsIFwiKSBcIikuY29uY2F0KHRoaXMuZmlsbENvbG9yKVxuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuZmlsbENvbG9yXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNHcmFwaGljQWJzdHJhY3QucHJvdG90eXBlLCBcImZpbGxPcGFjaXR5XCIsIHtcbiA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aXMuX2NoaWxkcmVuLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgdmFyIG1vdmVkRWxlbWVudCA9IGNoaWxkLmdldEVsZW1lbnQoKTtcbiAgICAgICAgICAgIHZhciByZXBsYWNlZEVsZW1lbnQgPSB0aGlzLl9jaGlsZHJlbltpbmRleF0uZ2V0RWxlbWVudCgpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX2NoaWxkcmVuW2luZGV4XSAhPT0gY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9jaGlsZHJlbi5zcGxpY2UoY2hpbGRJbmRleCwgMSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fY2hpbGRyZW4uc3BsaWNlKGluZGV4LCAwLCBjaGlsZCk7XG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkSW5kZXggPiBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuaW5zZXJ0QmVmb3JlKG1vdmVkRWxlbWVudCwgcmVwbGFjZWRFbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXBsYWNlZEVsZW1lbnQubmV4dFNpYmxpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZWxlbWVudC5pbnNlcnRCZWZvcmUobW92ZWRFbGVtZW50LCByZXBsYWNlZEVsZW1lbnQubmV4dFNpYmxpbmcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKG1vdmVkRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm93Q2hpbGR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YXRhLmhlaWdodCwgXCJweFwiKSxcbiAgICAgICAgICAgICAgICBfYSkpO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLmJhY2tncm91bmQsIHtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IFwiXCIuY29uY2F0KHRoaXMuZGF0YS5oZWlnaHQsIFwicHhcIilcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNDYW52YXMucHJvdG90eXBlLCBcIndpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhLndpZHRoO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIF9hO1xuICAgICAgICAgICAgdGhpcy5kYXRhLndpZHRoID0gdmFsdWU7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuZWxlbWVudCwgKF9hID0ge30sXG4gICAgICAgICAgICAgICAgX2FbU1ZHX1BST1BFUlRJRVMudmlld0JveF0gPSBcIjAgMCBcIi5jb25jYXQodGhpcy5kYXRhLndpZHRoLCBcIiBcIikuY29uY2F0KHRoaXMuZGF0YS5oZWlnaHQpLFxuICAgICAgICAgICAgICAgIF9hLndpZHRoID0gXCJcIi5jb25jYXQodGhpcy5kYXRhLndpZHRoLCBcInB4XCIpLFxuICAgICAgICAgICAgICAgIF9hKSk7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuYmFja2dyb3VuZCwge1xuICAgICAgICAgICAgICAgIHdpZHRoOiBcIlwiLmNvbm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VudChldmVudCkpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgY2xpZW50WDogZXZlbnQuY2xpZW50WCxcbiAgICAgICAgICAgICAgICBjbGllbnRZOiBldmVudC5jbGllbnRZXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBjbGllbnRYOiBldmVudC50b3VjaGVzWzBdLmNsaWVudFgsXG4gICAgICAgICAgICBjbGllbnRZOiBldmVudC50b3VjaGVzWzBdLmNsaWVudFlcbiAgICAgICAgfTtcbiAgICB9XG4gICAgcmV0dXJuIGV2ZW50O1xufTtcbnZhciBJc29tZXRyaWNEcmFnZ2FibGVBYnN0cmFjdCA9IChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgX19leHRlbmRzKElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0KCkge1xuICAgICAgICByZXR1cm4gX3N1cGVyICE9PSBudWxsICYmIF9zdXBlci5hcHBseSh0aGlzLCBhcmd1bWVudHMpIHx8IHRoaXM7XG4gICAgfVxuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5zZXR1cCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5zdGFydERyYWcgPSB0aGlzLnN0YXJ0RHJhZy5iaW5kKHRoaXMpO1xuICAgICAgICB0aGlzLnN0b3BEcmFnID0gdGhpcy5zdG9wRHJhZy5iaW5kKHRoaXMpO1xuICAgICAgICB0aGlzLm1vdmVFbGVtZW50ID0gdGhpcy5tb3ZlRWxlbWVudC5iaW5kKHRoaXMpO1xuICAgICAgICB0aGlzLmRyb3BFbGVtZW50ID0gdGhpcy5kcm9wRWxlbWVudC5iaW5kKHRoaXMpO1xuICAgICAgICB0aGlzLmFuaW1hdGUgPSB0aGlzLmFuaW1hdG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yZHMucmlnaHQgPSBfdGhpcy5nZXRSaWdodChlbnRyeVsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xlZnQnOlxuICAgICAgICAgICAgICAgICAgICBmaXhlZENvb3Jkcy5sZWZ0ID0gX3RoaXMuZ2V0TGVmdChlbnRyeVsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGZpeGVkQ29vcmRzLnRvcCA9IF90aGlzLmdldFRvcChlbnRyeVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZml4ZWRDb29yZHM7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50VHlwZSkge1xuICAgICAgICB2YXIgZHJhZ0V2ZW50ID0gbmV3IEN1c3RvbUV2ZW50KGV2ZW50VHlwZSwge1xuICAgICAgICAgICAgY2FuY2VsYWJsZTogZXZlbnRUeXBlID09PSBEUkFHX0VWRU5ULkRSQUcsXG4gICAgICAgICAgICBkZXRhaWw6IHtcbiAgICAgICAgICAgICAgICByaWdodDogdGhpcy5fY29vcmRzLnJpZ2h0IHx8IHRoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgbGVmdDogdGhpcy5fY29vcmRzLmxlZnQgfHwgdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgIHRvcDogdGhpcy5fY29vcmRzLnRvcCB8fCB0aGlzLnRvcFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5lbGVtZW50LmRpc3BhdGNoRXZlbnQoZHJhZ0V2ZW50KTtcbiAgICAgICAgcmV0dXJuIGRyYWdFdmVudDtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5hbmltYXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5fdXBkYXRlKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX3ByZXZlbnRlZCkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLnJpZ2h0ID09PSBUeXBlb2YuTlVNQkVSKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmlnaHQgPSB0aGlzLl9jb29yZHMucmlnaHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLmxlZnQgPT09IFR5cGVvZi5OVU1CRVIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sZWZ0ID0gdGhpcy5fY29vcmRzLmxlZnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fY29vcmRzLnRvcCA9PT0gVHlwZW9mLk5VTUJFUikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRvcCA9IHRoaXMuX2Nvb3Jkcy50b3A7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgX3JlcXVlc3RBbmltYXRpb25GcmFtZSh0aGlzLmFuaW1hdGUpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBJc29tZXRyaWNEcmFnZ2FibGVBYnN0cmFjdC5wcm90b3R5cGUuc3RhcnREcmFnID0gZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHZhciBfYSA9IGdldENsaWVudENvb3JkcyhldmVudCksIGNsaWVudFggPSBfYS5jbGllbnRYLCBjbGllbnRZID0gX2EuY2xpZW50WTtcbiAgICAgICAgdGhpcy5fZHJhZ1N0b3JlLnggPSBjbGllbnRYO1xuICA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gIGlmICh0aGlzLnByb3BzLnRvcCAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnRvcCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljRHJhZ2dhYmxlQWJzdHJhY3QucHJvdG90eXBlLCBcImRyYWdcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9kcmFnIHx8IGZhbHNlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLl9kcmFnID09PSBUeXBlb2YuVU5ERUZJTkVEKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXR1cCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fZHJhZyA9IHZhbHVlO1xuICAgICAgICAgICAgaWYgKF9pc0Jyb3dzZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnN0b3BEcmFnKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5iZWdpbkRyYWcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNEcmFnZ2FibGVBYnN0cmFjdC5wcm90b3R5cGUsIFwiYm91bmRzXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4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AgPSAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgIF9fZXh0ZW5kcyhJc29tZXRyaWNHcm91cCwgX3N1cGVyKTtcbiAgICBmdW5jdGlvbiBJc29tZXRyaWNHcm91cChwcm9wcykge1xuICAgICAgICBpZiAocHJvcHMgPT09IHZvaWQgMCkgeyBwcm9wcyA9IHt9OyB9XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIFNWR19FTEVNRU5UUy5ncm91cCkgfHwgdGhpcztcbiAgICAgICAgX3RoaXMucHJvcHMgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgZGVmYXVsdFByb3BzKSwgcHJvcHMpO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIElzb21ldHJpY0dyb3VwLnByb3RvdHlwZS51cGRhdGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmIChlbGVtZW50SGFzU1ZHUGFyZW50KHRoaXMuZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHZhciBwb2ludCA9IGdldFBvaW50RnJvbUlzb21ldHJpY1BvaW50KDAsIDAsIHtcbiAgICAgICAgICAgICAgICByOiB0aGlzLnByb3BzLnJpZ2h0LFxuICAgICAgICAgICAgICAgIGw6IHRoaXMucHJvcHMubGVmdCxcbiAgICAgICAgICAgICAgICB0OiB0aGlzLnByb3BzLnRvcFxuICAgICAgICAgICAgfSwgdGhpcy5kYXRhLnNjYWxlKTtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5lbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgdHJhbnNmb3JtOiBcInRyYW5zbGF0ZShcIi5jb25jYXQocG9pbnQueCwgXCIsIFwiKS5jb25jYXQocG9pbnQueSwgXCIpXCIpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gX3N1cGVyLnByb3RvdHlwZS51cGRhdGUuY2FsbCh0aGlzKTtcbiAgICB9O1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VjdC5hc3NpZ24gfHwgZnVuY3Rpb24odCkge1xuICAgICAgICBmb3IgKHZhciBzLCBpID0gMSwgbiA9IGFyZ3VtZW50cy5sZW5ndGg7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICAgIHMgPSBhcmd1bWVudHNbaV07XG4gICAgICAgICAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkpXG4gICAgICAgICAgICAgICAgdFtwXSA9IHNbcF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHQ7XG4gICAgfTtcbiAgICByZXR1cm4gX19hc3NpZ24uYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbn07XG52YXIgX19yZXN0ID0gKHRoaXMgJiYgdGhpcy5fX3Jlc3QpIHx8IGZ1bmN0aW9uIChzLCBlKSB7XG4gICAgdmFyIHQgPSB7fTtcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcbiAgICAgICAgdFtwXSA9IHNbcF07XG4gICAgaWYgKHMgIT0gbnVsbCAmJiB0eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyA9PT0gXCJmdW5jdGlvblwiKVxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoZS5pbmRleE9mKHBbaV0pIDwgMCAmJiBPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwocywgcFtpXSkpXG4gICAgICAgICAgICAgICAgdFtwW2ldXSA9IHNbcFtpXV07XG4gICAgICAgIH1cbiAgICByZXR1cm4gdDtcbn07XG5pbXBvcnQgeyBDb21tYW5kLCBQbGFuZ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ldHJpY1JlY3RhbmdsZS5wcm90b3R5cGUudXBkYXRlU3ViQ2xhc3NBbmltYXRpb25zID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICB2YXIgaXNOYXRpdmVTVkdQcm9wZXJ0eSA9IGlzU1ZHUHJvcGVydHkoYW5pbWF0aW9uLnByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmICghaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIHZhciBwcm9wc18xID0ge1xuICAgICAgICAgICAgICAgICAgICByaWdodDogX3RoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgICAgIGxlZnQ6IF90aGlzLmxlZnQsXG4gICAgICAgICAgICAgICAgICAgIHRvcDogX3RoaXMudG9wLFxuICAgICAgICAgICAgICAgICAgICB3aWR0aDogX3RoaXMud2lkdGgsXG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDogX3RoaXMuaGVpZ2h0XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzXzEsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICt2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5nZXRSZWN0YW5nbGVQYXRoKG1vZGlmaWVkQXJncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogX3RoaXMuZ2V0UmVjdGFuZ2xlUGF0aChtb2RpZmllZEFyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b0FyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG87XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IF90aGlzLmdldFJlY3RhbmdsZVBhdGgoZnJvbUFyZ3MpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBfdGhpcy5nZXRSZWN0YW5nbGVQYXRoKHRvQXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCdkJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNSZWN0YW5nbGUucHJvdG90eXBlLCBcIndpZHRoXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd2lkdGg7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl93aWR0aCA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNSZWN0YW5nbGUucHJvdG90eXBlLCBcImhlaWdodFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2hlaWdodDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX2hlaWdodCA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIElzb21ldHJpY1JlY3RhbmdsZS5wcm90b3R5cGUuYWRkQW5pbWF0aW9uID0gZnVuY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICByZXR1cm4gX3N1cGVyLnByb3RvdHlwZS5hZGRBbmltYXRpb24uY2FsbCh0aGlzLCBhbmltYXRpb24pO1xuICAgIH07XG4gICAgcmV0dXJ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B7XG4gICAgICAgIHZhciByaWdodCA9IChhcmdzID09PSBudWxsIHx8IGFyZ3MgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGFyZ3MucmlnaHQpIHx8IHRoaXMucmlnaHQ7XG4gICAgICAgIHZhciBsZWZ0ID0gKGFyZ3MgPT09IG51bGwgfHwgYXJncyA9PT0gdm9pZCAwID8gdm9pZCAwIDogYXJncy5sZWZ0KSB8fCB0aGlzLmxlZnQ7XG4gICAgICAgIHZhciB0b3AgPSAoYXJncyA9PT0gbnVsbCB8fCBhcmdzID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhcmdzLnRvcCkgfHwgdGhpcy50b3A7XG4gICAgICAgIHZhciByYWRpdXMgPSAoYXJncyA9PT0gbnVsbCB8fCBhcmdzID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhcmdzLnJhZGl1cykgfHwgdGhpcy5yYWRpdXM7XG4gICAgICAgIHZhciBjb21tYW5kcyA9IFtdO1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhbmVWaWV3KSB7XG4gICAgICAgICAgICBjYXNlIFBsYW5lVmlldy5GUk9OVDpcbiAgICAgICAgICAgICAgICBjb21tYW5kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5tb3ZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiByYWRpdXMsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogLXJhZGl1cywgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IDAsIGw6IDAsIHQ6IC1yYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogMCwgbDogMCwgdDogcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6XG4gICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQubW92ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogLXJhZGl1cywgbDogMCwgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiByYWRpdXMsIGw6IDAsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiAtcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IC1yYWRpdXMsIGw6IDAsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiByYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuVE9QOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLm1vdmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IHJhZGl1cywgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiAtcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogcmFkaXVzLCBsOiAwLCB0OiAwIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IHJhZGl1cywgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IC1yYWRpdXMsIGw6IDAsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHRyYW5zbGF0ZUNvbW1hbmRQb2ludHMoY29tbWFuZHMsIHJpZ2h0LCBsZWZ0LCB0b3ApO1xuICAgICAgICByZXR1cm4gY29tbWFuZHM7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDaXJjbGUucHJvdG90eXBlLmdldENpcmNsZVBhdGggPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgY29tbWFuZHMgPSB0aGlzLmdldENvbW1hbmRzKGFyZ3MpO1xuICAgICAgICByZXR1cm4gZ2V0U1ZHUGF0aChjb21tYW5kcywgdGhpcy5kYXRhLmNlbnRlclgsIHRoaXMuZGF0YS5jZW50ZXJZLCB0aGlzLmRhdGEuc2NhbGUsIHRydWUpO1xuICAgIH07XG4gICAgSXNvbWV0cmljQ2lyY2xlLnByb3RvdHlwZS51cGRhdGVTdWJDbGFzc0FuaW1hdGlvbnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMuYW5pbWF0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uIChhbmltYXRpb24pIHtcbiAgICAgICAgICAgIHZhciBpc05hdGl2ZVNWR1Byb3BlcnR5ID0gaXNTVkdQcm9wZXJ0eShhbmltYXRpb24ucHJvcGVydHkpO1xuICAgICAgICAgICAgaWYgKCFpc05hdGl2ZVNWR1Byb3BlcnR5KSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BzXzEgPSB7XG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0OiBfdGhpcy5yaWdodCxcbiAgICAgICAgICAgICAgICAgICAgbGVmdDogX3RoaXMubGVmdCxcbiAgICAgICAgICAgICAgICAgICAgdG9wOiBfdGhpcy50b3AsXG4gICAgICAgICAgICAgICAgICAgIHJhZGl1czogX3RoaXMucmFkaXVzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzXzEsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICt2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5nZXRDaXJjbGVQYXRoKG1vZGlmaWVkQXJncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogX3RoaXMuZ2V0Q2lyY2xlUGF0aChtb2RpZmllZEFyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b0FyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG87XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IF90aGlzLmdldENpcmNsZVBhdGgoZnJvbUFyZ3MpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBfdGhpcy5nZXRDaXJjbGVQYXRoKHRvQXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCdkJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNDaXJjbGUucHJvdG90eXBlLCBcInJhZGl1c1wiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoa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AgICAgICAgICAgICAgICAgPyBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQodmFsdWUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcykpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogX3RoaXMuZ2V0UGF0aEZyb21Db21tYW5kcyhcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG86IF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQoYW5pbWF0aW9uLnRvKSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgIC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jZW50ZXJYXG4gICAgICAgICAgICA6IDAsIGZyb21DZW50ZXJcbiAgICAgICAgICAgID8gdGhpcy5kYXRhLmNlbnRlcllcbiAgICAgICAgICAgIDogMCwge1xuICAgICAgICAgICAgcjogcHJvcHMucmlnaHQsXG4gICAgICAgICAgICBsOiBwcm9wcy5sZWZ0LFxuICAgICAgICAgICAgdDogcHJvcHMudG9wXG4gICAgICAgIH0sIHRoaXMuZGF0YS5zY2FsZSk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS51cGRhdGVTdWJDbGFzc0FuaW1hdGlvbnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBwcm9wcyA9IHtcbiAgICAgICAgICAgIHJpZ2h0OiAwLFxuICAgICAgICAgICAgbGVmdDogMCxcbiAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgIHJvdGF0aW9uOiAwLFxuICAgICAgICB9O1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICB2YXIgaXNOYXRpdmVTVkdQcm9wZXJ0eSA9IGlzU1ZHUHJvcGVydHkoYW5pbWF0aW9uLnByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmICghaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocHJvcHMsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnR5XzEgPSBhbmltYXRpb24ucHJvcGVydHk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpc1JvdGF0aW9uXzEgPSBwcm9wZXJ0eV8xID09PSAncm90YXRpb24nO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29tbW9uUHJvcHMgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgX3RoaXMuY29tbW9uQW5pbWF0aW9uQXR0cmlidXRlcyksIHsgdHlwZTogaXNSb3RhdGlvbl8xXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncm90YXRlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RyYW5zbGF0ZScsIGJlZ2luOiAnaW5kZWZpbml0ZScgfSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyB2YWx1ZXM6IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcIlwiLmNvbmNhdCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArdmFsdWUgLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzID0gX3RoaXMuZ2V0UG9zaXRpb25UcmFuc2Zvcm0obW9kaWZpZWRBcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiXCIuY29uY2F0KGNvb3Jkcy54LCBcIixcIikuY29uY2F0KGNvb3Jkcy55KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignOycpIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBcIlwiLmNvbmNhdChhbmltYXRpb24udmFsdWVzKSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK2FuaW1hdGlvbi52YWx1ZXMgLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKG1vZGlmaWVkQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyB2YWx1ZXM6IFwiXCIuY29uY2F0KGNvb3Jkcy54LCBcIixcIikuY29uY2F0KGNvb3Jkcy55KSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IGZyb206IFwiXCIuY29uY2F0KGFuaW1hdGlvbi5mcm9tKSwgdG86IFwiXCIuY29uY2F0KGFuaW1hdGlvbi50bykgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21BcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9BcmdzID0gX19hc3NpZ24oe30sIHByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24uZnJvbSAtIF90aGlzW3Byb3BlcnR5XzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udG8gLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzRnJvbSA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKGZyb21BcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3Jkc1RvID0gX3RoaXMuZ2V0UG9zaXRpb25UcmFuc2Zvcm0odG9BcmdzLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgZnJvbTogXCJcIi5jb25jYXQoY29vcmRzRnJvbS54LCBcIixcIikuY29uY2F0KGNvb3Jkc0Zyb20ueSksIHRvOiBcIlwiLmNvbmNhdChjb29yZHNUby54LCBcIixcIikuY29uY2F0KGNvb3Jkc1RvLnkpIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZVRyYW5zZm9ybSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYWRkQW5pbWF0aW9uQmFzaWNQcm9wZXJ0aWVzKCd0cmFuc2Zvcm0nLCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCBwcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNSb3RhdGlvbl8xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3RleHRFbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQuYmVnaW5FbGVtZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS51cGRhdGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmIChlbGVtZW50SGFzU1ZHUGFyZW50KHRoaXMuZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHZhciB0cmFuc2Zvcm0gPSB0aGlzLmdldE1hdHJpeFRyYW5zZm9ybSh7XG4gICAgICAgICAgICAgICAgcmlnaHQ6IHRoaXMucmlnaHQsXG4gICAgICAgICAgICAgICAgbGVmdDogdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgIHRvcDogdGhpcy50b3BcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90ZXh0RWxlbWVudCwgeyB0cmFuc2Zvcm06IHRyYW5zZm9ybSB9KTtcbiAgICAgICAgICAgIHRoaXMuX3RzcGFuLnRleHRDb250ZW50ID0gdGhpcy5fdGV4dDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlUGF0dGVyblRyYW5zZm9ybSh7IHg6IDAsIHk6IDAgfSwgdGhpcy5wbGFuZVZpZXcpO1xuICAgICAgICAgICAgdGhpcy51cGRhdGVBbmltYXRpb25zKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfTtcbiAgICBJc29tZXRyaWNUZXh0LnByb3RvdHlwZS5jbGVhciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy50ZXh0ID0gJyc7XG4gICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInRleHRcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl90ZXh0O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fdGV4dCA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJwbGFuZVZpZXdcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9wbGFuZVZpZXc7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9wbGFuZVZpZXcgPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwiZm9udEZhbWlseVwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2Zv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iAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX3NlbGVjdGFibGUgPSB2YWx1ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9zZWxlY3RhYmxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdGV4dEVsZW1lbnQucmVtb3ZlQXR0cmlidXRlKCdzdHlsZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90ZXh0RWxlbWVudCwge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZTogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJy13ZWJraXQtdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJy1tb3otdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJy1tcy11c2VyLXNlbGVjdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BvaW50ZXItZXZlbnRzJ1xuICAgICAgICAgICAgICAgICAgICBdLm1hcChmdW5jdGlvbiAoZGVjbCkgeyByZXR1cm4gXCJcIi5jb25jYXQoZGVjbCwgXCI6IG5vbmVcIik7IH0pLmpvaW4oJzsnKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcIm9yaWdpblwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX29yaWdpbjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW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Iiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9sZWZ0O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX2xlZnQgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGVmdCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwidG9wXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdG9wO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX3RvcCAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl90b3AgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInJvdGF0aW9uXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcm90YXRpb247XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB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sXG4gICAgICAgIGhlaWdodDogMzIwXG4gICAgfSk7XG5cbiAgICBjb25zdCBjb21tb25UZXh0dXJlUHJvcHMgPSB7XG4gICAgICAgIGhlaWdodDogMSxcbiAgICAgICAgd2lkdGg6IDEsXG4gICAgICAgIHBpeGVsYXRlZDogdHJ1ZVxuICAgIH07XG5cbiAgICBjb25zdCB0ZXh0dXJlU2lkZXMgPSB7XG4gICAgICAgIHVybDogJ2ltYWdlcy9ibG9ja19zaWRlLnBuZycsXG4gICAgICAgIC4uLmNvbW1vblRleHR1cmVQcm9wc1xuICAgIH07XG5cbiAgICBjb25zdCB0ZXh0dXJlVG9wID0ge1xuICAgICAgICB1cmw6ICdpbWFnZXMvYmxvY2tfdG9wLnBuZycsXG4gICAgICAgIHBsYW5lVmlldzogUGxhbmVWaWV3LlRPUCxcbiAgICAgICAgcm90YXRpb246IHtcbiAgICAgICAgICAgIGF4aXM6IEF4aXMuTEVGVCxcbiAgICAgICAgICAgIHZhbHVlOiAyNi41NjUwXG4gICAgICAgIH0sXG4gICAgICAgIC4uLmNvbW1vblRleHR1cmVQcm9wc1xuICAgIH07XG5cbiAgICBjb25zdCBzaWRlID0gbmV3IElzb21ldHJpY1BhdGgoe1xuICAgICAgICB0ZXh0dXJlOiB7XG4gICAgICAgICAgICBwbGFuZVZpZXc6IFBsYW5lVmlldy5TSURFLFxuICAgICAgICAgICAgLi4udGV4dHVyZVNpZGVzXG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIGNvbnN0IGZyb250ID0gbmV3IElzb21ldHJpY1JlY3RhbmdsZSh7XG4gICAgICAgIHBsYW5lVmlldzogUGxhbmVWaWV3LkZST05ULFxuICAgICAgICBoZWlnaHQ6IDAuNSxcbiAgICAgICAgd2lkdGg6IDEsXG4gICAgICAgIHRleHR1cmU6IHRleHR1cmVTaWRlc1xuICAgIH0pO1xuXG4gICAgY29uc3QgY2hvcCA9IG5ldyBJc29tZXRyaWNQYXRoKHtcbiAgICAgICAgdGV4dHVyZT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GUsIHdyYXBwZXIpO1xuICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQod3JhcHBlcik7XG4gICAgICAgIGRlbW8uYXBwZW5kQ2hpbGQoY29udGFpbmVyKTtcbiAgICAgICAgZGVtby5hcHBlbmRDaGlsZChmdW5jdGlvVG9TdHJpbmcobW9kdWxlKSk7XG4gICAgfSk7XG5cbn0pOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///807\n')},966:(module,exports)=>{eval('var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(){var r=null;\n(function(){function X(e){function j(){try{J.doScroll("left")}catch(e){P(j,50);return}w("poll")}function w(j){if(!(j.type=="readystatechange"&&x.readyState!="complete")&&((j.type=="load"?n:x)[z](i+j.type,w,!1),!m&&(m=!0)))e.call(n,j.type||j)}var Y=x.addEventListener,m=!1,C=!0,t=Y?"addEventListener":"attachEvent",z=Y?"removeEventListener":"detachEvent",i=Y?"":"on";if(x.readyState=="complete")e.call(n,"lazy");else{if(x.createEventObject&&J.doScroll){try{C=!n.frameElement}catch(A){}C&&j()}x[t](i+"DOMContentLoaded",\nw,!1);x[t](i+"readystatechange",w,!1);n[t](i+"load",w,!1)}}function Q(){S&&X(function(){var e=K.length;$(e?function(){for(var j=0;j=0;){var M=A[m],T=M.src.match(/^[^#?]*\\/run_prettify\\.js(\\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D=\n[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]-\na[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*]|\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\\\d+|\\\\[^\\dux]|\\(\\?[!:=]|[()^]|[^()[\\\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y,\ng),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\\S\\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\'\'(?:[^\'\\\\]|\\\\[\\S\\s]|\'\'?(?=[^\']))*(?:\'\'\'|$)|"""(?:[^"\\\\]|\\\\[\\S\\s]|""?(?=[^"]))*(?:"""|$)|\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$))/,\nr,"\'\\""]):a.multiLineStrings?d.push(["str",/^(?:\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$)|`(?:[^\\\\`]|\\\\[\\S\\s])*(?:`|$))/,r,"\'\\"`"]):d.push(["str",/^(?:\'(?:[^\\n\\r\'\\\\]|\\\\.)*(?:\'|$)|"(?:[^\\n\\r"\\\\]|\\\\.)*(?:"|$))/,r,"\\"\'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\\b|[^\\n\\r]*)/,\nr,"#"]),h.push(["str",/^<(?:(?:(?:\\.\\.\\/)*|\\/?)(?:[\\w-]+(?:\\/[\\w-]+)+)?[\\w-]+\\.h(?:h|pp|\\+\\+)?|[a-z]\\w*)>/,r])):d.push(["com",/^#[^\\n\\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\\/\\/[^\\n\\r]*/,r]),h.push(["com",/^\\/\\*[\\S\\s]*?(?:\\*\\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\\n\\r")?".":"[\\\\S\\\\s]";h.push(["lang-regex",RegExp("^(?:^^\\\\.?|[+-]|[!=]=?=?|\\\\#|%=?|&&?=?|\\\\(|\\\\*=?|[+\\\\-]=|->|\\\\/=?|::?|<>?>?=?|,|;|\\\\?|@|\\\\[|~|{|\\\\^\\\\^?=?|\\\\|\\\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\\\s*("+\n("/(?=[^/*"+b+"])(?:[^/\\\\x5B\\\\x5C"+b+"]|\\\\x5C"+e+"|\\\\x5B(?:[^\\\\x5C\\\\x5D"+b+"]|\\\\x5C"+e+")*(?:\\\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\\s,]+/g,"|")+")\\\\b"),r]);d.push(["pln",/^\\s+/,r," \\r\\n\\t\\u00a0"]);b="^.[^\\\\s\\\\w.$@\'\\"`/\\\\\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\\w$@]*|\\w+_t\\b)/,r],["pln",/^[$_a-z][\\w$@]*/i,r],["lit",/^(?:0x[\\da-f]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+-]?\\d+)?)[a-z]*/i,\nr,"0123456789"],["pln",/^\\\\[\\S\\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}}\nfunction e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\\s)nocode(?:\\s|$)/,m=/\\r\\n?|\\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],\n"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],\nL=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],\nN=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,\nS=/\\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\\!--[\\S\\s]*?(?:--\\>|$)/],["lang-",/^<\\?([\\S\\s]+?)(?:\\?>|$)/],["lang-",/^<%([\\S\\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",\n/^]*>([\\S\\s]+?)<\\/xmp\\b[^>]*>/i],["lang-js",/^]*>([\\S\\s]*?)(<\\/script\\b[^>]*>)/i],["lang-css",/^]*>([\\S\\s]*?)(<\\/style\\b[^>]*>)/i],["lang-in.tag",/^(<\\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\\s+/,r," \\t\\r\\n"],["atv",/^(?:"[^"]*"?|\'[^\']*\'?)/,r,"\\"\'"]],[["tag",/^^<\\/?[a-z](?:[\\w-.:]*\\w)?|\\/?>$/i],["atn",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],["lang-uq.val",/^=\\s*([^\\s"\'>]*(?:[^\\s"\'/>]|\\/(?=\\s)))/],["pun",/^[/<->]+/],\n["lang-js",/^on\\w+\\s*=\\s*"([^"]+)"/i],["lang-js",/^on\\w+\\s*=\\s*\'([^\']+)\'/i],["lang-js",/^on\\w+\\s*=\\s*([^\\s"\'>]+)/i],["lang-css",/^style\\s*=\\s*"([^"]+)"/i],["lang-css",/^style\\s*=\\s*\'([^\']+)\'/i],["lang-css",/^style\\s*=\\s*([^\\s"\'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\\S\\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}),\n["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N,\nhashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);\ni(C([],[["str",/^[\\S\\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML},\nprettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p{for(var C in g)__webpack_require__.o(g,C)&&!__webpack_require__.o(I,C)&&Object.defineProperty(I,C,{enumerable:!0,get:g[C]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(I){if("object"==typeof window)return window}}(),__webpack_require__.o=(I,g)=>Object.prototype.hasOwnProperty.call(I,g),__webpack_require__.r=I=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})},(()=>{var I;__webpack_require__.g.importScripts&&(I=__webpack_require__.g.location+"");var g=__webpack_require__.g.document;if(!I&&g&&(g.currentScript&&(I=g.currentScript.src),!I)){var C=g.getElementsByTagName("script");if(C.length)for(var t=C.length-1;t>-1&&(!I||!/^http(s?):/.test(I));)I=C[t--].src}if(!I)throw new Error("Automatic publicPath is not supported in this browser");I=I.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=I+"../"})();var __webpack_exports__=__webpack_require__(807),__webpack_export_target__=window;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file