From ae0bd3d1093c39fb2a84f21b990dfafe27e8731b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pereira=20Mu=C3=B1oz?= Date: Wed, 1 Jan 2025 15:27:26 +0100 Subject: [PATCH] Build demo bundle --- docs/scripts/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scripts/bundle.js b/docs/scripts/bundle.js index 213fb24..20cbb9b 100644 --- a/docs/scripts/bundle.js +++ b/docs/scripts/bundle.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={741:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval('\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 IsometricPentagram: () => (IsometricPentagram),\n IsometricRectangle: () => (IsometricRectangle),\n IsometricStarPolygon: () => (IsometricStarPolygon),\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;// ./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;// ./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;// ./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;// ./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;// ./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;// ./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;// ./src/@classes/abstract/IsometricStore/index.ts\n\n\n;// ./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(id, svgElement) {\n var _this = _super.call(this) || this;\n _this._id = id;\n _this.listeners = [];\n _this.element = document.createElementNS(SVG_NAMESPACE, svgElement);\n addSVGProperties(_this.element, {\n \'id\': _this._id\n });\n return _this;\n }\n IsometricElementAbstract.prototype.setId = function (value) {\n this._id = value;\n addSVGProperties(this.element, {\n \'id\': this._id\n });\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;// ./src/@classes/abstract/IsometricElementAbstract/index.ts\n\n\n;// ./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, props.id || uuid(), 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, __assign({ \'fill\': _this.props.texture\n ? "url(#".concat(_this.patternId, ") ").concat(_this.fillColor)\n : _this.fillColor, \'fill-opacity\': "".concat(_this.fillOpacity), \'stroke\': _this.strokeColor, \'stroke-dasharray\': _this.strokeDashArray.join(\' \'), \'stroke-linecap\': _this.strokeLinecap, \'stroke-linejoin\': _this.strokeLinejoin, \'stroke-opacity\': "".concat(_this.strokeOpacity), \'stroke-width\': "".concat(_this.strokeWidth) }, (_this.props.className && {\n class: _this.props.className\n })));\n return _this;\n }\n IsometricGraphicAbstract.prototype.createTexture = function (texture) {\n this.patternId = "".concat(this.id, "__texture");\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, "id", {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this.setId(value);\n if (this.pattern) {\n this.patternId = "".concat(this.id, "__texture");\n addSVGProperties(this.pattern, {\n \'id\': this.patternId\n });\n }\n },\n enumerable: false,\n configurable: true\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 Object.defineProperty(IsometricGraphicAbstract.prototype, "className", {\n get: function () {\n return this.props.className;\n },\n set: function (value) {\n this.props.className = value;\n addSVGProperties(this.element, {\n \'class\': this.props.className\n });\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;// ./src/@classes/abstract/IsometricGraphicAbstract/index.ts\n\n\n;// ./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(id, svgElement) {\n var _this = _super.call(this, id, 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, "id", {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this.setId(value);\n },\n enumerable: false,\n configurable: true\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.getChildByIndex = function (index) {\n return this._children[index] || null;\n };\n IsometricContainerAbstract.prototype.getChildById = function (id) {\n var child = this._children.find(function (child) { return child.id === id; });\n return child || null;\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.removeChildById = function (id) {\n var child = this.getChildById(id);\n if (child) {\n return this.removeChild(child);\n }\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;// ./src/@classes/abstract/IsometricContainerAbstract/index.ts\n\n\n;// ./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\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, props.id || uuid(), 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 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.getSVGCode = function () {\n return this.element.outerHTML;\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;// ./src/@classes/public/IsometricCanvas/index.ts\n\n\n\n;// ./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;// ./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;// ./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.getBoundOrMaximum = function (prop) {\n var _a;\n if (this.bounds) {\n return (_a = this.bounds[prop]) !== null && _a !== void 0 ? _a : IsometricDraggableAbstract_spreadArray([], NO_LIMITS, true);\n }\n return IsometricDraggableAbstract_spreadArray([], NO_LIMITS, true);\n };\n IsometricDraggableAbstract.prototype.getRight = function (value) {\n var bounds = this.getBoundOrMaximum(\'right\');\n return this.betweenBounds(this._dragStore.right + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getLeft = function (value) {\n var bounds = this.getBoundOrMaximum(\'left\');\n return this.betweenBounds(this._dragStore.left + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getTop = function (value) {\n var bounds = this.getBoundOrMaximum(\'top\');\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 _a, _b, _c;\n var dragEvent = new CustomEvent(eventType, {\n cancelable: eventType === DRAG_EVENT.DRAG,\n detail: {\n right: (_a = this._coords.right) !== null && _a !== void 0 ? _a : this.right,\n left: (_b = this._coords.left) !== null && _b !== void 0 ? _b : this.left,\n top: (_c = this._coords.top) !== null && _c !== void 0 ? _c : 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.getBoundOrMaximum(\'right\');\n var boundsLeft = this.getBoundOrMaximum(\'left\');\n var boundsTop = this.getBoundOrMaximum(\'top\');\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;// ./src/@classes/abstract/IsometricDraggableAbstract/index.ts\n\n\n;// ./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, props.id || uuid(), 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;// ./src/@classes/public/IsometricGroup/index.ts\n\n\n;// ./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;// ./src/@classes/abstract/IsometricPathAbstract/index.ts\n\n\n;// ./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;// ./src/@classes/abstract/IsometricShapeAbstract/index.ts\n\n\n;// ./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 _a, _b, _c, _d, _e;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var width = (_d = args === null || args === void 0 ? void 0 : args.width) !== null && _d !== void 0 ? _d : this.width;\n var height = (_e = args === null || args === void 0 ? void 0 : args.height) !== null && _e !== void 0 ? _e : 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;// ./src/@classes/public/IsometricRectangle/index.ts\n\n\n;// ./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 _a, _b, _c, _d;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var radius = (_d = args === null || args === void 0 ? void 0 : args.radius) !== null && _d !== void 0 ? _d : 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;// ./src/@classes/public/IsometricCircle/index.ts\n\n\n;// ./src/@classes/abstract/IsometricStarPolygonAbstract/IsometricStarPolygonAbstract.ts\nvar IsometricStarPolygonAbstract_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 IsometricStarPolygonAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricStarPolygonAbstract_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 IsometricStarPolygonAbstract_assign.apply(this, arguments);\n};\nvar IsometricStarPolygonAbstract_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};\nvar IsometricStarPolygonAbstract_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 IsometricStarPolygonAbstract = (function (_super) {\n IsometricStarPolygonAbstract_extends(IsometricStarPolygonAbstract, _super);\n function IsometricStarPolygonAbstract(props) {\n var _this = this;\n var radius = props.radius, points = props.points, density = props.density, _a = props.rotation, rotation = _a === void 0 ? 0 : _a, rest = IsometricStarPolygonAbstract_rest(props, ["radius", "points", "density", "rotation"]);\n _this = _super.call(this, rest) || this;\n _this._radius = radius;\n _this._points = points;\n _this._density = density;\n _this._rotation = rotation;\n _this._sector = 2 * Math.PI / _this._points;\n _this._halfSector = _this._sector / 2;\n return _this;\n }\n IsometricStarPolygonAbstract.prototype.getCommands = function (args) {\n var _a, _b, _c, _d, _e, _f, _g;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var radius = (_d = args === null || args === void 0 ? void 0 : args.radius) !== null && _d !== void 0 ? _d : this.radius;\n var points = (_e = args === null || args === void 0 ? void 0 : args.points) !== null && _e !== void 0 ? _e : this._points;\n var density = (_f = args === null || args === void 0 ? void 0 : args.density) !== null && _f !== void 0 ? _f : this._density;\n var rotation = (_g = args === null || args === void 0 ? void 0 : args.rotation) !== null && _g !== void 0 ? _g : this.rotation;\n var coordinates = this.get2DCoordinates(radius, points, density, rotation);\n var commands = [];\n switch (this.planeView) {\n case PlaneView.FRONT:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: 0,\n l: point.x,\n t: point.y\n }\n });\n });\n break;\n case PlaneView.SIDE:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: point.x,\n l: 0,\n t: point.y\n }\n });\n });\n break;\n case PlaneView.TOP:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: -point.x,\n l: -point.y,\n t: 0\n }\n });\n });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricStarPolygonAbstract.prototype._getRadianAngle = function (angle) {\n return angle * Math.PI / 180;\n };\n IsometricStarPolygonAbstract.prototype._getInnerRadius = function (radius, points, density) {\n return radius * Math.cos(Math.PI * density / points) / Math.cos(Math.PI * (density - 1) / points);\n };\n IsometricStarPolygonAbstract.prototype.get2DCoordinates = function (radius, points, density, rotation) {\n var _this = this;\n var innerRadius = this._getInnerRadius(radius, points, density);\n return IsometricStarPolygonAbstract_spreadArray([], Array(this._points), true).reduce(function (points, _undefined, index) {\n var angle = index * _this._sector + 2 * Math.PI - _this._getRadianAngle(rotation);\n var innerAngle = angle + _this._halfSector;\n var oX = Math.sin(angle) * radius;\n var oY = Math.cos(angle) * radius;\n var iX = Math.sin(innerAngle) * innerRadius;\n var iY = Math.cos(innerAngle) * innerRadius;\n return IsometricStarPolygonAbstract_spreadArray(IsometricStarPolygonAbstract_spreadArray([], points, true), [\n { x: oX, y: oY },\n { x: iX, y: iY }\n ], false);\n }, []);\n };\n IsometricStarPolygonAbstract.prototype.getPentagramPath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricStarPolygonAbstract.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 points: _this._points,\n density: _this._density,\n rotation: _this.rotation\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 = IsometricStarPolygonAbstract_assign({}, props_1);\n modifiedArgs[property_1] = +value;\n return _this.getPentagramPath(modifiedArgs);\n }).join(\';\')\n };\n }\n else {\n var modifiedArgs = IsometricStarPolygonAbstract_assign({}, props_1);\n modifiedArgs[property_1] = +animation.values;\n properties = {\n values: _this.getPentagramPath(modifiedArgs)\n };\n }\n }\n else {\n var fromArgs = IsometricStarPolygonAbstract_assign({}, props_1);\n var toArgs = IsometricStarPolygonAbstract_assign({}, props_1);\n fromArgs[property_1] = +animation.from;\n toArgs[property_1] = +animation.to;\n properties = {\n from: _this.getPentagramPath(fromArgs),\n to: _this.getPentagramPath(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(IsometricStarPolygonAbstract.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 Object.defineProperty(IsometricStarPolygonAbstract.prototype, "rotation", {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n this._rotation = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricStarPolygonAbstract.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricStarPolygonAbstract;\n}(IsometricShapeAbstract));\n\n\n;// ./src/@classes/abstract/IsometricStarPolygonAbstract/index.ts\n\n\n\n;// ./src/@classes/public/IsometricPentagram/IsometricPentagram.ts\nvar IsometricPentagram_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 IsometricPentagram_assign = (undefined && undefined.__assign) || function () {\n IsometricPentagram_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 IsometricPentagram_assign.apply(this, arguments);\n};\n\nvar IsometricPentagram = (function (_super) {\n IsometricPentagram_extends(IsometricPentagram, _super);\n function IsometricPentagram(props) {\n return _super.call(this, IsometricPentagram_assign(IsometricPentagram_assign({}, props), { points: 5, density: 2 })) || this;\n }\n return IsometricPentagram;\n}(IsometricStarPolygonAbstract));\n\n\n;// ./src/@classes/public/IsometricPentagram/index.ts\n\n\n;// ./src/@classes/public/IsometricStarPolygon/IsometricStarPolygon.ts\nvar IsometricStarPolygon_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\nvar IsometricStarPolygon = (function (_super) {\n IsometricStarPolygon_extends(IsometricStarPolygon, _super);\n function IsometricStarPolygon(props) {\n return _super.call(this, props) || this;\n }\n Object.defineProperty(IsometricStarPolygon.prototype, "points", {\n get: function () {\n return this._points;\n },\n set: function (value) {\n this._points = value;\n this._sector = 2 * Math.PI / this._points;\n this._halfSector = this._sector / 2;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricStarPolygon.prototype, "density", {\n get: function () {\n return this._density;\n },\n set: function (value) {\n this._density = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n return IsometricStarPolygon;\n}(IsometricStarPolygonAbstract));\n\n\n;// ./src/@classes/public/IsometricStarPolygon/index.ts\n\n\n;// ./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;// ./src/@classes/public/IsometricPath/index.ts\n\n\n;// ./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;// ./src/@classes/public/IsometricText/index.ts\n\n\n;// ./src/index.ts\n\n\n\n\n\n\n\n\n\n\n;// ./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;// ./demo/demo2/index.js\n/* harmony default export */ const demo2 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, IsometricPentagram, 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 star = new IsometricPentagram({ radius: 0.35, planeView: PlaneView.TOP, right: 0.5, left: 0.5, top: 1});\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 star\n .addAnimation({\n property: \'top\',\n duration,\n values: [1, 0.5, 1]\n });\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, star);\n\n});\n;// ./demo/images/block_side.png\nconst block_side_namespaceObject = __webpack_require__.p + "images/block_side.png";\n;// ./demo/images/block_top.png\nconst block_top_namespaceObject = __webpack_require__.p + "images/block_top.png";\n;// ./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;// ./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;// ./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;// ./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;// ./demo/demo7/index.js\n/* harmony default export */ const demo7 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricStarPolygon, 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 = {\n radius: 0.5,\n points: 8,\n density: 2,\n right: 0.5,\n left: 0.5,\n top: 0.5\n };\n\n const planes = [PlaneView.SIDE, PlaneView.FRONT, PlaneView.TOP];\n\n const planePropsHash = {\n [PlaneView.TOP]: \'top\',\n [PlaneView.FRONT]: \'right\',\n [PlaneView.SIDE]: \'left\'\n };\n\n planes.forEach((planeView) => {\n const props = { ...commonProps, planeView };\n const coord = planePropsHash[planeView];\n const starPolygonBack = new IsometricStarPolygon({...props, id: `${coord}-back`, fillColor: \'#EEE\'});\n const starPolygonFront = new IsometricStarPolygon({...props, id: `${coord}-front`});\n starPolygonBack[coord] = 0;\n starPolygonFront[coord] = 1;\n cube.addChildren(starPolygonBack, starPolygonFront);\n });\n\n planes.forEach((planeView) => {\n const coord = planePropsHash[planeView];\n const starPolygonBack = cube.getChildById(`${coord}-back`);\n const starPolygonFront = cube.getChildById(`${coord}-front`);\n cube.sendChildToBack(starPolygonBack);\n cube.bringChildToFront(starPolygonFront);\n });\n\n});\n;// ./demo/demo8/index.js\n/* harmony default export */ const demo8 = (( 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;// ./demo/demo9/index.js\n\n\n\n/* harmony default export */ const demo9 = (( 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;// ./demo/demo.js\n\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 [\'demo9\', demo9],\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQxLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBTztBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsb0NBQW9DO0FBQzlCO0FBQ1A7QUFDQTtBQUNBLENBQUMsd0NBQXdDO0FBQ2xDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ087QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsQ0FBQyx3QkFBd0I7QUFDbEI7QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsMEJBQTBCO0FBQ3BCO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDLDRCQUE0QjtBQUN0QjtBQUNQO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQywwQkFBMEI7QUFDcEI7QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsOEJBQThCO0FBQ3hCO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDLG9CQUFvQjtBQUNkO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsQ0FBQyx3QkFBd0I7QUFD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aXBseU1hdHJpY2VzKHJvdGF0ZVooUk9UXzYwKSwgcm90YXRlWChST1RfQ01BKSwgcm90YXRlWigtUk9UXzQ1KSk7XG52YXIgcm90YXRpb25Ub1JvdGF0aW9uTWF0cml4ID0gZnVuY3Rpb24gKHZpZXcsIHJvdGF0aW9uKSB7XG4gICAgdmFyIHZhbHVlID0gcmFkaWFuKHJvdGF0aW9uLnZhbHVlKTtcbiAgICBzd2l0Y2ggKHZpZXcpIHtcbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuVE9QOiB7XG4gICAgICAgICAgICBzd2l0Y2ggKHJvdGF0aW9uLmF4aXMpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuVE9QOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWih2YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLkxFRlQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVYKC12YWx1ZSk7XG4gICAgICAgICAgICAgICAgY2FzZSBBeGlzLlJJR0hUOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgoLXZhbHVlKTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxufTtcbmV4cG9ydCB2YXIgZ2V0Vmlld01hdHJpeCA9IGZ1bmN0aW9uIChwbGFuZVZpZXcsIHJvdGF0aW9uKSB7XG4gICAgdmFyIHJvdGF0aW9uTWF0cmljZXMgPSBbXTtcbiAgICB2YXIgcm90YXRpb25NYXRyaXggPSByb3RhdGlvblxuICAgICAgICA/IHJvdGF0aW9uVG9Sb3RhdGlvbk1hdHJpeChwbGFuZVZpZXcsIHJvdGF0aW9uKVxuICAgICAgICA6IG51bGw7XG4gICAgaWYgKHJvdGF0aW9uTWF0cml4KVxuICAgICAgICByb3RhdGlvbk1hdHJpY2VzLnB1c2gocm90YXRpb25NYXRyaXgpO1xuICAgIHN3aXRjaCAocGxhbmVWaWV3KSB7XG4gICAgICAg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ICAgICAgICBjYXNlICdMJzpcbiAgICAgICAgICAgICAgICBjb21tYW5kc0FycmF5LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVsyXSwgbDogK2FycmF5WzNdLCB0OiArYXJyYXlbNF0gfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgICAgICAgY29tbWFuZHNBcnJheS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiArYXJyYXlbNl0sIGw6ICthcnJheVs3XSwgdDogK2FycmF5WzhdIH0sXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVs5XSwgbDogK2FycmF5WzEwXSwgdDogK2FycmF5WzExXSB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGNvbW1hbmRzQXJyYXk7XG59O1xuZXhwb3J0IHZhciB0cmFuc2xhdGVDb21tYW5kUG9pbnRzID0gZnVuY3Rpb24gKGNvbW1hbmRzLCByaWdodCwgbGVmdCwgdG9wKSB7XG4gICAgY29tbWFuZHMuZm9yRWFjaChmdW5jdGlvbiAoY29tbWFuZCkge1xuICAgICAgICBjb21tYW5kLnBvaW50LnIgKz0gcmlnaHQ7XG4gICAgICAgIGNvbW1hbmQucG9pbnQubCArPSBsZWZ0O1xuICAgICAgICBjb21tYW5kLnBvaW50LnQgKz0gdG9wO1xuICAgICAgICBpZiAoY29tbWFuZC5jb250cm9sKSB7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wuciArPSByaWdodDtcbiAgICAgICAgICAgIGNvbW1hbmQuY29udHJvbC5sICs9IGxlZnQ7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wudCArPSB0b3A7XG4gICAgICAgIH1cbiAgICB9KTtcbn07XG5leHBvcnQgdmFyIGdldFRleHR1cmVDb3JuZXIgPSBmdW5jdGlvbiAoY29tbWFuZHMsIGNlbnRlclgsIGNlbnRlclksIHNjYWxlKSB7XG4gICAgdmFyIGNvcm5lciA9IHtcbiAgICAgICAgeDogTnVtYmVyLk1BWF9TQUZFX0lOVEVHRVIsXG4gICAgICAgIHk6IE51bWJlci5NQVhfU0FGRV9JTlRFR0VSXG4gICAgfTtcbiAgICBnZXRDb21tYW5kc1dpdGhTdGFydChjb21tYW5kcylcbiAgICAgICAgLmZvckVhY2goZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gZ2V0UG9pbnRGcm9tSXNvbWV0cmljUG9pbnQoY2VudGVyWCwgY2VudGVyWSwgYy5wb2ludCwgc2NhbGUpO1xuICAgICAgICBpZiAocG9pbnQueCA8IGNvcm5lci54IHx8XG4gICAgICAgICAgICAocG9pbnQueCA9PT0gY29ybmVyLnggJiZcbiAgICAgICAgICAgICAgICBwb2ludC55IDwgY29ybmVyLnkpKSB7XG4gICAgICAgICAgICBjb3JuZXIueCA9IHBvaW50Lng7XG4gICAgICAgICAgICBjb3JuZXIueSA9IHBvaW50Lnk7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gY29ybmVyO1xufTtcbmV4cG9ydCB2YXIgaXNTVkdQcm9wZXJ0eSA9IGZ1bmN0aW9uIChwcm9wZXJ0eSkge1xuICAgIHJldHVybiBbXG4gICAgICAgICdmaWxsQ29sb3InLFxuICAgICAgICAnZmlsbE9wYWNpdHknLFxuICAgICAgICAnc3Ryb2tlQ29sb3InLFxuICAgICAgICAnc3Ryb2tlT3BhY2l0eScsXG4gICAgICAgICdzdHJva2VXaWR0aCdcbiAgICBdLmluY2x1ZGVzKHByb3BlcnR5KTtcbn07XG5leHBvcnQgdmFyIGd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0gKHRoaXMgJiYgdGhpcy5fX2Fzc2lnbikgfHwgZnVuY3Rpb24gKCkge1xuICAgIF9fYXNzaWduID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbih0KSB7XG4gICAgICAgIGZvciAodmFyIHMsIGkgPSAxLCBuID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgcyA9IGFyZ3VtZW50c1tpXTtcbiAgICAgICAgICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSlcbiAgICAgICAgICAgICAgICB0W3BdID0gc1twXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdDtcbiAgICB9O1xuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xufTtcbnZhciBfX3Jlc3QgPSAodGhpcyAmJiB0aGlzLl9fcmVzdCkgfHwgZnVuY3Rpb24gKHMsIGUpIHtcbiAgICB2YXIgdCA9IHt9O1xuICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSAmJiBlLmluZGV4T2YocCkgPCAwKVxuICAgICAgICB0W3BdID0gc1twXTtcbiAgICBpZiAocyAhPSBudWxsICYmIHR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzID09PSBcImZ1bmN0aW9uXCIpXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBwID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhzKTsgaSA8IHAubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcbiAgICAgICAgICAgICAgICB0W3BbaV1dID0gc1tw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DaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcyhwcm9wZXJ0eSwgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uLnZhbHVlcykge1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IEFycmF5LmlzQXJyYXkoYW5pbWF0aW9uLnZhbHVlcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGFuaW1hdGlvbi52YWx1ZXMubWFwKGZ1bmN0aW9uICh2YWx1ZSkgeyByZXR1cm4gXCJcIi5jb25jYXQodmFsdWUpOyB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFwiXCIuY29uY2F0KGFuaW1hdGlvbi52YWx1ZXMpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogXCJcIi5jb25jYXQoYW5pbWF0aW9uLmZyb20pLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG86IFwiXCIuY29uY2F0KGFuaW1hdGlvbi50bylcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy51cGRhdGVTdWJDbGFzc0FuaW1hdGlvbnMoKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUudXBkYXRlUGF0dGVyblRyYW5zZm9ybSA9IGZ1bmN0aW9uIChjb3JuZXIsIHBsYW5lVmlldykge1xuICAgICAgICB2YXIgX2EsIF9iLCBfYztcbiAgICAgICAgaWYgKHRoaXMucHJvcHMudGV4dHVyZSkge1xuICAgICAgICAgICAgdmFyIGhlaWdodCA9IHRoaXMucHJvcHMudGV4dHVyZS5oZWlnaHRcbiAgICAgICAgICAgICAgICA/IFwiXCIuY29uY2F0KHRoaXMucHJvcHMudGV4dHVyZS5oZWlnaHQgKiB0aGlzLmRhdGEuc2NhbGUpXG4gICAgICAgICAgICAgICAgOiAnMTAwJSc7XG4gICAgICAgICAgICB2YXIgd2lkdGggPSB0aGlzLnByb3BzLnRleHR1cmUud2lkdGhcbiAgICAgICAgICAgICAgICA/IFwiXCIuY29uY2F0KHRoaXMucHJvcHMudGV4dHVyZS53aWR0aCAqIHRoaXMuZGF0YS5zY2FsZSlcbiAgICAgICAgICAgICAgICA6ICcxMDAlJztcbiAgICAgICAgICAgIHZhciBzaGlmdCA9IGdldFBvaW50RnJvbUlzb21ldHJpY1BvaW50KDAsIDAsIHtcbiAgICAgICAgICAgICAgICByOiAoKF9hID0gdGhpcy5wcm9wcy50ZXh0dXJlLnNoaWZ0KSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EucmlnaHQpIHx8IDAsXG4gICAgICAgICAgICAgICAgbDogKChfYiA9IHRoaXMucHJvcHMudGV4dHVyZS5zaGlmdCkgPT09IG51bGwgfHwgX2IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9iLmxlZnQpIHx8IDAsXG4gICAgICAgICAgICAgICAgdDogKChfYyA9IHRoaXMucHJvcHMudGV4dHVyZS5zaGlmdCkgPT09IG51bGwgfHwgX2MgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9jLnRvcCkgfHwgMFxuICAgICAgICAgICAgfSwgdGhpcy5kYXRhLnNjYWxlKTtcbiAgICAgICAgICAgIHZhciB0cmFuc2Zvcm0gPSBnZXRQYXR0ZXJuVHJhbnNmb3JtKHtcbiAgICAgICAgICAgICAgICB4OiByb3VuZChjb3JuZXIueCArIHNoaWZ0LngsIERFQ0lNQUxTKSxcbiAgICAgICAgICAgICAgICB5OiByb3VuZChjb3JuZXIueSArIHNoaWZ0LnksIERFQ0lNQUxTKVxuICAgICAgICAgICAgfSwgdGhpcy5wcm9wcy50ZXh0dXJlLnBsYW5lVmlldyB8fCBwbGFuZVZpZXcsIHRoaXMucHJvcHMudGV4dHVyZS5zY2FsZSwgdGhpcy5wcm9wcy50ZXh0dXJlLnJvdGF0aW9uKTtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5wYXR0ZXJuLCB7XG4gICAgICAgICAgICAgICAgJ3BhdHRlcm5UcmFuc2Zvcm0nOiB0cmFuc2Zvcm0sXG4gICAgICAgICAgICAgICAgJ2hlaWdodCc6IGhlaWdodCxcbiAgICAgICAgICAgICAgICAnd2lkdGgnOiB3aWR0aFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMucGF0dGVybi5maXJzdENoaWxkLCB7XG4gICAgICAgICAgICAgICAgJ2hlaWdodCc6IGhlaWdodCxcbiAgICAgICAgICAgICAgICAnd2lkdGgnOiB3aWR0aFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNHcmFwaGljQWJzdHJhY3QucHJvdG90eXBlLCBcImlkXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faWQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNldElkKHZhbHVlKTtcbiAgICAgICAgICAgIGlmICh0aGlzLnBhdHRlcm4pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnBhdHRlcm5JZCA9IFwiXCIuY29uY2F0KHRoaXMuaWQsIFwiX190ZXh0dXJlXCIpO1xuICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5wYXR0ZXJuLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IHRoaXMucGF0dGVybklkXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3RvdHlwZSwgXCJmaWxsQ29sb3JcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByb3BzLmZpbGxDb2xvcjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMucHJvcHMuZmlsbENvbG9yID0gdmFsdWU7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuZWxlbWVudCwge1xuICAgICAgICAgICAgICAgICdmaWxsJzogdGhpcy5wcm9wcy50ZXh0dXJlXG4gICAgICAgICAgICAgICAgICAgID8gXCJ1cmwoI1wiLmNvbmNhdCh0aGlzLnBhdHRlcm5JZCwgXCIpIFwiKS5jb25jYXQodGhpcy5maWxsQ29sb3IpXG4gICAgICAgICAgICAgICAgICAgIDogdGhpcy5maWxsQ29sb3JcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0dyYXBoaWNBYnN0c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PSB2YWx1ZS5zaGlmdCwgcm90YXRpb24gPSB2YWx1ZS5yb3RhdGlvbiwgbmV3UHJvcHMgPSBfX3Jlc3QodmFsdWUsIFtcInNoaWZ0XCIsIFwicm90YXRpb25cIl0pO1xuICAgICAgICAgICAgdGhpcy5wcm9wcy50ZXh0dXJlID0gaGFzVGV4dHVyZVxuICAgICAgICAgICAgICAgID8gX19hc3NpZ24oX19hc3NpZ24oe30sIHRoaXMucHJvcHMudGV4dHVyZSksIG5ld1Byb3BzKSA6IF9fYXNzaWduKHt9LCBuZXdQcm9wcyk7XG4gICAgICAgICAgICBpZiAoc2hpZnQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnRleHR1cmUuc2hpZnQgPSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgKHRoaXMucHJvcHMudGV4dHVyZS5zaGlmdCB8fCB7fSkpLCBzaGlmdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocm90YXRpb24pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnRleHR1cmUucm90YXRpb24gPSByb3RhdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChoYXNUZXh0dXJlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRlVGV4dHVyZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVUZXh0dXJlKHRoaXMucHJvcHMudGV4dHVyZSk7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuICAgIElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUuYWRkQW5pbWF0aW9uID0gZnVuY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMucHVzaChfX2F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JlKHBhdHRlcm4sIHRoaXMuZWxlbWVudC5maXJzdENoaWxkKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0NvbnRhaW5lckFic3RyYWN0LnByb3RvdHlwZSwgXCJpZFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2lkO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5zZXRJZCh2YWx1ZSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljQ29udGFpbmVyQWJzdHJhY3QucHJvdG90eXBlLCBcImNoaWxkcmVuXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fY2hpbGRyZW47XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cGUudXBkYXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAoZWxlbWVudEhhc1NWR1BhcmVudCh0aGlzLmVsZW1lbnQpKSB7XG4gICAgICAgICAgICB0aGlzLl9jaGlsZHJlbi5mb3JFYWNoKGZ1bmN0aW9uIChjaGlsZCkge1xuICAgICAgICAgICAgICAgIGNoaWxkLmRhdGEgPSBfdGhpcy5kYXRhO1xuICAgICAgICAgICAgICAgIGNoaWxkLnVwZGF0ZSgpO1xuICAgICAgICAgICAg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bGVtZW50LCByZXBsYWNlZEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcGxhY2VkRWxlbWVudC5uZXh0U2libGluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbGVtZW50Lmluc2VydEJlZm9yZShtb3ZlZEVsZW1lbnQsIHJlcGxhY2VkRWxlbWVudC5uZXh0U2libGluZyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQobW92ZWRFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudGhyb3dDaGlsZEVycm9yKCk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cGUuYnJpbmdDaGlsZFRvRnJvbnQgPSBmdW5jdGlvbiAoY2hpbGQpIHtcbiAgICAgICAgdmFyIGNoaWxkSW5kZXggPSB0aGlzLmdldENoaWxkSW5kZXgoY2hpbGQpO1xuICAgICAgICBpZiAoY2hpbGRJbmRleCA+IC0xKSB7XG4gICAgICAgICAgICB0aGlzLnNldENoaWxkSW5kZXgoY2hpbGQsIHRoaXMuX2NoaWxkcmVuLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy50aHJvd0NoaWxkRXJyb3IoKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0NvbnRhaW5lckFic3RyYWN0LnByb3RvdHlwZS5icmluZ0NoaWxkRm9yd2FyZCA9IGZ1bmN0aW9uIChjaGlsZCkge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JvdG90eXBlLCBcImhlaWdodFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YS5oZWlnaHQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgX2E7XG4gICAgICAgICAgICB0aGlzLmRhdGEuaGVpZ2h0ID0gdmFsdWU7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuZWxlbWVudCwgKF9hID0ge30sXG4gICAgICAgICAgICAgICAgX2FbU1ZHX1BST1BFUlRJRVMudmlld0JveF0gPSBcIjAgMCBcIi5jb25jYXQodGhpcy5kYXRhLndpZHRoLCBcIiBcIikuY29uY2F0KHRoaXMuZGF0YS5oZWlnaHQpLFxuICAgICAgICAgICAgICAgIF9hLmhlaWdodCA9IFwiXCIuY29uY2F0KHRoaXMuZGF0YS5oZWlnaHQsIFwicHhcIiksXG4gICAgICAgICAgICAgICAgX2EpKTtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5iYWNrZ3JvdW5kLCB7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBcIlwiLmNvbmNhdCh0aGlzLmRhdGEuaGVpZ2h0LCBcInB4XCIpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljQ2FudmFzLnByb3RvdHlwZSwgXCJ3aWR0aFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YS53aWR0aDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHZhciBfYTtcbiAgICAgICAgICAgIHRoaXMuZGF0YS53aWR0aCA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLmVsZW1lbnQsIChfYSA9IHt9LFxuICAgICAgICAgICAgICAgIF9hW1NWR19QUk9QRVJUSUVTLnZpZXdCb3hdID0gXCIwIDAgXCIuY29uY2F0KHRoaXMuZGF0YS53aWR0aCwgXCIgXCIpLmNvbmNhdCh0aGlzLmRhdGEuaGVpZ2h0KSxcbiAgICAgICAgICAgICAgICBfYS53aWR0aCA9IFwiXCIuY29uY2F0KHRoaXMuZGF0YS53aWR0aCwgXCJweFwiKSxcbiAgICAgICAgICAgICAgICBfYSkpO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLmJhY2tncm91bmQsIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogXCJcIi5jb25jYXQodGhpcy5kYXRhLndpZHRoLCBcInB4XCIpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljQ2FudmFzLnByb3RvdHlwZSwgXCJhbmltYXRlZFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaXNBbmltYXRlZDtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIElzb21ldHJpY0NhbnZhcy5wcm90b3R5cGUuZ2V0U1ZHQ29kZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dX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Nhc2UgJ2xlZnQnOlxuICAgICAgICAgICAgICAgICAgICBmaXhlZENvb3Jkcy5sZWZ0ID0gX3RoaXMuZ2V0TGVmdChlbnRyeVsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGZpeGVkQ29vcmRzLnRvcCA9IF90aGlzLmdldFRvcChlbnRyeVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZml4ZWRDb29yZHM7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50VHlwZSkge1xuICAgICAgICB2YXIgX2EsIF9iLCBfYztcbiAgICAgICAgdmFyIGRyYWdFdmVudCA9IG5ldyBDdXN0b21FdmVudChldmVudFR5cGUsIHtcbiAgICAgICAgICAgIGNhbmNlbGFibGU6IGV2ZW50VHlwZSA9PT0gRFJBR19FVkVOVC5EUkFHLFxuICAgICAgICAgICAgZGV0YWlsOiB7XG4gICAgICAgICAgICAgICAgcmlnaHQ6IChfYSA9IHRoaXMuX2Nvb3Jkcy5yaWdodCkgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogdGhpcy5yaWdodCxcbiAgICAgICAgICAgICAgICBsZWZ0OiAoX2IgPSB0aGlzLl9jb29yZHMubGVmdCkgIT09IG51bGwgJiYgX2IgIT09IHZvaWQgMCA/IF9iIDogdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgIHRvcDogKF9jID0gdGhpcy5fY29vcmRzLnRvcCkgIT09IG51bGwgJiYgX2MgIT09IHZvaWQgMCA/IF9jIDogdGhpcy50b3BcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMuZWxlbWVudC5kaXNwYXRjaEV2ZW50K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gdGhpcy5wcm9wcy50b3A7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcm9wcy50b3AgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5wcm9wcy50b3AgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZSwgXCJkcmFnXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZHJhZyB8fCBmYWxzZTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fZHJhZyA9PT0gVHlwZW9mLlVOREVGSU5FRCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0dXAoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2RyYWcgPSB2YWx1ZTtcbiAgICAgICAgICAgIGlmIChfaXNCcm93c2VyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdG9wRHJhZygpO1xuICAgICAgICAgICAgICAgIHRoaXMuYmVnaW5EcmFnKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljRHJhZ2dhYmxlQWJzdHJhY3QucHJvd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c18xLCBhbmltYXRpb24ucHJvcGVydHkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0eV8xID0gYW5pbWF0aW9uLnByb3BlcnR5O1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbi52YWx1ZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFuaW1hdGlvbi52YWx1ZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RpZmllZEFyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuZ2V0UmVjdGFuZ2xlUGF0aChtb2RpZmllZEFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnZhbHVlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IF90aGlzLmdldFJlY3RhbmdsZVBhdGgobW9kaWZpZWRBcmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbUFyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9BcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbUFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLmZyb207XG4gICAgICAgICAgICAgICAgICAgICAgICB0b0FyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnRvO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiBfdGhpcy5nZXRSZWN0YW5nbGVQYXRoKGZyb21BcmdzKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bzogX3RoaXMuZ2V0UmVjdGFuZ2xlUGF0aCh0b0FyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKFNWR19OQU1FU1BBQ0UsIFNWR19FTEVNRU5UUy5hbmltYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50LnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygnZCcsIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljUmVjdGFuZ2xlLnByb3RvdHlwZSwgXCJ3aWR0aFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dpZHRoO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fd2lkdGggPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljUmVjdGFuZ2xlLnByb3RvdHlwZSwgXCJoZWlnaHRcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9oZWlnaHQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9oZ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ICAgICAgdmFyIGNvbW1hbmRzID0gW107XG4gICAgICAgIHN3aXRjaCAodGhpcy5wbGFuZVZpZXcpIHtcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LkZST05UOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLm1vdmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IHJhZGl1cywgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiAtcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogMCwgbDogMCwgdDogLXJhZGl1cyB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiByYWRpdXMsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiByYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuU0lERTpcbiAgICAgICAgICAgICAgICBjb21tYW5kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5tb3ZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAtcmFkaXVzLCBsOiAwLCB0OiAwIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IHJhZGl1cywgbDogMCwgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IDAsIGw6IDAsIHQ6IC1yYWRpdXMgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogLXJhZGl1cywgbDogMCwgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IDAsIGw6IDAsIHQ6IHJhZGl1cyB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFBsYW5lVmlldy5UT1A6XG4gICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQubW92ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogcmFkaXVzLCB0OiAwIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IC1yYWRpdXMsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiByYWRpdXMsIGw6IDAsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogcmFkaXVzLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogLXJhZGl1cywgbDogMCwgdDogMCB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7X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ucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocHJvcHNfMSwgYW5pbWF0aW9uLnByb3BlcnR5KSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydHlfMSA9IGFuaW1hdGlvbi5wcm9wZXJ0eTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSB2b2lkIDA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhbmltYXRpb24udmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShhbmltYXRpb24udmFsdWVzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogYW5pbWF0aW9uLnZhbHVlcy5tYXAoZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kaWZpZWRBcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK3ZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLmdldENpcmNsZVBhdGgobW9kaWZpZWRBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignOycpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RpZmllZEFyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK2FuaW1hdGlvbi52YWx1ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBfdGhpcy5nZXRDaXJjbGVQYXRoKG1vZGlmaWVkQXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21BcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyb21BcmdzW3Byb3BlcnR5XzFdID0gK2FuaW1hdGlvbi5mcm9tO1xuICAgICAgICAgICAgICAgICAgICAgICAgdG9BcmdzW3Byb3BlcnR5XzFdID0gK2FuaW1hdGlvbi50bztcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogX3RoaXMuZ2V0Q2lyY2xlUGF0aChmcm9tQXJncyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG86IF90aGlzLmdldENpcmNsZVBhdGgodG9BcmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5hZGRBbmltYXRpb25CYXNpY1Byb3BlcnRpZXMoJ2QnLCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCBwcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0NpcmNsZS5wcm90b3R5cGUsIFwicmFkaXVzXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcmFkaXVzO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fcmFkaXVzID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgSXNvbWV0cmljQ2lyY2xlLnByb3RvdHlwZS5hZGRBbmltYXRpb24gPSBmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgIHJldHVybiBfc3VwZXIucHJvdG90eXBlLmFkZEFuaW1hdGlvbi5jYWxsKHRoaXMsIGFuaW1hdGlvbik7XG4gICAgfTtcbiAgICByZXR1cm4gSXNvbWV0cmljQ2lyY2xlO1xufShJc29tZXRyaWNT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T09IHZvaWQgMCA/IHZvaWQgMCA6IGFyZ3Mucm90YXRpb24pICE9PSBudWxsICYmIF9nICE9PSB2b2lkIDAgPyBfZyA6IHRoaXMucm90YXRpb247XG4gICAgICAgIHZhciBjb29yZGluYXRlcyA9IHRoaXMuZ2V0MkRDb29yZGluYXRlcyhyYWRpdXMsIHBvaW50cywgZGVuc2l0eSwgcm90YXRpb24pO1xuICAgICAgICB2YXIgY29tbWFuZHMgPSBbXTtcbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYW5lVmlldykge1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6XG4gICAgICAgICAgICAgICAgY29vcmRpbmF0ZXMuZm9yRWFjaChmdW5jdGlvbiAocG9pbnQsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogaW5kZXggPT09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IENvbW1hbmQubW92ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogQ29tbWFuZC5saW5lLFxuICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGw6IHBvaW50LngsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdDogcG9pbnQueVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6XG4gICAgICAgICAgICAgICAgY29vcmRpbmF0ZXMuZm9yRWFjaChmdW5jdGlvbiAocG9pbnQsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogaW5kZXggPT09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IENvbW1hbmQubW92ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogQ29tbWFuZC5saW5lLFxuICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByOiBwb2ludC54LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGw6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdDogcG9pbnQueVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LlRPUDpcbiAgICAgICAgICAgICAgICBjb29yZGluYXRlcy5mb3JFYWNoKGZ1bmN0aW9uIChwb2ludCwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBpbmRleCA9PT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ29tbWFuZC5tb3ZlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb2ludDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHI6IC1wb2ludC54LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGw6IC1wb2ludC55LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQ6IDBcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgdHJhbnNsYXRlQ29tbWFuZFBvaW50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3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICAgICAgdmFyIGlzTmF0aXZlU1ZHUHJvcGVydHkgPSBpc1NWR1Byb3BlcnR5KGFuaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICBpZiAoIWlzTmF0aXZlU1ZHUHJvcGVydHkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJvcHNfMSA9IHtcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IF90aGlzLnJpZ2h0LFxuICAgICAgICAgICAgICAgICAgICBsZWZ0OiBfdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgICAgICB0b3A6IF90aGlzLnRvcCxcbiAgICAgICAgICAgICAgICAgICAgcmFkaXVzOiBfdGhpcy5yYWRpdXMsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50czogX3RoaXMuX3BvaW50cyxcbiAgICAgICAgICAgICAgICAgICAgZGVuc2l0eTogX3RoaXMuX2RlbnNpdHksXG4gICAgICAgICAgICAgICAgICAgIHJvdGF0aW9uOiBfdGhpcy5yb3RhdGlvblxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChwcm9wc18xLCBhbmltYXRpb24ucHJvcGVydHkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0eV8xID0gYW5pbWF0aW9uLnByb3BlcnR5O1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbi52YWx1ZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFuaW1hdGlvbi52YWx1ZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RpZmllZEFyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuZ2V0UGVudGFncmFtUGF0aChtb2RpZmllZEFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wc18xKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZmllZEFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnZhbHVlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IF90aGlzLmdldFBlbnRhZ3JhbVBhdGgobW9kaWZpZWRBcmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbUFyZ3MgPSBfX2Fzc2lnbih7fSwgcHJvcHNfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9BcmdzID0gX19hc3NpZ24oe30sIHByb3BzXzEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbUFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLmZyb207XG4gICAgICAgICAgICAgICAgICAgICAgICB0b0FyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnRvO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiBfdGhpcy5nZXRQZW50YWdyYW1QYXRoKGZyb21BcmdzKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bzogX3RoaXMuZ2V0UGVudGFncmFtUGF0aCh0b0FyZ3MpXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKFNWR19OQU1FU1BBQ0UsIFNWR19FTEVNRU5UUy5hbmltYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50LnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygnZCcsIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgIC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AgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlczogQXJyYXkuaXNBcnJheShhbmltYXRpb24udmFsdWVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gYW5pbWF0aW9uLnZhbHVlcy5tYXAoZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5nZXRQYXRoRnJvbUNvbW1hbmRzKFwiXCIuY29uY2F0KHZhbHVlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignOycpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBfdGhpcy5nZXRQYXRoRnJvbUNvbW1hbmRzKFwiXCIuY29uY2F0KGFuaW1hdGlvbi52YWx1ZXMpKVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IF90aGlzLmdldFBhdGhGcm9tQ29tbWFuZHMoXCJcIi5jb25jYXQoYW5pbWF0aW9uLmZyb20pKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBfdGhpcy5nZXRQYXRoRnJvbUNvbW1hbmRzKFwiXCIuY29uY2F0KGFuaW1hdGlvbi50bykpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50LnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygnZCcsIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgSXNvbWV0cmljUGF0aC5wcm90b3R5cGUuZ2V0Q29tbWFuZHMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNvbW1hbmRzO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1BhdGgucHJvdG90eXBlLCBcImF1dG9jbG9zZVwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2F1dG9jbG9zZTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX2F1dG9jbG9zZSA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIElzb21ldHJpY1BhdGgucHJvdG90eXBlLnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy51cGRhdGVHcmFwaGljKHVuZGVmaW5lZCwgdGhpcy5hdXRvY2xvc2UpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuICAgIElzb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Gcm9tSXNvbWV0cmljUG9pbnQoZnJvbUNlbnRlclxuICAgICAgICAgICAgPyB0aGlzLmRhdGEuY2VudGVyWFxuICAgICAgICAgICAgOiAwLCBmcm9tQ2VudGVyXG4gICAgICAgICAgICA/IHRoaXMuZGF0YS5jZW50ZXJZXG4gICAgICAgICAgICA6IDAsIHtcbiAgICAgICAgICAgIHI6IHByb3BzLnJpZ2h0LFxuICAgICAgICAgICAgbDogcHJvcHMubGVmdCxcbiAgICAgICAgICAgIHQ6IHByb3BzLnRvcFxuICAgICAgICB9LCB0aGlzLmRhdGEuc2NhbGUpO1xuICAgIH07XG4gICAgSXNvbWV0cmljVGV4dC5wcm90b3R5cGUudXBkYXRlU3ViQ2xhc3NBbmltYXRpb25zID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgcHJvcHMgPSB7XG4gICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgIGxlZnQ6IDAsXG4gICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICByb3RhdGlvbjogMCxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5hbmltYXRpb25zLmZvckVhY2goZnVuY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICAgICAgdmFyIGlzTmF0aXZlU1ZHUHJvcGVydHkgPSBpc1NWR1Byb3BlcnR5KGFuaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICBpZiAoIWlzTmF0aXZlU1ZHUHJvcGVydHkpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzLCBhbmltYXRpb24ucHJvcGVydHkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0eV8xID0gYW5pbWF0aW9uLnByb3BlcnR5O1xuICAgICAgICAgICAgICAgICAgICB2YXIgaXNSb3RhdGlvbl8xID0gcHJvcGVydHlfMSA9PT0gJ3JvdGF0aW9uJztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbW1vblByb3BzID0gX19hc3NpZ24oX19hc3NpZ24oe30sIF90aGlzLmNvbW1vbkFuaW1hdGlvbkF0dHJpYnV0ZXMpLCB7IHR5cGU6IGlzUm90YXRpb25fMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JvdGF0ZSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0cmFuc2xhdGUnLCBiZWdpbjogJ2luZGVmaW5pdGUnIH0pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbi52YWx1ZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFuaW1hdGlvbi52YWx1ZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJcIi5jb25jYXQodmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK3ZhbHVlIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKG1vZGlmaWVkQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcIlwiLmNvbmNhdChjb29yZHMueCwgXCIsXCIpLmNvbmNhdChjb29yZHMueSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNSb3RhdGlvbl8xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IHZhbHVlczogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcykgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHMgPSBfdGhpcy5nZXRQb3NpdGlvblRyYW5zZm9ybShtb2RpZmllZEFyZ3MsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBcIlwiLmNvbmNhdChjb29yZHMueCwgXCIsXCIpLmNvbmNhdChjb29yZHMueSkgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyBmcm9tOiBcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSksIHRvOiBcIlwiLmNvbmNhdChhbmltYXRpb24udG8pIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbUFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLmZyb20gLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b0FyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnRvIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3Jkc0Zyb20gPSBfdGhpcy5nZXRQb3NpdGlvblRyYW5zZm9ybShmcm9tQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHNUbyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKHRvQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IGZyb206IFwiXCIuY29uY2F0KGNvb3Jkc0Zyb20ueCwgXCIsXCIpLmNvbmNhdChjb29yZHNGcm9tLnkpLCB0bzogXCJcIi5jb25jYXQoY29vcmRzVG8ueCwgXCIsXCIpLmNvbmNhdChjb29yZHNUby55KSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGVUcmFuc2Zvcm0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygndHJhbnNmb3JtJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl90ZXh0RWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50LmJlZ2luRWxlbWVudCgpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgSXNvbWV0cmljVGV4dC5wcm90b3R5cGUudXBkYXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoZWxlbWVudEhhc1NWR1BhcmVudCh0aGlzLmVsZW1lbnQpKSB7XG4gICAgICAgICAgICB2YXIgdHJhbnNmb3JtID0gdGhpcy5nZXRNYXRyaXhUcmFuc2Zvcm0oe1xuICAgICAgICAgICAgICAgIHJpZ2h0OiB0aGlzLnJpZ2h0LFxuICAgICAgICAgICAgICAgIGxlZnQ6IHRoaXMubGVmdCxcbiAgICAgICAgICAgICAgICB0b3A6IHRoaXMudG9wXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5fdGV4dEVsZW1lbnQsIHsgdHJhbnNmb3JtOiB0cmFuc2Zvcm0gfSk7XG4gICAgICAgICAgICB0aGlzLl90c3Bhbi50ZXh0Q29udGVudCA9IHRoaXMuX3RleHQ7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZVBhdHRlcm5UcmFuc2Zvcm0oeyB4OiAwLCB5OiAwIH0sIHRoaXMucGxhbmVWaWV3KTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlQW5pbWF0aW9ucygpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4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6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9mb250RmFtaWx5O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fZm9udEZhbWlseSA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90c3Bhbiwge1xuICAgICAgICAgICAgICAgICdmb250LWZhbWlseSc6IHRoaXMuX2ZvbnRGYW1pbHlcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcImZvbnRTaXplXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZm9udFNpemU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9mb250U2l6ZSA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90c3Bhbiwge1xuICAgICAgICAgICAgICAgICdmb250LXNpemUnOiBcIlwiLmNvbmNhdCh0aGlzLl9mb250U2l6ZSwgXCJweFwiKVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwiZm9udFN0eWxlXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1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uIHRoaXMuX3NlbGVjdGFibGU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9zZWxlY3RhYmxlID0gdmFsdWU7XG4gICAgICAgICAgICBpZiAodGhpcy5fc2VsZWN0YWJsZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3RleHRFbGVtZW50LnJlbW92ZUF0dHJpYnV0ZSgnc3R5bGUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5fdGV4dEVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICctd2Via2l0LXVzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICctbW96LXVzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICctbXMtdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb2ludGVyLWV2ZW50cydcbiAgICAgICAgICAgICAgICAgICAgXS5tYXAoZnVuY3Rpb24gKGRlY2wpIHsgcmV0dXJuIFwiXCIuY29uY2F0KGRlY2wsIFwiOiBub25lXCIpOyB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJvcmlnaW5cIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aG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kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJsZWZ0XCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fbGVmdDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl9sZWZ0ICE9PSB2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xlZnQgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInRvcFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3RvcDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl90b3AgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdG9wID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJyb3RhdGlvblwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaX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gIC5saW5lVG8oMCwgMSwgMSk7XG5cbiAgICB0b3BQaWVjZVxuICAgICAgICAuYWRkQW5pbWF0aW9uKHtcbiAgICAgICAgICAgIHByb3BlcnR5OiAncGF0aCcsXG4gICAgICAgICAgICBkdXJhdGlvbixcbiAgICAgICAgICAgIHZhbHVlczogW1xuICAgICAgICAgICAgICAgICdNMCAwIDEgTDEgMCAxIEwxIDEgMSBMMCAxIDEnLFxuICAgICAgICAgICAgICAgICdNMCAwIDAuNSBMMSAwIDAuNSBMMSAxIDAuNSBMMCAxIDAuNScsXG4gICAgICAgICAgICAgICAgJ00wIDAgMSBMMSAwIDEgTDEgMSAxIEwwIDEgMSdcbiAgICAgICAgICAgIF1cbiAgICAgICAgfSlcbiAgICAgICAgLmFkZEFuaW1hdGlvbihjb2xvckFuaW1hdGlvblByb3BzKTtcblxuICAgIHN0YXJcbiAgICAgICAgLmFkZEFuaW1hdGlvbih7XG4gICAgICAgICAgICBwcm9wZXJ0eTogJ3RvcCcsXG4gICAgICAgICAgICBkdXJhdGlvbixcbiAgICAgICAgICAgIHZhbHVlczogWzEsIDAuNSwgMV1cbiAgICAgICAgfSk7XG5cbiAgICByaWdodFBpZWNlXG4gICAgICAgIC5hZGRBbmltYXRpb24ocmVjdGFuZ2xlQW5pbWF0aW9uUHJvcHMpXG4gICAgICAgIC5hZGRBbmltYXRpb24oY29sb3JBbmltYXRpb25Qcm9wcyk7XG5cbiAgICBsZWZ0UGllY2VcbiAgICAgICAgLmFkZEFuaW1hdGlvbihyZWN0YW5nbGVBbmltYXRpb25Qcm9wcylcbiAgICAgICAgLmFkZEFuaW1hdGlvbihjb2xvckFuaW1hdGlvblByb3BzKTtcblxuICAgIGN1YmUuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKHRoaXMuYW5pbWF0ZWQpIHtcbiAgICAgICAgICAgIHRoaXMucGF1c2VBbmltYXRpb25zKCk7XG4gICAgICAgIH0gZW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W50TGlzdGVuZXIoJ0RPTUNvbnRlbnRMb2FkZWQnLCBmdW5jdGlvbiAoKSB7XG5cbiAgICBkZW1vcy5mb3JFYWNoKChtb2R1bGUsIGRpdikgPT4ge1xuICAgICAgICBjb25zdCBkZW1vID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZGl2KTtcbiAgICAgICAgY29uc3QgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7XG4gICAgICAgIGNvbnN0IHdyYXBwZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcblxuICAgICAgICBjb250YWluZXIuY2xhc3NMaXN0LmFkZCgnZGVtby1jb250YWluZXInKTtcbiAgICAgICAgd3JhcHBlci5jbGFzc0xpc3QuYWRkKCdkZW1vLXdyYXBwZXInKTtcblxuICAgICAgICBtb2R1bGUoSXNvbWV0cmljTW9kdWxlLCB3cmFwcGVyKTtcbiAgICAgICAgY29udGFpbmVyLmFwcGVuZENoaWxkKHdyYXBwZXIpO1xuICAgICAgICBkZW1vLmFwcGVuZENoaWxkKGNvbnRhaW5lcik7XG4gICAgICAgIGRlbW8uYXBwZW5kQ2hpbGQoZnVuY3Rpb1RvU3RyaW5nKG1vZHVsZSkpO1xuICAgIH0pO1xuXG59KTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///741\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&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(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__(741),__webpack_export_target__=window;for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__]=__webpack_exports__[__webpack_i__];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var __webpack_modules__={741:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval('\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 IsometricPentagram: () => (IsometricPentagram),\n IsometricRectangle: () => (IsometricRectangle),\n IsometricStarPolygon: () => (IsometricStarPolygon),\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;// ./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;// ./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;// ./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;// ./src/@utils/svg.ts\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 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};\nvar getAnimationProperties = function (getPath, animation, props) {\n var properties;\n var localGetPath = function (value) {\n var _a;\n if (props) {\n return getPath(__assign(__assign({}, props), (_a = {}, _a[animation.property] = +value, _a)));\n }\n return getPath(value);\n };\n if (animation.values) {\n if (Array.isArray(animation.values)) {\n properties = {\n values: animation.values.map(function (value) {\n return localGetPath(value);\n }).join(\';\')\n };\n }\n else {\n properties = {\n values: localGetPath(animation.values)\n };\n }\n }\n else {\n properties = {\n from: localGetPath(animation.from),\n to: localGetPath(animation.to)\n };\n }\n return properties;\n};\n\n;// ./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;// ./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;// ./src/@classes/abstract/IsometricStore/index.ts\n\n\n;// ./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(id, svgElement) {\n var _this = _super.call(this) || this;\n _this._id = id;\n _this.listeners = [];\n _this.element = document.createElementNS(SVG_NAMESPACE, svgElement);\n addSVGProperties(_this.element, {\n \'id\': _this._id\n });\n return _this;\n }\n IsometricElementAbstract.prototype.setId = function (value) {\n this._id = value;\n addSVGProperties(this.element, {\n \'id\': this._id\n });\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;// ./src/@classes/abstract/IsometricElementAbstract/index.ts\n\n\n;// ./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 IsometricGraphicAbstract_assign = (undefined && undefined.__assign) || function () {\n IsometricGraphicAbstract_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 IsometricGraphicAbstract_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, props.id || uuid(), svgElement) || this;\n _this.props = IsometricGraphicAbstract_assign(IsometricGraphicAbstract_assign({}, defaultObjectProps), props);\n _this.animations = [];\n if (_this.props.texture) {\n _this.createTexture(_this.props.texture);\n }\n addSVGProperties(_this.element, IsometricGraphicAbstract_assign({ \'fill\': _this.props.texture\n ? "url(#".concat(_this.patternId, ") ").concat(_this.fillColor)\n : _this.fillColor, \'fill-opacity\': "".concat(_this.fillOpacity), \'stroke\': _this.strokeColor, \'stroke-dasharray\': _this.strokeDashArray.join(\' \'), \'stroke-linecap\': _this.strokeLinecap, \'stroke-linejoin\': _this.strokeLinejoin, \'stroke-opacity\': "".concat(_this.strokeOpacity), \'stroke-width\': "".concat(_this.strokeWidth) }, (_this.props.className && {\n class: _this.props.className\n })));\n return _this;\n }\n IsometricGraphicAbstract.prototype.createTexture = function (texture) {\n this.patternId = "".concat(this.id, "__texture");\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 var properties = getAnimationProperties(function (value) { return "".concat(value); }, animation);\n addSVGProperties(animation.element, properties);\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, "id", {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this.setId(value);\n if (this.pattern) {\n this.patternId = "".concat(this.id, "__texture");\n addSVGProperties(this.pattern, {\n \'id\': this.patternId\n });\n }\n },\n enumerable: false,\n configurable: true\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 Object.defineProperty(IsometricGraphicAbstract.prototype, "className", {\n get: function () {\n return this.props.className;\n },\n set: function (value) {\n this.props.className = value;\n addSVGProperties(this.element, {\n \'class\': this.props.className\n });\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 ? IsometricGraphicAbstract_assign(IsometricGraphicAbstract_assign({}, this.props.texture), newProps) : IsometricGraphicAbstract_assign({}, newProps);\n if (shift) {\n this.props.texture.shift = IsometricGraphicAbstract_assign(IsometricGraphicAbstract_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(IsometricGraphicAbstract_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;// ./src/@classes/abstract/IsometricGraphicAbstract/index.ts\n\n\n;// ./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(id, svgElement) {\n var _this = _super.call(this, id, 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, "id", {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this.setId(value);\n },\n enumerable: false,\n configurable: true\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.getChildByIndex = function (index) {\n return this._children[index] || null;\n };\n IsometricContainerAbstract.prototype.getChildById = function (id) {\n var child = this._children.find(function (child) { return child.id === id; });\n return child || null;\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.removeChildById = function (id) {\n var child = this.getChildById(id);\n if (child) {\n return this.removeChild(child);\n }\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;// ./src/@classes/abstract/IsometricContainerAbstract/index.ts\n\n\n;// ./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\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, props.id || uuid(), 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 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.getSVGCode = function () {\n return this.element.outerHTML;\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;// ./src/@classes/public/IsometricCanvas/index.ts\n\n\n\n;// ./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;// ./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;// ./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.getBoundOrMaximum = function (prop) {\n var _a;\n if (this.bounds) {\n return (_a = this.bounds[prop]) !== null && _a !== void 0 ? _a : IsometricDraggableAbstract_spreadArray([], NO_LIMITS, true);\n }\n return IsometricDraggableAbstract_spreadArray([], NO_LIMITS, true);\n };\n IsometricDraggableAbstract.prototype.getRight = function (value) {\n var bounds = this.getBoundOrMaximum(\'right\');\n return this.betweenBounds(this._dragStore.right + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getLeft = function (value) {\n var bounds = this.getBoundOrMaximum(\'left\');\n return this.betweenBounds(this._dragStore.left + value / this.data.scale, bounds);\n };\n IsometricDraggableAbstract.prototype.getTop = function (value) {\n var bounds = this.getBoundOrMaximum(\'top\');\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 _a, _b, _c;\n var dragEvent = new CustomEvent(eventType, {\n cancelable: eventType === DRAG_EVENT.DRAG,\n detail: {\n right: (_a = this._coords.right) !== null && _a !== void 0 ? _a : this.right,\n left: (_b = this._coords.left) !== null && _b !== void 0 ? _b : this.left,\n top: (_c = this._coords.top) !== null && _c !== void 0 ? _c : 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.getBoundOrMaximum(\'right\');\n var boundsLeft = this.getBoundOrMaximum(\'left\');\n var boundsTop = this.getBoundOrMaximum(\'top\');\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;// ./src/@classes/abstract/IsometricDraggableAbstract/index.ts\n\n\n;// ./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, props.id || uuid(), 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;// ./src/@classes/public/IsometricGroup/index.ts\n\n\n;// ./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;// ./src/@classes/abstract/IsometricPathAbstract/index.ts\n\n\n;// ./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;// ./src/@classes/abstract/IsometricShapeAbstract/index.ts\n\n\n;// ./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_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 _a, _b, _c, _d, _e;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var width = (_d = args === null || args === void 0 ? void 0 : args.width) !== null && _d !== void 0 ? _d : this.width;\n var height = (_e = args === null || args === void 0 ? void 0 : args.height) !== null && _e !== void 0 ? _e : 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 = {\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, animation.property)) {\n var properties = getAnimationProperties(_this.getRectanglePath.bind(_this), animation, props);\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;// ./src/@classes/public/IsometricRectangle/index.ts\n\n\n;// ./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_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 _a, _b, _c, _d;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var radius = (_d = args === null || args === void 0 ? void 0 : args.radius) !== null && _d !== void 0 ? _d : 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 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n radius: _this.radius\n };\n if (Object.prototype.hasOwnProperty.call(props, animation.property)) {\n var properties = getAnimationProperties(_this.getCirclePath.bind(_this), animation, props);\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;// ./src/@classes/public/IsometricCircle/index.ts\n\n\n;// ./src/@classes/abstract/IsometricStarPolygonAbstract/IsometricStarPolygonAbstract.ts\nvar IsometricStarPolygonAbstract_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 IsometricStarPolygonAbstract_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};\nvar IsometricStarPolygonAbstract_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 IsometricStarPolygonAbstract = (function (_super) {\n IsometricStarPolygonAbstract_extends(IsometricStarPolygonAbstract, _super);\n function IsometricStarPolygonAbstract(props) {\n var _this = this;\n var radius = props.radius, points = props.points, density = props.density, _a = props.rotation, rotation = _a === void 0 ? 0 : _a, rest = IsometricStarPolygonAbstract_rest(props, ["radius", "points", "density", "rotation"]);\n _this = _super.call(this, rest) || this;\n _this._radius = radius;\n _this._points = points;\n _this._density = density;\n _this._rotation = rotation;\n _this._sector = 2 * Math.PI / _this._points;\n _this._halfSector = _this._sector / 2;\n return _this;\n }\n IsometricStarPolygonAbstract.prototype.getCommands = function (args) {\n var _a, _b, _c, _d, _e, _f, _g;\n var right = (_a = args === null || args === void 0 ? void 0 : args.right) !== null && _a !== void 0 ? _a : this.right;\n var left = (_b = args === null || args === void 0 ? void 0 : args.left) !== null && _b !== void 0 ? _b : this.left;\n var top = (_c = args === null || args === void 0 ? void 0 : args.top) !== null && _c !== void 0 ? _c : this.top;\n var radius = (_d = args === null || args === void 0 ? void 0 : args.radius) !== null && _d !== void 0 ? _d : this.radius;\n var points = (_e = args === null || args === void 0 ? void 0 : args.points) !== null && _e !== void 0 ? _e : this._points;\n var density = (_f = args === null || args === void 0 ? void 0 : args.density) !== null && _f !== void 0 ? _f : this._density;\n var rotation = (_g = args === null || args === void 0 ? void 0 : args.rotation) !== null && _g !== void 0 ? _g : this.rotation;\n var coordinates = this.get2DCoordinates(radius, points, density, rotation);\n var commands = [];\n switch (this.planeView) {\n case PlaneView.FRONT:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: 0,\n l: point.x,\n t: point.y\n }\n });\n });\n break;\n case PlaneView.SIDE:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: point.x,\n l: 0,\n t: point.y\n }\n });\n });\n break;\n case PlaneView.TOP:\n coordinates.forEach(function (point, index) {\n commands.push({\n command: index === 0\n ? Command.move\n : Command.line,\n point: {\n r: -point.x,\n l: -point.y,\n t: 0\n }\n });\n });\n break;\n }\n translateCommandPoints(commands, right, left, top);\n return commands;\n };\n IsometricStarPolygonAbstract.prototype._getRadianAngle = function (angle) {\n return angle * Math.PI / 180;\n };\n IsometricStarPolygonAbstract.prototype._getInnerRadius = function (radius, points, density) {\n return radius * Math.cos(Math.PI * density / points) / Math.cos(Math.PI * (density - 1) / points);\n };\n IsometricStarPolygonAbstract.prototype.get2DCoordinates = function (radius, points, density, rotation) {\n var _this = this;\n var innerRadius = this._getInnerRadius(radius, points, density);\n return IsometricStarPolygonAbstract_spreadArray([], Array(this._points), true).reduce(function (points, _undefined, index) {\n var angle = index * _this._sector + 2 * Math.PI - _this._getRadianAngle(rotation);\n var innerAngle = angle + _this._halfSector;\n var oX = Math.sin(angle) * radius;\n var oY = Math.cos(angle) * radius;\n var iX = Math.sin(innerAngle) * innerRadius;\n var iY = Math.cos(innerAngle) * innerRadius;\n return IsometricStarPolygonAbstract_spreadArray(IsometricStarPolygonAbstract_spreadArray([], points, true), [\n { x: oX, y: oY },\n { x: iX, y: iY }\n ], false);\n }, []);\n };\n IsometricStarPolygonAbstract.prototype.getPentagramPath = function (args) {\n var commands = this.getCommands(args);\n return getSVGPath(commands, this.data.centerX, this.data.centerY, this.data.scale, true);\n };\n IsometricStarPolygonAbstract.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 = {\n right: _this.right,\n left: _this.left,\n top: _this.top,\n radius: _this.radius,\n points: _this._points,\n density: _this._density,\n rotation: _this.rotation\n };\n if (Object.prototype.hasOwnProperty.call(props, animation.property)) {\n var properties = getAnimationProperties(_this.getPentagramPath.bind(_this), animation, props);\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(IsometricStarPolygonAbstract.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 Object.defineProperty(IsometricStarPolygonAbstract.prototype, "rotation", {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n this._rotation = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n IsometricStarPolygonAbstract.prototype.addAnimation = function (animation) {\n return _super.prototype.addAnimation.call(this, animation);\n };\n return IsometricStarPolygonAbstract;\n}(IsometricShapeAbstract));\n\n\n;// ./src/@classes/abstract/IsometricStarPolygonAbstract/index.ts\n\n\n\n;// ./src/@classes/public/IsometricPentagram/IsometricPentagram.ts\nvar IsometricPentagram_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 IsometricPentagram_assign = (undefined && undefined.__assign) || function () {\n IsometricPentagram_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 IsometricPentagram_assign.apply(this, arguments);\n};\n\nvar IsometricPentagram = (function (_super) {\n IsometricPentagram_extends(IsometricPentagram, _super);\n function IsometricPentagram(props) {\n return _super.call(this, IsometricPentagram_assign(IsometricPentagram_assign({}, props), { points: 5, density: 2 })) || this;\n }\n return IsometricPentagram;\n}(IsometricStarPolygonAbstract));\n\n\n;// ./src/@classes/public/IsometricPentagram/index.ts\n\n\n;// ./src/@classes/public/IsometricStarPolygon/IsometricStarPolygon.ts\nvar IsometricStarPolygon_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\nvar IsometricStarPolygon = (function (_super) {\n IsometricStarPolygon_extends(IsometricStarPolygon, _super);\n function IsometricStarPolygon(props) {\n return _super.call(this, props) || this;\n }\n Object.defineProperty(IsometricStarPolygon.prototype, "points", {\n get: function () {\n return this._points;\n },\n set: function (value) {\n this._points = value;\n this._sector = 2 * Math.PI / this._points;\n this._halfSector = this._sector / 2;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(IsometricStarPolygon.prototype, "density", {\n get: function () {\n return this._density;\n },\n set: function (value) {\n this._density = value;\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n return IsometricStarPolygon;\n}(IsometricStarPolygonAbstract));\n\n\n;// ./src/@classes/public/IsometricStarPolygon/index.ts\n\n\n;// ./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("".concat(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 = getAnimationProperties(_this.getPathFromCommands.bind(_this), animation);\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;// ./src/@classes/public/IsometricPath/index.ts\n\n\n;// ./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;// ./src/@classes/public/IsometricText/index.ts\n\n\n;// ./src/index.ts\n\n\n\n\n\n\n\n\n\n\n;// ./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;// ./demo/demo2/index.js\n/* harmony default export */ const demo2 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricPath, IsometricRectangle, IsometricPentagram, 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 star = new IsometricPentagram({ radius: 0.35, planeView: PlaneView.TOP, right: 0.5, left: 0.5, top: 1});\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 star\n .addAnimation({\n property: \'top\',\n duration,\n values: [1, 0.5, 1]\n });\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, star);\n\n});\n;// ./demo/images/block_side.png\nconst block_side_namespaceObject = __webpack_require__.p + "images/block_side.png";\n;// ./demo/images/block_top.png\nconst block_top_namespaceObject = __webpack_require__.p + "images/block_top.png";\n;// ./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;// ./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;// ./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;// ./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;// ./demo/demo7/index.js\n/* harmony default export */ const demo7 = (( IsometricModule, container ) => {\n\n const { IsometricCanvas, IsometricStarPolygon, 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 = {\n radius: 0.5,\n points: 8,\n density: 2,\n right: 0.5,\n left: 0.5,\n top: 0.5\n };\n\n const planes = [PlaneView.SIDE, PlaneView.FRONT, PlaneView.TOP];\n\n const planePropsHash = {\n [PlaneView.TOP]: \'top\',\n [PlaneView.FRONT]: \'right\',\n [PlaneView.SIDE]: \'left\'\n };\n\n planes.forEach((planeView) => {\n const props = { ...commonProps, planeView };\n const coord = planePropsHash[planeView];\n const starPolygonBack = new IsometricStarPolygon({...props, id: `${coord}-back`, fillColor: \'#EEE\'});\n const starPolygonFront = new IsometricStarPolygon({...props, id: `${coord}-front`});\n starPolygonBack[coord] = 0;\n starPolygonFront[coord] = 1;\n cube.addChildren(starPolygonBack, starPolygonFront);\n });\n\n planes.forEach((planeView) => {\n const coord = planePropsHash[planeView];\n const starPolygonBack = cube.getChildById(`${coord}-back`);\n const starPolygonFront = cube.getChildById(`${coord}-front`);\n cube.sendChildToBack(starPolygonBack);\n cube.bringChildToFront(starPolygonFront);\n });\n\n});\n;// ./demo/demo8/index.js\n/* harmony default export */ const demo8 = (( 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;// ./demo/demo9/index.js\n\n\n\n/* harmony default export */ const demo9 = (( 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;// ./demo/demo.js\n\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 [\'demo9\', demo9],\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQxLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBTztBQUNBO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMsb0NBQW9DO0FBQzlCO0FBQ1A7QUFDQTtBQUNBLENBQUMsd0NBQXdDO0FBQ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2FzZSBBeGlzLlJJR0hUOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlWSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhc2UgUGxhbmVWaWV3LlNJREU6IHtcbiAgICAgICAgICAgIHN3aXRjaCAocm90YXRpb24uYXhpcykge1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5UT1A6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGVZKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBjYXNlIEF4aXMuTEVGVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVoodmFsdWUpO1xuICAgICAgICAgICAgICAgIGNhc2UgQXhpcy5SSUdIVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZVgoLXZhbHVlKTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAg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RhcnQoY29tbWFuZHMpO1xuICAgIHZhciBzdmdQYXRocyA9IGRyYXdDb21tYW5kcy5tYXAoZnVuY3Rpb24gKGMsIGluZGV4KSB7XG4gICAgICAgIHZhciBwb2ludCA9IGdldFBvaW50RnJvbUlzb21ldHJpY1BvaW50KGNlbnRlclgsIGNlbnRlclksIGMucG9pbnQsIHNjYWxlKTtcbiAgICAgICAgc3dpdGNoIChjLmNvbW1hbmQpIHtcbiAgICAgICAgICAgIGNhc2UgQ29tbWFuZC5tb3ZlOlxuICAgICAgICAgICAgICAgIHJldHVybiBcIk1cIi5jb25jYXQocG9pbnQueCwgXCIgXCIpLmNvbmNhdChwb2ludC55KTtcbiAgICAgICAgICAgIGNhc2UgQ29tbWFuZC5saW5lOlxuICAgICAgICAgICAgICAgIHJldHVybiBcIkxcIi5jb25jYXQocG9pbnQueCwgXCIgXCIpLmNvbmNhdChwb2ludC55KTtcbiAgICAgICAgICAgIGNhc2UgQ29tbWFuZC5jdXJ2ZToge1xuICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IGdldFBvaW50RnJvbUlzb21ldHJpY1BvaW50KGNlbnRlclgsIGNlbnRlclksIGNvbW1hbmRzW2luZGV4IC0gMV0ucG9pbnQsIHNjYWxlKTtcbiAgICAgICAgICAgICAgICB2YXIgY29udHJvbCA9IGdldFBvaW50RnJvbUlzb21ldHJpY1BvaW50KGNlbnRlclgsIGNlbnRlclksIGMuY29udHJvbCwgc2NhbGUpO1xuICAgICAgICAgICAgICAgIHZhciBlbGxpcHNpc1NwZWNzID0gZ2V0RWxsaXBzaXNTcGVjcyhzdGFydCwgcG9pbnQsIGNvbnRyb2wpO1xuICAgICAgICAgICAgICAgIHZhciBzd2VlcEZsYWcgPSBnZXRPcmllbnRhdGlvbihzdGFydCwgY29udHJvbCwgcG9pbnQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBcIkEgXCIuY29uY2F0KGVsbGlwc2lzU3BlY3NbMF0sIFwiIFwiKS5jb25jYXQoZWxsaXBzaXNTcGVjc1sxXSwgXCIgXCIpLmNvbmNhdChlbGxpcHNpc1NwZWNzWzJdLCBcIiAwIFwiKS5jb25jYXQoc3dlZXBGbGFnLCBcIiBcIikuY29uY2F0KHBvaW50LngsIFwiIFwiKS5jb25jYXQocG9pbnQueSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICBpZiAoc3ZnUGF0aHMubGVuZ3RoKSB7XG4gICAgICAgIHZhciBwYXRoRW5kID0gYXV0b2Nsb3NlID8gJ3onIDogJyc7XG4gICAgICAgIHJldHVybiBcIlwiLmNvbmNhdChzdmdQYXRocy5qb2luKCcgJykudHJpbSgpKS5jb25jYXQocGF0aEVuZCk7XG4gICAgfVxuICAgIHJldHVybiAnJztcbn07XG5leHBvcnQgdmFyIHBhcnNlRHJhd0NvbW1hbmRzID0gZnVuY3Rpb24gKGNvbW1hbmRzKSB7XG4gICAgdmFyIGNvbW1hbmRzQXJyYXkgPSBbXTtcbiAgICB2YXIgYXJyYXk7XG4gICAgd2hpbGUgKChhcnJheSA9IENPTU1BTkRTX1JFR0VYUC5leGVjKGNvbW1hbmRzKSkgIT09IG51bGwpIHtcbiAgICAgICAgdmFyIGNvbW1hbmQgPSBhcnJheVs1XSB8fCBhcnJheVsxXTtcbiAgICAgICAgc3dpdGNoIChjb21tYW5kKSB7XG4gICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBjb21tYW5kc0FycmF5LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLm1vdmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6ICthcnJheVsyXSwgbDogK2FycmF5WzNdLCB0OiArYXJyYXlbNF0gfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnTCc6XG4gICAgICAgICAgICAgICAgY29tbWFuZHNBcnJheS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5saW5lLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiArYXJyYXlbMl0sIGw6ICthcnJheVszXSwgdDogK2FycmF5WzRdIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ0MnOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzQXJyYXkucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogK2FycmF5WzZdLCBsOiArYXJyYXlbN10sIHQ6ICthcnJheVs4XSB9LFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiArYXJyYXlbOV0sIGw6ICthcnJheVsxMF0sIHQ6ICthcnJheVsxMV0gfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBjb21tYW5kc0FycmF5O1xufTtcbmV4cG9ydCB2YXIgdHJhbnNsYXRlQ29tbWFuZFBvaW50cyA9IGZ1bmN0aW9uIChjb21tYW5kcywgcmlnaHQsIGxlZnQsIHRvcCkge1xuICAgIGNvbW1hbmRzLmZvckVhY2goZnVuY3Rpb24gKGNvbW1hbmQpIHtcbiAgICAgICAgY29tbWFuZC5wb2ludC5yICs9IHJpZ2h0O1xuICAgICAgICBjb21tYW5kLnBvaW50LmwgKz0gbGVmdDtcbiAgICAgICAgY29tbWFuZC5wb2ludC50ICs9IHRvcDtcbiAgICAgICAgaWYgKGNvbW1hbmQuY29udHJvbCkge1xuICAgICAgICAgICAgY29tbWFuZC5jb250cm9sLnIgKz0gcmlnaHQ7XG4gICAgICAgICAgICBjb21tYW5kLmNvbnRyb2wubCArPSBsZWZ0O1xuICAgICAgICAgICAgY29tbWFuZC5jb250cm9sLnQgKz0gdG9wO1xuICAgICAgICB9XG4g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R1cm4gbG9jYWxHZXRQYXRoKHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9KS5qb2luKCc7JylcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgICAgIHZhbHVlczogbG9jYWxHZXRQYXRoKGFuaW1hdGlvbi52YWx1ZXMpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBwcm9wZXJ0aWVzID0ge1xuICAgICAgICAgICAgZnJvbTogbG9jYWxHZXRQYXRoKGFuaW1hdGlvbi5mcm9tKSxcbiAgICAgICAgICAgIHRvOiBsb2NhbEdldFBhdGgoYW5pbWF0aW9uLnRvKVxuICAgICAgICB9O1xuICAgIH1cbiAgICByZXR1cm4gcHJvcGVydGllcztcbn07XG4iLCJ2YXIgU3RvcmUgPSAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIFN0b3JlKHdpZHRoLCBoZWlnaHQsIHNjYWxlKSB7XG4gICAgICAgIHRoaXMuc2l6ZXMgPSB7XG4gICAgICAgICAgICBjZW50ZXJYOiB3aWR0aCAvIDIsXG4gICAgICAgICAgICBjZW50ZXJZOiBoZWlnaHQgLyAyLFxuICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXG4gICAgICAgICAgICB3aWR0aDogd2lkdGgsXG4gICAgICAgICAgICBzY2FsZTogc2NhbGVcbiAgICAgICAgfTtcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KFN0b3JlLnByb3RvdHlwZSwgXCJ3aWR0aFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuc2l6ZXMud2lkdGg7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLn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gICB9XG4gICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBfdGhpcy5hZGRBbmltYXRpb25CYXNpY1Byb3BlcnRpZXMocHJvcGVydHksIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBnZXRBbmltYXRpb25Qcm9wZXJ0aWVzKGZ1bmN0aW9uICh2YWx1ZSkgeyByZXR1cm4gXCJcIi5jb25jYXQodmFsdWUpOyB9LCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy51cGRhdGVTdWJDbGFzc0FuaW1hdGlvbnMoKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUudXBkYXRlUGF0dGVyblRyYW5zZm9ybSA9IGZ1bmN0aW9uIChjb3JuZXIsIHBsYW5lVmlldykge1xuICAgICAgICB2YXIgX2EsIF9iLCBfYztcbiAgICAgICAgaWYgKHRoaXMucHJvcHMudGV4dHVyZSkge1xuICAgICAgICAgICAgdmFyIGhlaWdodCA9IHRoaXMucHJvcHMudGV4dHVyZS5oZWlnaHRcbiAgICAgICAgICAgICAgICA/IFwiXCIuY29uY2F0KHRoaXMucHJvcHMudGV4dHVyZS5oZWlnaHQgKiB0aGlzLmRhdGEuc2NhbGUpXG4gICAgICAgICAgICAgICAgOiAnMTAwJSc7XG4gICAgICAgICAgICB2YXIgd2lkdGggPSB0aGlzLnByb3BzLnRleHR1cmUud2lkdGhcbiAgICAgIC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AgICAgICAgJ3BhdHRlcm5UcmFuc2Zvcm0nOiB0cmFuc2Zvcm0sXG4gICAgICAgICAgICAgICAgJ2hlaWdodCc6IGhlaWdodCxcbiAgICAgICAgICAgICAgICAnd2lkdGgnOiB3aWR0aFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMucGF0dGVybi5maXJzdENoaWxkLCB7XG4gICAgICAgICAgICAgICAgJ2hlaWdodCc6IGhlaWdodCxcbiAgICAgICAgICAgICAgICAnd2lkdGgnOiB3aWR0aFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNHcmFwaGljQWJzdHJhY3QucHJvdG90eXBlLCBcImlkXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faWQ7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnNldElkKHZhbHVlKTtcbiAgICAgICAgICAgIGlmICh0aGlzLnBhdHRlcm4pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnBhdHRlcm5JZCA9IFwiXCIuY29uY2F0KHRoaXMuaWQsIFwiX190ZXh0dXJlXCIpO1xuICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5wYXR0ZXJuLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IHRoaXMucGF0dGVybklkXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3Rvd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LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUsIFwidGV4dHVyZVwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJvcHMudGV4dHVyZTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHZhciBoYXNUZXh0dXJlID0gISF0aGlzLnByb3BzLnRleHR1cmU7XG4gICAgICAgICAgICB0aGlzLnByb3BzLnRleHR1cmUgPSB2YWx1ZTtcbiAgICAgICAgICAgIGlmIChoYXNUZXh0dXJlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRlVGV4dHVyZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVUZXh0dXJlKHRoaXMucHJvcHMudGV4dHVyZSk7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNHcmFwaGljQWJzdHJhY3QucHJvdG90eXBlLCBcInN0cm9rZUNvbG9yXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcm9wcy5zdHJva2VDb2xvcjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgIC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PSBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgKHRoaXMucHJvcHMudGV4dHVyZS5zaGlmdCB8fCB7fSkpLCBzaGlmdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocm90YXRpb24pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnRleHR1cmUucm90YXRpb24gPSByb3RhdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChoYXNUZXh0dXJlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRlVGV4dHVyZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVUZXh0dXJlKHRoaXMucHJvcHMudGV4dHVyZSk7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuICAgIElzb21ldHJpY0dyYXBoaWNBYnN0cmFjdC5wcm90b3R5cGUuYWRkQW5pbWF0aW9uID0gZnVuY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMucHVzaChfX2Fzc2lnbih7fSwgYW5pbWF0aW9uKSk7XG4gICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4gICAgSXNvbWV0cmljR3JhcGhpY0Fic3RyYWN0LnByb3RvdHlwZS5yZW1vdmVBbmltYXRpb25CeUluZGV4ID0gZnVuY3Rpb24gKGluZGV4KSB7XG4gICAgICAgIGlmIChpbmRleCA+PSAwICYmIGluZGV4IDwgdGhpcy5hbmltYXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGFuaW1hdGlvbiA9IHRoaXMuYW5pbWF0aW9ucy5zcGxpY2UoaW5kZXgsIDEpWzBdO1xuICAgICAgICAgICAgaWYgKGFua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GNoaWxkSW5kZXggPSB0aGlzLmdldENoaWxkSW5kZXgoY2hpbGQpO1xuICAgICAgICBpZiAoY2hpbGRJbmRleCA+IC0xKSB7XG4gICAgICAgICAgICBpbmRleCA9IE1hdGgubWluKE1hdGgubWF4KDAsIGluZGV4KSwgdGhpcy5fY2hpbGRyZW4ubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICB2YXIgbW92ZWRFbGVtZW50ID0gY2hpbGQuZ2V0RWxlbWVudCgpO1xuICAgICAgICAgICAgdmFyIHJlcGxhY2VkRWxlbWVudCA9IHRoaXMuX2NoaWxkcmVuW2luZGV4XS5nZXRFbGVtZW50KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5fY2hpbGRyZW5baW5kZXhdICE9PSBjaGlsZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2NoaWxkcmVuLnNwbGljZShjaGlsZEluZGV4LCAxKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9jaGlsZHJlbi5zcGxpY2UoaW5kZXgsIDAsIGNoaWxkKTtcbiAgICAgICAgICAgICAgICBpZiAoY2hpbGRJbmRleCA+IGluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZWxlbWVudC5pbnNlcnRCZWZvcmUobW92ZWRFbGVtZW50LCByZXBsYWNlZEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcGxhY2VkRWxlbWVudC5uZXh0U2libGluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbGVtZW50Lmluc2VydEJlZm9yZShtb3ZlZEVsZW1lbnQsIHJlcGxhY2VkRWxlbWVudC5uZXh0U2libGluZyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQobW92ZWRFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudGhyb3dDaGlsZEVycm9yKCk7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDb250YWluZXJBYnN0cmFjdC5wcm90b3R5cGUuYnJpbmdDaGlsZFRvRnJvbnQgPSBmdW5jdGlvbiAoY2hpbGQpIHtcbiAgICAgICAgdmFyIGNoaWxkSW5kZXggPSB0aGlzLmdldENoaWxkSW5kZXgoY2hpbGQpO1xuICAgICAgICBpZiAoY2hpbGRJbmRleCA+IC0xKSB7XG4gICAgICAgICAgICB0aGlzLnNldENoaWxkSW5kZXgoY2hpbGQsIHRoaXMuX2NoaWxkcmVuLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy50aHJvd0NoaWxkRXJyb3IoKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0NvbnRhaW5lckFic3RyYWN0LnByb3RvdHlwZS5icmluZ0NoaWxkRm9yd2FyZCA9IGZ1bmN0aW9uIChjaGlsZCkge1xuICAgICAgICB2YXIgY2hpbGRJbmRleCA9IHRoaXMuZ2V0Q2hpbGRJbmRleChjaGlsZCk7XG4gICAgICAgIGlmIChjaGlsZEluZGV4ID4gLTEpIHtcbiAgICAgICAgICAgIGlmIChjaGlsZEluZGV4IDwgdGhpcy5fY2hpbGRyZW4ubGVuZ3RoIC0gMSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0Q2hpbGRJbmRleChjaGlsZCwgY2hpbGRJbmRleCArIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy50aHJvd0NoaWxkRXJyb3IoKTtcbiAgICB9O1xuICAgIElzb21ldHJ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yhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMucmVjdCk7XG4gICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoX3RoaXMuYmFja2dyb3VuZCwge1xuICAgICAgICAgICAgZmlsbDogX3RoaXMuYmFja2dyb3VuZENvbG9yLFxuICAgICAgICAgICAgeDogJzAnLFxuICAgICAgICAgICAgeTogJzAnLFxuICAgICAgICAgICAgd2lkdGg6IFwiXCIuY29uY2F0KF90aGlzLmRhdGEud2lkdGgsIFwicHhcIiksXG4gICAgICAgICAgICBoZWlnaHQ6IFwiXCIuY29uY2F0KF90aGlzLmRhdGEuaGVpZ2h0LCBcInB4XCIpXG4gICAgICAgIH0pO1xuICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKF90aGlzLmJhY2tncm91bmQpO1xuICAgICAgICB2YXIgY29udGFpbmVyRWxlbWVudCA9IHR5cGVvZiBfdGhpcy5wcm9wcy5jb250YWluZXIgPT09ICdzdHJpbmcnXG4gICAgICAgICAgICA/IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoX3RoaXMucHJvcHMuY29udGFpbmVyKVxuICAgICAgICAgICAgOiBfdGhpcy5wcm9wcy5jb250YWluZXI7XG4gICAgICAgIGNvbnRhaW5lckVsZW1lbnQuYXBwZW5kQ2hpbGQoX3RoaXMuZWxlbWVudCk7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY0NhbnZhcy5wcm90b3R5cGUsIFwiYmFja2dyb3VuZENvbG9yXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcm9wcy5iYWNrZ3JvdW5kQ29sb3I7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLnByb3BzLmJhY2tncm91bmRDb2xvci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cbiAgICAgICAgICAgICAgICBfYSkpO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLmJhY2tncm91bmQsIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogXCJcIi5jb25jYXQodGhpcy5kYXRhLndpZHRoLCBcInB4XCIpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljQ2FudmFzLnByb3RvdHlwZSwgXCJhbmltYXRlZFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaXNBbmltYXRlZDtcbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIElzb21ldHJpY0NhbnZhcy5wcm90b3R5cGUuZ2V0U1ZHQ29kZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZWxlbWVudC5vdXRlckhUTUw7XG4gICAgfTtcbiAgICBJc29tZXRyaWNDYW52YXMucHJvdG90eXBlLnBhdXNlQW5pbWF0aW9ucyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHN2ZyA9IHRoaXMuZWxlbWVudDtcbiAgICAgICAgaWYgKHR5cGVvZiBzdmcucGF1c2VBbmltYXRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICBzdmcucGF1c2VBbmltYXRpb25zKCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5pc0FuaW1hdGVkID0gZmFsc2U7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4gICAgSXNvbW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Z2V0Qm91bmRPck1heGltdW0oJ3RvcCcpO1xuICAgICAgICByZXR1cm4gdGhpcy5iZXR3ZWVuQm91bmRzKHRoaXMuX2RyYWdTdG9yZS50b3AgKyB2YWx1ZSAvIHRoaXMuZGF0YS5zY2FsZSwgYm91bmRzKTtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5nZXRGaXhlZENvb3JkaW5hdGVzID0gZnVuY3Rpb24gKGNvb3Jkcykge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICByZXR1cm4gT2JqZWN0LmVudHJpZXMoY29vcmRzKS5yZWR1Y2UoZnVuY3Rpb24gKGFjYywgZW50cnkpIHtcbiAgICAgICAgICAgIHZhciBmaXhlZENvb3JkcyA9IF9fYXNzaWduKHt9LCBhY2MpO1xuICAgICAgICAgICAgc3dpdGNoIChlbnRyeVswXSkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3JpZ2h0JzpcbiAgICAgICAgICAgICAgICAgICAgZml4ZWRDb29yZHMucmlnaHQgPSBfdGhpcy5nZXRSaWdodChlbnRyeVsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xlZnQnOlxuICAgICAgICAgICAgICAgICAgICBmaXhlZENvb3Jkcy5sZWZ0ID0gX3RoaXMuZ2V0TGVmdChlbnRyeVsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGZpeGVkQ29vcmRzLnRvcCA9IF90aGlzLmdldFRvcChlbnRyeVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZml4ZWRDb29yZHM7XG4gICAgICAgIH0sIHt9KTtcbiAgICB9O1xuICAgIElzb21ldHJpY0RyYWdnYWJsZUFic3RyYWN0LnByb3RvdHlwZS5kaXNw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AgICAgICAgICAgICAgICAgd2lkdGg6IF90aGlzLndpZHRoLFxuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IF90aGlzLmhlaWdodFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChwcm9wcywgYW5pbWF0aW9uLnByb3BlcnR5KSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IGdldEFuaW1hdGlvblByb3BlcnRpZXMoX3RoaXMuZ2V0UmVjdGFuZ2xlUGF0aC5iaW5kKF90aGlzKSwgYW5pbWF0aW9uLCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKFNWR19OQU1FU1BBQ0UsIFNWR19FTEVNRU5UUy5hbmltYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50LnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygnZCcsIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV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dmFyIHJhZGl1cyA9IChfZCA9IGFyZ3MgPT09IG51bGwgfHwgYXJncyA9PT0gdm9pZCAwID8gdm9pZCAwIDogYXJncy5yYWRpdXMpICE9PSBudWxsICYmIF9kICE9PSB2b2lkIDAgPyBfZCA6IHRoaXMucmFkaXVzO1xuICAgICAgICB2YXIgY29tbWFuZHMgPSBbXTtcbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYW5lVmlldykge1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuRlJPTlQ6XG4gICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQubW92ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogcmFkaXVzLCB0OiAwIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IC1yYWRpdXMsIHQ6IDAgfSxcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbDogeyByOiAwLCBsOiAwLCB0OiAtcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IENvbW1hbmQuY3VydmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IDAsIGw6IHJhZGl1cywgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IDAsIGw6IDAsIHQ6IHJhZGl1cyB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFBsYW5lVmlldy5TSURFOlxuICAgICAgICAgICAgICAgIGNvbW1hbmRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLm1vdmUsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50OiB7IHI6IC1yYWRpdXMsIGw6IDAsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogcmFkaXVzLCBsOiAwLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogMCwgbDogMCwgdDogLXJhZGl1cyB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAtcmFkaXVzLCBsOiAwLCB0OiAwIH0sXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2w6IHsgcjogMCwgbDogMCwgdDogcmFkaXVzIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUGxhbmVWaWV3LlRPUDpcbiAgICAgICAgICAgICAgICBjb21tYW5kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5tb3ZlLFxuICAgICAgICAgICAgICAgICAgICBwb2ludDogeyByOiAwLCBsOiByYWRpdXMsIHQ6IDAgfVxuICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZDogQ29tbWFuZC5jdXJ2ZSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IHsgcjogMCwgbDogLXJhZGl1cywgdDogMCB9LFxuICAgICAgICAgICAgICAgICAgICBjb250cm9sOiB7IHI6IHJhZGl1cywgbDogMCwgdDogMCB9XG4gICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBDb21tYW5kLmN1cnZlLFxuICAgICAgICAgICAgICAgICAgICB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y5sZWZ0LFxuICAgICAgICAgICAgICAgICAgICB0b3A6IF90aGlzLnRvcCxcbiAgICAgICAgICAgICAgICAgICAgcmFkaXVzOiBfdGhpcy5yYWRpdXNcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocHJvcHMsIGFuaW1hdGlvbi5wcm9wZXJ0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBnZXRBbmltYXRpb25Qcm9wZXJ0aWVzKF90aGlzLmdldENpcmNsZVBhdGguYmluZChfdGhpcyksIGFuaW1hdGlvbiwgcHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhTVkdfTkFNRVNQQUNFLCBTVkdfRUxFTUVOVFMuYW5pbWF0ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5hZGRBbmltYXRpb25CYXNpY1Byb3BlcnRpZXMoJ2QnLCBhbmltYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKGFuaW1hdGlvbi5lbGVtZW50LCBwcm9wZXJ0aWVzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21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kIDAgPyBfZiA6IHRoaXMuX2RlbnNpdHk7XG4gICAgICAgIHZhciByb3RhdGlvbiA9IChfZyA9IGFyZ3MgPT09IG51bGwgfHwgYXJncyA9PT0gdm9pZCAwID8gdm9pZCAwIDogYXJncy5yb3RhdGlvbikgIT09IG51bGwgJiYgX2cgIT09IHZvaWQgMCA/IF9nIDogdGhpcy5yb3RhdGlvbjtcbiAgICAgICAgdmFyIGNvb3JkaW5hdGVzID0gdGhpcy5nZXQyRENvb3JkaW5hdGVzKHJhZGl1cywgcG9pbnRzLCBkZW5zaXR5LCByb3RhdGlvbik7XG4gICAgICAgIHZhciBjb21tYW5kcyA9IFtdO1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhbmVWaWV3KSB7XG4gICAgICAgICAgICBjYXNlIFBsYW5lVmlldy5GUk9OVDpcbiAgICAgICAgICAgICAgICBjb29yZGluYXRlcy5mb3JFYWNoKGZ1bmN0aW9uIChwb2ludCwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBpbmRleCA9PT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ29tbWFuZC5tb3ZlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb2ludDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHI6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbDogcG9pbnQueCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0OiBwb2ludC55XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuU0lERTpcbiAgICAgICAgICAgICAgICBjb29yZGluYXRlcy5mb3JFYWNoKGZ1bmN0aW9uIChwb2ludCwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWFuZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kOiBpbmRleCA9PT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ29tbWFuZC5tb3ZlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBDb21tYW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb2ludDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHI6IHBvaW50LngsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbDogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0OiBwb2ludC55XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQbGFuZVZpZXcuVE9QOlxuICAgICAgICAgICAgICAgIGNvb3JkaW5hdGVzLmZvckVhY2goZnVuY3Rpb24gKHBvaW50LCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBjb21tYW5kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQ6IGluZGV4ID09PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDb21tYW5kLm1vdmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IENvbW1hbmQubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcjogLXBvaW50LngsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbDogLXBvaW50LnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdDogMFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9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VuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB0aGlzLmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICB2YXIgaXNOYXRpdmVTVkdQcm9wZXJ0eSA9IGlzU1ZHUHJvcGVydHkoYW5pbWF0aW9uLnByb3BlcnR5KTtcbiAgICAgICAgICAgIGlmICghaXNOYXRpdmVTVkdQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIHZhciBwcm9wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IF90aGlzLnJpZ2h0LFxuICAgICAgICAgICAgICAgICAgICBsZWZ0OiBfdGhpcy5sZWZ0LFxuICAgICAgICAgICAgICAgICAgICB0b3A6IF90aGlzLnRvcCxcbiAgICAgICAgICAgICAgICAgICAgcmFkaXVzOiBfdGhpcy5yYWRpdXMsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50czogX3RoaXMuX3BvaW50cyxcbiAgICAgICAgICAgICAgICAgICAgZGVuc2l0eTogX3RoaXMuX2RlbnNpdHksXG4gICAgICAgICAgICAgICAgICAgIHJvdGF0aW9uOiBfdGhpcy5yb3RhdGlvblxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChwcm9wcywgYW5pbWF0aW9uLnByb3BlcnR5KSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IGdldEFuaW1hdGlvblByb3BlcnRpZXMoX3RoaXMuZ2V0UGVudGFncmFtUGF0aC5iaW5kKF90aGlzKSwgYW5pbWF0aW9uLCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKFNWR19OQU1FU1BBQ0UsIFNWR19FTEVNRU5UUy5hbmltYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGlvbi5lbGVtZW50LnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoYW5pbWF0aW9uLmVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygnZCcsIGFuaW1hdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXMoYW5pbWF0aW9uLmVsZW1lbnQsIHByb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljU3RhclBvbHlnb25BYnN0cmFjdC5wcm90b3R5cGUsIFwicmFkaXVzXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcmFkaXVzO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fcmFkaXVzID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1N0YXJQb2x5Z29uQWJzdHJhY3QucHJvdG90eXBlLCBcInJvdGF0aW9uXCIsIHtcbiAgICAgICAg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1xuICAgIH07XG59KSgpO1xudmFyIF9fYXNzaWduID0gKHRoaXMgJiYgdGhpcy5fX2Fzc2lnbikgfHwgZnVuY3Rpb24gKCkge1xuICAgIF9fYXNzaWduID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbih0KSB7XG4gICAgICAgIGZvciAodmFyIHMsIGkgPSAxLCBuID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgcyA9IGFyZ3VtZW50c1tpXTtcbiAgICAgICAgICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSlcbiAgICAgICAgICAgICAgICB0W3BdID0gc1twXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdDtcbiAgICB9O1xuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xufTtcbnZhciBfX3Jlc3QgPSAodGhpcyAmJiB0aGlzLl9fcmVzdCkgfHwgZnVuY3Rpb24gKHMsIGUpIHtcbiAgICB2YXIgdCA9IHt9O1xuICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSAmJiBlLmluZGV4T2YocCkgPCAwKVxuICAgICAgICB0W3BdID0gc1twXTtcbiAgICBpZiAocyAhPSBudWxsICYmIHR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzID09PSBcImZ1bmN0aW9uXCIpXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBwID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhzKTsgaSA8IHAubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKS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mdCxcbiAgICAgICAgICAgIHQ6IHByb3BzLnRvcFxuICAgICAgICB9LCB0aGlzLmRhdGEuc2NhbGUpO1xuICAgIH07XG4gICAgSXNvbWV0cmljVGV4dC5wcm90b3R5cGUudXBkYXRlU3ViQ2xhc3NBbmltYXRpb25zID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgcHJvcHMgPSB7XG4gICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgIGxlZnQ6IDAsXG4gICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICByb3RhdGlvbjogMCxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5hbmltYXRpb25zLmZvckVhY2goZnVuY3Rpb24gKGFuaW1hdGlvbikge1xuICAgICAgICAgICAgdmFyIGlzTmF0aXZlU1ZHUHJvcGVydHkgPSBpc1NWR1Byb3BlcnR5KGFuaW1hdGlvbi5wcm9wZXJ0eSk7XG4gICAgICAgICAgICBpZiAoIWlzTmF0aXZlU1ZHUHJvcGVydHkpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3BzLCBhbmltYXRpb24ucHJvcGVydHkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0eV8xID0gYW5pbWF0aW9uLnByb3BlcnR5O1xuICAgICAgICAgICAgICAgICAgICB2YXIgaXNSb3RhdGlvbl8xID0gcHJvcGVydHlfMSA9PT0gJ3JvdGF0aW9uJztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbW1vblByb3BzID0gX19hc3NpZ24oX19hc3NpZ24oe30sIF90aGlzLmNvbW1vbkFuaW1hdGlvbkF0dHJpYnV0ZXMpLCB7IHR5cGU6IGlzUm90YXRpb25fMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JvdGF0ZSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0cmFuc2xhdGUnLCBiZWdpbjogJ2luZGVmaW5pdGUnIH0pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbi52YWx1ZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFuaW1hdGlvbi52YWx1ZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBhbmltYXRpb24udmFsdWVzLm1hcChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJcIi5jb25jYXQodmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWRBcmdzW3Byb3BlcnR5XzFdID0gK3ZhbHVlIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKG1vZGlmaWVkQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcIlwiLmNvbmNhdChjb29yZHMueCwgXCIsXCIpLmNvbmNhdChjb29yZHMueSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNSb3RhdGlvbl8xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IHZhbHVlczogXCJcIi5jb25jYXQoYW5pbWF0aW9uLnZhbHVlcykgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGlmaWVkQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkQXJnc1twcm9wZXJ0eV8xXSA9ICthbmltYXRpb24udmFsdWVzIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHMgPSBfdGhpcy5nZXRQb3NpdGlvblRyYW5zZm9ybShtb2RpZmllZEFyZ3MsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IF9fYXNzaWduKHsgdmFsdWVzOiBcIlwiLmNvbmNhdChjb29yZHMueCwgXCIsXCIpLmNvbmNhdChjb29yZHMueSkgfSwgY29tbW9uUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1JvdGF0aW9uXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzID0gX19hc3NpZ24oeyBmcm9tOiBcIlwiLmNvbmNhdChhbmltYXRpb24uZnJvbSksIHRvOiBcIlwiLmNvbmNhdChhbmltYXRpb24udG8pIH0sIGNvbW1vblByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvQXJncyA9IF9fYXNzaWduKHt9LCBwcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbUFyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLmZyb20gLSBfdGhpc1twcm9wZXJ0eV8xXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b0FyZ3NbcHJvcGVydHlfMV0gPSArYW5pbWF0aW9uLnRvIC0gX3RoaXNbcHJvcGVydHlfMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3Jkc0Zyb20gPSBfdGhpcy5nZXRQb3NpdGlvblRyYW5zZm9ybShmcm9tQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHNUbyA9IF90aGlzLmdldFBvc2l0aW9uVHJhbnNmb3JtKHRvQXJncywgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSBfX2Fzc2lnbih7IGZyb206IFwiXCIuY29uY2F0KGNvb3Jkc0Zyb20ueCwgXCIsXCIpLmNvbmNhdChjb29yZHNGcm9tLnkpLCB0bzogXCJcIi5jb25jYXQoY29vcmRzVG8ueCwgXCIsXCIpLmNvbmNhdChjb29yZHNUby55KSB9LCBjb21tb25Qcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmltYXRpb24uZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLmVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoU1ZHX05BTUVTUEFDRSwgU1ZHX0VMRU1FTlRTLmFuaW1hdGVUcmFuc2Zvcm0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmFkZEFuaW1hdGlvbkJhc2ljUHJvcGVydGllcygndHJhbnNmb3JtJywgYW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyhhbmltYXRpb24uZWxlbWVudCwgcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghYW5pbWF0aW9uLmVsZW1lbnQucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUm90YXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl90ZXh0RWxlbWVudC5hcHBlbmRDaGlsZChhbmltYXRpb24uZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5lbGVtZW50LmFwcGVuZENoaWxkKGFuaW1hdGlvbi5lbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5lbGVtZW50Lm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sIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdGV4dDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRoaXMuX3RleHQgPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwicGxhbmVWaWV3XCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fcGxhbmVWaWV3O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fcGxhbmVWaWV3ID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcImZvbnRGYW1pbHlcIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9mb250RmFtaWx5O1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fZm9udEZhbWlseSA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90c3Bhbiwge1xuICAgICAgICAgICAgICAgICdmb250LWZhbWlseSc6IHRoaXMuX2ZvbnRGYW1pbHlcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcImZvbnRTaXplXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZm9udFNpemU7XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9mb250U2l6ZSA9IHZhbHVlO1xuICAgICAgICAgICAgYWRkU1ZHUHJvcGVydGllcyh0aGlzLl90c3Bhbiwge1xuICAgICAgICAgICAgICAgICdmb250LXNpemUnOiBcIlwiLmNvbmNhdCh0aGlzLl9mb250U2l6ZSwgXCJweFwiKVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoSXNvbWV0cmljVGV4dC5wcm90b3R5cGUsIFwiZm9udFN0eWxlXCIsIHtcbiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZm9udFN0eWxlO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5fZm9udFN0eWxlID0gdmFsdWU7XG4gICAgICAgICAgICBhZGRTVkdQcm9wZXJ0aWVzKHRoaXMuX3RzcGFuLCB7XG4gICAgICAgICAgICAgICAgJ2ZvbnQtc3R5bGUnOiBcIlwiLmNvbmNhdC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5bGUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGFkZFNWR1Byb3BlcnRpZXModGhpcy5fdGV4dEVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGU6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICctd2Via2l0LXVzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICctbW96LXVzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICctbXMtdXNlci1zZWxlY3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXItc2VsZWN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb2ludGVyLWV2ZW50cydcbiAgICAgICAgICAgICAgICAgICAgXS5tYXAoZnVuY3Rpb24gKGRlY2wpIHsgcmV0dXJuIFwiXCIuY29uY2F0KGRlY2wsIFwiOiBub25lXCIpOyB9KS5qb2luKCc7JylcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJvcmlnaW5cIiwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9vcmlnaW47XG4gICAgICAgIH0sXG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLl9vcmlnaW4gPSB2YWx1ZTtcbiAgICAgICAgICAgIHZhciBfYSA9IHRoaXMuX29yaWdpbiwgdGV4dEFuY2hvciA9IF9hWzBdLCBhbGlnbm1lbnRCYXNlbGluZSA9IF9hWzFdO1xuICAgICAgICAgICAgYWRkU1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B2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xlZnQgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlXG4gICAgfSk7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KElzb21ldHJpY1RleHQucHJvdG90eXBlLCBcInRvcFwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3RvcDtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl90b3AgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdG9wID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgIH0pO1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShJc29tZXRyaWNUZXh0LnByb3RvdHlwZSwgXCJyb3RhdGlvblwiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3JvdGF0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX3JvdGF0aW9uICE9PSB2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3JvdGF0aW9uID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAg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nZGl2Jyk7XG4gICAgICAgIGNvbnN0IHdyYXBwZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcblxuICAgICAgICBjb250YWluZXIuY2xhc3NMaXN0LmFkZCgnZGVtby1jb250YWluZXInKTtcbiAgICAgICAgd3JhcHBlci5jbGFzc0xpc3QuYWRkKCdkZW1vLXdyYXBwZXInKTtcblxuICAgICAgICBtb2R1bGUoSXNvbWV0cmljTW9kdWxlLCB3cmFwcGVyKTtcbiAgICAgICAgY29udGFpbmVyLmFwcGVuZENoaWxkKHdyYXBwZXIpO1xuICAgICAgICBkZW1vLmFwcGVuZENoaWxkKGNvbnRhaW5lcik7XG4gICAgICAgIGRlbW8uYXBwZW5kQ2hpbGQoZnVuY3Rpb1RvU3RyaW5nKG1vZHVsZSkpO1xuICAgIH0pO1xuXG59KTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///741\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&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(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__(741),__webpack_export_target__=window;for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__]=__webpack_exports__[__webpack_i__];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file