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/B,SAAW5/B,KAAK4/B,SAAWx+B,GAChCpB,KAAK4/B,QAAQK,MAAMtU,YAAY,WAEnCvqB,EAAM6+B,MAAMpU,SAAS,CACjB,QAAW,SAEfhsB,EAAOmB,UAAU2+B,UAAU5/B,KAAKC,KAAMoB,EAC1C,EACO0+B,CACX,CA7GgC,CA6G9B,I,6FC1GEI,EAA+B,SAAUrgC,GAKzC,SAASqgC,IACL,IAAIpgC,EAAQD,EAAOE,KAAKC,OAASA,KAYjC,OAXAF,EAAMc,UAAY,gBAKlBd,EAAMm+B,cAAgBn+B,EAAM+4B,MAAMtM,IAAI,iBACtCzsB,EAAMm+B,cAAcjT,KAAK,CAAE,KAAQ,WACnClrB,EAAMg+B,iBAAiBh6B,KAAKhE,EAAMm+B,eAElCn+B,EAAM+5B,UAAY,EAClB/5B,EAAMe,aACCf,CACX,CA0BA,OA5CA,QAAUogC,EAAergC,GAmBzBiB,OAAOC,eAAem/B,EAAcl/B,UAAW,YAAa,CAIxDC,IAAK,WACD,OAAOjB,KAAK24B,WAAW,YAC3B,EAWAx3B,IAAK,SAAUC,GACXpB,KAAK24B,WAAW,aAAev3B,EAC/B,IAAI++B,EAAI/+B,EAAQ,EAChBpB,KAAKi+B,cAAcjT,KAAK,CAAE,OAAUmV,EAAI,cAAgBA,EAAI,cAAgBA,EAAI,kBACpF,EACA5+B,YAAY,EACZC,cAAc,IAEX0+B,CACX,CA9CkC,CA8ChC,KAQF,oCAA8CA,C","sources":["webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/formatters/DateFormatter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/formatters/DurationFormatter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/formatters/NumberFormatter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/formatters/TextFormatter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Inertia.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Interaction.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionKeyboardObject.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObject.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObjectEvents.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Mouse.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/AMElement.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Group.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Paper.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Path.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/SVGContainer.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Smoothing.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/CirclePattern.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/ColorModifier.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/GradientModifier.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinePattern.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradient.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradientModifier.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/Pattern.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradient.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradientModifier.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RectPattern.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/BlurFilter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/ColorizeFilter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DesaturateFilter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DropShadowFilter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/Filter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/FocusFilter.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/LightenFilter.js"],"sourcesContent":["/**\r\n * Handles date and time formatting\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * Handles date and time formatting.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @todo Better type casting of passed in date?\r\n * @todo Quarter support?\r\n * @todo When parsing named months make the search case-insensitive\r\n * @todo Escape a.m./p.m. properly when used in RegEx\r\n */\r\nvar DateFormatter = /** @class */ (function (_super) {\r\n __extends(DateFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DateFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Date format.\r\n */\r\n _this._dateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Input date format.\r\n */\r\n _this._inputDateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Assume UTC time zone.\r\n */\r\n _this._utc = false;\r\n /**\r\n * If `timezone` is set, this will hold minute fraction of the timezone.\r\n *\r\n * @readonly\r\n * @ignore\r\n */\r\n _this.timezoneMinutes = 0;\r\n /**\r\n * First day of week.\r\n *\r\n * 0 - Sunday\r\n * 1 - Monday\r\n *\r\n * Etc.\r\n */\r\n _this._firstDayOfWeek = 1;\r\n /**\r\n * A list of month names.\r\n */\r\n _this.months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n /**\r\n * A list of short month names.\r\n */\r\n _this.monthsShort = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May(short)\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\r\n /**\r\n * A list of weekday names.\r\n */\r\n _this.weekdays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n /**\r\n * A list of short weekday names.\r\n */\r\n _this.weekdaysShort = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Should the first letter of the formatted date be capitalized?\r\n *\r\n * @default true\r\n */\r\n _this.capitalize = true;\r\n _this.className = \"DateFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DateFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] object.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n this.dateFormat = this._language.translate(\"_date\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the date value according to specified format.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @param source Date value\r\n * @param format Format\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.format = function (source, format, applyTimezone) {\r\n // No language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language();\r\n }\r\n }\r\n // No format passed in or it's empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n format = this._dateFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Do casting if required\r\n // This will take care of timestamps as well as Date objects\r\n var date;\r\n if ($type.isString(source)) {\r\n // If it's a string, let's try parsing it using our own functionality\r\n date = this.parse(source);\r\n }\r\n else {\r\n date = $utils.anyToDate(source);\r\n }\r\n // Is it a built-in format or Intl.DateTimeFormat\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.DateTimeFormat(this.intlLocales, format).format(date);\r\n }\r\n else {\r\n return new Intl.DateTimeFormat(undefined, format).format(date);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format);\r\n // Should we apply custom time zone?\r\n if ($type.hasValue(this.timezoneOffset)) {\r\n date.setMinutes(date.getMinutes() + date.getTimezoneOffset() - this.timezoneOffset);\r\n }\r\n else if ($type.hasValue(this.timezone) && applyTimezone !== false) {\r\n date = $time.setTimezone(date, this.timezone);\r\n }\r\n // Check if it's a valid date\r\n if (!$type.isNumber(date.getTime())) {\r\n return this.language.translate(\"Invalid date\");\r\n }\r\n // Apply format\r\n formatted = this.applyFormat(date, info, this.language);\r\n // Capitalize\r\n if (this.capitalize) {\r\n formatted = formatted.replace(/^.{1}/, formatted.substr(0, 1).toUpperCase());\r\n }\r\n }\r\n // We're done\r\n return formatted;\r\n };\r\n /**\r\n * Parses format into structured infromation.\r\n *\r\n * @param format Format template\r\n */\r\n DateFormatter.prototype.parseFormat = function (format) {\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // Init format parse info holder\r\n var info = {\r\n \"template\": \"\",\r\n \"parts\": []\r\n };\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(format, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n if (chunk.type === \"value\") {\r\n // Just \"Date\"?\r\n if (chunk.text.match(/^date$/i) && $type.isString(this._dateFormat)) {\r\n chunk.text = this._dateFormat;\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);\r\n // Found?\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n info.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n info.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //info.template = getTextFormatter().format(info.template, this.outputFormat);\r\n // Save cache\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies format to Date.\r\n *\r\n * @param date Date object\r\n * @param info Parsed format information\r\n * @param language Language\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.applyFormat = function (date, info, language) {\r\n // Init return value\r\n var res = info.template;\r\n // Get values\r\n var fullYear, month, weekday, day, hours, minutes, seconds, milliseconds, offset = date.getTimezoneOffset(), timestamp = date.getTime();\r\n if (this.utc) {\r\n fullYear = date.getUTCFullYear();\r\n month = date.getUTCMonth();\r\n weekday = date.getUTCDay();\r\n day = date.getUTCDate();\r\n hours = date.getUTCHours();\r\n minutes = date.getUTCMinutes();\r\n seconds = date.getUTCSeconds();\r\n milliseconds = date.getUTCMilliseconds();\r\n }\r\n else {\r\n fullYear = date.getFullYear();\r\n month = date.getMonth();\r\n weekday = date.getDay();\r\n day = date.getDate();\r\n hours = date.getHours();\r\n minutes = date.getMinutes();\r\n seconds = date.getSeconds();\r\n milliseconds = date.getMilliseconds();\r\n }\r\n // Go through each part and format/replace it in template\r\n for (var i = 0, len = info.parts.length; i < len; i++) {\r\n var value = \"\";\r\n switch (info.parts[i]) {\r\n case \"G\":\r\n value = language.translate(fullYear < 0\r\n ? \"_era_bc\"\r\n : \"_era_ad\");\r\n break;\r\n case \"yyyy\":\r\n value = Math.abs(fullYear).toString();\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"yyy\":\r\n case \"yy\":\r\n case \"y\":\r\n value = Math.abs(fullYear).toString().substr(-info.parts[i].length);\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n var week = $utils.getWeek(date);\r\n var year = fullYear;\r\n if (week == 1 && (weekday > 4)) {\r\n year--;\r\n }\r\n if (info.parts[i] == \"YYYY\") {\r\n value = Math.abs(year).toString();\r\n }\r\n else {\r\n value = Math.abs(year).toString().substr(-info.parts[i].length);\r\n }\r\n if (year < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"u\":\r\n // @todo\r\n break;\r\n case \"q\":\r\n value = \"\" + Math.ceil((date.getMonth() + 1) / 3);\r\n break;\r\n case \"MMMMM\":\r\n value = language.translate(this.months[month]).substr(0, 1);\r\n break;\r\n case \"MMMM\":\r\n value = language.translate(this.months[month]);\r\n break;\r\n case \"MMM\":\r\n value = language.translate(this.monthsShort[month]);\r\n break;\r\n case \"MM\":\r\n value = $utils.padString(month + 1, 2, \"0\");\r\n break;\r\n case \"M\":\r\n value = (month + 1).toString();\r\n break;\r\n case \"ww\":\r\n value = $utils.padString($utils.getWeek(date, this.utc), 2, \"0\");\r\n break;\r\n case \"w\":\r\n value = $utils.getWeek(date, this.utc).toString();\r\n break;\r\n case \"W\":\r\n value = $utils.getMonthWeek(date, this.utc).toString();\r\n break;\r\n case \"dd\":\r\n value = $utils.padString(day, 2, \"0\");\r\n break;\r\n case \"d\":\r\n value = day.toString();\r\n break;\r\n case \"DD\":\r\n case \"DDD\":\r\n value = $utils.padString($utils.getYearDay(date, this.utc).toString(), info.parts[i].length, \"0\");\r\n break;\r\n case \"D\":\r\n value = $utils.getYearDay(date, this.utc).toString();\r\n break;\r\n case \"F\":\r\n // @todo\r\n break;\r\n case \"g\":\r\n // @todo\r\n break;\r\n case \"t\":\r\n value = language.translateFunc(\"_dateOrd\").call(this, day);\r\n break;\r\n case \"E\":\r\n value = (weekday || 7).toString();\r\n break;\r\n case \"EE\":\r\n value = $utils.padString((weekday || 7).toString(), 2, \"0\");\r\n break;\r\n case \"EEE\":\r\n case \"eee\":\r\n value = language.translate(this.weekdaysShort[weekday]);\r\n break;\r\n case \"EEEE\":\r\n case \"eeee\":\r\n value = language.translate(this.weekdays[weekday]);\r\n break;\r\n case \"EEEEE\":\r\n case \"eeeee\":\r\n value = language.translate(this.weekdays[weekday]).substr(0, 1);\r\n break;\r\n case \"e\":\r\n case \"ee\":\r\n value = (weekday - this.firstDayOfWeek + 1).toString();\r\n if (info.parts[i] == \"ee\") {\r\n value = $utils.padString(value, 2, \"0\");\r\n }\r\n break;\r\n case \"a\":\r\n if (hours >= 12) {\r\n value = language.translate(\"PM\");\r\n }\r\n else {\r\n value = language.translate(\"AM\");\r\n }\r\n break;\r\n case \"aa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P.M.\");\r\n }\r\n else {\r\n value = language.translate(\"A.M.\");\r\n }\r\n break;\r\n case \"aaa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P\");\r\n }\r\n else {\r\n value = language.translate(\"A\");\r\n }\r\n break;\r\n case \"h\":\r\n value = $utils.get12Hours(hours).toString();\r\n break;\r\n case \"hh\":\r\n value = $utils.padString($utils.get12Hours(hours), 2, \"0\");\r\n break;\r\n case \"H\":\r\n value = hours.toString();\r\n break;\r\n case \"HH\":\r\n value = $utils.padString(hours, 2, \"0\");\r\n break;\r\n case \"K\":\r\n value = $utils.get12Hours(hours, 0).toString();\r\n break;\r\n case \"KK\":\r\n value = $utils.padString($utils.get12Hours(hours, 0), 2, \"0\");\r\n break;\r\n case \"k\":\r\n value = (hours + 1).toString();\r\n break;\r\n case \"kk\":\r\n value = $utils.padString(hours + 1, 2, \"0\");\r\n break;\r\n case \"m\":\r\n value = minutes.toString();\r\n break;\r\n case \"mm\":\r\n value = $utils.padString(minutes, 2, \"0\");\r\n break;\r\n case \"s\":\r\n value = seconds.toString();\r\n break;\r\n case \"ss\":\r\n value = $utils.padString(seconds, 2, \"0\");\r\n break;\r\n case \"S\":\r\n case \"SS\":\r\n case \"SSS\":\r\n value = Math.round((milliseconds / 1000) * Math.pow(10, info.parts[i].length)).toString();\r\n break;\r\n case \"x\":\r\n value = timestamp.toString();\r\n break;\r\n case \"n\":\r\n case \"nn\":\r\n case \"nnn\":\r\n value = $utils.padString(milliseconds, info.parts[i].length, \"0\");\r\n break;\r\n case \"z\":\r\n value = $utils.getTimeZone(date, false, false, this.utc);\r\n break;\r\n case \"zz\":\r\n value = $utils.getTimeZone(date, true, false, this.utc);\r\n break;\r\n case \"zzz\":\r\n value = $utils.getTimeZone(date, false, true, this.utc);\r\n break;\r\n case \"zzzz\":\r\n value = $utils.getTimeZone(date, true, true, this.utc);\r\n break;\r\n case \"Z\":\r\n case \"ZZ\":\r\n var tz = Math.abs(offset) / 60;\r\n var tzh = Math.floor(tz);\r\n var tzm = tz * 60 - tzh * 60;\r\n if (this.utc) {\r\n tzh = 0;\r\n tzm = 0;\r\n }\r\n if (info.parts[i] == \"Z\") {\r\n value = \"GMT\";\r\n value += offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + \":\" + $utils.padString(tzm, 2);\r\n }\r\n else {\r\n value = offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + $utils.padString(tzm, 2);\r\n }\r\n break;\r\n case \"i\":\r\n value = date.toISOString();\r\n break;\r\n case \"I\":\r\n value = date.toUTCString();\r\n break;\r\n }\r\n res = res.replace($strings.PLACEHOLDER, value);\r\n }\r\n return res;\r\n };\r\n /**\r\n * Parses any input value into Date object.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date/time parsing\r\n * @param source Source value\r\n * @param format Source format\r\n * @return Date object\r\n */\r\n DateFormatter.prototype.parse = function (source, format) {\r\n // Format set?\r\n if (!$type.hasValue(format)) {\r\n format = this.inputDateFormat;\r\n }\r\n // Is it already a Date\r\n if (source instanceof Date) {\r\n return source;\r\n }\r\n // Is it a numeric timestamp\r\n if (typeof source === \"number\") {\r\n return new Date(source);\r\n }\r\n // No? Let's check if it's string, and try converting to it if nec\r\n if (typeof source !== \"string\") {\r\n source = source.toString();\r\n }\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // Init return value\r\n var res;\r\n // Init RegEx for parsing\r\n var reg = \"\";\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Clip format to length of the source string\r\n format = format.substr(0, source.length);\r\n // Parse format\r\n var info = this.parseFormat(format);\r\n // Init parsed items holder\r\n var parsedIndexes = {\r\n \"year\": -1,\r\n \"year3\": -1,\r\n \"year2\": -1,\r\n \"year1\": -1,\r\n \"month\": -1,\r\n \"monthShort\": -1,\r\n \"monthLong\": -1,\r\n \"weekdayShort\": -1,\r\n \"weekdayLong\": -1,\r\n \"day\": -1,\r\n \"yearDay\": -1,\r\n \"week\": -1,\r\n \"hourBase0\": -1,\r\n \"hour12Base0\": -1,\r\n \"hourBase1\": -1,\r\n \"hour12Base1\": -1,\r\n \"minute\": -1,\r\n \"second\": -1,\r\n \"millisecond\": -1,\r\n \"millisecondDigits\": -1,\r\n \"am\": -1,\r\n \"zone\": -1,\r\n \"timestamp\": -1,\r\n \"iso\": -1\r\n };\r\n // Init values\r\n var resValues = {\r\n \"year\": 1970,\r\n \"month\": 0,\r\n \"day\": 1,\r\n \"hour\": 0,\r\n \"minute\": 0,\r\n \"second\": 0,\r\n \"millisecond\": 0,\r\n \"timestamp\": null,\r\n \"offset\": 0,\r\n \"utc\": this.utc\r\n };\r\n // Index adjuster\r\n var indexAdjust = 0, index = 0;\r\n // Iterate through all of the parts\r\n for (var i = 0; i < info.parts.length; i++) {\r\n // Set current match index\r\n index = i + indexAdjust + 1;\r\n switch (info.parts[i]) {\r\n case \"yyyy\":\r\n case \"YYYY\":\r\n reg += \"([0-9]{4})\";\r\n parsedIndexes.year = index;\r\n break;\r\n case \"yyy\":\r\n case \"YYY\":\r\n reg += \"([0-9]{3})\";\r\n parsedIndexes.year3 = index;\r\n break;\r\n case \"yy\":\r\n case \"YY\":\r\n reg += \"([0-9]{2})\";\r\n parsedIndexes.year2 = index;\r\n break;\r\n case \"y\":\r\n case \"Y\":\r\n reg += \"([0-9]{1})\";\r\n parsedIndexes.year1 = index;\r\n break;\r\n case \"MMMM\":\r\n reg += \"(\" + this.getStringList(this.months).join(\"|\") + \")\";\r\n parsedIndexes.monthLong = index;\r\n break;\r\n case \"MMM\":\r\n reg += \"(\" + this.getStringList(this.monthsShort).join(\"|\") + \")\";\r\n parsedIndexes.monthShort = index;\r\n break;\r\n case \"MM\":\r\n case \"M\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.month = index;\r\n break;\r\n case \"ww\":\r\n case \"w\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.week = index;\r\n break;\r\n case \"dd\":\r\n case \"d\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.day = index;\r\n break;\r\n case \"DDD\":\r\n case \"DD\":\r\n case \"D\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.yearDay = index;\r\n break;\r\n case \"dddd\":\r\n reg += \"(\" + this.getStringList(this.weekdays).join(\"|\") + \")\";\r\n parsedIndexes.weekdayLong = index;\r\n break;\r\n case \"ddd\":\r\n reg += \"(\" + this.getStringList(this.weekdaysShort).join(\"|\") + \")\";\r\n parsedIndexes.weekdayShort = index;\r\n break;\r\n case \"aaa\":\r\n case \"aa\":\r\n case \"a\":\r\n // TODO: fix (escape regex)\r\n reg += \"(\" + this.getStringList([\"AM\", \"PM\", \"A\\.M\\.\", \"P\\.M\\.\", \"A\", \"P\"]).join(\"|\") + \")\";\r\n parsedIndexes.am = index;\r\n break;\r\n case \"hh\":\r\n case \"h\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base1 = index;\r\n break;\r\n case \"HH\":\r\n case \"H\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase0 = index;\r\n break;\r\n case \"KK\":\r\n case \"K\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base0 = index;\r\n break;\r\n case \"kk\":\r\n case \"k\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase1 = index;\r\n break;\r\n case \"mm\":\r\n case \"m\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.minute = index;\r\n break;\r\n case \"ss\":\r\n case \"s\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.second = index;\r\n break;\r\n case \"SSS\":\r\n case \"SS\":\r\n case \"S\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n parsedIndexes.millisecondDigits = info.parts[i].length;\r\n break;\r\n case \"nnn\":\r\n case \"nn\":\r\n case \"n\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n break;\r\n case \"x\":\r\n reg += \"([0-9]{1,})\";\r\n parsedIndexes.timestamp = index;\r\n break;\r\n case \"Z\":\r\n reg += \"GMT([-+]+[0-9]{2}:[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"ZZ\":\r\n reg += \"([\\\\-+]+[0-9]{2}[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"i\":\r\n reg += \"([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)\";\r\n parsedIndexes.iso = index;\r\n indexAdjust += 7;\r\n break;\r\n case \"G\":\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n case \"MMMMM\":\r\n case \"W\":\r\n case \"EEEEE\":\r\n case \"EEEE\":\r\n case \"EEE\":\r\n case \"EE\":\r\n case \"E\":\r\n case \"eeeee\":\r\n case \"eeee\":\r\n case \"eee\":\r\n case \"ee\":\r\n case \"e\":\r\n case \"zzzz\":\r\n case \"zzz\":\r\n case \"zz\":\r\n case \"z\":\r\n case \"t\":\r\n // Ignore\r\n indexAdjust--;\r\n break;\r\n }\r\n reg += \"[^0-9]*\";\r\n }\r\n // Try matching\r\n var regex = new RegExp(reg);\r\n var matches = source.match(regex);\r\n if (matches) {\r\n // Populate the date object\r\n // Full year\r\n if (parsedIndexes.year > -1) {\r\n resValues.year = parseInt(matches[parsedIndexes.year]);\r\n }\r\n // 3-digit year\r\n if (parsedIndexes.year3 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year3]);\r\n val += 1000;\r\n resValues.year = val;\r\n }\r\n // 2-digit year\r\n if (parsedIndexes.year2 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year2]);\r\n if (val > 50) {\r\n val += 1000;\r\n }\r\n else {\r\n val += 2000;\r\n }\r\n resValues.year = val;\r\n }\r\n // 1-digit year\r\n if (parsedIndexes.year1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year1]);\r\n val = Math.floor((new Date().getFullYear()) / 10) * 10 + val;\r\n resValues.year = val;\r\n }\r\n // Full month\r\n if (parsedIndexes.monthLong > -1) {\r\n resValues.month = this.resolveMonth(matches[parsedIndexes.monthLong]);\r\n }\r\n // Short month\r\n if (parsedIndexes.monthShort > -1) {\r\n resValues.month = this.resolveShortMonth(matches[parsedIndexes.monthShort]);\r\n }\r\n // Numeric month\r\n if (parsedIndexes.month > -1) {\r\n resValues.month = parseInt(matches[parsedIndexes.month]) - 1;\r\n }\r\n // Weekday\r\n // @todo\r\n // Week\r\n if ((parsedIndexes.week > -1) && (parsedIndexes.day === -1)) {\r\n // We parse weeks ONLY if day is not explicitly set\r\n // TODO: this needs work\r\n // (but maybe later - I can hardly imagine anyone passing their dates in weeks)\r\n resValues.month = 0;\r\n resValues.day = $utils.getDayFromWeek(parseInt(matches[parsedIndexes.week]), resValues.year, 1, this.utc);\r\n }\r\n // Day\r\n if (parsedIndexes.day > -1) {\r\n resValues.day = parseInt(matches[parsedIndexes.day]);\r\n }\r\n // Year day\r\n if (parsedIndexes.yearDay > -1) {\r\n resValues.month = 0;\r\n resValues.day = parseInt(matches[parsedIndexes.yearDay]);\r\n }\r\n // 24 Hour (0-23)\r\n if (parsedIndexes.hourBase0 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase0]);\r\n }\r\n // 24 Hour (1-24)\r\n if (parsedIndexes.hourBase1 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase1]) - 1;\r\n }\r\n // 12 Hour (0-11)\r\n if (parsedIndexes.hour12Base0 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base0]);\r\n if (val == 11) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // 12 Hour (1-12)\r\n if (parsedIndexes.hour12Base1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base1]);\r\n if (val == 12) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // Minute\r\n if (parsedIndexes.minute > -1) {\r\n resValues.minute = parseInt(matches[parsedIndexes.minute]);\r\n }\r\n // Second\r\n if (parsedIndexes.second > -1) {\r\n resValues.second = parseInt(matches[parsedIndexes.second]);\r\n }\r\n // Millisecond\r\n if (parsedIndexes.millisecond > -1) {\r\n var val = parseInt(matches[parsedIndexes.millisecond]);\r\n if (parsedIndexes.millisecondDigits == 2) {\r\n val *= 10;\r\n }\r\n else if (parsedIndexes.millisecondDigits == 1) {\r\n val *= 100;\r\n }\r\n resValues.millisecond = val;\r\n }\r\n // Timestamp\r\n if (parsedIndexes.timestamp > -1) {\r\n resValues.timestamp = parseInt(matches[parsedIndexes.timestamp]);\r\n var ts = new Date(resValues.timestamp);\r\n resValues.year = ts.getUTCFullYear();\r\n resValues.month = ts.getUTCMonth();\r\n resValues.day = ts.getUTCDate();\r\n resValues.hour = ts.getUTCHours();\r\n resValues.minute = ts.getUTCMinutes();\r\n resValues.second = ts.getUTCSeconds();\r\n resValues.millisecond = ts.getUTCMilliseconds();\r\n }\r\n // Adjust time zone\r\n if (parsedIndexes.zone > -1) {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.zone]);\r\n }\r\n // ISO\r\n if (parsedIndexes.iso > -1) {\r\n resValues.year = $type.toNumber(matches[parsedIndexes.iso + 0]);\r\n resValues.month = $type.toNumber(matches[parsedIndexes.iso + 1]) - 1;\r\n resValues.day = $type.toNumber(matches[parsedIndexes.iso + 2]);\r\n resValues.hour = $type.toNumber(matches[parsedIndexes.iso + 3]);\r\n resValues.minute = $type.toNumber(matches[parsedIndexes.iso + 4]);\r\n resValues.second = $type.toNumber(matches[parsedIndexes.iso + 5]);\r\n resValues.millisecond = $type.toNumber(matches[parsedIndexes.iso + 6]);\r\n if (matches[parsedIndexes.iso + 7] == \"Z\" || matches[parsedIndexes.iso + 7] == \"z\") {\r\n resValues.utc = true;\r\n }\r\n else if (matches[parsedIndexes.iso + 7] != \"\") {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.iso + 7]);\r\n }\r\n }\r\n // Create Date object\r\n if (resValues.utc) {\r\n res = new Date(Date.UTC(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute, resValues.second, resValues.millisecond));\r\n }\r\n else {\r\n res = new Date(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute + resValues.offset, resValues.second, resValues.millisecond);\r\n }\r\n }\r\n else {\r\n // Didn't match anything\r\n // Let's try dropping it into Date constructor and hope for the best\r\n res = new Date(source);\r\n }\r\n return res;\r\n };\r\n DateFormatter.prototype.resolveTimezoneOffset = function (date, zone) {\r\n var value = zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/);\r\n if (value) {\r\n var match = $type.getValue(zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/));\r\n var dir = match[1];\r\n var hour = match[2];\r\n var minute = match[3];\r\n var offset = parseInt(hour) * 60 + parseInt(minute);\r\n // Adjust offset\r\n // Making it negative does not seem to make sense, but it's right\r\n // because of how JavaScript calculates GMT offsets\r\n if (dir == \"+\") {\r\n offset *= -1;\r\n }\r\n // Check the difference in offset\r\n var originalOffset = (date || new Date()).getTimezoneOffset();\r\n var diff = offset - originalOffset;\r\n return diff;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves month name (i.e. \"December\") into a month number (11).\r\n *\r\n * @param value Month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveMonth = function (value) {\r\n // Let's try English first\r\n var month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.months).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves short month name (i.e. \"Dec\") into a month number.\r\n *\r\n * @param value Short month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveShortMonth = function (value) {\r\n // Let's try English first\r\n var month = this.monthsShort.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Maybe long month (workaround for May)\r\n month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.monthsShort).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Checks if passed in string represents AM/PM notation in many of its\r\n * versions.\r\n *\r\n * @param value Source string\r\n * @return Is it AM/PM?\r\n */\r\n DateFormatter.prototype.isAm = function (value) {\r\n var list = this.getStringList([\"AM\", \"A.M.\", \"A\"]);\r\n return list.indexOf(value.toUpperCase()) > -1;\r\n };\r\n /**\r\n * Invalidates related [[Sprite]] causing it to redraw.\r\n */\r\n DateFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n /**\r\n * Translates list of strings.\r\n *\r\n * @param list Source strings\r\n * @return Translated strings\r\n */\r\n DateFormatter.prototype.getStringList = function (list) {\r\n var res = [];\r\n for (var i = 0; i < list.length; i++) {\r\n // translate?\r\n if (this.language) {\r\n res.push($utils.escapeForRgex(this.language.translate(list[i])));\r\n }\r\n else {\r\n res.push($utils.escapeForRgex(list[i]));\r\n }\r\n }\r\n return res;\r\n };\r\n Object.defineProperty(DateFormatter.prototype, \"dateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._dateFormat;\r\n },\r\n /**\r\n * Date format to use.\r\n *\r\n * If format is not supplied in-line in the string, this setting will be\r\n * used.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._dateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"inputDateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._inputDateFormat;\r\n },\r\n /**\r\n * Date format to use when parsing dates.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._inputDateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.DateTimeFormatOptions` syntax.\r\n *\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"utc\", {\r\n /**\r\n * @return Use UTC?\r\n */\r\n get: function () {\r\n return this._utc;\r\n },\r\n /**\r\n * Should formatter use UTC functions?\r\n *\r\n * If UTC is used, all date/time values will be independent on client's\r\n * time zone.\r\n *\r\n * @param value Use UTC?\r\n */\r\n set: function (value) {\r\n this._utc = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezoneOffset\", {\r\n /**\r\n * @return Offset (minutes)\r\n */\r\n get: function () {\r\n return this._timezoneOffset;\r\n },\r\n /**\r\n * If set, will apply specific offset in minutes before formatting the date\r\n * text.\r\n *\r\n * The value is a number of minutes from target time zone to UTC.\r\n *\r\n * E.g. `300` will recalculate Dates in \"GMT-5\" time zone.\r\n *\r\n * @param value Offset (minutes)\r\n */\r\n set: function (value) {\r\n if (this._timezoneOffset != value) {\r\n this._timezoneOffset = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezone\", {\r\n /**\r\n * @return Timezone\r\n */\r\n get: function () {\r\n return this._timezone;\r\n },\r\n /**\r\n * If set, will format date/time in specific time zone.\r\n *\r\n * The value should be named time zone, e.g.:\r\n * `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`.\r\n *\r\n * @since 4.10.1\r\n * @param value Timezone\r\n */\r\n set: function (value) {\r\n if (this._timezone != value) {\r\n this._timezone = value;\r\n this.timezoneMinutes = $time.getTimezoneMinutes(value);\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"firstDayOfWeek\", {\r\n /**\r\n * @return First day of week\r\n */\r\n get: function () {\r\n return this._firstDayOfWeek;\r\n },\r\n /**\r\n * First day of the week:\r\n *\r\n * * 0 - Sunday\r\n * * 1 - Monday\r\n * * 2 - Tuesday\r\n *\r\n * Etc.\r\n *\r\n * @param value First day of week\r\n */\r\n set: function (value) {\r\n this._firstDayOfWeek = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Output format for the formatted date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n this._outputFormat = value.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DateFormatter;\r\n}(BaseObject));\r\nexport { DateFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateFormatter\"] = DateFormatter;\r\n//# sourceMappingURL=DateFormatter.js.map","/**\r\n * Duration formatting functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * DurationFormatter class. Formats numbers as durations.\r\n *\r\n * `1000` as `16:40`\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n */\r\nvar DurationFormatter = /** @class */ (function (_super) {\r\n __extends(DurationFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DurationFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * A base unit to consider values are in.\r\n *\r\n * @default \"s\"\r\n */\r\n _this._baseUnit = \"second\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * How many milliseconds each unit represents.\r\n */\r\n _this._unitValues = {\r\n \"millisecond\": 1,\r\n \"second\": 1000,\r\n \"minute\": 60000,\r\n \"hour\": 3600000,\r\n \"day\": 86400000,\r\n \"week\": 604800000,\r\n \"month\": 2592000000,\r\n \"year\": 31536000000,\r\n };\r\n /**\r\n * Collection of aliases for units.\r\n */\r\n _this._unitAliases = {\r\n \"Y\": \"y\",\r\n \"D\": \"d\",\r\n \"H\": \"h\",\r\n \"K\": \"h\",\r\n \"k\": \"h\",\r\n \"n\": \"S\"\r\n };\r\n _this.className = \"DurationFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Formats the number according as duration.\r\n *\r\n * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n * 16 minutes and 40 seconds.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @param base Override base unit\r\n * @return Formatted number\r\n */\r\n DurationFormatter.prototype.format = function (value, format, base) {\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // no format passed in or empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n if ($type.hasValue(this.durationFormat)) {\r\n format = this.durationFormat;\r\n }\r\n else {\r\n format = this.getFormat($type.toNumber(value), null, baseUnit);\r\n }\r\n }\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, baseUnit);\r\n // cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // format and replace the number\r\n var details;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Format\r\n var formatted = this.applyFormat(source, details);\r\n // Apply color?\r\n if (details.color !== \"\") {\r\n if (this._outputFormat === \"svg\") {\r\n formatted = \"\" + formatted + \"\";\r\n }\r\n else if (this._outputFormat === \"html\") {\r\n formatted = \"\" + formatted + \"\";\r\n }\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param base Override base unit\r\n * @return Parsed information\r\n */\r\n DurationFormatter.prototype.parseFormat = function (format, base) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // Initialize duration parsing info\r\n var info = {\r\n \"positive\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"negative\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"zero\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Check for [] directives\r\n var dirs = [];\r\n dirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n if (dirs && dirs.length && dirs[0] !== \"\") {\r\n partFormat = item.source.substr(dirs[0].length);\r\n item.color = dirs[1];\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Just \"Duration\"?\r\n // if (chunk.text.toLowerCase() === \"duration\") {\r\n // \tchunk.text = durationFormat;\r\n // }\r\n // Check for \"a\" (absolute) modifier\r\n if (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n item.absolute = true;\r\n chunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n // Is it an alias?\r\n if (!$type.hasValue(matches[x])) {\r\n matches[x] = _this._unitAliases[matches[x]];\r\n }\r\n item.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n item.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by {parseFormat}\r\n * @return Formatted duration\r\n */\r\n DurationFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = !details.absolute && (value < this._negativeBase);\r\n value = Math.abs(value);\r\n // Recalculate to milliseconds\r\n var tstamp = this.toTimeStamp(value, details.baseUnit);\r\n // Init return value\r\n var res = details.template;\r\n // Iterate through duration parts\r\n for (var i = 0, len = details.parts.length; i < len; i++) {\r\n // Gather the part\r\n var part = details.parts[i];\r\n var unit = this.toTimeUnit(part.substr(0, 1));\r\n var digits = part.length;\r\n // Calculate current unit value\r\n var ints = Math.floor(tstamp / this._unitValues[unit]);\r\n res = res.replace($strings.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n // Reduce timestamp\r\n tstamp -= ints * this._unitValues[unit];\r\n }\r\n // Reapply negative sign\r\n if (negative) {\r\n res = \"-\" + res;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Converts numeric value to timestamp in milliseconds.\r\n *\r\n * @param value A source value\r\n * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n * @return Value representation as a timestamp in milliseconds\r\n */\r\n DurationFormatter.prototype.toTimeStamp = function (value, baseUnit) {\r\n return value * this._unitValues[baseUnit];\r\n };\r\n DurationFormatter.prototype.toTimeUnit = function (code) {\r\n switch (code) {\r\n case \"S\":\r\n return \"millisecond\";\r\n case \"s\":\r\n return \"second\";\r\n case \"m\":\r\n return \"minute\";\r\n case \"h\":\r\n return \"hour\";\r\n case \"d\":\r\n return \"day\";\r\n case \"w\":\r\n return \"week\";\r\n case \"M\":\r\n return \"month\";\r\n case \"y\":\r\n return \"year\";\r\n }\r\n ;\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n DurationFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"baseUnit\", {\r\n /**\r\n * @return Base unit\r\n */\r\n get: function () {\r\n return this._baseUnit;\r\n },\r\n /**\r\n * Base unit the values are in.\r\n *\r\n * A base unit will be used to recalculate the numeric value to millisecond\r\n * timestamps.\r\n *\r\n * Available options:\r\n *\r\n * * \"millisecond\"\r\n * * \"second\"\r\n * * \"minute\"\r\n * * \"hour\"\r\n * * \"day\"\r\n * * \"week\"\r\n * * \"month\"\r\n * * \"year\"\r\n *\r\n * @default \"s\"\r\n * @param baseUnit A base unit\r\n */\r\n set: function (baseUnit) {\r\n this._baseUnit = baseUnit;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * Getter for output format.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Setter for output format: \"svg\" or \"html.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns appropriate default format for the value.\r\n *\r\n * If `maxValue` is sepcified, it will use that value to determine the time\r\n * unit for the format.\r\n *\r\n * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n * will get `\"10\"`.\r\n *\r\n * However, you might want it to be formatted in the context of bigger scale,\r\n * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n * values, including small ones will use format with minutes, e.g.:\r\n * `00:10`, `00:50`, `12: 30`, etc.\r\n *\r\n * @param value Value to format\r\n * @param maxValue Maximum value to be used to determine format\r\n * @param baseUnit Base unit of the value\r\n * @return Format\r\n */\r\n DurationFormatter.prototype.getFormat = function (value, maxValue, baseUnit) {\r\n // Is format override set?\r\n if ($type.hasValue(this.durationFormat)) {\r\n return this.durationFormat;\r\n }\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n if ($type.hasValue(maxValue) && value != maxValue) {\r\n value = Math.abs(value);\r\n maxValue = Math.abs(maxValue);\r\n var maxUnit = this.getValueUnit($math.max(value, maxValue), baseUnit);\r\n //let diffUnit = this.getValueUnit(Math.abs(maxValue - value), baseUnit);\r\n //console.log(maxUnit, diffUnit);\r\n return this.durationFormats[baseUnit][maxUnit];\r\n }\r\n else {\r\n var unit = this.getValueUnit(value, baseUnit);\r\n return this.durationFormats[baseUnit][unit];\r\n }\r\n };\r\n /**\r\n * Returns value's closest denominator time unit, e.g 100 seconds is\r\n * `\"minute\"`, while 59 seconds would still be `second`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Denominator\r\n */\r\n DurationFormatter.prototype.getValueUnit = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n // Convert to milliseconds\r\n var currentUnit;\r\n var ms = this.getMilliseconds(value, baseUnit);\r\n $object.eachContinue(this._unitValues, function (key, val) {\r\n if (key == baseUnit || currentUnit) {\r\n var num = ms / val;\r\n if (num <= 1) {\r\n if (!currentUnit) {\r\n currentUnit = key;\r\n }\r\n return false;\r\n }\r\n currentUnit = key;\r\n }\r\n return true;\r\n });\r\n return currentUnit;\r\n };\r\n /**\r\n * Converts value to milliseconds according to `baseUnit`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Value in milliseconds\r\n */\r\n DurationFormatter.prototype.getMilliseconds = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n return value * this._unitValues[baseUnit];\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormat\", {\r\n /**\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._durationFormat;\r\n },\r\n /**\r\n * If set, this format will be used instead of the one determined dynamically\r\n * based on the basedUnit and range of values.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Available fomatting codes\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n if (this._durationFormat != value) {\r\n this._durationFormat = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormats\", {\r\n /**\r\n * @return Formats\r\n */\r\n get: function () {\r\n if (!this._durationFormats) {\r\n this._durationFormats = {\r\n \"millisecond\": {\r\n \"millisecond\": this.language.translate(\"_duration_millisecond\"),\r\n \"second\": this.language.translate(\"_duration_millisecond_second\"),\r\n \"minute\": this.language.translate(\"_duration_millisecond_minute\"),\r\n \"hour\": this.language.translate(\"_duration_millisecond_hour\"),\r\n \"day\": this.language.translate(\"_duration_millisecond_day\"),\r\n \"week\": this.language.translate(\"_duration_millisecond_week\"),\r\n \"month\": this.language.translate(\"_duration_millisecond_month\"),\r\n \"year\": this.language.translate(\"_duration_millisecond_year\")\r\n },\r\n \"second\": {\r\n \"second\": this.language.translate(\"_duration_second\"),\r\n \"minute\": this.language.translate(\"_duration_second_minute\"),\r\n \"hour\": this.language.translate(\"_duration_second_hour\"),\r\n \"day\": this.language.translate(\"_duration_second_day\"),\r\n \"week\": this.language.translate(\"_duration_second_week\"),\r\n \"month\": this.language.translate(\"_duration_second_month\"),\r\n \"year\": this.language.translate(\"_duration_second_year\")\r\n },\r\n \"minute\": {\r\n \"minute\": this.language.translate(\"_duration_minute\"),\r\n \"hour\": this.language.translate(\"_duration_minute_hour\"),\r\n \"day\": this.language.translate(\"_duration_minute_day\"),\r\n \"week\": this.language.translate(\"_duration_minute_week\"),\r\n \"month\": this.language.translate(\"_duration_minute_month\"),\r\n \"year\": this.language.translate(\"_duration_minute_year\")\r\n },\r\n \"hour\": {\r\n \"hour\": this.language.translate(\"_duration_hour\"),\r\n \"day\": this.language.translate(\"_duration_hour_day\"),\r\n \"week\": this.language.translate(\"_duration_hour_week\"),\r\n \"month\": this.language.translate(\"_duration_hour_month\"),\r\n \"year\": this.language.translate(\"_duration_hour_year\")\r\n },\r\n \"day\": {\r\n \"day\": this.language.translate(\"_duration_day\"),\r\n \"week\": this.language.translate(\"_duration_day_week\"),\r\n \"month\": this.language.translate(\"_duration_day_month\"),\r\n \"year\": this.language.translate(\"_duration_day_year\")\r\n },\r\n \"week\": {\r\n \"week\": this.language.translate(\"_duration_week\"),\r\n \"month\": this.language.translate(\"_duration_week_month\"),\r\n \"year\": this.language.translate(\"_duration_week_year\")\r\n },\r\n \"month\": {\r\n \"month\": this.language.translate(\"_duration_month\"),\r\n \"year\": this.language.translate(\"_duration_month_year\")\r\n },\r\n \"year\": {\r\n \"year\": this.language.translate(\"_duration_year\")\r\n }\r\n };\r\n }\r\n return this._durationFormats;\r\n },\r\n /**\r\n * Duration formats for various combination of base units.\r\n *\r\n * @param value Formats\r\n */\r\n set: function (value) {\r\n this._durationFormats = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DurationFormatter;\r\n}(BaseObject));\r\nexport { DurationFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DurationFormatter\"] = DurationFormatter;\r\n//# sourceMappingURL=DurationFormatter.js.map","/**\r\n * Number formatting-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * NumberFormatter class. Formats numbers according to specified formats.\r\n *\r\n * @todo Apply translations to suffixes/prefixes\r\n */\r\nvar NumberFormatter = /** @class */ (function (_super) {\r\n __extends(NumberFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function NumberFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * Holds number format.\r\n *\r\n * @default #,###.#####\r\n */\r\n _this._numberFormat = \"#,###.#####\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n */\r\n _this._smallNumberThreshold = 1.00;\r\n _this._forceLTR = false;\r\n _this.className = \"NumberFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n NumberFormatter.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.language) {\r\n this.language.dispose();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n if (this.sprite) {\r\n this._language = this.sprite.language;\r\n }\r\n else {\r\n this._language = new Language;\r\n }\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] instance.\r\n *\r\n * Formatter will use language to translate various items, like number\r\n * suffixes, etc.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the number according to specific format.\r\n *\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.format = function (value, format, precision) {\r\n // no format passed in or \"Number\"\r\n if (typeof format === \"undefined\" || ($type.isString(format) && format.toLowerCase() === \"number\")) {\r\n format = this._numberFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // Is it a built-in format or Intl.NumberFormatOptions\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.NumberFormat(this.intlLocales, format).format(source);\r\n }\r\n else {\r\n return new Intl.NumberFormat(undefined, format).format(source);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, this.language);\r\n // format and replace the number\r\n var details = void 0;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Adjust precision\r\n if ($type.hasValue(precision) && !details.mod) {\r\n details = $object.clone(details);\r\n details.decimals.active = source == 0 ? 0 : precision;\r\n }\r\n // Format\r\n formatted = details.template.split($strings.PLACEHOLDER).join(this.applyFormat(source, details));\r\n }\r\n if (this.forceLTR) {\r\n formatted = \"‎\" + formatted;\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param language Language\r\n */\r\n NumberFormatter.prototype.parseFormat = function (format, language) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // init format parse info holder\r\n var info = {\r\n \"positive\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"negative\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"zero\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Just \"Number\"?\r\n if (partFormat.toLowerCase() === \"number\") {\r\n partFormat = $type.isString(_this._numberFormat) ? _this._numberFormat : \"#,###.#####\";\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Parse format\r\n // Look for codes\r\n var matches = chunk.text.match(/[#0.,]+[ ]?[abespABESP%!]?[abespABESP‰!]?/);\r\n if (matches) {\r\n if (matches === null || matches[0] === \"\") {\r\n // no codes here - assume string\r\n // nothing to do here\r\n item.template += chunk.text;\r\n }\r\n else {\r\n // look for the format modifiers at the end\r\n var mods = matches[0].match(/[abespABESP%‰!]{2}|[abespABESP%‰]{1}$/);\r\n if (mods) {\r\n item.mod = mods[0].toLowerCase();\r\n item.modSpacing = matches[0].match(/[ ]{1}[abespABESP%‰!]{1}$/) ? true : false;\r\n }\r\n // break the format up\r\n var a = matches[0].split(\".\");\r\n // Deal with thousands\r\n if (a[0] === \"\") {\r\n // No directives for thousands\r\n // Leave default settings (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.thousands.active = (a[0].match(/0/g) || []).length;\r\n item.thousands.passive = (a[0].match(/\\#/g) || []).length + item.thousands.active;\r\n // Separator interval\r\n var b = a[0].split(\",\");\r\n if (b.length === 1) {\r\n // No thousands separators\r\n // Do nothing\r\n }\r\n else {\r\n // Use length fo the last chunk as thousands length\r\n item.thousands.interval = $type.getValue(b.pop()).length;\r\n if (item.thousands.interval === 0) {\r\n item.thousands.interval = -1;\r\n }\r\n }\r\n }\r\n // Deal with decimals\r\n if (typeof (a[1]) === \"undefined\") {\r\n // No directives for decimals\r\n // Leave at defaults (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.decimals.active = (a[1].match(/0/g) || []).length;\r\n item.decimals.passive = (a[1].match(/\\#/g) || []).length + item.decimals.active;\r\n }\r\n // Add special code to template\r\n item.template += chunk.text.split(matches[0]).join($strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n else {\r\n // Quoted string - take it as it is\r\n item.template += chunk.text;\r\n }\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by parseFormat()\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // Recalculate according to modifier\r\n var prefix = \"\", suffix = \"\";\r\n var mods = details.mod ? details.mod.split(\"\") : [];\r\n if (mods.indexOf(\"b\") !== -1) {\r\n var a_1 = this.applyPrefix(value, this.bytePrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_1[0];\r\n prefix = a_1[1];\r\n suffix = a_1[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"a\") !== -1) {\r\n var a_2 = this.applyPrefix(value, value < this.smallNumberThreshold ? this.smallNumberPrefixes : this.bigNumberPrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_2[0];\r\n prefix = a_2[1];\r\n suffix = a_2[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"p\") !== -1) {\r\n var ol = Math.min(value.toString().length + 2, 21);\r\n //value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n prefix = this.language.translate(\"_percentPrefix\") || \"\";\r\n suffix = this.language.translate(\"_percentSuffix\") || \"\";\r\n if (prefix == \"\" && suffix == \"\") {\r\n suffix = \"%\";\r\n }\r\n }\r\n else if (mods.indexOf(\"%\") !== -1) {\r\n var ol = $math.min(value.toString().length + 2, 21);\r\n value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"%\";\r\n }\r\n else if (mods.indexOf(\"‰\") !== -1) {\r\n var ol = $math.min(value.toString().length + 3, 21);\r\n value *= 1000;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"‰\";\r\n }\r\n // Round to passive\r\n if (mods.indexOf(\"e\") !== -1) {\r\n // convert the value to exponential\r\n var exp = void 0;\r\n if (details.decimals.passive >= 0) {\r\n exp = value.toExponential(details.decimals.passive).split(\"e\");\r\n }\r\n else {\r\n exp = value.toExponential().split(\"e\");\r\n }\r\n value = Number(exp[0]);\r\n suffix = \"e\" + exp[1];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (details.decimals.passive === 0) {\r\n value = Math.round(value);\r\n }\r\n else if (details.decimals.passive > 0) {\r\n var d = Math.pow(10, details.decimals.passive);\r\n value = Math.round(value * d) / d;\r\n }\r\n // Init return value\r\n var res = \"\";\r\n // Calc integer and decimal parts\r\n var a = $utils.numberToString(value).split(\".\");\r\n // Format integers\r\n var ints = a[0];\r\n // Pad integers to active length\r\n if (ints.length < details.thousands.active) {\r\n ints = Array(details.thousands.active - ints.length + 1).join(\"0\") + ints;\r\n }\r\n // Insert thousands separators\r\n if (details.thousands.interval > 0) {\r\n var ip = [];\r\n var intsr = ints.split(\"\").reverse().join(\"\");\r\n for (var i = 0, len = ints.length; i <= len; i += details.thousands.interval) {\r\n var c = intsr.substr(i, details.thousands.interval).split(\"\").reverse().join(\"\");\r\n if (c !== \"\") {\r\n ip.unshift(c);\r\n }\r\n }\r\n ints = ip.join(details.thousands.separator);\r\n }\r\n // Add integers\r\n res += ints;\r\n // Add decimals\r\n if (a.length === 1) {\r\n a.push(\"\");\r\n }\r\n var decs = a[1];\r\n // Fill zeros?\r\n if (decs.length < details.decimals.active) {\r\n decs += Array(details.decimals.active - decs.length + 1).join(\"0\");\r\n }\r\n if (decs !== \"\") {\r\n res += details.decimals.separator + decs;\r\n }\r\n // Can't have empty return value\r\n if (res === \"\") {\r\n res = \"0\";\r\n }\r\n // Add minus sign back\r\n if (value !== 0 && negative && (mods.indexOf(\"s\") === -1)) {\r\n res = \"-\" + res;\r\n }\r\n // Add suffixes/prefixes\r\n if (prefix) {\r\n res = prefix + res;\r\n }\r\n if (suffix) {\r\n res += suffix;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Chooses appropriate prefix and suffix based on the passed in rules.\r\n *\r\n * @param value Value\r\n * @param prefixes Prefix array\r\n * @param force Force application of a first prefix (@sice 4.5.4)\r\n * @return Result\r\n */\r\n NumberFormatter.prototype.applyPrefix = function (value, prefixes, force) {\r\n if (force === void 0) { force = false; }\r\n var newvalue = value;\r\n var prefix = \"\";\r\n var suffix = \"\";\r\n var applied = false;\r\n var k = 1;\r\n for (var i = 0, len = prefixes.length; i < len; i++) {\r\n if (prefixes[i].number <= value) {\r\n if (prefixes[i].number === 0) {\r\n newvalue = 0;\r\n }\r\n else {\r\n newvalue = value / prefixes[i].number;\r\n k = prefixes[i].number;\r\n }\r\n prefix = prefixes[i].prefix;\r\n suffix = prefixes[i].suffix;\r\n applied = true;\r\n }\r\n }\r\n if (!applied && force && prefixes.length && value != 0) {\r\n // Prefix was not applied. Use the first prefix.\r\n newvalue = value / prefixes[0].number;\r\n prefix = prefixes[0].prefix;\r\n suffix = prefixes[0].suffix;\r\n applied = true;\r\n }\r\n if (applied) {\r\n newvalue = parseFloat(newvalue.toPrecision($math.min(k.toString().length + Math.floor(newvalue).toString().replace(/[^0-9]*/g, \"\").length, 21)));\r\n }\r\n return [newvalue, prefix, suffix];\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n NumberFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"numberFormat\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._numberFormat;\r\n },\r\n /**\r\n * Number format.\r\n *\r\n * @default \"#,###.#####\"\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (format) {\r\n this._numberFormat = format;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.NumberFormatOptions` syntax.\r\n *\r\n * @see (@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) about using Intl for number formatting\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"negativeBase\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._negativeBase;\r\n },\r\n /**\r\n * Negative base for negative numbers.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (value) {\r\n this._negativeBase = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bigNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for big numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bigNumberPrefixes)) {\r\n this._bigNumberPrefixes = [\r\n { \"number\": 1e+3, \"suffix\": this.language.translate(\"_big_number_suffix_3\") },\r\n { \"number\": 1e+6, \"suffix\": this.language.translate(\"_big_number_suffix_6\") },\r\n { \"number\": 1e+9, \"suffix\": this.language.translate(\"_big_number_suffix_9\") },\r\n { \"number\": 1e+12, \"suffix\": this.language.translate(\"_big_number_suffix_12\") },\r\n { \"number\": 1e+15, \"suffix\": this.language.translate(\"_big_number_suffix_15\") },\r\n { \"number\": 1e+18, \"suffix\": this.language.translate(\"_big_number_suffix_18\") },\r\n { \"number\": 1e+21, \"suffix\": this.language.translate(\"_big_number_suffix_21\") },\r\n { \"number\": 1e+24, \"suffix\": this.language.translate(\"_big_number_suffix_24\") }\r\n ];\r\n }\r\n return this._bigNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e+3, \"suffix\": \"K\" },\r\n * { \"number\": 1e+6, \"suffix\": \"M\" },\r\n * { \"number\": 1e+9, \"suffix\": \"G\" },\r\n * { \"number\": 1e+12, \"suffix\": \"T\" },\r\n * { \"number\": 1e+15, \"suffix\": \"P\" },\r\n * { \"number\": 1e+18, \"suffix\": \"E\" },\r\n * { \"number\": 1e+21, \"suffix\": \"Z\" },\r\n * { \"number\": 1e+24, \"suffix\": \"Y\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is bigger than the `number` ir will be converted to the\r\n * appropriate bigger number with prefix.\r\n *\r\n * E.g. as per above `1500` will be converted to `1.5K`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for big numbers\r\n */\r\n set: function (prefixes) {\r\n this._bigNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for small numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._smallNumberPrefixes)) {\r\n this._smallNumberPrefixes = [\r\n { \"number\": 1e-24, \"suffix\": this.language.translate(\"_small_number_suffix_24\") },\r\n { \"number\": 1e-21, \"suffix\": this.language.translate(\"_small_number_suffix_21\") },\r\n { \"number\": 1e-18, \"suffix\": this.language.translate(\"_small_number_suffix_18\") },\r\n { \"number\": 1e-15, \"suffix\": this.language.translate(\"_small_number_suffix_15\") },\r\n { \"number\": 1e-12, \"suffix\": this.language.translate(\"_small_number_suffix_12\") },\r\n { \"number\": 1e-9, \"suffix\": this.language.translate(\"_small_number_suffix_9\") },\r\n { \"number\": 1e-6, \"suffix\": this.language.translate(\"_small_number_suffix_6\") },\r\n { \"number\": 1e-3, \"suffix\": this.language.translate(\"_small_number_suffix_3\") }\r\n ];\r\n }\r\n return this._smallNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e-24, \"suffix\": \"y\" },\r\n * { \"number\": 1e-21, \"suffix\": \"z\" },\r\n * { \"number\": 1e-18, \"suffix\": \"a\" },\r\n * { \"number\": 1e-15, \"suffix\": \"f\" },\r\n * { \"number\": 1e-12, \"suffix\": \"p\" },\r\n * { \"number\": 1e-9, \"suffix\": \"n\" },\r\n * { \"number\": 1e-6, \"suffix\": \"μ\" },\r\n * { \"number\": 1e-3, \"suffix\": \"m\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is smaller than the `number` ir will be converted to the\r\n * appropriate smaller number with prefix.\r\n *\r\n * E.g. as per above `0.0015` will be converted to `1.5m`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * IMPORTANT: The order of the suffixes is important. The list must start\r\n * from the smallest number and work towards bigger ones.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for small numbers\r\n */\r\n set: function (prefixes) {\r\n this._smallNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberThreshold\", {\r\n /**\r\n * @return Small number threshold\r\n */\r\n get: function () {\r\n return this._smallNumberThreshold;\r\n },\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n *\r\n * @since 4.6.8\r\n * @param value Small number threshold\r\n */\r\n set: function (value) {\r\n this._smallNumberThreshold = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bytePrefixes\", {\r\n /**\r\n * @return Prefixes for byte-size formatting\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bytePrefixes)) {\r\n this._bytePrefixes = [\r\n { \"number\": 1, suffix: this.language.translate(\"_byte_suffix_B\") },\r\n { \"number\": 1024, suffix: this.language.translate(\"_byte_suffix_KB\") },\r\n { \"number\": 1048576, suffix: this.language.translate(\"_byte_suffix_MB\") },\r\n { \"number\": 1073741824, suffix: this.language.translate(\"_byte_suffix_GB\") },\r\n { \"number\": 1099511627776, suffix: this.language.translate(\"_byte_suffix_TB\") },\r\n { \"number\": 1125899906842624, suffix: this.language.translate(\"_byte_suffix_PB\") }\r\n ];\r\n }\r\n return this._bytePrefixes;\r\n },\r\n /**\r\n * Basically the same as `bigNumberPrefixes`, except base for calculation\r\n * is not thousand but byte (1024).\r\n *\r\n * The modifier is \"b\".\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00b\")}\r\n * ```\r\n *\r\n * The above `2048` will change to `2K`.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for byte-size formatting\r\n */\r\n set: function (prefixes) {\r\n this._bytePrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Ooutput format: \"svg\" or \"html\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"forceLTR\", {\r\n get: function () {\r\n return this._forceLTR;\r\n },\r\n set: function (value) {\r\n this._forceLTR = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n NumberFormatter.prototype.escape = function (text) {\r\n return text.replace(\"||\", $strings.PLACEHOLDER2);\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n NumberFormatter.prototype.unescape = function (text) {\r\n return text.replace($strings.PLACEHOLDER2, \"|\");\r\n };\r\n return NumberFormatter;\r\n}(BaseObject));\r\nexport { NumberFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NumberFormatter\"] = NumberFormatter;\r\n//# sourceMappingURL=NumberFormatter.js.map","/**\r\n * Handles formatting of pseudo-markup in text.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { AMElement } from \"../rendering/AMElement\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Handles formatting of pseudo-markdown in text.\r\n *\r\n * @todo Encode < > in output\r\n * @todo Add more adapters\r\n * @important\r\n */\r\nvar TextFormatter = /** @class */ (function (_super) {\r\n __extends(TextFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function TextFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n _this.className = \"TextFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n TextFormatter.prototype.debug = function () { };\r\n /**\r\n * Formats the text according to specifications passed in.\r\n *\r\n * @param text Text to format\r\n * @param output Output format (svg, html)\r\n * @return Formatted text\r\n */\r\n TextFormatter.prototype.format = function (text, output) {\r\n // Apply default\r\n if (!$type.hasValue(output)) {\r\n output = \"svg\";\r\n }\r\n // Init return value\r\n var formatted = \"\";\r\n // Replace double (escaped) square spaces with remporary codes\r\n text = this.escape(text);\r\n // Divvy up the string by style tags\r\n var styles = text.match(/\\[([^\\]]*?)\\]/gm);\r\n if (!styles) {\r\n // Nothing to do here - no formatting elements\r\n return this.wrap(text, \"\", output);\r\n }\r\n // Get pure text - no style tags\r\n var texts = text.split(/\\[[^\\[\\]]*\\]/);\r\n // Go through each of the texts and wrap it in style tags\r\n for (var i = 0, len = texts.length; i < len; i++) {\r\n // Get text bit\r\n var t = texts[i];\r\n // Check if string is empty\r\n if (t === \"\") {\r\n continue;\r\n }\r\n // Run through an adapter\r\n t = this.adapter.apply(\"chunk\", t);\r\n // Get related style\r\n var s = \"\";\r\n if (i > 0) {\r\n s = styles[i - 1].replace('[', '').replace(']', '');\r\n }\r\n // Wrap text in tag\r\n formatted += this.wrap(t, s, output);\r\n }\r\n // Replace placeholders back\r\n formatted = this.unescape(formatted);\r\n // Return result\r\n return this.cleanUp(formatted);\r\n };\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n TextFormatter.prototype.escape = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, registry.getPlaceholder(\"1\")).\r\n replace(/([^\\/\\]]{1})\\]\\]/g, \"$1\" + registry.getPlaceholder(\"2\")).\r\n replace(/\\]\\]/g, registry.getPlaceholder(\"2\")).\r\n replace(/\\{\\{/g, registry.getPlaceholder(\"3\")).\r\n replace(/\\}\\}/g, registry.getPlaceholder(\"4\")).\r\n replace(/\\'\\'/g, registry.getPlaceholder(\"5\"));\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n TextFormatter.prototype.unescape = function (text) {\r\n return text.\r\n replace(new RegExp(registry.getPlaceholder(\"1\"), \"g\"), \"[[\").\r\n replace(new RegExp(registry.getPlaceholder(\"2\"), \"g\"), \"]]\").\r\n replace(new RegExp(registry.getPlaceholder(\"3\"), \"g\"), \"{{\").\r\n replace(new RegExp(registry.getPlaceholder(\"4\"), \"g\"), \"}}\").\r\n replace(new RegExp(registry.getPlaceholder(\"5\"), \"g\"), \"''\");\r\n };\r\n /**\r\n * Cleans up the text text for leftover double square brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Cleaned up text\r\n */\r\n TextFormatter.prototype.cleanUp = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, \"[\").\r\n replace(/\\]\\]/g, \"]\").\r\n replace(/\\{\\{/g, \"{\").\r\n replace(/\\}\\}/g, \"}\").\r\n replace(/\\'\\'/g, \"'\");\r\n };\r\n /**\r\n * Wraps text into corresponding tags.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Styles\r\n * @param output Format to output in (svg, html)\r\n * @return Formatted string\r\n */\r\n TextFormatter.prototype.wrap = function (text, style, output) {\r\n if (style === \"\" || style === \"/\") {\r\n //return text;\r\n style = \"\";\r\n }\r\n switch (output) {\r\n case \"html\":\r\n return this.wrapHtml(text, this.translateStyleShortcuts(style));\r\n default:\r\n return this.wrapSvg(text, this.translateStyleShortcuts(style));\r\n }\r\n };\r\n /**\r\n * Wraps text in styled SVG tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n */\r\n TextFormatter.prototype.wrapSvg = function (text, style) {\r\n if (style === \"\") {\r\n return \"\" + text + \"\";\r\n }\r\n else {\r\n return \"\" + text + \"\";\r\n }\r\n };\r\n /**\r\n * Returns an SVG `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text\r\n * @param style Style\r\n * @return Element\r\n */\r\n TextFormatter.prototype.getSvgElement = function (text, style) {\r\n var element = new AMElement(\"tspan\");\r\n element.textContent = text;\r\n if (style) {\r\n element.node.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Wraps text in HTML tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n * @todo Translate SVG styles into HTML ones\r\n */\r\n TextFormatter.prototype.wrapHtml = function (text, style) {\r\n if (style === \"\") {\r\n return \"\" + text + \"\";\r\n }\r\n else {\r\n return \"\" + text + \"\";\r\n }\r\n };\r\n /**\r\n * Returns an HTML `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text/HTML\r\n * @param style Style definition\r\n * @return HTML element\r\n */\r\n TextFormatter.prototype.getHtmlElement = function (text, style) {\r\n var element = document.createElement(\"span\");\r\n element.innerHTML = text;\r\n if (style) {\r\n element.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Trabslates SVG CSS into HTML CSS.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style SVG CSS\r\n * @return HTML CSS\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.styleSvgToHtml = function (style) {\r\n style = style.replace(/fill:/, \"color:\");\r\n return style;\r\n };\r\n /**\r\n * Translates style shortcuts into full styles, i.e.:\r\n * \"bold\" => \"font-weight: bold\"\r\n * \"#f00\" => \"fill: #f00\"\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Untranslated style\r\n * @return Translated style\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.translateStyleShortcuts = function (style) {\r\n if (style == \"\" || style == \"[ ]\") {\r\n return \"\";\r\n }\r\n var cached = registry.getCache(\"translateStyleShortcuts_\" + style);\r\n if (cached) {\r\n return cached;\r\n }\r\n // Pre-process quoted text\r\n var q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\r\n if (q) {\r\n for (var i = 0; i < q.length; i++) {\r\n style = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\r\n }\r\n }\r\n // Get style parts\r\n var b = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\r\n // Empty?\r\n if (!b) {\r\n return style;\r\n }\r\n // Check each part\r\n for (var i = 0; i < b.length; i++) {\r\n if (b[i].match(/^bold$/i)) {\r\n // Bold\r\n b[i] = \"font-weight:\" + b[i];\r\n }\r\n else if (b[i] == \"/\") {\r\n // Just closing tag\r\n // Do nothing\r\n b[i] = \"\";\r\n }\r\n else if (!b[i].match(/:/)) {\r\n // Color\r\n b[i] = \"fill:\" + b[i];\r\n }\r\n else {\r\n b[i] = b[i].replace(/\\+/g, \" \");\r\n }\r\n }\r\n var res = b.join(';');\r\n registry.setCache(\"translateStyleShortcuts_\" + style, res);\r\n return res;\r\n };\r\n /**\r\n * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\r\n *\r\n * If the second parameter `quotedBlocks` is set to `true` this method will\r\n * also single out text blocks enclosed within single quotes that no\r\n * formatting should be applied to, and they should be displayed as is.\r\n *\r\n * Default for the above is `false`, so that you can use single quote in text\r\n * without escaping it.\r\n *\r\n * If enabled, single quotes can be escaped by doubling it - adding two\r\n * single quotes, which will be replaced by a one single quote in the final\r\n * output.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to chunk\r\n * @param quotedBlocks Use quoted blocks\r\n * @param noFormatting Formatting blocks will be treated as regular text\r\n * @return Array of string chunks\r\n */\r\n TextFormatter.prototype.chunk = function (text, quotedBlocks, noFormatting) {\r\n if (quotedBlocks === void 0) { quotedBlocks = false; }\r\n if (noFormatting === void 0) { noFormatting = false; }\r\n // Init result\r\n var res = [];\r\n // Replace double (escaped) square spaces and quotes with temporary codes\r\n text = this.escape(text);\r\n // Deal with style blocks\r\n var chunks = quotedBlocks ? text.split(\"'\") : [text];\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // Empty?\r\n if (chunk === \"\") {\r\n continue;\r\n }\r\n if ((i % 2) === 0) {\r\n // Text outside quotes\r\n // Parse for style blocks which are \"text\" chunks, the rest chunks are\r\n // \"value\"\r\n chunk = chunk.replace(/\\]\\[/g, \"]\" + $strings.PLACEHOLDER + \"[\");\r\n chunk = chunk.replace(/\\[\\]/g, \"[ ]\");\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Placeholder?\r\n if (chunk2 === $strings.PLACEHOLDER) {\r\n continue;\r\n }\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or value\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"value\",\r\n \"text\": this.adapter.apply(\"chunk\", chunk2)\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": noFormatting ? \"value\" : \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n // A text within doublequotes\r\n // All chunks are \"text\"\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or text\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"text\",\r\n \"text\": chunk2\r\n });\r\n }\r\n else if (this.isImage(chunk2)) {\r\n res.push({\r\n \"type\": \"image\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if supplied format contains image information and should be\r\n * formatted as such.\r\n * I.e.: `[img: myImage.png]`\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Format\r\n * @return `true` if it is an image\r\n */\r\n TextFormatter.prototype.isImage = function (text) {\r\n return text.match(/img[ ]?:/) ? true : false;\r\n };\r\n return TextFormatter;\r\n}(BaseObject));\r\nexport { TextFormatter };\r\nvar formatter;\r\n/**\r\n * Returns the global instance of [[TextFormatter]].\r\n *\r\n * All classes and instances should reuse this universal text formatter,\r\n * rather than create their own instance of it.\r\n */\r\nexport function getTextFormatter() {\r\n if (formatter == null) {\r\n formatter = new TextFormatter();\r\n }\r\n return formatter;\r\n}\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextFormatter\"] = TextFormatter;\r\n//# sourceMappingURL=TextFormatter.js.map","/**\r\n * Functionality related to inertia\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * A point of inertia is to simulate gradually drecreasing motion even after\r\n * actual interaction by user, that caused it, has already ended.\r\n *\r\n * [[Inertia]] object will continue triggering the same [[Sprite]] handlers\r\n * as if the interaction was still happening, gradually reducing\r\n * shift/angle/scale values until full stop.\r\n *\r\n * Basically, from the target element's point of view, while inertia is\r\n * playing, it is still being interacted with by user, albeit with a\r\n * decreasing speed.\r\n */\r\nvar Inertia = /** @class */ (function (_super) {\r\n __extends(Inertia, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Inertia(interaction, type, point, startPoint) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of animations currently playing.\r\n */\r\n _this.animations = [];\r\n _this.className = \"Inertia\";\r\n _this.interaction = interaction;\r\n _this.type = type;\r\n _this.point = point;\r\n _this.startPoint = startPoint;\r\n // Make animations disposable\r\n _this._disposers.push(new AnimationDisposer(_this.animations));\r\n return _this;\r\n }\r\n Object.defineProperty(Inertia.prototype, \"x\", {\r\n /**\r\n * Returns current X coordinate.\r\n *\r\n * @return X\r\n */\r\n get: function () {\r\n return this.point.x;\r\n },\r\n /**\r\n * Sets current X coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.x = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Inertia.prototype, \"y\", {\r\n /**\r\n * Returns current Y coordinate.\r\n *\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.point.y;\r\n },\r\n /**\r\n * Sets current Y coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.y = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Simulates dragging of element.\r\n */\r\n Inertia.prototype.handleMove = function () {\r\n // Prepare {InteractionEvent} object\r\n if (this.interaction.events.isEnabled(\"drag\")) {\r\n var imev = {\r\n type: \"drag\",\r\n target: this.interaction,\r\n shift: {\r\n x: this.x - this.startPoint.x,\r\n y: this.y - this.startPoint.y\r\n },\r\n startPoint: this.startPoint,\r\n point: {\r\n x: this.x,\r\n y: this.y\r\n },\r\n touch: false\r\n };\r\n // Call handler\r\n this.interaction.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n };\r\n /**\r\n * Finishes up the inertia animation. (removes reference to this animation\r\n * object)\r\n */\r\n Inertia.prototype.done = function () {\r\n // Remove inertia animation from the object\r\n this.interaction.inertias.removeKey(this.type);\r\n // Move ended\r\n if (this.type === \"move\") {\r\n getInteraction().processDragStop(this.interaction);\r\n }\r\n // Destroy\r\n this.dispose();\r\n };\r\n return Inertia;\r\n}(BaseObject));\r\nexport { Inertia };\r\n//# sourceMappingURL=Inertia.js.map","/**\r\n * Interaction manages all aspects of user interaction - mouse move,\r\n * click, hover, drag events, touch gestures.\r\n *\r\n * [[InteractionObject]] elements that want to use certain events, must attach event\r\n * listeners to Interaction instance.\r\n *\r\n * Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n * those elements to handle interaction information received via event triggers.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InteractionObject } from \"./InteractionObject\";\r\nimport { InteractionKeyboardObject } from \"./InteractionKeyboardObject\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { Inertia } from \"./Inertia\";\r\nimport { addEventListener } from \"../utils/DOM\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { system } from \"./../System\";\r\nimport { options } from \"./../Options\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n* Interaction manages all aspects of user interaction - mouse move,\r\n* click, hover, drag events, touch gestures.\r\n*\r\n* [[InteractionObject]] elements that want to use certain events, must attach event\r\n* listeners to Interaction instance.\r\n*\r\n* Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n* those elements to handle interaction information received via event triggers.\r\n*\r\n* @see {@link IInteractionEvents} for a list of available events\r\n*/\r\nvar Interaction = /** @class */ (function (_super) {\r\n __extends(Interaction, _super);\r\n /**\r\n * Constructor. Sets up universal document-wide move events to handle stuff\r\n * outside particular chart container.\r\n */\r\n function Interaction() {\r\n var _this = \r\n // Call super\r\n _super.call(this) || this;\r\n /**\r\n * An indicator of global events were already initialized.\r\n */\r\n _this._globalEventsAdded = false;\r\n /**\r\n * Holds which mouse event listeners to use.\r\n */\r\n _this._pointerEvents = {\r\n \"pointerdown\": \"mousedown\",\r\n \"pointerup\": \"mouseup\",\r\n \"pointermove\": \"mousemove\",\r\n \"pointercancel\": \"mouseup\",\r\n \"pointerover\": \"mouseover\",\r\n \"pointerout\": \"mouseout\",\r\n \"wheel\": \"wheel\"\r\n };\r\n /**\r\n * Indicates if Interaction should use only \"pointer\" type events, like\r\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n * events, like \"touchmove\".\r\n */\r\n _this._usePointerEventsOnly = false;\r\n /**\r\n * Use only touch events (for touch only devices such as tablets and phones)\r\n */\r\n _this._useTouchEventsOnly = false;\r\n /**\r\n * Add special hover events. Normally, touch device tap will also simulate\r\n * hover event. On some devices (ahem iOS) we want to prevent that so that\r\n * over/out events are not duplicated.\r\n */\r\n _this._addHoverEvents = true;\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n _this._passiveSupported = false;\r\n /**\r\n * Holds list of delayed events\r\n */\r\n _this._delayedEvents = { out: [] };\r\n /**\r\n * List of objects that current have a pointer hovered over them.\r\n */\r\n _this.overObjects = new List();\r\n /**\r\n * List of objects that currently has a pressed pointer.\r\n */\r\n _this.downObjects = new List();\r\n /**\r\n * List of objects that need mouse position to be reported to them.\r\n */\r\n _this.trackedObjects = new List();\r\n /**\r\n * List of objects that are currently being dragged.\r\n */\r\n _this.transformedObjects = new List();\r\n /**\r\n * Holds all known pointers.\r\n */\r\n _this.pointers = new Dictionary();\r\n /**\r\n * Inertia options that need to be applied to after element drag, if it's\r\n * `inert = true`.\r\n *\r\n * This is just a default, which can and probably will be overridden by\r\n * actual elements.\r\n */\r\n _this.inertiaOptions = new Dictionary();\r\n /**\r\n * Default options for click events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hitOptions = {\r\n \"doubleHitTime\": 300,\r\n //\"delayFirstHit\": false,\r\n \"hitTolerance\": 10,\r\n \"noFocus\": true\r\n };\r\n /**\r\n * Default options for hover events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hoverOptions = {\r\n \"touchOutBehavior\": \"leave\",\r\n \"touchOutDelay\": 1000\r\n };\r\n /**\r\n * Default options for detecting a swipe gesture. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.swipeOptions = {\r\n \"time\": 500,\r\n \"verticalThreshold\": 75,\r\n \"horizontalThreshold\": 30\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.keyboardOptions = {\r\n \"speed\": 0.1,\r\n \"accelleration\": 1.2,\r\n \"accellerationDelay\": 2000\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @since 4.5.14\r\n */\r\n _this.mouseOptions = {\r\n \"sensitivity\": 1\r\n };\r\n // Set class name\r\n _this.className = \"Interaction\";\r\n // Create InteractionObject for \r\n _this.body = _this.getInteraction(document.body);\r\n _this._disposers.push(_this.body);\r\n // Detect browser capabilities and determine what event listeners to use\r\n if (window.hasOwnProperty(\"PointerEvent\")) {\r\n // IE10+/Edge without touch controls enabled\r\n _this._pointerEvents.pointerdown = \"pointerdown\";\r\n _this._pointerEvents.pointerup = \"pointerup\";\r\n _this._pointerEvents.pointermove = \"pointermove\";\r\n _this._pointerEvents.pointercancel = \"pointercancel\";\r\n _this._pointerEvents.pointerover = \"pointerover\";\r\n _this._pointerEvents.pointerout = \"pointerout\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n // IE9\r\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\r\n _this._pointerEvents.pointerup = \"MSPointerUp\";\r\n _this._pointerEvents.pointermove = \"MSPointerMove\";\r\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\r\n _this._pointerEvents.pointerover = \"MSPointerOver\";\r\n _this._pointerEvents.pointerout = \"MSPointerOut\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)').matches) {\r\n // This is only for Safari as it does not support PointerEvent\r\n // Do nothing and let it use regular `mouse*` events\r\n // Hi Apple ;)\r\n // Additionally disable hover events for iOS devices\r\n if ('ontouchstart' in window) {\r\n _this._addHoverEvents = false;\r\n _this._useTouchEventsOnly = true;\r\n }\r\n }\r\n else if (window.navigator.userAgent.match(/MSIE /)) {\r\n // Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else if (_this.fullFF()) {\r\n // Old FF, let's use regular events.\r\n // (Newer FFs would be detected by the PointerEvent availability check)\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else {\r\n // Uses defaults for normal browsers\r\n // We also assume that this must be a touch device that does not have\r\n // any pointer events\r\n _this._useTouchEventsOnly = true;\r\n }\r\n // Detect if device has a mouse\r\n // This is turning out to be not reliable\r\n // @todo remove\r\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n this._useTouchEventsOnly = true;\r\n }*/\r\n // Detect proper mouse wheel events\r\n if (\"onwheel\" in document.createElement(\"div\")) {\r\n // Modern browsers\r\n _this._pointerEvents.wheel = \"wheel\";\r\n }\r\n else if ($type.hasValue(document.onmousewheel)) {\r\n // Webkit and IE support at least \"mousewheel\"\r\n _this._pointerEvents.wheel = \"mousewheel\";\r\n }\r\n // Set up default inertia options\r\n _this.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n _this.inertiaOptions.setKey(\"resize\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n // Set the passive mode support\r\n _this._passiveSupported = Interaction.passiveSupported;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * This is a nasty detection for Firefox. The reason why we have is that\r\n * Firefox ESR version does not support matchMedia correctly.\r\n *\r\n * On iOS, Firefox uses different userAgent, so we don't have to detect iOS.\r\n *\r\n * @return Full Firefox?\r\n */\r\n Interaction.prototype.fullFF = function () {\r\n return (window.navigator.userAgent.match(/Firefox/)) && !(window.navigator.userAgent.match(/Android/));\r\n };\r\n Interaction.prototype.debug = function () { };\r\n /**\r\n * ==========================================================================\r\n * Processing\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sets up global events.\r\n *\r\n * We need this so that we can track drag movement beyond chart's container.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.addGlobalEvents = function () {\r\n var _this = this;\r\n if (!this._globalEventsAdded) {\r\n if (!this._useTouchEventsOnly) {\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerdown, function (ev) { _this.handleGlobalPointerDown(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointermove, function (ev) { _this.handleGlobalPointerMove(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerup, function (ev) { _this.handleGlobalPointerUp(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointercancel, function (ev) { _this.handleGlobalPointerUp(ev, true); }));\r\n this._disposers.push(addEventListener(document, \"mouseenter\", function (ev) {\r\n if (!$type.hasValue(ev.relatedTarget) && (ev.buttons == 0 || ev.which == 0)) {\r\n _this.handleDocumentLeave(ev);\r\n }\r\n }));\r\n }\r\n // No need to duplicate events for hubrid systems that support both\r\n // pointer events and touch events. Touch events are need only for\r\n // some touch-only systems, like Mobile Safari.\r\n if (!this._usePointerEventsOnly) {\r\n this._disposers.push(addEventListener(document, \"touchstart\", function (ev) { _this.handleGlobalTouchStart(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchmove\", function (ev) { _this.handleGlobalTouchMove(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchend\", function (ev) { _this.handleGlobalTouchEnd(ev); }));\r\n }\r\n this._disposers.push(addEventListener(document, \"keydown\", function (ev) { _this.handleGlobalKeyDown(ev); }));\r\n this._disposers.push(addEventListener(document, \"keyup\", function (ev) { _this.handleGlobalKeyUp(ev); }));\r\n this._globalEventsAdded = true;\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is clickable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processClickable = function (io) {\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] will display context menu when right-clicked.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processContextMenu = function (io) {\r\n if (io.contextMenuDisabled) {\r\n if (!io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.setKey(\"contextMenuDisabled\", addEventListener(io.element, \"contextmenu\", function (e) {\r\n e.preventDefault();\r\n }));\r\n }\r\n }\r\n else {\r\n if (io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.getKey(\"contextMenuDisabled\").dispose();\r\n }\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is hoverable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processHoverable = function (io) {\r\n var _this = this;\r\n if (io.hoverable || io.trackable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"hoverable\") && this._addHoverEvents) {\r\n io.eventDisposers.setKey(\"hoverable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerout, function (e) { return _this.handlePointerOut(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerover, function (e) { return _this.handlePointerOver(io, e); })\r\n ]));\r\n }\r\n if (io.trackable) {\r\n //sprite.addEventListener(\"touchmove\", this.handleTouchMove, false, this);\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"hoverable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"hoverable\");\r\n }\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets up [[InteractionObject]] as movable. Movable can be any\r\n * transformation, e.g. drag, swipe, resize, track.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processMovable = function (io) {\r\n // Add unified events\r\n if (io.draggable || io.swipeable || io.trackable || io.resizable) {\r\n // Prep the element\r\n if (!this.isGlobalElement(io) && !io.isTouchProtected) {\r\n this.prepElement(io);\r\n }\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is trackable and sets relative events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTrackable = function (io) {\r\n this.processHoverable(io);\r\n this.processMovable(io);\r\n if (io.trackable) {\r\n this.trackedObjects.moveValue(io);\r\n }\r\n else {\r\n this.trackedObjects.removeValue(io);\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is draggable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processDraggable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is swipeable and sets relative events.\r\n *\r\n * A swipe event is triggered when a horizontal drag of 75px or more (and\r\n * less than 30px vertically) occurs within 700 milliseconds. This can be\r\n * overridden in sprites [[swipeOptions]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processSwipeable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is resizable and attaches required events\r\n * to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processResizable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is supposed to capture mouse wheel events\r\n * and prepares it to catch those events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processWheelable = function (io) {\r\n var _this = this;\r\n if (io.wheelable) {\r\n //io.hoverable = true;\r\n if (!io.eventDisposers.hasKey(\"wheelable\")) {\r\n io.eventDisposers.setKey(\"wheelable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.wheel, function (e) { return _this.handleMouseWheel(io, e); }, this._passiveSupported ? { passive: false } : false),\r\n io.events.on(\"out\", function (e) {\r\n if (io.wheelable) {\r\n _this.unlockWheel();\r\n }\r\n }),\r\n io.events.on(\"over\", function (e) {\r\n //console.log(\"whelab over\")\r\n if (io.wheelable) {\r\n _this.lockWheel();\r\n }\r\n })\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"wheelable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"wheelable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is focusable. A focusable element is an\r\n * element that will be highlighted when users presses TAB key. If the\r\n * element is focusable, this function will attach relative focus/blur\r\n * events to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processFocusable = function (io) {\r\n var _this = this;\r\n if (io.focusable === true && (io.tabindex > -1) && !this._useTouchEventsOnly) {\r\n if (!io.eventDisposers.hasKey(\"focusable\")) {\r\n io.eventDisposers.setKey(\"focusable\", new MultiDisposer([\r\n addEventListener(io.element, \"focus\", function (e) { return _this.handleFocus(io, e); }),\r\n addEventListener(io.element, \"blur\", function (e) { return _this.handleBlur(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handleFocusBlur(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleFocusBlur(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"focusable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"focusable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is \"touchable\". It means any interaction\r\n * whatsoever: mouse click, touch screen tap, swipe, drag, resize, etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTouchable = function (io) {\r\n var _this = this;\r\n // Add unified events\r\n if (io.clickable || io.hoverable || io.trackable || io.draggable || io.swipeable || io.resizable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"touchable\")) {\r\n if (!this._useTouchEventsOnly && !this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n else if (!this._useTouchEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }));\r\n }\r\n else if (!this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false));\r\n }\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"touchable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"touchable\");\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Non-pointer events\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Dispatches \"focus\" event when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocus = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = true;\r\n if (io.events.isEnabled(\"focus\") && !system.isPaused) {\r\n var imev = {\r\n type: \"focus\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"focus\", imev);\r\n }\r\n };\r\n /**\r\n * Used by regular click events to prevent focus if \"noFocus\" is set.\r\n *\r\n * This should not be called by \"focus\" handlers.\r\n *\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocusBlur = function (io, ev) {\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\")) {\r\n io.events.once(\"focus\", function () {\r\n io.events.disableType(\"blur\");\r\n $dom.blur();\r\n if (io.sprite) {\r\n io.sprite.handleBlur();\r\n }\r\n io.events.enableType(\"blur\");\r\n });\r\n }\r\n };\r\n /**\r\n * Dispatches \"blur\" event when element loses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleBlur = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = false;\r\n if (io.events.isEnabled(\"blur\") && !system.isPaused) {\r\n var imev = {\r\n type: \"blur\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"blur\", imev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global keyboard-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Checks if there is an item that has currently focus and that they key is\r\n * one of the directional keys. If both of the conditions are true, it\r\n * creates an object to simulate movement of dragable element with keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyDown = function (ev) {\r\n if (this.focusedObject) {\r\n if (keyboard.isKey(ev, \"esc\")) {\r\n // ESC removes focus\r\n $dom.blur();\r\n }\r\n else if (this.focusedObject.draggable && keyboard.isKey(ev, [\"up\", \"down\", \"left\", \"right\"])) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Get focused object\r\n var io = this.focusedObject;\r\n // Get particular key\r\n var disposerKey = \"interactionKeyboardObject\";\r\n // If such disposer already exists we know the event is going on so we\r\n // just move on\r\n if (io.eventDisposers.hasKey(disposerKey)) {\r\n return;\r\n }\r\n // Create a keyboard mover\r\n var ko = new InteractionKeyboardObject(io, ev);\r\n io.eventDisposers.setKey(disposerKey, ko);\r\n switch (keyboard.getEventKey(ev)) {\r\n case \"up\":\r\n ko.directionY = -1;\r\n break;\r\n case \"down\":\r\n ko.directionY = 1;\r\n break;\r\n case \"left\":\r\n ko.directionX = -1;\r\n break;\r\n case \"right\":\r\n ko.directionX = 1;\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches related events when the keyboard key is realeasd.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyUp = function (ev) {\r\n var disposerKey = \"interactionKeyboardObject\";\r\n if (this.focusedObject) {\r\n var disposer = this.focusedObject.eventDisposers.getKey(disposerKey);\r\n if (disposer != null) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Dispose stuff\r\n disposer.dispose();\r\n this.focusedObject.eventDisposers.removeKey(disposerKey);\r\n }\r\n // Does focused object have \"hit\" event?\r\n var sprite = this.focusedObject.sprite;\r\n if (keyboard.isKey(ev, \"enter\") && sprite) {\r\n if (sprite.events.isEnabled(\"hit\") || sprite.events.isEnabled(\"toggled\")) {\r\n this.focusedObject.dispatchImmediately(\"hit\");\r\n }\r\n else if (sprite.showTooltipOn == \"hit\") {\r\n this.focusedObject.dispatchImmediately(\"up\");\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handler for a global \"pointermove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerMove = function (ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n };\r\n /**\r\n * Handler for a global \"pointerdown\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerDown = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Prevents touch action from firing.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Interaction.prototype.preventTouchAction = function (ev) {\r\n if (!ev.defaultPrevented) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Handler for a global \"pointerup\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerUp = function (ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Process further\r\n this.handleGlobalUp(pointer, ev, cancelled);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global touch-related even handlers\r\n * ==========================================================================\r\n */\r\n /**\r\n * Handler for a global \"touchmove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchMove = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchstart\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchStart = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (!this._usePointerEventsOnly && this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchend\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchEnd = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Handle element-related events\r\n this.handleGlobalUp(pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles event when pointer is over [[InteractionObject]] and button is\r\n * pressed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //ev.preventDefault();\r\n //ev.stopPropagation();\r\n //if (ev.defaultPrevented) {\r\n //}\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Ignore if it's anything but mouse's primary button\r\n if (!pointer.touch && ev.which != 1 && ev.which != 3) {\r\n return;\r\n }\r\n // Set mouse button\r\n pointer.button = ev.which;\r\n // Reset pointer\r\n this.resetPointer(pointer, ev);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] is hovered by a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOver = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOver(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] loses hover from a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOut = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOut(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when mouse wheel is crolled over the [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n * @todo Investigate more-cross browser stuff https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n */\r\n Interaction.prototype.handleMouseWheel = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Init delta values\r\n var deltaX = 0, deltaY = 0;\r\n // Set up modifier\r\n // This is needed because FireFox reports wheel deltas in \"lines\" instead\r\n // of pixels so we have to approximate pixel value\r\n var mod = 1;\r\n if (ev.deltaMode == 1) {\r\n mod = 50;\r\n }\r\n // Adjust configurable sensitivity\r\n mod *= this.getMouseOption(io, \"sensitivity\");\r\n // Calculate deltas\r\n if (ev instanceof WheelEvent) {\r\n deltaX = Math.round((-1 * ev.wheelDeltaX) || (ev.deltaX * mod));\r\n deltaY = Math.round((-1 * ev.wheelDeltaY) || (ev.deltaY * mod));\r\n }\r\n else {\r\n throw new Error(\"Invalid event type\");\r\n }\r\n // Handle the event\r\n this.handleWheel(io, pointer, deltaX, deltaY, ev);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific touch-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles an event when an [[InteractionObject]] is touched on a touch\r\n * device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTouchDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //this.maybePreventDefault(io, ev);\r\n //return;\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Reset pointer\r\n this.resetPointer(pointer, ev.changedTouches[i]);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Universal handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles click/tap. Checks for doublehit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleHit = function (io, pointer, ev) {\r\n // Check if this is a double-hit\r\n var now = $time.getTime();\r\n if (io.lastHit && (io.lastHit >= (now - this.getHitOption(io, \"doubleHitTime\")))) {\r\n // Yup - it's a double-hit\r\n // Cancel the hit\r\n //clearTimeout(io.lastHitPointer.hitTimeout);\r\n // If it happened too fast it probably means that hybrid device just\r\n // generated two events for the same tap\r\n if ((now - io.lastHit) < 100) {\r\n // Ignore\r\n return;\r\n }\r\n // Clear last hit\r\n io.lastHit = undefined;\r\n io.lastHitPointer = undefined;\r\n // Dispatch event\r\n if (io.events.isEnabled(\"doublehit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"doublehit\",\r\n target: io,\r\n point: pointer.point,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"doublehit\", imev);\r\n }\r\n }\r\n else {\r\n // Log last hit\r\n io.lastHit = now;\r\n io.lastHitPointer = pointer;\r\n if (pointer.button === 3) {\r\n // Execute HIT now\r\n if (io.events.isEnabled(\"rightclick\") && !system.isPaused) {\r\n var imev = {\r\n type: \"rightclick\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"rightclick\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"hit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"hit\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"hit\", imev);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles pointer hovering over [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n */\r\n Interaction.prototype.handleOver = function (io, pointer, ev, soft) {\r\n if (soft === void 0) { soft = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n var hoversPaused = false;\r\n if (this.shouldCancelHovers(pointer) && this.areTransformed() && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n hoversPaused = true;\r\n this.cancelAllHovers(ev);\r\n }\r\n // Remove any delayed outs\r\n this.processDelayed();\r\n // Add pointer\r\n io.overPointers.moveValue(pointer);\r\n // Check if object is not yet hovered\r\n if (!io.isRealHover) {\r\n // Set element as hovered\r\n if (!hoversPaused) {\r\n io.isHover = true;\r\n io.isRealHover = true;\r\n this.overObjects.moveValue(io);\r\n }\r\n // Generate body track event. This is needed so that if element loads\r\n // under unmoved mouse cursor, we still need all the actions that are\r\n // required to happen to kick in.\r\n this.handleTrack(this.body, pointer, ev, true);\r\n // Event\r\n if (io.events.isEnabled(\"over\") && !system.isPaused && !hoversPaused) {\r\n var imev = {\r\n type: \"over\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"over\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * If `soft = true`, this means that method is being invoked by some other\r\n * code, not hard \"out\" function, like `handleUp` which implies we need to\r\n * run additional checks before unhovering the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n * @param force Force imediate out\r\n */\r\n Interaction.prototype.handleOut = function (io, pointer, ev, soft, force) {\r\n var _this = this;\r\n if (soft === void 0) { soft = false; }\r\n if (force === void 0) { force = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n // Remove pointer\r\n io.overPointers.removeValue(pointer);\r\n // Check if element is still hovered\r\n if (io.isHover && (!io.hasDelayedOut || force)) {\r\n // Should we run additional checks?\r\n if (soft && io.overPointers.length) {\r\n // There are still pointers hovering - don't do anything else and\r\n // wait until either no over pointers are there or we get a hard out\r\n // event.\r\n return;\r\n }\r\n // Should we delay \"out\" if this is happening on a touch device?\r\n if (pointer && pointer.touch && !force && !this.old(pointer)) {\r\n // This is a touch pointer, and it hasn't moved, let's pretend\r\n // the object is still hovered, and act as per \"behavior\" setting\r\n var behavior = this.getHoverOption(io, \"touchOutBehavior\");\r\n if (behavior == \"leave\") {\r\n // Set to \"leave\", so we do not execute any \"out\" event.\r\n // It will be handled by any other interaction that happens\r\n // afterwards.\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500\r\n });\r\n io.hasDelayedOut = true;\r\n return;\r\n }\r\n else if (behavior == \"delay\" && this.getHoverOption(io, \"touchOutDelay\")) {\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500,\r\n timeout: this.setTimeout(function () {\r\n _this.handleOut(io, pointer, ev, true);\r\n }, this.getHoverOption(io, \"touchOutDelay\"))\r\n });\r\n return;\r\n }\r\n else {\r\n // Nothing for \"remove\" - that's how it works \"out-of-the-box\"\r\n }\r\n }\r\n // Set element as not hovered\r\n io.isHover = false;\r\n this.overObjects.removeValue(io);\r\n // Invoke event\r\n if (!io.isDisposed() && io.events.isEnabled(\"out\") && !system.isPaused) {\r\n var imev = {\r\n type: \"out\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"out\", imev);\r\n }\r\n // Reset object from lefover delayed outs, pointers\r\n io.overPointers.clear();\r\n io.hasDelayedOut = false;\r\n // @todo (clean delayed)\r\n }\r\n };\r\n /**\r\n * Processes dalyed events, such as \"out\" event that was initiated for\r\n * elements by touch.\r\n */\r\n Interaction.prototype.processDelayed = function () {\r\n var delayedEvent;\r\n while (true) {\r\n delayedEvent = this._delayedEvents.out.pop();\r\n if (!delayedEvent) {\r\n break;\r\n }\r\n if (delayedEvent.timeout) {\r\n delayedEvent.timeout.dispose();\r\n }\r\n this.handleOut(delayedEvent.io, delayedEvent.pointer, delayedEvent.event, false, true);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer down.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDown = function (io, pointer, ev) {\r\n // Need to prevent default event from happening on transformable objects\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Stop inertia animations if they're currently being played out\r\n if (io.inert) {\r\n this.stopInertia(io);\r\n }\r\n // Trigger hover because some touch devices won't trigger over events\r\n // on their own\r\n this.handleOver(io, pointer, ev, true);\r\n // Add pointer to list\r\n io.downPointers.moveValue(pointer);\r\n // Apply styles if necessary\r\n this.applyCursorDownStyle(io, pointer);\r\n // Check if object is already down\r\n if (!io.isDown) {\r\n // Lose focus if needed\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\") && this.focusedObject) {\r\n $dom.blur();\r\n }\r\n // Set object as hovered\r\n io.isDown = true;\r\n this.downObjects.moveValue(io);\r\n // Prep object for dragging and/or resizing\r\n if (io.draggable) {\r\n this.processDragStart(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStart(io, pointer, ev);\r\n }\r\n }\r\n // Dispatch \"down\" event\r\n if (io.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer up.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalUp = function (pointer, ev, cancelled) {\r\n var _this = this;\r\n if (cancelled === void 0) { cancelled = false; }\r\n var sorted = this.downObjects.values.slice();\r\n sorted.sort(function (x, y) {\r\n if (x && y) {\r\n var pos = x.element.compareDocumentPosition(y.element);\r\n if (pos & Node.DOCUMENT_POSITION_CONTAINED_BY) {\r\n return 1;\r\n }\r\n else if (pos & Node.DOCUMENT_POSITION_CONTAINS) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return 0;\r\n }\r\n });\r\n // Process all down objects\r\n $array.each(sorted, function (io) {\r\n // Check if this particular pointer is pressing down\r\n // on object\r\n if (io && io.downPointers.contains(pointer)) {\r\n _this.handleUp(io, pointer, ev, cancelled);\r\n }\r\n });\r\n };\r\n /**\r\n * Simulates all pointers being up once mouse leaves document area.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDocumentLeave = function (ev) {\r\n var _this = this;\r\n // Process all down objects\r\n $iter.each(this.downObjects.backwards().iterator(), function (io) {\r\n io.downPointers.each(function (pointer) {\r\n _this.handleUp(io, pointer, ev);\r\n });\r\n });\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleUp = function (io, pointer, ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Restore cursor style\r\n this.restoreCursorDownStyle(io, pointer);\r\n // Remove pointer from the list\r\n io.downPointers.removeValue(pointer);\r\n // Trigger out because some touch devices won't trigger out events\r\n // on their own\r\n if (pointer.touch || this._useTouchEventsOnly) {\r\n this.handleOut(io, pointer, ev, true);\r\n }\r\n // Check if object still down\r\n if (io.isDown) {\r\n // Check if there are no other pointers hovering this element\r\n if (io.downPointers.length == 0) {\r\n // Set element as no longer down\r\n io.isDown = false;\r\n this.downObjects.removeValue(io);\r\n }\r\n // Dispatch \"up\" event\r\n if (io.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Check if this was not a cancelled event.\r\n // If event was canelled (which might happen if gesture resulted in\r\n // navigation or page scroll) there's no point in triggering hit and\r\n // other actions.\r\n if (!cancelled) {\r\n // Handle swiping-related stuff\r\n if (io.swipeable && this.swiped(io, pointer)) {\r\n // Swiped - nothing else should happen\r\n this.handleSwipe(io, pointer, ev);\r\n }\r\n else {\r\n // Check if it maybe a click\r\n if (io.clickable && !this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleHit(io, pointer, ev);\r\n }\r\n // Handle inertia\r\n if (io.inert && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleInertia(io, pointer);\r\n }\r\n else if (io.draggable) {\r\n this.processDragStop(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStop(io, pointer, ev);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if event needs to be prevented on draggable and such items, so that\r\n * touch gestures like navigation and scroll do not kick in.\r\n *\r\n * @param io Object\r\n * @param ev Event\r\n */\r\n Interaction.prototype.maybePreventDefault = function (io, ev, pointer) {\r\n if ($type.hasValue(ev)\r\n && (io.draggable || io.swipeable || io.trackable || io.resizable)\r\n && !this.isGlobalElement(io)\r\n && ev.cancelable !== false\r\n && (!io.isTouchProtected || !pointer || !pointer.touch)) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Cancels all hovers on all currently hovered objects.\r\n *\r\n * @param pointer Pointer\r\n * @param ev Event\r\n */\r\n Interaction.prototype.cancelAllHovers = function (ev) {\r\n var _this = this;\r\n //this.overObjects.each((io) => {\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n if (io) {\r\n var pointer = io.overPointers.getIndex(0);\r\n _this.handleOut(io, pointer, ev, true, true);\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if hovers should be cancelled on transform as per global options.\r\n * @param pointer Pointer\r\n * @return Cancel?\r\n */\r\n Interaction.prototype.shouldCancelHovers = function (pointer) {\r\n return options.disableHoverOnTransform == \"always\" || (options.disableHoverOnTransform == \"touch\" && pointer.touch);\r\n };\r\n /**\r\n * Handles pointer move.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalMove = function (pointer, ev) {\r\n var _this = this;\r\n // Process hovered elements\r\n // We check if the element became unhovered without reporting the mouseout\r\n // event. (it happens in some cases)\r\n if (!pointer.touch) {\r\n var target_1 = $dom.eventTarget(pointer.lastEvent);\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io && io.overPointers.contains(pointer) && io.hoverable) {\r\n // Check if the element is still hovered\r\n var reset = false;\r\n if (io.element && pointer.lastEvent) {\r\n if (!$dom.contains(io.element, target_1)) {\r\n reset = true;\r\n }\r\n }\r\n else {\r\n reset = true;\r\n }\r\n if (reset) {\r\n _this.handleOut(io, pointer, ev, true);\r\n }\r\n }\r\n });\r\n }\r\n // Process down elements\r\n $iter.each(this.transformedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io.downPointers.contains(pointer) &&\r\n // Swipe still happening?\r\n !(io.swipeable && _this.swiping(io, pointer)) &&\r\n (io.draggable || io.resizable)) {\r\n _this.handleTransform(io, ev);\r\n }\r\n });\r\n // Process tracked elements\r\n $iter.each(this.trackedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (!io.overPointers.contains(pointer)) {\r\n _this.handleTrack(io, pointer, ev);\r\n }\r\n });\r\n };\r\n /**\r\n * Handles reporting of pointer movement.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param skipCheck Sould we skip check if cursor actually moved\r\n */\r\n Interaction.prototype.handleTrack = function (io, pointer, ev, skipCheck) {\r\n if (skipCheck === void 0) { skipCheck = false; }\r\n // Do nothing if the cursor did not actually move\r\n if (!skipCheck && !this.moved(pointer, 0)) {\r\n return;\r\n }\r\n // Initiate TRACK event\r\n if (io.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"track\", imev);\r\n }\r\n };\r\n /**\r\n * Handles swipe action.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleSwipe = function (io, pointer, ev) {\r\n // We pass in InteractionEvent with shift in mouse coordinates\r\n // between when the drag started and ended\r\n if (io.events.isEnabled(\"swipe\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipe\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipe\", imev);\r\n }\r\n if (pointer.startPoint.x < pointer.point.x) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swiperight\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swiperight\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"swipeleft\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipeleft\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipeleft\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles event triggering for wheel rotation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param deltaX Horizontal shift\r\n * @param deltaY Vertical shift\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleWheel = function (io, pointer, deltaX, deltaY, ev) {\r\n var shift = {\r\n x: deltaX,\r\n y: deltaY\r\n };\r\n // Trigger generic WHEEL event\r\n if (io.events.isEnabled(\"wheel\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheel\", {\r\n type: \"wheel\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Trigger direction-specific events\r\n // Horizontal\r\n if (deltaX < 0) {\r\n if (io.events.isEnabled(\"wheelleft\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelleft\", {\r\n type: \"wheelleft\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaX > 0) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelright\", {\r\n type: \"wheelright\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Vertical\r\n }\r\n else if (deltaY < 0) {\r\n if (io.events.isEnabled(\"wheelup\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelup\", {\r\n type: \"wheelup\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaY > 0) {\r\n if (io.events.isEnabled(\"wheeldown\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheeldown\", {\r\n type: \"wheeldown\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Initiates inertia checking sub-routines for different movement types:\r\n * drag, resize.\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite\r\n * @param pointer\r\n */\r\n Interaction.prototype.handleInertia = function (io, pointer) {\r\n if (io.draggable && io.downPointers.length === 0) {\r\n this.handleMoveInertia(io, pointer);\r\n }\r\n if (io.resizable && io.downPointers.length > 1) {\r\n this.handleResizeInertia(io, pointer);\r\n }\r\n };\r\n /**\r\n * Continues moving the element to simulate the effect of inertia. Happens\r\n * when `inert` and `draggable` object is dragged and then released.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleMoveInertia = function (io, pointer) {\r\n var interaction = io;\r\n var type = \"move\";\r\n var point = {\r\n \"x\": pointer.point.x,\r\n \"y\": pointer.point.y\r\n };\r\n var startPoint = {\r\n \"x\": pointer.startPoint.x,\r\n \"y\": pointer.startPoint.y\r\n };\r\n // Init inertia object\r\n var inertia = new Inertia(interaction, type, point, startPoint);\r\n // Get inertia data\r\n var ref = this.getTrailPoint(pointer, $time.getTime() - this.getInertiaOption(io, \"move\", \"time\"));\r\n if (typeof ref === \"undefined\") {\r\n this.processDragStop(io, pointer, pointer.lastUpEvent);\r\n return;\r\n }\r\n // Init animation options\r\n var factor = this.getInertiaOption(io, \"move\", \"factor\");\r\n var animationOptions = [{\r\n \"to\": pointer.point.x + (pointer.point.x - ref.point.x) * factor,\r\n \"property\": \"x\"\r\n }, {\r\n \"to\": pointer.point.y + (pointer.point.y - ref.point.y) * factor,\r\n \"property\": \"y\"\r\n }];\r\n // Start animation\r\n var animation = new Animation(inertia, animationOptions, this.getInertiaOption(io, \"move\", \"duration\"), this.getInertiaOption(io, \"move\", \"easing\")).start();\r\n this._disposers.push(animation.events.on(\"animationended\", function (ev) {\r\n inertia.done();\r\n }));\r\n // Add inertia object\r\n io.inertias.setKey(\"move\", inertia);\r\n };\r\n /**\r\n * Continues resizing of a `resizable` element after it is resized and\r\n * released.\r\n *\r\n * **NOTE:** this is is just a placeholder function. No actual fucntionality\r\n * is implemented, yet.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleResizeInertia = function (io, pointer) {\r\n // Some day, folks. Some day...\r\n };\r\n /**\r\n * Recalculates element's position and size based on position of\r\n * all its related pointers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTransform = function (io, ev) {\r\n // Get primary pointer and its respective points\r\n var pointer1 = io.downPointers.getIndex(0);\r\n var point1 = null;\r\n var startPoint1 = null;\r\n if (pointer1) {\r\n point1 = pointer1.point;\r\n startPoint1 = pointer1.startPoint;\r\n }\r\n // Init secondary pointer\r\n var pointer2;\r\n var point2;\r\n var startPoint2;\r\n // Use center of the sprite to simulate \"second\" point of touch\r\n point2 = {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n };\r\n startPoint2 = point2;\r\n // Determine if it's a sinngle pointer or multi\r\n var singlePoint = true;\r\n for (var i = 1; i < io.downPointers.length; i++) {\r\n // Get pointer\r\n var nextPointer = io.downPointers.getIndex(i);\r\n // Doublecheck if it's not the same pointer by comparing original position\r\n if (startPoint1.x != nextPointer.startPoint.x && startPoint1.y != nextPointer.startPoint.y) {\r\n // Several pointers down\r\n singlePoint = false;\r\n // Get second pointer\r\n pointer2 = nextPointer;\r\n point2 = pointer2.point;\r\n startPoint2 = pointer2.startPoint;\r\n // Stop looking\r\n break;\r\n }\r\n }\r\n // Primary touch point moved?\r\n var pointer1Moved = pointer1 && this.moved(pointer1, 0);\r\n // Report DRAG_START if necessary\r\n if (io.draggable && pointer1 && pointer1.dragStartEvents && pointer1.dragStartEvents.length && pointer1Moved) {\r\n if (io.events.isEnabled(\"dragstart\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"dragstart\", pointer1.dragStartEvents.shift());\r\n }\r\n //delete pointer1.dragStartEvents;\r\n }\r\n // Determine what we do in order of superiority\r\n if (singlePoint && io.draggable) {\r\n // We have only one pointer and the Sprite is draggable\r\n // There's nothing else to be done - just move it\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n if (this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n }\r\n else {\r\n // Check if second touch point moved\r\n var pointer2Moved = pointer2 && this.moved(pointer2, 0);\r\n if ((this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\")))\r\n ||\r\n (this.shouldCancelHovers(pointer2) && this.moved(pointer2, this.getHitOption(io, \"hitTolerance\")))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n if (io.draggable && io.resizable) {\r\n //this.handleTransformAll(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved);\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n else {\r\n if (io.draggable) {\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n }\r\n if (io.resizable && (!singlePoint || ev.ctrlKey)) {\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles movement of the dragged element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point Current point of the pointer\r\n * @param startPoint Starting point of the pointer\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformMove = function (io, point, startPoint, ev, pointerMoved, touch) {\r\n if (pointerMoved) {\r\n if (io.events.isEnabled(\"drag\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"drag\",\r\n target: io,\r\n event: ev,\r\n shift: {\r\n \"x\": point.x - startPoint.x,\r\n \"y\": point.y - startPoint.y\r\n },\r\n startPoint: startPoint,\r\n point: point,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles resizing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point1 Current position of reference point #1\r\n * @param startPoint1 Original position of reference point #1\r\n * @param point2 Current position of reference point #2\r\n * @param startPoint2 Original position of reference point #2\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformResize = function (io, point1, startPoint1, point2, startPoint2, ev, pointerMoved, touch) {\r\n if (io.events.isEnabled(\"resize\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"resize\",\r\n target: io,\r\n event: ev,\r\n scale: $math.getScale(point1, startPoint1, point2, startPoint2),\r\n startPoint1: startPoint1,\r\n point1: point1,\r\n startPoint2: startPoint2,\r\n point2: point2,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"resize\", imev);\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n if (this.shouldCancelHovers(pointer)) {\r\n this.cancelAllHovers(ev);\r\n }\r\n // Report \"dragstart\"\r\n var imev = {\r\n type: \"dragstart\",\r\n target: io,\r\n event: ev,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n // Log object that we are starting to drag, so we can check against and\r\n // avoid hovers on other objects that might be in the path of movement.\r\n if (pointer) {\r\n pointer.dragTarget = io;\r\n //pointer.startPoint = pointer.point;\r\n }\r\n /**\r\n * If pointer is set we will not fire the event until the pointer has\r\n * actually moved. If it's not set we don't have to wait for anything, so we\r\n * just fire off the event right away.\r\n */\r\n if (pointer && pointer.dragStartEvents) {\r\n pointer.dragStartEvents.push(imev);\r\n }\r\n else {\r\n if (!system.isPaused) {\r\n io.dispatchImmediately(\"dragstart\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStop = function (io, pointer, ev) {\r\n // Pointer set?\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n // Unset drag object\r\n if (pointer) {\r\n pointer.dragTarget = undefined;\r\n }\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n // Unlock document\r\n //this.unlockDocument();\r\n // Report dragstop\r\n if (!pointer || this.moved(pointer, 0)) {\r\n if (io.events.isEnabled(\"dragstop\") && !system.isPaused) {\r\n var imev = {\r\n type: \"dragstop\",\r\n target: io,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n io.events.dispatchImmediately(\"dragstop\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be resized.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStop = function (io, pointer, ev) {\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Controls for InteractionObjects initiating directly\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Manually triggers drag start on the element. Could be useful in cases\r\n * where tracking or dragging one element can also influence dragging another\r\n * element.\r\n *\r\n * Passing in `pointer` reference is advisable. If not passed in it will try\r\n * to determine which pointer to attach to. However, it's better to specify\r\n * it explicitly.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStart = function (io, pointer) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer) {\r\n this.handleDown(io, pointer, pointer.lastDownEvent);\r\n }\r\n };\r\n /**\r\n * Manually ends drag on the element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStop = function (io, pointer, cancelled) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer && !cancelled) {\r\n this.handleGlobalUp(pointer, pointer.lastUpEvent, cancelled);\r\n }\r\n };\r\n /**\r\n * This method uses a fuzzy logic to find the pointer to be used for dragging.\r\n * Beware that this is not a rock-solid solution. If there are a few objects\r\n * being dragged at the same time, you may get unexepected results.\r\n *\r\n * @param io InteractionObject to get pointers from\r\n * @return Pointer currently being used for dragging\r\n */\r\n Interaction.prototype.getDragPointer = function (io) {\r\n if (io) {\r\n // InteractionObject is supplied\r\n // Use it's first down pointer\r\n return io.downPointers.getIndex(0);\r\n }\r\n else if (this.transformedObjects.length) {\r\n // Use first dragged object\r\n return this.getDragPointer(this.transformedObjects.getIndex(0));\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Utils\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns pointer id for the given event object.\r\n *\r\n * @param ev Event\r\n * @return Pointer ID\r\n */\r\n Interaction.prototype.getPointerId = function (ev) {\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = \"\" + ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = \"\" + ev.pointerId;\r\n }\r\n else {\r\n id = \"m\";\r\n }\r\n return id.replace(\"-\", \"\");\r\n };\r\n /**\r\n * Returns a cursor position of the event.\r\n *\r\n * @param ev Original event\r\n * @return Event point\r\n */\r\n Interaction.prototype.getPointerPoint = function (ev) {\r\n return {\r\n \"x\": ev.clientX,\r\n \"y\": ev.clientY\r\n };\r\n };\r\n /**\r\n * Returns [[Pointer]] object that is associated with the Event.\r\n *\r\n * If no such [[Pointer]] object exists, it is created.\r\n *\r\n * @param ev Event\r\n * @return Pointer\r\n */\r\n Interaction.prototype.getPointer = function (ev) {\r\n // Get pointer id\r\n var id = this.getPointerId(ev);\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n // Look for the pointer in the Dictionary if it maybe already exists\r\n var pointer;\r\n if (this.pointers.hasKey(id)) {\r\n // We already have such pointer\r\n pointer = this.pointers.getKey(id);\r\n // We need this, because Edge reuses pointer ids across touch and mouse\r\n pointer.touch = this.isPointerTouch(ev);\r\n // Reset pointer\r\n //pointer.point = point;\r\n }\r\n else {\r\n // Init pointer\r\n pointer = {\r\n \"id\": id,\r\n //\"touch\": !(ev instanceof MouseEvent) || ((ev).pointerType && (ev).pointerType != \"pointer\"),\r\n //\"touch\": !(ev instanceof MouseEvent) || ((ev).pointerType && (ev).pointerType != \"mouse\"),\r\n \"touch\": this.isPointerTouch(ev),\r\n \"startPoint\": point,\r\n \"startTime\": $time.getTime(),\r\n \"point\": point,\r\n \"track\": [],\r\n \"swipeCanceled\": false,\r\n \"dragStartEvents\": []\r\n };\r\n // Add first breadcrumb\r\n this.addBreadCrumb(pointer, point);\r\n // Add for re-use later\r\n this.pointers.setKey(id, pointer);\r\n }\r\n // Log last event\r\n pointer.lastEvent = ev;\r\n this.lastPointer = pointer;\r\n return pointer;\r\n };\r\n /**\r\n * Determines if pointer event originated from a touch pointer or mouse.\r\n *\r\n * @param ev Original event\r\n * @return Touch pointer?\r\n */\r\n Interaction.prototype.isPointerTouch = function (ev) {\r\n if (typeof Touch !== \"undefined\" && ev instanceof Touch) {\r\n return true;\r\n }\r\n else if (typeof PointerEvent !== \"undefined\" && ev instanceof PointerEvent && $type.hasValue(ev.pointerType)) {\r\n switch (ev.pointerType) {\r\n case \"touch\":\r\n case \"pen\":\r\n case 2:\r\n return true;\r\n case \"mouse\":\r\n case 4:\r\n return false;\r\n default:\r\n return !(ev instanceof MouseEvent);\r\n }\r\n }\r\n else if ($type.hasValue(ev.type)) {\r\n if (ev.type.match(/^mouse/)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Resets the poiner to original state, i.e. cleans movement information,\r\n * starting point, etc.\r\n *\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.resetPointer = function (pointer, ev) {\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n ;\r\n pointer.startTime = $time.getTime();\r\n pointer.startPoint = { x: point.x, y: point.y };\r\n pointer.point = { x: point.x, y: point.y };\r\n pointer.track = [];\r\n pointer.swipeCanceled = false;\r\n //clearTimeout(pointer.swipeTimeout);\r\n //clearTimeout(pointer.holdTimeout);\r\n };\r\n /**\r\n * Adds a \"breadcrumb\" point to the [[Pointer]] to log its movement path.\r\n *\r\n * @param pointer Pointer\r\n * @param point Point coordinates\r\n */\r\n Interaction.prototype.addBreadCrumb = function (pointer, point) {\r\n pointer.track.push({\r\n \"timestamp\": $time.getTime(),\r\n \"point\": point\r\n });\r\n };\r\n /**\r\n * Prepares the document for various touch-related operations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockDocument = function () {\r\n this.prepElement(this.body);\r\n };\r\n /**\r\n * Restores document functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockDocument = function () {\r\n if (this.transformedObjects.length == 0) {\r\n this.restoreAllStyles(this.body);\r\n }\r\n };\r\n /**\r\n * Lock element (disable all touch)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockElement = function (io) {\r\n this.prepElement(io);\r\n };\r\n /**\r\n * Restores element's functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockElement = function (io) {\r\n this.restoreAllStyles(io);\r\n };\r\n /**\r\n * Locks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockWheel = function () {\r\n window.addEventListener(this._pointerEvents.wheel, this.wheelLockEvent, this._passiveSupported ? { passive: false } : false);\r\n };\r\n /**\r\n * Unlocks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockWheel = function () {\r\n window.removeEventListener(this._pointerEvents.wheel, this.wheelLockEvent);\r\n };\r\n /**\r\n * Checks if top element at pointer's position belongs to the SVG.\r\n *\r\n * @ignore Exlude from docs\r\n * @param pointer Pointer\r\n * @param svg The element\r\n * @param id A unique identifier of the object that is checking for locality\r\n * @return Belongs to SVG\r\n */\r\n Interaction.prototype.isLocalElement = function (pointer, svg, id) {\r\n var cached = this.getCache(\"local_pointer_\" + pointer.id);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n var doc = ($dom.getRoot(svg) || document);\r\n if (doc.elementFromPoint) {\r\n var target = doc.elementFromPoint(pointer.point.x, pointer.point.y);\r\n var local = target && $dom.contains(svg, target);\r\n this.setCache(\"local_pointer_\" + pointer.id + \"_\" + id, local, 100);\r\n return local;\r\n }\r\n return false;\r\n };\r\n /**\r\n * A function that cancels mouse wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @return Returns `false` to cancel\r\n */\r\n Interaction.prototype.wheelLockEvent = function (ev) {\r\n ev.preventDefault();\r\n return false;\r\n };\r\n /**\r\n * Applies a set of styles to an element. Stores the original styles so they\r\n * can be restored later.\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.prepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.setTemporaryStyle(io, props[i], \"none\");\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.setTemporaryStyle(io, \"tapHighlightColor\", \"rgba(0, 0, 0, 0)\");\r\n //this.setTemporaryStyle(io, \"webkitOverflowScrolling\", \"none\");\r\n }\r\n };\r\n /**\r\n * Restores replaced styles\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.unprepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.restoreStyle(io, props[i]);\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.restoreStyle(io, \"tapHighlightColor\");\r\n //this.restoreStyle(io, \"webkitOverflowScrolling\");\r\n }\r\n };\r\n /**\r\n * Returns an option associated with hit events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHitOption = function (io, option) {\r\n var res = io.hitOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hitOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with hover events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHoverOption = function (io, option) {\r\n var res = io.hoverOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hoverOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with swipe events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getSwipeOption = function (io, option) {\r\n var res = io.swipeOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.swipeOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getKeyboardOption = function (io, option) {\r\n var res = io.keyboardOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.keyboardOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for mouse.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getMouseOption = function (io, option) {\r\n var res = io.mouseOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.mouseOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with inertia.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param type Inertia type\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getInertiaOption = function (io, type, option) {\r\n var options = io.inertiaOptions.getKey(type);\r\n var res;\r\n if (options && $type.hasValue(options[option])) {\r\n res = options[option];\r\n }\r\n else {\r\n res = this.inertiaOptions.getKey(type)[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Stops currently going on inertia. Useful if inertia is currently being\r\n * animated and the object is being interacted with.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.stopInertia = function (io) {\r\n var x;\r\n var inertias = [\"move\", \"resize\"];\r\n for (var i = 0; i < inertias.length; i++) {\r\n x = inertias[i];\r\n if (io.inertias.hasKey(x)) {\r\n var inertia = io.inertias.getKey(x);\r\n if (inertia) {\r\n inertia.dispose();\r\n //io.inertiaAnimations.removeKey(x);\r\n //this.processDragStop(io);\r\n continue;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Check if swiping is currently being performed on an object.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer to check\r\n * @return `true` if swiping\r\n */\r\n Interaction.prototype.swiping = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled || !io.swipeable) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Returns `true` if a successfull swipe action was performed on an element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @return Swiped?\r\n */\r\n Interaction.prototype.swiped = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.x - pointer.point.x) > this.getSwipeOption(io, \"horizontalThreshold\")) &&\r\n (Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Element\r\n */\r\n Interaction.prototype.applyCursorOverStyle = function (io) {\r\n // Get sprite's cursor ooptions\r\n var options = io.cursorOptions;\r\n if (!$type.hasValue(options.overStyle)) {\r\n return;\r\n }\r\n // Apply cursor down styles\r\n for (var i = 0; i < options.overStyle.length; i++) {\r\n $dom.setStyle(io.element, options.overStyle[i].property, options.overStyle[i].value);\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.applyCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.setTemporaryStyle(this.body, downStyle[i].property, downStyle[i].value);\r\n this.setTemporaryStyle(io, downStyle[i].property, downStyle[i].value);\r\n }\r\n }\r\n };\r\n /**\r\n * Restores original cursor style for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.restoreCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.restoreStyle(this.body, downStyle[i].property);\r\n this.restoreStyle(io, downStyle[i].property);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.setGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.setTemporaryStyle(body, styles[i].property, styles[i].value);\r\n }\r\n };\r\n /**\r\n * Restores style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.restoreGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.restoreStyle(body, styles[i].property);\r\n }\r\n };\r\n /**\r\n * Checks if element is a non-cahrt element.\r\n *\r\n * @param io InteractionObject\r\n * @return Global element?\r\n */\r\n Interaction.prototype.isGlobalElement = function (io) {\r\n return document.body === io.element;\r\n };\r\n /**\r\n * Checks if pointer has moved since it was created.\r\n *\r\n * @param pointer Pointer\r\n * @param tolerance Tolerance in pixels\r\n * @param minTime Minimum time required for the pointer to be down to be considered moved\r\n * @return `true` if the pointer has moved\r\n */\r\n Interaction.prototype.moved = function (pointer, tolerance, minTime) {\r\n /*// If there was more time, we don't care if cursor actually moved\r\n let duration = $time.getTime() - pointer.startTime;\r\n if ($type.hasValue(minTime) && (minTime > duration)) {\r\n return false;\r\n }*/\r\n if (minTime === void 0) { minTime = 300; }\r\n // That was quick measure shift\r\n var shift = this.getShift(pointer);\r\n return (Math.abs(shift.x) > tolerance) || (Math.abs(shift.y) > tolerance);\r\n };\r\n /**\r\n * Returns if pointer is \"old\", meaning it has been pressing for more than\r\n * X milliseconds.\r\n *\r\n * @ignore\r\n * @param pointer Pointer\r\n * @param minTime Minimum time to consider pointer old\r\n * @return {boolean}\r\n */\r\n Interaction.prototype.old = function (pointer, minTime) {\r\n if (minTime === void 0) { minTime = 300; }\r\n return $time.getTime() - pointer.startTime > minTime;\r\n };\r\n /**\r\n * Returns total a shift in pointers coordinates between its original\r\n * position and now.\r\n *\r\n * @param pointer Pointer\r\n * @return Shift in coordinates (x/y)\r\n */\r\n Interaction.prototype.getShift = function (pointer) {\r\n return {\r\n \"x\": pointer.startPoint.x - pointer.point.x,\r\n \"y\": pointer.startPoint.y - pointer.point.y\r\n };\r\n };\r\n /**\r\n * Returns a point from [[Pointer]]'s move history at a certain timetamp.\r\n *\r\n * @param pointer Pointer\r\n * @param timestamp Timestamp\r\n * @return Point\r\n */\r\n Interaction.prototype.getTrailPoint = function (pointer, timestamp) {\r\n var res;\r\n for (var i = 0; i < pointer.track.length; i++) {\r\n if (pointer.track[i].timestamp >= timestamp) {\r\n res = pointer.track[i];\r\n break;\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if same pointer already exists in the list.\r\n *\r\n * @param list List to check agains\r\n * @param pointer Pointer\r\n * @return Exists?\r\n */\r\n Interaction.prototype.pointerExists = function (list, pointer) {\r\n var exists = false;\r\n list.each(function (item) {\r\n if (item == pointer) {\r\n return;\r\n }\r\n exists = item.point.x == pointer.point.x && item.point.y == pointer.point.y;\r\n });\r\n return exists;\r\n };\r\n /**\r\n * Returns an [[InteractionObject]] representation of a DOM element.\r\n *\r\n * You can use this on any HTML or SVG element, to add interactive features\r\n * to it.\r\n *\r\n * @param element Element\r\n * @return InteractionObject\r\n */\r\n Interaction.prototype.getInteraction = function (element) {\r\n return new InteractionObject(element);\r\n };\r\n /**\r\n * Sets a style property on an element. Stores original value to be restored\r\n * later with [[restoreStyle]].\r\n *\r\n * @see {@link restoreStyle}\r\n * @param io Element\r\n * @param property Property\r\n * @param value Value\r\n */\r\n Interaction.prototype.setTemporaryStyle = function (io, property, value) {\r\n // Get element\r\n //let el = io.element.tagName == \"g\" ? io.element.parentNode : io.element;\r\n var el = io.element;\r\n // Save original property if it is set and hasn't been saved before already\r\n if ($type.hasValue(el.style[property]) && !io.replacedStyles.hasKey(property)) {\r\n io.replacedStyles.setKey(property, el.style[property]);\r\n }\r\n // Replace with the new one\r\n $dom.setStyle(el, property, value);\r\n };\r\n /**\r\n * Restores specific style on an element.\r\n *\r\n * @param io Element\r\n * @param property Style property\r\n */\r\n Interaction.prototype.restoreStyle = function (io, property) {\r\n // Reset style\r\n if (io.replacedStyles.hasKey(property)) {\r\n io.element.style[property] = io.replacedStyles.getKey(property);\r\n io.replacedStyles.removeKey(property);\r\n }\r\n else {\r\n delete io.element.style[property];\r\n }\r\n };\r\n /**\r\n * Restore temporarily reset styles on an element.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.restoreAllStyles = function (io) {\r\n $iter.each(io.replacedStyles.iterator(), function (a) {\r\n var key = a[0];\r\n var value = a[1];\r\n io.element.style[key] = value;\r\n io.replacedStyles.removeKey(key);\r\n });\r\n };\r\n /**\r\n * Disposes this object and cleans up after itself.\r\n */\r\n Interaction.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n _super.prototype.dispose.call(this);\r\n this.restoreAllStyles(this.body);\r\n this.unlockWheel();\r\n }\r\n };\r\n // @ts-ignore Used for debugging\r\n Interaction.prototype.log = function (text, ev, io) {\r\n var show = true;\r\n if (show) {\r\n // Touchlist?\r\n if (ev.changedTouches) {\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n this.logTouch(text, ev.type, ev.changedTouches[i]);\r\n }\r\n return;\r\n }\r\n // Get type\r\n var type = \"\";\r\n if (ev.pointerType) {\r\n switch (ev.pointerType) {\r\n case 2:\r\n type = \"touch\";\r\n break;\r\n case 4:\r\n type = \"mouse\";\r\n break;\r\n default:\r\n type = ev.pointerType;\r\n break;\r\n }\r\n }\r\n else if (typeof TouchEvent != \"undefined\" && ev instanceof TouchEvent) {\r\n type = \"touch\";\r\n }\r\n else if (ev.type.match(/^mouse/)) {\r\n type = \"mouse\";\r\n }\r\n else {\r\n type = \"???\";\r\n }\r\n // Get ID\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = ev.pointerId;\r\n }\r\n else {\r\n id = \"???\";\r\n }\r\n if (io) {\r\n console.log(text + \" (\" + io.uid + \") \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n else {\r\n console.log(text + \" \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether there are currently any objects being transformed (dragged\r\n * or resized).\r\n *\r\n * If `except` is set, that object will be ignored.\r\n *\r\n * @since 4.9.3\r\n * @param except Ignore this object(s)\r\n * @return Objects are being transformed\r\n */\r\n Interaction.prototype.areTransformed = function (except) {\r\n var count = this.transformedObjects.length;\r\n if (except) {\r\n var ex = $type.isArray(except) ? except : [except];\r\n for (var i = 0; i < ex.length; i++) {\r\n if (this.transformedObjects.contains(ex[i])) {\r\n count--;\r\n }\r\n }\r\n }\r\n return count > 0;\r\n };\r\n /**\r\n * Log.\r\n */\r\n Interaction.prototype.logTouch = function (text, type, ev) {\r\n console.log(text + \" \" + type + \" \" + \"touch\" + \" \" + ev.identifier);\r\n };\r\n Object.defineProperty(Interaction, \"passiveSupported\", {\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (this._passiveSupported == null) {\r\n // Check for passive mode support\r\n try {\r\n var options_1 = Object.defineProperty({}, \"passive\", {\r\n get: function () {\r\n _this._passiveSupported = true;\r\n }\r\n });\r\n window.addEventListener(\"test\", options_1, options_1);\r\n window.removeEventListener(\"test\", options_1, options_1);\r\n }\r\n catch (err) {\r\n this._passiveSupported = false;\r\n }\r\n }\r\n return this._passiveSupported;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Interaction;\r\n}(BaseObjectEvents));\r\nexport { Interaction };\r\nvar interaction = null;\r\n/**\r\n * Returns a single unified global instance of [[Interaction]].\r\n *\r\n * All code should use this function, rather than create their own instances\r\n * of [[Interaction]].\r\n */\r\nexport function getInteraction() {\r\n if (interaction == null) {\r\n interaction = new Interaction();\r\n }\r\n return interaction;\r\n}\r\n//# sourceMappingURL=Interaction.js.map","/**\r\n * Functionality related simulating of dragging of elements using keyboard.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { system } from \"../System\";\r\nimport * as $array from \"../utils/Array\";\r\n/**\r\n * [[InteractionKeyboardObject]] is used to simulate dragging of the `draggable`\r\n * element using keyboard arrows.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar InteractionKeyboardObject = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param io An InteractionObject\r\n */\r\n function InteractionKeyboardObject(io, ev) {\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * Indicates direction of current horizontal movement.\r\n *\r\n * 0 - not moving horizontally\r\n * 1 - moving right\r\n * -1 - moving left\r\n */\r\n this.directionX = 0;\r\n /**\r\n * Indicates direction of current vertical movement.\r\n *\r\n * 0 - not moving vertically\r\n * 1 - moving down\r\n * -1 - moving up\r\n */\r\n this.directionY = 0;\r\n this.interaction = io;\r\n this.keyboardEvent = ev;\r\n this._startedOn = new Date().getTime();\r\n getInteraction().processDragStart(io);\r\n system.animations.push(this);\r\n this.update();\r\n }\r\n /**\r\n * It's an update method which is called by the system if\r\n * [[InteractionObject]] is used as animation.\r\n *\r\n * This will update coordinates of the element based on the movement\r\n * directions.\r\n */\r\n InteractionKeyboardObject.prototype.update = function () {\r\n // Init and get settings\r\n var io = this.interaction;\r\n var speed = getInteraction().getKeyboardOption(io, \"speed\"), accelleration = getInteraction().getKeyboardOption(io, \"accelleration\"), accellerationDelay = getInteraction().getKeyboardOption(io, \"accellerationDelay\"), shift = {\r\n x: 0,\r\n y: 0\r\n };\r\n // If SHIFT key is pressed we slash speed by half and disable accelleration\r\n if (this.keyboardEvent.shiftKey) {\r\n speed *= 0.5;\r\n accelleration = 1;\r\n }\r\n // If CTRL is pressed we increase speed by x2\r\n else if (this.keyboardEvent.ctrlKey) {\r\n speed *= 2;\r\n }\r\n // Get elapsed time\r\n var ms = new Date().getTime() - this._startedOn;\r\n var accelleratedMs = ms - accellerationDelay;\r\n // Add accellerated movement\r\n if ((accelleration > 0) && (accelleratedMs > 0)) {\r\n var accellerationFactor = ms / accellerationDelay;\r\n ms = accellerationDelay;\r\n shift.x += this.directionX * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n shift.y += this.directionY * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n }\r\n // Calculate position\r\n shift.x += this.directionX * (speed * ms);\r\n shift.y += this.directionY * (speed * ms);\r\n // Simulate move on Interaction\r\n getInteraction().handleTransformMove(io, shift, { x: 0, y: 0 }, this.keyboardEvent, true, false);\r\n };\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n InteractionKeyboardObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes this object. Removes from system animations.\r\n */\r\n InteractionKeyboardObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n getInteraction().processDragStop(this.interaction);\r\n $array.remove(system.animations, this);\r\n }\r\n };\r\n return InteractionKeyboardObject;\r\n}());\r\nexport { InteractionKeyboardObject };\r\n//# sourceMappingURL=InteractionKeyboardObject.js.map","/**\r\n * Interaction Object module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { InteractionObjectEventDispatcher } from \"./InteractionObjectEvents\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../utils/Dictionary\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Re-exports\r\n */\r\nexport { InteractionObjectEventDispatcher };\r\n/**\r\n * Interaction object represents an object that is subject for any kind of\r\n * interaction with it with any input devices: mouse, touch or keyboard.\r\n *\r\n * Any DOM element can be wrapped into an Internaction object which in turn\r\n * enables attaching various interaction events to it, such as: hit, drag,\r\n * swipe, etc.\r\n *\r\n * To create an [[InteractionObject]] out of a [[Sprite]], use:\r\n * `interaction.getInteractionFromSprite(sprite: Sprite)`\r\n *\r\n * To create an [[InteractionObject]] out of a a regular element:\r\n * `interaction.getInteraction(element: HTMLElement)`\r\n */\r\nvar InteractionObject = /** @class */ (function (_super) {\r\n __extends(InteractionObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InteractionObject(element) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * @ignore\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n _this._eventDispatcher = new InteractionObjectEventDispatcher(_this);\r\n /**\r\n * Collection of Disposers for various events. (so that those get disposed\r\n * when the whole InteractionObject is disposed)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.eventDisposers = new Dictionary();\r\n /**\r\n * A [[Dictionary]] that holds temporarily replaced original style values for\r\n * HTML element, so that they can be restored when the functionality that\r\n * replaced them is done.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.replacedStyles = new Dictionary();\r\n _this._clickable = false;\r\n _this._contextMenuDisabled = false;\r\n _this._hoverable = false;\r\n _this._trackable = false;\r\n _this._draggable = false;\r\n _this._swipeable = false;\r\n _this._resizable = false;\r\n _this._wheelable = false;\r\n _this._inert = false;\r\n /**\r\n * Is element currently hovered?\r\n */\r\n _this._isHover = false;\r\n /**\r\n * Was this element hovered via pointer or is it just \"pretenting\" to be\r\n * hovered.\r\n *\r\n * @ignore\r\n */\r\n _this.isRealHover = false;\r\n /**\r\n * Is the element hovered by touch pointer?\r\n */\r\n _this._isHoverByTouch = false;\r\n /**\r\n * Has element got any pointers currently pressing down on it?\r\n */\r\n _this._isDown = false;\r\n /**\r\n * Does element have focus?\r\n */\r\n _this._isFocused = false;\r\n /**\r\n * Is element currently protected from touch interactions?\r\n */\r\n _this._isTouchProtected = false;\r\n /**\r\n * Options used for inertia functionality.\r\n */\r\n _this._inertiaOptions = new Dictionary();\r\n /**\r\n * A collection of different inertia types, currently playing out.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.inertias = new Dictionary();\r\n /**\r\n * Click/tap options.\r\n */\r\n _this._hitOptions = {};\r\n /**\r\n * Hover options.\r\n */\r\n _this._hoverOptions = {};\r\n /**\r\n * Swipe gesture options.\r\n */\r\n _this._swipeOptions = {};\r\n /**\r\n * Keyboard options.\r\n */\r\n _this._keyboardOptions = {};\r\n /**\r\n * Mouse options.\r\n */\r\n _this._mouseOptions = {};\r\n /**\r\n * Cursor options.\r\n */\r\n _this._cursorOptions = {\r\n \"defaultStyle\": [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }]\r\n };\r\n _this._disposers.push(_this._eventDispatcher);\r\n _this._element = element;\r\n _this.className = \"InteractionObject\";\r\n _this._disposers.push(new DictionaryDisposer(_this.inertias));\r\n _this._disposers.push(new DictionaryDisposer(_this.eventDisposers));\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n ;\r\n Object.defineProperty(InteractionObject.prototype, \"events\", {\r\n /**\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHover\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHover;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHover != value) {\r\n this._isHover = value;\r\n if (value) {\r\n getInteraction().overObjects.moveValue(this);\r\n }\r\n else {\r\n this.isRealHover = false;\r\n getInteraction().overObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHoverByTouch\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHoverByTouch;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHoverByTouch != value) {\r\n this._isHoverByTouch = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"overPointers\", {\r\n /**\r\n * A list of pointers currently over the element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List if pointers currently hovering the element\r\n */\r\n get: function () {\r\n if (!this._overPointers) {\r\n this._overPointers = new List();\r\n }\r\n return this._overPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isDown\", {\r\n /**\r\n * @return Has down pointers?\r\n */\r\n get: function () {\r\n return this._isDown;\r\n },\r\n /**\r\n * Indicates if this element has currently any pointers pressing on it.\r\n *\r\n * @param value Has down pointers?\r\n */\r\n set: function (value) {\r\n if (this.isDown != value) {\r\n this._isDown = value;\r\n if (value) {\r\n getInteraction().downObjects.moveValue(this);\r\n }\r\n else {\r\n getInteraction().downObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"downPointers\", {\r\n /**\r\n * A list of pointers currently pressing down on this element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List of down pointers\r\n */\r\n get: function () {\r\n if (!this._downPointers) {\r\n this._downPointers = new List();\r\n }\r\n return this._downPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isFocused\", {\r\n /**\r\n * @return Focused?\r\n */\r\n get: function () {\r\n return this._isFocused;\r\n },\r\n /**\r\n * Indicates if this element is currently focused.\r\n *\r\n * @param value Focused?\r\n */\r\n set: function (value) {\r\n if (this.isFocused != value) {\r\n this._isFocused = value;\r\n if (value) {\r\n getInteraction().focusedObject = this;\r\n }\r\n else {\r\n getInteraction().focusedObject = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isTouchProtected\", {\r\n /**\r\n * @ignore\r\n * @return Touch protected?\r\n */\r\n get: function () {\r\n return this._isTouchProtected;\r\n },\r\n /**\r\n * Indicates if this element is currently being protected from touch actions.\r\n *\r\n * @ignore\r\n * @param value Touch protected?\r\n */\r\n set: function (value) {\r\n if (this._isTouchProtected != value) {\r\n this._isTouchProtected = value;\r\n if (value) {\r\n getInteraction().unprepElement(this);\r\n }\r\n else if (this.draggable || this.swipeable || this.trackable || this.resizable) {\r\n getInteraction().prepElement(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"clickable\", {\r\n /**\r\n * @return Clickable?\r\n */\r\n get: function () {\r\n return this._clickable;\r\n },\r\n /**\r\n * Is element clickable? Clickable elements will generate \"hit\" events when\r\n * clicked or tapped.\r\n *\r\n * @param value Clickable?\r\n */\r\n set: function (value) {\r\n if (this._clickable !== value) {\r\n this._clickable = value;\r\n getInteraction().processClickable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this._contextMenuDisabled;\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n if (this._contextMenuDisabled !== value) {\r\n this._contextMenuDisabled = value;\r\n getInteraction().processContextMenu(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverable\", {\r\n /**\r\n * @return Hoverable?\r\n */\r\n get: function () {\r\n return this._hoverable;\r\n },\r\n /**\r\n * Indicates if element should generate hover events.\r\n *\r\n * @param value Hoverable?\r\n */\r\n set: function (value) {\r\n if (this._hoverable !== value) {\r\n this._hoverable = value;\r\n getInteraction().processHoverable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"trackable\", {\r\n /**\r\n * @return Track pointer?\r\n */\r\n get: function () {\r\n return this._trackable;\r\n },\r\n /**\r\n * Indicates if pointer movement over element should be tracked.\r\n *\r\n * @param value Track pointer?\r\n */\r\n set: function (value) {\r\n if (this._trackable !== value) {\r\n this._trackable = value;\r\n getInteraction().processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"draggable\", {\r\n /**\r\n * @return Draggable?\r\n */\r\n get: function () {\r\n return this._draggable;\r\n },\r\n /**\r\n * Indicates if element can be dragged. (moved)\r\n *\r\n * @param value Draggable?\r\n */\r\n set: function (value) {\r\n if (this._draggable !== value) {\r\n this._draggable = value;\r\n getInteraction().processDraggable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeable\", {\r\n /**\r\n * @return Track swipe?\r\n */\r\n get: function () {\r\n return this._swipeable;\r\n },\r\n /**\r\n * Indicates whether element should react to swipe gesture.\r\n *\r\n * @param value Track swipe?\r\n */\r\n set: function (value) {\r\n if (this._swipeable !== value) {\r\n this._swipeable = value;\r\n getInteraction().processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"resizable\", {\r\n /**\r\n * @return Resizeble?\r\n */\r\n get: function () {\r\n return this._resizable;\r\n },\r\n /**\r\n * Indicates if element can be resized.\r\n *\r\n * @param value Resizeable?\r\n */\r\n set: function (value) {\r\n if (this._resizable !== value) {\r\n this._resizable = value;\r\n getInteraction().processResizable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"wheelable\", {\r\n /**\r\n * @return Track wheel?\r\n */\r\n get: function () {\r\n return this._wheelable;\r\n },\r\n /**\r\n * Indicates whether track moouse wheel rotation over element.\r\n *\r\n * @param value Track wheel?\r\n */\r\n set: function (value) {\r\n if (this._wheelable !== value) {\r\n this._wheelable = value;\r\n getInteraction().processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inert\", {\r\n /**\r\n * @return Inert?\r\n */\r\n get: function () {\r\n return this._inert;\r\n },\r\n /**\r\n * Indicates if element is inert, i.e. if it should carry movement momentum\r\n * after it is dragged and released.\r\n *\r\n * @param value Inert?\r\n */\r\n set: function (value) {\r\n if (this._inert !== value) {\r\n this._inert = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"focusable\", {\r\n /**\r\n * @return Focusable?\r\n */\r\n get: function () {\r\n return this._focusable;\r\n },\r\n /**\r\n * Indicates if element can gain focus.\r\n *\r\n * @param value Focusable?\r\n */\r\n set: function (value) {\r\n if (this._focusable !== value) {\r\n this._focusable = value;\r\n if (this._focusable && this.tabindex == -1) {\r\n this._tabindex = 1;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"tabindex\", {\r\n /**\r\n * @return Tab index\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._tabindex, -1);\r\n },\r\n /**\r\n * Element's tab index.\r\n *\r\n * @param value Tab index\r\n */\r\n set: function (value) {\r\n if (this._tabindex !== value) {\r\n this._tabindex = value;\r\n if (value > -1) {\r\n this.focusable = true;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * A DOM element associated with this element.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n this._element = element;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalPosition\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Position.\r\n */\r\n get: function () {\r\n return this._originalPosition || { x: 0, y: 0 };\r\n },\r\n /**\r\n * Element's original position.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this._originalPosition = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalScale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalScale, 1);\r\n },\r\n /**\r\n * Element's original scale.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._originalScale !== value) {\r\n this._originalScale = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalAngle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalAngle, 0);\r\n },\r\n /**\r\n * Element's original angle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n if (this._originalAngle !== value) {\r\n this._originalAngle = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inertiaOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"inertiaOptions\", this._inertiaOptions);\r\n }\r\n else {\r\n return this._inertiaOptions;\r\n }\r\n },\r\n /**\r\n * Inertia options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._inertiaOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hitOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hitOptions\", this._hitOptions);\r\n }\r\n else {\r\n return this._hitOptions;\r\n }\r\n },\r\n /**\r\n * Hit options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hitOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hoverOptions\", this._hoverOptions);\r\n }\r\n else {\r\n return this._hoverOptions;\r\n }\r\n },\r\n /**\r\n * Hover options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hoverOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"swipeOptions\", this._swipeOptions);\r\n }\r\n else {\r\n return this._swipeOptions;\r\n }\r\n },\r\n /**\r\n * Swipe options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._swipeOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"keyboardOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"keyboardOptions\", this._keyboardOptions);\r\n }\r\n else {\r\n return this._keyboardOptions;\r\n }\r\n },\r\n /**\r\n * Keyboard options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._keyboardOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"mouseOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"mouseOptions\", this._mouseOptions);\r\n }\r\n else {\r\n return this._mouseOptions;\r\n }\r\n },\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.14\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._mouseOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"cursorOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"cursorOptions\", this._cursorOptions);\r\n }\r\n else {\r\n return this._cursorOptions;\r\n }\r\n },\r\n /**\r\n * Cursor options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._cursorOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related assets from another object of the same\r\n * type.\r\n *\r\n * @param source Source object\r\n */\r\n InteractionObject.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.inertiaOptions = source.inertiaOptions;\r\n this.hitOptions = source.hitOptions;\r\n this.hoverOptions = source.hoverOptions;\r\n this.swipeOptions = source.swipeOptions;\r\n this.keyboardOptions = source.keyboardOptions;\r\n this.cursorOptions = source.cursorOptions;\r\n this.contextMenuDisabled = source.contextMenuDisabled;\r\n getInteraction().applyCursorOverStyle(this);\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n InteractionObject.prototype.setEventDisposer = function (key, value, f) {\r\n var disposer = this.eventDisposers.getKey(key);\r\n if (value) {\r\n if (disposer == null) {\r\n this.eventDisposers.setKey(key, f());\r\n }\r\n }\r\n else {\r\n if (disposer != null) {\r\n disposer.dispose();\r\n this.eventDisposers.removeKey(key);\r\n }\r\n }\r\n };\r\n /**\r\n * Disposes object.\r\n */\r\n InteractionObject.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n // Remove from all interaction registries\r\n var interaction = getInteraction();\r\n interaction.overObjects.removeValue(this);\r\n interaction.downObjects.removeValue(this);\r\n interaction.trackedObjects.removeValue(this);\r\n interaction.transformedObjects.removeValue(this);\r\n // Unlock document wheel\r\n if (this.isHover && this.wheelable) {\r\n interaction.unlockWheel();\r\n }\r\n if (interaction.focusedObject === this) {\r\n interaction.focusedObject = undefined;\r\n }\r\n };\r\n return InteractionObject;\r\n}(BaseObjectEvents));\r\nexport { InteractionObject };\r\n//# sourceMappingURL=InteractionObject.js.map","import { __extends } from \"tslib\";\r\nimport { TargetedEventDispatcher } from \"../utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\n/**\r\n * Represents an Event Dispatcher for [[InteractionObject]].\r\n *\r\n * Besides regular [[EventDispatcher]] functionality it adds new events with\r\n * direct application to DOM nodes. Primarily used to handle keyboard events,\r\n * but can turn into something else moving forward.\r\n */\r\nvar InteractionObjectEventDispatcher = /** @class */ (function (_super) {\r\n __extends(InteractionObjectEventDispatcher, _super);\r\n function InteractionObjectEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Holds a list of Disposers for DOM events added.\r\n */\r\n _this._domEvents = {};\r\n return _this;\r\n }\r\n /**\r\n * Adds a DOM event and returns Disposer.\r\n *\r\n * @return Disposer\r\n */\r\n InteractionObjectEventDispatcher.prototype._addDOMEvent = function (type, key, listener, context) {\r\n var _this = this;\r\n if (!this._domEvents[type]) {\r\n var callback_1 = function (e) {\r\n listener.call(context, key, e);\r\n };\r\n this.target.element.addEventListener(type, callback_1, false);\r\n this._domEvents[type] = new CounterDisposer(function () {\r\n delete _this._domEvents[type];\r\n _this.target.element.removeEventListener(type, callback_1, false);\r\n });\r\n }\r\n return this._domEvents[type].increment();\r\n };\r\n InteractionObjectEventDispatcher.prototype._dispatchKeyboardEvent = function (key, ev) {\r\n // TODO use this.dispatchImmediately ?\r\n if (this.target.events.isEnabled(key)) {\r\n this.target.events.dispatchImmediately(key, {\r\n type: key,\r\n target: this.target,\r\n event: ev\r\n });\r\n }\r\n };\r\n InteractionObjectEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n case \"focusin\":\r\n case \"focusout\":\r\n this.target.focusable = true;\r\n break;\r\n case \"keydown\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keyup\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keypress\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"input\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return InteractionObjectEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { InteractionObjectEventDispatcher };\r\n//# sourceMappingURL=InteractionObjectEvents.js.map","/**\r\n * Mouse-related functionality\r\n */\r\n/**\r\n * Defines static methods that hold style list for various mouse cursor styles,\r\n * maintaining browser compatibility.\r\n */\r\nvar MouseCursorStyle = /** @class */ (function () {\r\n function MouseCursorStyle() {\r\n }\r\n /**\r\n * Styles for \"grab\" mouse cursor.\r\n */\r\n MouseCursorStyle.grab = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grab\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grab\"\r\n }];\r\n /**\r\n * Styles for \"grabbing\" mouse cursor.\r\n */\r\n MouseCursorStyle.grabbing = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grabbing\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grabbing\"\r\n }];\r\n /**\r\n * Styles for \"pointer\" mouse cursor. (usually used for links)\r\n */\r\n MouseCursorStyle.pointer = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"pointer\"\r\n }];\r\n /**\r\n * Styles for default mouse cursor. (browser determines style)\r\n */\r\n MouseCursorStyle.default = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }];\r\n /**\r\n * Styles for horizontal bi-directional resize mouse cursor.\r\n */\r\n MouseCursorStyle.horizontalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ew-resize\"\r\n }];\r\n /**\r\n * Styles for vertical bi-directional mouse cursor.\r\n */\r\n MouseCursorStyle.verticalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ns-resize\"\r\n }];\r\n /**\r\n * Styles for \"no-allowed\" cursor.\r\n * @since 4.7.15\r\n */\r\n MouseCursorStyle.notAllowed = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"not-allowed\"\r\n }];\r\n /**\r\n * Styles for \"text\" cursor.\r\n * @since 4.9.12\r\n */\r\n MouseCursorStyle.text = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"text\"\r\n }];\r\n return MouseCursorStyle;\r\n}());\r\nexport { MouseCursorStyle };\r\n//# sourceMappingURL=Mouse.js.map","/**\r\n * [[AMElement]] represents any SVG element and related functionality.\r\n */\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all SVG elements. Provides low-level DOM functionality.\r\n *\r\n * All visual elements extend this class.\r\n */\r\nvar AMElement = /** @class */ (function () {\r\n /**\r\n * Constructor creates a new element or uses the one that was passed in.\r\n *\r\n * @param element Element reference node type\r\n */\r\n function AMElement(element) {\r\n /**\r\n * Indicates if the element was already disposed.\r\n */\r\n this._isDisposed = false;\r\n /**\r\n * Current X coordinate.\r\n */\r\n this._x = 0;\r\n /**\r\n * Current Y coordinate.\r\n */\r\n this._y = 0;\r\n /**\r\n *\r\n */\r\n this._rotationY = 0;\r\n /**\r\n *\r\n */\r\n this._rotationX = 0;\r\n /**\r\n * Current rotation.\r\n */\r\n this._rotation = 0;\r\n /**\r\n * Current scale.\r\n */\r\n this._scale = 1;\r\n if (typeof element === \"string\") {\r\n this.node = document.createElementNS($dom.SVGNS, element);\r\n }\r\n else {\r\n this.node = element;\r\n }\r\n }\r\n /**\r\n * Removes element's node from DOM.\r\n */\r\n AMElement.prototype.removeNode = function () {\r\n if (this.node) {\r\n if (this.node.parentNode) {\r\n this.node.parentNode.removeChild(this.node);\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"transformString\", {\r\n /**\r\n * Returns `transform` attribute of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Transform attribute value\r\n */\r\n get: function () {\r\n if (this.node) {\r\n return this._transformString;\r\n /*\r\n const value = this.node.getAttribute(\"transform\");\r\n \r\n if (value !== null) {\r\n return value;\r\n }*/\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Appply position, rotation and scale properties via elemen's `transform`\r\n * property\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AMElement.prototype.transform = function () {\r\n var transfromString = \"translate(\" + this._x + \",\" + this._y + \")\";\r\n if (this._scale != 1) {\r\n transfromString += ((transfromString ? \" \" : \"\") + \"scale(\" + this._scale + \")\");\r\n }\r\n if (this._rotation != 0) {\r\n var rotateString = \"rotate(\" + this._rotation + \")\";\r\n if (this._rotationX && this._rotationY) {\r\n rotateString = \"rotate(\" + this._rotation + \" \" + this._rotationX + \" \" + this._rotationY + \")\";\r\n }\r\n transfromString += ((transfromString ? \" \" : \"\") + rotateString);\r\n }\r\n this._transformString = transfromString;\r\n this.node.setAttribute(\"transform\", transfromString);\r\n };\r\n /**\r\n * Returns bounding box of the element.\r\n *\r\n * ATTENTION: Bounding box calculations are extremely costly so should be\r\n * used sparingly and cached whenever possible.\r\n *\r\n * @return Bounding rectangle\r\n */\r\n AMElement.prototype.getBBox = function () {\r\n var bbox = {\r\n width: 0,\r\n height: 0,\r\n x: 0,\r\n y: 0\r\n };\r\n // FF would fail if getBBox() is called without node added to parent\r\n if (this.node && this.node.parentNode) {\r\n try { // again for ff. TODO: check if this doesn't slow down\r\n var svgbbox = this.node.getBBox();\r\n bbox.x = svgbbox.x;\r\n bbox.y = svgbbox.y;\r\n bbox.width = svgbbox.width;\r\n bbox.height = svgbbox.height;\r\n }\r\n catch (err) { }\r\n }\r\n return bbox;\r\n };\r\n /**\r\n * Moves the element to new coordinates.\r\n *\r\n * @param x Target X\r\n * @param y Target Y\r\n */\r\n AMElement.prototype.moveTo = function (point) {\r\n if (point) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (this._x != x || this._y != y) {\r\n this._x = x;\r\n this._y = y;\r\n this.transform();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"content\", {\r\n /**\r\n * Returns element's contents as SVG markup.\r\n *\r\n * @return Contents\r\n */\r\n get: function () {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n return this.node.innerHTML || \"\";\r\n },\r\n /**\r\n * Element's SVG contents.\r\n *\r\n * @param value Contents\r\n */\r\n set: function (value) {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"textContent\", {\r\n /**\r\n * @return Text contents\r\n */\r\n get: function () {\r\n return this.node.textContent || \"\";\r\n },\r\n /**\r\n * Text contents of the SVG element.\r\n *\r\n * @param value Text contents\r\n */\r\n set: function (value) {\r\n this.node.textContent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"x\", {\r\n /**\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n return this._x;\r\n },\r\n /**\r\n * Element's X position in pixels.\r\n *\r\n * @param value X coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._x != value) {\r\n this._x = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n return this._y;\r\n },\r\n /**\r\n * Element's Y position in pixels.\r\n *\r\n * @param value Y coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._y != value) {\r\n this._y = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Element's rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (angle) {\r\n if (this._rotation != angle) {\r\n this._rotation = angle;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationX\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationX;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (x) {\r\n if (this._rotationX != x) {\r\n this._rotationX = x;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationY\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationY;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (y) {\r\n if (this._rotationY != y) {\r\n this._rotationY = y;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"scale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * Element's scale where 1 is original size.\r\n *\r\n * Setting to 0.5 will reduce element's size by 50%, 2 will make element\r\n * twice as large, etc.\r\n *\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._scale != value) {\r\n this._scale = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes an attribute from element.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeAttr = function (attribute) {\r\n this.node.removeAttribute(attribute);\r\n };\r\n /**\r\n * Sets a set of attributes on a element.\r\n *\r\n * @param attributes An object with attribute names (key) and values\r\n * @return The same element\r\n */\r\n AMElement.prototype.attr = function (attributes) {\r\n var _this = this;\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.node.removeAttribute(attributeName);\r\n }\r\n else {\r\n // this is for performance testing\r\n //if(attributeValue == this.node.getAttribute(attributeName)){\r\n //\tconsole.log(attributeName, attributeValue)\r\n //}\r\n _this.node.setAttribute(attributeName, attributeValue);\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Returns a value of a node attribute.\r\n *\r\n * @param attribute Attribute name\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttr = function (attribute) {\r\n return this.node.getAttribute(attribute);\r\n };\r\n /**\r\n * Sets a single attribute of the element's node using namesspace.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @param value Value\r\n * @return The same element\r\n */\r\n AMElement.prototype.attrNS = function (ns, attribute, value) {\r\n this.node.setAttributeNS(ns, attribute, value);\r\n return this;\r\n };\r\n /**\r\n * Returns a namespaced attribute value from node.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttrNS = function (ns, attribute) {\r\n return this.node.getAttributeNS(ns, attribute);\r\n };\r\n /**\r\n * Removes `style` attribute from node.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n this.node.style[attribute] = null;\r\n delete this.node.style[attribute];\r\n };\r\n /**\r\n * Returns style attribute value.\r\n *\r\n * @param attribute Style attribute value\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n return this.node.style[attribute];\r\n };\r\n /**\r\n * Adds style attributes to element's node.\r\n *\r\n * @param attributes Object containing attribute: value pairs\r\n * @return The same element\r\n */\r\n AMElement.prototype.addStyle = function (attributes) {\r\n var _this = this;\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.removeStyle(attributeName);\r\n }\r\n else {\r\n _this.node.style[attributeName] = attributeValue;\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Adds a class to element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.addClass = function (name) {\r\n $dom.addClass(this.node, name);\r\n };\r\n /**\r\n * Removes a class from element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.removeClass = function (name) {\r\n $dom.removeClass(this.node, name);\r\n };\r\n /**\r\n * Sets a class name on element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.setClass = function (name) {\r\n this.node.setAttribute(\"class\", name);\r\n };\r\n /**\r\n * Removes all element's child nodes, basically leaving it empty.\r\n */\r\n AMElement.prototype.removeChildNodes = function () {\r\n // remove all children\r\n while (this.node.childNodes.length > 0) {\r\n this.node.removeChild(this.node.firstChild);\r\n }\r\n };\r\n /**\r\n * Was this element already been disposed?\r\n *\r\n * @return Disposed?\r\n */\r\n AMElement.prototype.isDisposed = function () {\r\n return this._isDisposed;\r\n };\r\n /**\r\n * Disposes element.\r\n */\r\n AMElement.prototype.dispose = function () {\r\n this.removeNode();\r\n };\r\n return AMElement;\r\n}());\r\nexport { AMElement };\r\n//# sourceMappingURL=AMElement.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates an SVG `` element.\r\n *\r\n * SVG groups are used for elements that need more elements just one.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g} About `` element\r\n */\r\nvar Group = /** @class */ (function (_super) {\r\n __extends(Group, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param elementName Element type (should be \"g\")\r\n */\r\n function Group(elementName) {\r\n return _super.call(this, elementName) || this;\r\n }\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.add = function (element) {\r\n if (element) {\r\n this.node.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.addToBack = function (element) {\r\n if (element) {\r\n var first = this.node.childNodes[0];\r\n if (first) {\r\n if (first != element.node) {\r\n this.node.insertBefore(element.node, first);\r\n }\r\n }\r\n else {\r\n this.node.appendChild(element.node);\r\n }\r\n }\r\n };\r\n /**\r\n * Removes the `element` from group.\r\n *\r\n * Please note that this will not dispose the element itself, it will just\r\n * remove it from the group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.removeElement = function (element) {\r\n // todo: not sure about the speed, need to investigate, maybe it's faster to check if node is a child\r\n if (element) {\r\n try {\r\n if (element.node && element.node.parentNode == this.node) {\r\n this.node.removeChild(element.node);\r\n }\r\n }\r\n catch (err) {\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this group already has the child element added\r\n *\r\n * @param element\r\n * @return {boolean}\r\n */\r\n Group.prototype.hasChild = function (element) {\r\n for (var i = 0; i < this.node.childNodes.length; i++) {\r\n if (this.node.childNodes[i] == element.node) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Group.prototype, \"content\", {\r\n /**\r\n * @return SVG markup\r\n */\r\n get: function () {\r\n return this.node.innerHTML;\r\n },\r\n /**\r\n * Content of the group element.\r\n *\r\n * Can be used to add a lot of proprietary SVG markup into group.\r\n *\r\n * @param value SVG markup\r\n */\r\n set: function (value) {\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes all children from the group.\r\n */\r\n Group.prototype.removeChildren = function () {\r\n if (this.node.childNodes) {\r\n while (this.node.childNodes.length > 0) {\r\n var childNode = this.node.firstChild;\r\n if (childNode && childNode.parentNode) {\r\n childNode.parentNode.removeChild(childNode);\r\n }\r\n }\r\n }\r\n };\r\n Group.prototype.removeChildrenByTag = function (tag) {\r\n if (this.node.childNodes) {\r\n var remove = this.node.getElementsByTagName(tag);\r\n for (var i = 0; i < remove.length; i++) {\r\n this.node.removeChild(remove[i]);\r\n }\r\n }\r\n };\r\n return Group;\r\n}(AMElement));\r\nexport { Group };\r\n//# sourceMappingURL=Group.js.map","/**\r\n * Paper class just like the white sheet of pressed fiber it draws its name\r\n * inspiration from is used as a starting point to start a drawing.\r\n *\r\n * Before we can start adding elements (drawing) we need to take out a new sheet\r\n * of paper, or in this instance create a blank SVG element.\r\n *\r\n * This class creates such element, as well as implements methods needed to\r\n * start adding elements to it.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\nimport { Group } from \"./Group\";\r\nimport { SVGContainer } from \"./SVGContainer\";\r\nimport * as $dom from \"../utils/DOM\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Paper class which when instantiated will create an SVG element as well as\r\n * some of the sub-elements like ``, ``.\r\n *\r\n * Use its methods like `addGroup` and `append` to add elements to the paper.\r\n */\r\nvar Paper = /** @class */ (function () {\r\n /**\r\n * Creates main `` container and related elements.\r\n *\r\n * @param container A reference to HTML element to create `` in\r\n */\r\n function Paper(container, id) {\r\n // Store container reference\r\n this.container = container;\r\n this.id = id;\r\n // Create SVG element\r\n var svg = document.createElementNS($dom.SVGNS, \"svg\");\r\n svg.setAttribute(\"version\", \"1.1\");\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns\", $dom.SVGNS);\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns:xlink\", $dom.XLINK);\r\n svg.setAttribute(\"role\", \"group\");\r\n this.container.appendChild(svg);\r\n // Add description\r\n //let desc: SVGElement = document.createElementNS($dom.SVGNS, \"desc\");\r\n //desc.appendChild(document.createTextNode(\"JavaScript chart by amCharts\"));\r\n //svg.appendChild(desc);\r\n // Add defs\r\n this.defs = document.createElementNS($dom.SVGNS, \"defs\");\r\n svg.appendChild(this.defs);\r\n // Set width and height to fit container\r\n svg.style.width = \"100%\";\r\n svg.style.height = \"100%\";\r\n svg.style.overflow = \"visible\";\r\n // Store variable\r\n this.svg = svg;\r\n }\r\n /**\r\n * Creates and returns a new element. Does not attach it to Paper yet.\r\n *\r\n * @param elementName Element name\r\n * @return New element\r\n */\r\n Paper.prototype.add = function (elementName) {\r\n return new AMElement(elementName);\r\n };\r\n /**\r\n * Creates and returns a new Group element. Does not attach it to Paper.\r\n *\r\n * @param groupName Element name\r\n * @return New Group\r\n */\r\n Paper.prototype.addGroup = function (groupName) {\r\n return new Group(groupName);\r\n };\r\n /**\r\n * Appends an element to Paper.\r\n *\r\n * @param element Element to append\r\n */\r\n Paper.prototype.append = function (element) {\r\n if (element) {\r\n this.svg.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Appends an element to `` block of the Paper.\r\n *\r\n * @param element Element\r\n */\r\n Paper.prototype.appendDef = function (element) {\r\n if (element) {\r\n this.defs.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Creates and returns new `` element. Does not append it to\r\n * Paper.\r\n *\r\n * @return A foreignObject element\r\n */\r\n Paper.prototype.foreignObject = function () {\r\n var element = new AMElement(\"foreignObject\");\r\n //this.append(element);\r\n return element;\r\n };\r\n /**\r\n * Checks if browser supports `` elements.\r\n *\r\n * @return Supports `foreignObject`?\r\n */\r\n Paper.prototype.supportsForeignObject = function () {\r\n return document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Extensibility\", \"1.1\");\r\n };\r\n return Paper;\r\n}());\r\nexport { Paper };\r\nvar ghostPaper = null;\r\n/**\r\n * A [[Paper]] instance to create elements, that are not yet ready to be\r\n * placed in visible DOM.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getGhostPaper() {\r\n if (ghostPaper === null) {\r\n // ghost is used to draw elements while real paper is not yet created or Sprite doesn't know parent yet\r\n var ghostDiv = document.createElement(\"div\");\r\n ghostDiv.hidden = true;\r\n ghostDiv.style.width = \"1px\";\r\n ghostDiv.style.height = \"1px\";\r\n ghostDiv.style.position = \"absolute\";\r\n ghostDiv.style.zIndex = \"-1000000\";\r\n document.body.appendChild(ghostDiv);\r\n var ghostSvgContainer = new SVGContainer(ghostDiv, true);\r\n ghostPaper = new Paper(ghostSvgContainer.SVGContainer, \"ghost\");\r\n }\r\n return ghostPaper;\r\n}\r\n//# sourceMappingURL=Paper.js.map","/**\r\n * A collection of functions that deals with path calculations.\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { getGhostPaper } from \"../rendering/Paper\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * ============================================================================\r\n * PATH FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns an SVG path from a number of points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param points An array of line elbow points\r\n * @return SVG path\r\n */\r\nexport function polyline(points) {\r\n var path = lineTo(points[0]);\r\n var prevPoint = { x: 0, y: 0 };\r\n var minStep = options.minPolylineStep;\r\n if (!$type.isNumber(minStep)) {\r\n minStep = 0.5;\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if ($math.getDistance(point, prevPoint) > minStep) {\r\n path += lineTo(point);\r\n prevPoint = point;\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Returns a starting point of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Starting point\r\n * @return SVG path\r\n */\r\nexport function moveTo(point) {\r\n return \" M\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a line part of SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point SVG path\r\n * @return SVG path\r\n */\r\nexport function lineTo(point) {\r\n return \" L\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a quadratic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPoint Control point\r\n * @return SVG path\r\n */\r\nexport function quadraticCurveTo(point, controlPoint) {\r\n return \" Q\" + $math.round(controlPoint.x, 4)\r\n + \",\" + $math.round(controlPoint.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a cubic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPointA Control point A\r\n * @param controlPointB Control point B\r\n * @return SVG path\r\n */\r\nexport function cubicCurveTo(point, controlPointA, controlPointB) {\r\n return \" C\" + $math.round(controlPointA.x, 4)\r\n + \",\" + $math.round(controlPointA.y, 4) + \" \" + $math.round(controlPointB.x, 4)\r\n + \",\" + $math.round(controlPointB.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a terminator for an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @return SVG path\r\n */\r\nexport function closePath() {\r\n return \" Z\";\r\n}\r\n/**\r\n * Returns an arc part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better parameter descriptions\r\n * @param startAngle Starting angle\r\n * @param arc Arc\r\n * @param radius Radius\r\n * @param radiusY Vertical radius\r\n * @return SVG path\r\n */\r\nexport function arcTo(startAngle, arc, radius, radiusY) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(radiusY)) {\r\n radiusY = radius;\r\n }\r\n var path = \"\";\r\n var c = \",\";\r\n var segments = Math.ceil(Math.abs(arc) / 180);\r\n var l = 1;\r\n if (arc < 0) {\r\n l = 0;\r\n }\r\n // previous, as we use a not A\r\n var pax = 0;\r\n var pay = 0;\r\n // center\r\n var cx = -$math.cos(startAngle) * radius;\r\n var cy = -$math.sin(startAngle) * radiusY;\r\n // foir very short angles and big radius, solves artefacts\r\n if (arc < 0.5 && radius > 3000) {\r\n var endAngle = startAngle + arc;\r\n var ax = $math.round($math.cos(endAngle) * radius, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY, 4);\r\n return lineTo({ x: ax, y: ay });\r\n }\r\n for (var i = 0; i < segments; i++) {\r\n var endAngle = startAngle + arc / segments * (i + 1);\r\n var ax = $math.round($math.cos(endAngle) * radius + cx - pax, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY + cy - pay, 4);\r\n path += \" a\" + radius + c + radiusY + c + 0 + c + 0 + c + l + c + ax + c + ay;\r\n pax = ax;\r\n pay = ay;\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates an arc path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startAngle [description]\r\n * @param arc [description]\r\n * @param radius [description]\r\n * @param innerRadius [description]\r\n * @param radiusY [description]\r\n * @param cornerRadius [description]\r\n * @param innerCornerRadius [description]\r\n * @return SVG path\r\n */\r\nexport function arc(startAngle, arc, radius, innerRadius, radiusY, cornerRadius, innerCornerRadius) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(innerRadius)) {\r\n innerRadius = 0;\r\n }\r\n if (radius == 0 && innerRadius <= 0) {\r\n return \"\";\r\n }\r\n if (radius < innerRadius) {\r\n var temp = radius;\r\n radius = innerRadius;\r\n innerRadius = temp;\r\n if ($type.isNumber(radiusY)) {\r\n radiusY = radiusY / innerRadius * radius;\r\n }\r\n }\r\n arc = $math.min(arc, 360);\r\n if (arc == 360) {\r\n cornerRadius = 0;\r\n innerCornerRadius = 0;\r\n }\r\n var endAngle = startAngle + arc;\r\n var crSin = $math.sin($math.min(arc, 45) / 2);\r\n radiusY = $type.isNumber(radiusY) ? radiusY : radius;\r\n cornerRadius = cornerRadius || 0;\r\n innerCornerRadius = $type.isNumber(innerCornerRadius) ? innerCornerRadius : cornerRadius;\r\n var innerRadiusY = (radiusY / radius) * innerRadius;\r\n var cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n var innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n cornerRadius = $math.round($math.fitToRange(cornerRadius, 0, radius * crSin), 4);\r\n cornerRadiusY = $math.round($math.fitToRange(cornerRadiusY, 0, radiusY * crSin), 4);\r\n innerCornerRadius = $math.round($math.fitToRange(innerCornerRadius, 0, innerRadius * crSin), 4);\r\n innerCornerRadiusY = $math.round($math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin), 4);\r\n var crAngle = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n var crAngleY = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n if (innerRadius < innerCornerRadius) {\r\n innerRadius = innerCornerRadius;\r\n }\r\n if (innerRadiusY < innerCornerRadiusY) {\r\n innerRadiusY = innerCornerRadiusY;\r\n }\r\n var crInnerAngle = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n var crInnerAngleY = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n if (!$type.isNumber(crInnerAngle)) {\r\n crInnerAngle = 0;\r\n }\r\n if (!$type.isNumber(crInnerAngleY)) {\r\n crInnerAngleY = 0;\r\n }\r\n var middleAngle = startAngle + arc / 2;\r\n var mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.sin(middleAngle) * innerRadiusY };\r\n var a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n var c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n var d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b1 = { x: $math.cos(startAngle + crAngle) * radius, y: $math.sin(startAngle + crAngleY) * radiusY };\r\n var d1 = { x: $math.cos(endAngle - crInnerAngle) * innerRadius, y: $math.sin(endAngle - crInnerAngleY) * innerRadiusY };\r\n // some magic math\r\n innerCornerRadius += innerCornerRadius * $math.sin(crInnerAngle / 2);\r\n innerCornerRadiusY += innerCornerRadiusY * $math.sin(crInnerAngleY / 2);\r\n if (crInnerAngle > (endAngle - startAngle) / 2) {\r\n d1 = mPoint;\r\n }\r\n var path = \"\";\r\n // start from b if this is full circle\r\n if (arc == 360) {\r\n path = moveTo(b0);\r\n }\r\n // otherwise start from a\r\n else {\r\n path = moveTo(a0);\r\n path += lineTo(b0);\r\n path += arcToPoint(b1, cornerRadius, cornerRadiusY, true);\r\n }\r\n // draw arc\r\n path += arcTo(startAngle + crAngle, arc - 2 * crAngle, radius, radiusY);\r\n // draw inner arc\r\n if ($type.isNumber(innerRadius) && innerRadius != 0) {\r\n // move to B if this is full circle\r\n if (arc == 360 && cornerRadius == 0) {\r\n path += moveTo(d0);\r\n }\r\n // draw line otherwise\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n path += lineTo(d0);\r\n path += arcToPoint(d1, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += arcTo(endAngle - crInnerAngle, -(arc - 2 * crInnerAngle), innerRadius, innerRadiusY);\r\n if (arc < 360 || cornerRadius > 0) {\r\n path += arcToPoint(a0, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += lineTo(a0);\r\n }\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n if (arc < 360) {\r\n path += lineTo(a0);\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates a path for an arc to specific coordinate.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param point Reference point\r\n * @param radius Radius\r\n * @param radiusY Vertical radius (for skewed arcs)\r\n * @param sweepFlag [description]\r\n * @param largeArcFlag [description]\r\n * @param xAxisRotation [description]\r\n * @return Arc path\r\n */\r\nexport function arcToPoint(point, radius, radiusY, sweepFlag, largeArcFlag, xAxisRotation) {\r\n if (radius == 0) {\r\n return \"\";\r\n }\r\n xAxisRotation = xAxisRotation || 0;\r\n largeArcFlag = Boolean(largeArcFlag);\r\n sweepFlag = Boolean(sweepFlag);\r\n var c = \",\";\r\n var sweepFlagValue = +sweepFlag; // converts to 1 or 0\r\n var largeArcFlagValue = +largeArcFlag; // converts to 1 or 0\r\n return \" A\" + radius + c + radiusY + c + xAxisRotation + c + largeArcFlagValue + c + sweepFlagValue + c + $math.round(point.x, 4) + c + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Creates a new rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param x X position\r\n * @param y Y position\r\n * @return Rectangle\r\n */\r\nexport function rectangle(width, height, x, y) {\r\n if (!$type.isNumber(x)) {\r\n x = 0;\r\n }\r\n if (!$type.isNumber(y)) {\r\n y = 0;\r\n }\r\n return moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\r\n}\r\n/**\r\n * Converts a rectangle to an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Rectangle\r\n * @param ccw Counter-clockwise?\r\n * @return SVG path\r\n */\r\nexport function rectToPath(rect, ccw) {\r\n var c = \",\";\r\n var L = \" L\";\r\n if (ccw) {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + rect.x\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + rect.y + L + rect.x\r\n + c + rect.y;\r\n }\r\n else {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + rect.y;\r\n }\r\n}\r\n/**\r\n * Converts SVG path to array of points.\r\n *\r\n * Note, this is experimental feature based on method which is deprecated\r\n * on some browsers and some browsers do not support it at all.\r\n *\r\n * You can save the output of this function, but not rely on it completely.\r\n */\r\nexport function pathToPoints(path, pointCount) {\r\n var paper = getGhostPaper();\r\n var svgPath = paper.add(\"path\").node;\r\n svgPath.setAttribute(\"d\", path);\r\n if (svgPath.getPointAtLength && svgPath.getTotalLength) {\r\n var length_1 = svgPath.getTotalLength();\r\n var toPoints = [];\r\n for (var i = 0; i < pointCount; i++) {\r\n var point = svgPath.getPointAtLength(i / pointCount * length_1);\r\n toPoints.push({ x: point.x, y: point.y });\r\n }\r\n return toPoints;\r\n }\r\n svgPath.remove();\r\n}\r\nexport function spiralPoints(cx, cy, radius, radiusY, innerRadius, step, radiusStep, startAngle, endAngle) {\r\n if (!$type.isNumber(startAngle)) {\r\n startAngle = 0;\r\n }\r\n if (!$type.isNumber(startAngle)) {\r\n endAngle = startAngle;\r\n }\r\n var r = innerRadius + 0.01;\r\n var angle = startAngle * $math.RADIANS;\r\n var points = [];\r\n while (r < radius + radiusStep) {\r\n var stepSize = step;\r\n if (stepSize / 2 > r) {\r\n stepSize = 2 * r;\r\n }\r\n angle += 2 * Math.asin(stepSize / 2 / r);\r\n if (angle * $math.DEGREES > endAngle + ((radius - innerRadius) / radiusStep) * 360) {\r\n break;\r\n }\r\n var degrees = angle * $math.DEGREES;\r\n var point = { x: cx + r * Math.cos(angle), y: cy + r * radiusY / radius * Math.sin(angle) };\r\n points.push(point);\r\n r = innerRadius + degrees / 360 * radiusStep;\r\n }\r\n points.shift();\r\n return points;\r\n}\r\nexport function pointsToPath(points) {\r\n if (!points || points.length == 0) {\r\n return \"\";\r\n }\r\n var path = moveTo(points[0]);\r\n if (points && points.length > 0) {\r\n for (var i = 1; i < points.length; i++) {\r\n path += lineTo(points[i]);\r\n }\r\n }\r\n return path;\r\n}\r\n//# sourceMappingURL=Path.js.map","/**\r\n * This functionality is related to the HTML wrapper that houses `` tag.\r\n */\r\nimport { Popup } from \"../elements/Popup\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { ListTemplate, ListDisposer } from \"../utils/List\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { ResizeSensor } from \"../utils/ResizeSensor\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A array of all SVG Containers (one SVG container per chart instance).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var svgContainers = [];\r\n/**\r\n * A class used to create an HTML wrapper for the SVG contents.\r\n */\r\nvar SVGContainer = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * * Creates an HTML wrapper for SVG\r\n */\r\n function SVGContainer(htmlElement, ghost) {\r\n var _this = this;\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * If this component is in a separate HTML container, `autoResize` means the\r\n * module will constantly measure container's size and adopt contents to it.\r\n */\r\n this.autoResize = true;\r\n /**\r\n * Holds list of references to [[Sprite]] objects that should not be exported\r\n * when exporting chart to an image.\r\n *\r\n * @ignore\r\n */\r\n this.nonExportableSprites = [];\r\n /**\r\n * List of objects that need to be disposed when this one is disposed.\r\n */\r\n this._disposers = [];\r\n this.cssScale = 1;\r\n // This is needed so that it won't resize while printing, so that way printing works correctly.\r\n this._printing = false;\r\n // Log parent HTML element\r\n this.htmlElement = htmlElement;\r\n if (!ghost) {\r\n this._printing = false;\r\n this.initSensor();\r\n this._disposers.push($dom.addEventListener(window, \"beforeprint\", function () {\r\n _this._printing = true;\r\n }));\r\n this._disposers.push($dom.addEventListener(window, \"afterprint\", function () {\r\n _this._printing = false;\r\n }));\r\n }\r\n // Adds to containers array\r\n svgContainers.push(this);\r\n /**\r\n * Create child div for the container - it will have svg node\r\n * It might seem that this container is not necessay, however having it solves\r\n * a problems with mouse position detection and some other.\r\n */\r\n var svgContainer = document.createElement(\"div\");\r\n var style = svgContainer.style;\r\n style.width = \"100%\";\r\n style.height = \"100%\";\r\n style.position = \"relative\";\r\n htmlElement.appendChild(svgContainer);\r\n this.SVGContainer = svgContainer;\r\n }\r\n /**\r\n * (Re)Initializes a resize sensor.\r\n */\r\n SVGContainer.prototype.initSensor = function () {\r\n var _this = this;\r\n if (this.resizeSensor) {\r\n this.resizeSensor.dispose();\r\n }\r\n var callback = function () {\r\n if (_this.autoResize && !_this._printing) {\r\n _this.measure();\r\n }\r\n };\r\n this.resizeSensor = new ResizeSensor(this.htmlElement, callback);\r\n this._disposers.push(this.resizeSensor);\r\n };\r\n /**\r\n * Measures size of parent HTML element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SVGContainer.prototype.measure = function () {\r\n var width = $utils.width(this.htmlElement);\r\n var height = $utils.height(this.htmlElement);\r\n var container = this.container;\r\n if (container) {\r\n if (this.width != width || this.height != height) {\r\n this.width = width;\r\n this.height = height;\r\n if (width > 0) {\r\n container.maxWidth = width;\r\n }\r\n if (height > 0) {\r\n container.maxHeight = height;\r\n }\r\n $dom.fixPixelPerfect(this.SVGContainer);\r\n }\r\n if (!container.maxWidth) {\r\n container.maxWidth = 0;\r\n }\r\n if (!container.maxHeight) {\r\n container.maxHeight = 0;\r\n }\r\n this.cssScale = 1;\r\n this.checkTransform(this.htmlElement);\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"container\", {\r\n /**\r\n * @return Container\r\n */\r\n get: function () {\r\n return this._container;\r\n },\r\n /**\r\n * A [[Container]] element which is placed into container.\r\n *\r\n * @param container Container\r\n */\r\n set: function (container) {\r\n this._container = container;\r\n this.measure();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n SVGContainer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Removes this container from SVG container list in system, which\r\n * effectively disables size change monitoring for it.\r\n */\r\n SVGContainer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n $array.remove(svgContainers, this);\r\n }\r\n $array.each(this._disposers, function (item) {\r\n item.dispose();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"hideOverflow\", {\r\n /**\r\n * Indicates if chart container should have its style set\r\n * to `overflow: hidden`.\r\n *\r\n * Normally, we don't want that, so that certain elements, such as tooltips,\r\n * would be able to go outside chart area.\r\n *\r\n * There is one issue though. Some browsers ignore SVG masks and would\r\n * display scrollbars if chart elements, that go outside chart area extend\r\n * outside window.\r\n *\r\n * This is especially true for [[MapChart]], which can have its elements\r\n * extend very widely when zoomed in. Even if those parts are not visible\r\n * because of SVG masks, some browsers might still display window scrollbars.\r\n *\r\n * This is why we set this setting to `true` in [[MapChart]].\r\n *\r\n * Other charts use default of `false`.\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.SVGContainer.style.overflow = \"hidden\";\r\n }\r\n else {\r\n this.SVGContainer.style.overflow = \"\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SVGContainer.prototype, \"modal\", {\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._modal)) {\r\n // Create new modal\r\n this._modal = new Modal();\r\n this._modal.container = this.SVGContainer;\r\n // Add to disposers\r\n this._disposers.push(this._modal);\r\n }\r\n return this._modal;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n SVGContainer.prototype.openModal = function (text, title) {\r\n // Hide previous modal\r\n this.closeModal();\r\n // Create modal\r\n var modal = this.modal;\r\n modal.content = text;\r\n modal.readerTitle = title || \"\";\r\n modal.title = title || \"\";\r\n modal.open();\r\n return modal;\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n SVGContainer.prototype.closeModal = function () {\r\n if (this._modal) {\r\n this.modal.close();\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._popups)) {\r\n // Create popup template\r\n var popupTemplate = new Popup();\r\n popupTemplate.container = this.SVGContainer;\r\n // Create the list\r\n this._popups = new ListTemplate(popupTemplate);\r\n // Add to disposers\r\n this._disposers.push(new ListDisposer(this._popups));\r\n this._disposers.push(this._popups.template);\r\n }\r\n return this._popups;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n SVGContainer.prototype.openPopup = function (text, title) {\r\n var popup = this.popups.create();\r\n popup.content = text;\r\n if ($type.hasValue(title)) {\r\n popup.title = title;\r\n }\r\n popup.open();\r\n return popup;\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n SVGContainer.prototype.closeAllPopups = function () {\r\n this.popups.each(function (popup) {\r\n popup.close();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"readerAlertElement\", {\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A `
` element used as as placeholder to trigger screen alerts.\r\n *\r\n * @sunce 4.9.2\r\n * @return Element\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._readerAlertElement)) {\r\n // Create element\r\n var div = document.createElement(\"div\");\r\n div.setAttribute(\"role\", \"alert\");\r\n div.style.zIndex = \"-100000\";\r\n div.style.opacity = \"0\";\r\n div.style.position = \"absolute\";\r\n div.style.top = \"0\";\r\n this.SVGContainer.appendChild(div);\r\n this._readerAlertElement = div;\r\n }\r\n return this._readerAlertElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Triggers screen reader read out a message.\r\n *\r\n * @since 4.9.2\r\n * @param text Alert text\r\n */\r\n SVGContainer.prototype.readerAlert = function (text) {\r\n this.readerAlertElement.innerHTML = text;\r\n };\r\n /**\r\n * ==========================================================================\r\n * OTHER STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n SVGContainer.prototype.checkTransform = function (div) {\r\n if (window.getComputedStyle) {\r\n if (div && div.style) {\r\n var style = window.getComputedStyle(div, null);\r\n if (style) {\r\n var matrix = style.getPropertyValue(\"-webkit-transform\") ||\r\n style.getPropertyValue(\"-moz-transform\") ||\r\n style.getPropertyValue(\"-ms-transform\") ||\r\n style.getPropertyValue(\"-o-transform\") ||\r\n style.getPropertyValue(\"transform\");\r\n if (matrix && matrix !== \"none\") {\r\n var values = matrix.split('(')[1].split(')')[0].split(',');\r\n var a = Number(values[0]);\r\n var b = Number(values[1]);\r\n var scale = Math.sqrt(a * a + b * b);\r\n if (!isNaN(scale)) {\r\n this.cssScale *= scale;\r\n }\r\n }\r\n }\r\n }\r\n if (div.parentNode && div.parentNode instanceof HTMLElement) {\r\n this.checkTransform(div.parentNode);\r\n }\r\n }\r\n };\r\n return SVGContainer;\r\n}());\r\nexport { SVGContainer };\r\n//# sourceMappingURL=SVGContainer.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"./Path\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Tension = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n */\r\n function Tension(tensionX, tensionY) {\r\n this._tensionX = tensionX;\r\n this._tensionY = tensionY;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Tension.prototype.smooth = function (points) {\r\n for (var i = points.length - 1; i > 0; i--) {\r\n var p0 = points[i];\r\n var p1 = points[i - 1];\r\n if (Math.abs(p0.x - p1.x) < 0.1 && Math.abs(p0.y - p1.y) < 0.1) {\r\n points.splice(i - 1, 1);\r\n }\r\n }\r\n var tensionX = this._tensionX;\r\n var tensionY = this._tensionY;\r\n if (points.length < 3 || (tensionX >= 1 && tensionY >= 1)) {\r\n return $path.polyline(points);\r\n }\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed = true;\r\n }\r\n // Can't moveTo here, as it wont be possible to have fill then.\r\n var path = \"\";\r\n for (var i = 0, len = points.length - 1; i < len; i++) {\r\n var p0 = points[i - 1];\r\n var p1 = points[i];\r\n var p2 = points[i + 1];\r\n var p3 = points[i + 2];\r\n if (i === 0) {\r\n if (closed) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (i == points.length - 2) {\r\n if (closed) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[i + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n }\r\n return path;\r\n };\r\n return Tension;\r\n}());\r\nexport { Tension };\r\n/**\r\n * Returns a waved line SVG path between two points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point1 Starting point\r\n * @param point2 Ending point\r\n * @param waveLength Wave length\r\n * @param waveHeight Wave height\r\n * @param adjustWaveLength Adjust wave length based on the actual line length\r\n * @return SVG path\r\n */\r\nexport function wavedLine(point1, point2, waveLength, waveHeight, tension, adjustWaveLength) {\r\n var x1 = point1.x;\r\n var y1 = point1.y;\r\n var x2 = point2.x;\r\n var y2 = point2.y;\r\n var distance = $math.getDistance(point1, point2);\r\n if (adjustWaveLength) {\r\n waveLength = distance / Math.round(distance / waveLength);\r\n }\r\n var d = registry.getCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]));\r\n if (!d) {\r\n if (distance > 0) {\r\n var angle = Math.atan2(y2 - y1, x2 - x1);\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var waveLengthX = waveLength * cos;\r\n var waveLengthY = waveLength * sin;\r\n if (waveLength <= 1 || waveHeight <= 1) {\r\n d = $path.lineTo(point2);\r\n }\r\n else {\r\n var halfWaveCount = Math.round(2 * distance / waveLength);\r\n var points = [];\r\n var sign_1 = 1;\r\n if (x2 < x1) {\r\n sign_1 *= -1;\r\n }\r\n if (y2 < y1) {\r\n sign_1 *= -1;\r\n }\r\n for (var i = 0; i <= halfWaveCount; i++) {\r\n sign_1 *= -1;\r\n var x = x1 + i * waveLengthX / 2 + sign_1 * waveHeight / 2 * sin;\r\n var y = y1 + i * waveLengthY / 2 - sign_1 * waveHeight / 2 * cos;\r\n points.push({ x: x, y: y });\r\n }\r\n d = new Tension(tension, tension).smooth(points);\r\n }\r\n }\r\n else {\r\n d = \"\";\r\n }\r\n registry.setCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]), d);\r\n }\r\n return d;\r\n}\r\nvar Monotone = /** @class */ (function () {\r\n function Monotone(reversed, info) {\r\n this._reversed = reversed;\r\n this._closed = info.closed;\r\n }\r\n // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\r\n // \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\r\n // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\r\n Monotone.prototype._curve = function (x0, x1, y0, y1, t0, t1) {\r\n var dx = (x1 - x0) / 3;\r\n if (this._reversed) {\r\n return $path.cubicCurveTo({ x: y1, y: x1 }, { x: y0 + dx * t0, y: x0 + dx }, { x: y1 - dx * t1, y: x1 - dx });\r\n }\r\n else {\r\n return $path.cubicCurveTo({ x: x1, y: y1 }, { x: x0 + dx, y: y0 + dx * t0 }, { x: x1 - dx, y: y1 - dx * t1 });\r\n }\r\n };\r\n Monotone.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var t0 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n $array.each(points, function (_a) {\r\n var x = _a.x, y = _a.y;\r\n if (_this._reversed) {\r\n var temp = x;\r\n x = y;\r\n y = temp;\r\n }\r\n var t1 = NaN;\r\n if (!(x === x1 && y === y1)) {\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._reversed) {\r\n output += $path.lineTo({ x: y, y: x });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n break;\r\n case 2:\r\n point = 3;\r\n output += _this._curve(x0, x1, y0, y1, slope2(x0, x1, y0, y1, t1 = slope3(x0, x1, y0, y1, x, y)), t1);\r\n break;\r\n default:\r\n output += _this._curve(x0, x1, y0, y1, t0, t1 = slope3(x0, x1, y0, y1, x, y));\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n t0 = t1;\r\n }\r\n });\r\n switch (point) {\r\n case 2:\r\n if (this._reversed) {\r\n output += $path.lineTo({ x: y1, y: x1 });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n }\r\n break;\r\n case 3:\r\n output += this._curve(x0, x1, y0, y1, t0, slope2(x0, x1, y0, y1, t0));\r\n break;\r\n }\r\n if (this._closed) {\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Monotone;\r\n}());\r\nexport { Monotone };\r\n// TODO move this someplace else\r\nfunction sign(x) {\r\n return x < 0 ? -1 : 1;\r\n}\r\nfunction slope2(x0, x1, y0, y1, t) {\r\n var h = x1 - x0;\r\n return h ? (3 * (y1 - y0) / h - t) / 2 : t;\r\n}\r\nfunction slope3(x0, x1, y0, y1, x2, y2) {\r\n var h0 = x1 - x0;\r\n var h1 = x2 - x1;\r\n var s0 = (y1 - y0) / (h0 || h1 < 0 && -0);\r\n var s1 = (y2 - y1) / (h1 || h0 < 0 && -0);\r\n var p = (s0 * h1 + s1 * h0) / (h0 + h1);\r\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\r\n}\r\nvar MonotoneX = /** @class */ (function (_super) {\r\n __extends(MonotoneX, _super);\r\n function MonotoneX(info) {\r\n return _super.call(this, false, info) || this;\r\n }\r\n return MonotoneX;\r\n}(Monotone));\r\nexport { MonotoneX };\r\nvar MonotoneY = /** @class */ (function (_super) {\r\n __extends(MonotoneY, _super);\r\n function MonotoneY(info) {\r\n return _super.call(this, true, info) || this;\r\n }\r\n return MonotoneY;\r\n}(Monotone));\r\nexport { MonotoneY };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Basis = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param info [description]\r\n */\r\n function Basis(info) {\r\n this._closed = info.closed;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Basis.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var x2 = NaN;\r\n var x3 = NaN;\r\n var x4 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var y2 = NaN;\r\n var y3 = NaN;\r\n var y4 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n var pushCurve = function (x, y) {\r\n output += $path.cubicCurveTo({\r\n x: (x0 + 4 * x1 + x) / 6,\r\n y: (y0 + 4 * y1 + y) / 6\r\n }, {\r\n x: (2 * x0 + x1) / 3,\r\n y: (2 * y0 + y1) / 3\r\n }, {\r\n x: (x0 + 2 * x1) / 3,\r\n y: (y0 + 2 * y1) / 3\r\n });\r\n };\r\n var pushPoint = function (_a) {\r\n var x = _a.x, y = _a.y;\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._closed) {\r\n x2 = x;\r\n y2 = y;\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n if (_this._closed) {\r\n x3 = x;\r\n y3 = y;\r\n }\r\n break;\r\n case 2:\r\n point = 3;\r\n if (_this._closed) {\r\n x4 = x;\r\n y4 = y;\r\n output += $path.moveTo({ x: (x0 + 4 * x1 + x) / 6, y: (y0 + 4 * y1 + y) / 6 });\r\n break;\r\n }\r\n else {\r\n output += $path.lineTo({ x: (5 * x0 + x1) / 6, y: (5 * y0 + y1) / 6 });\r\n // fall-through\r\n }\r\n default:\r\n pushCurve(x, y);\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n };\r\n $array.each(points, pushPoint);\r\n if (this._closed) {\r\n switch (point) {\r\n case 1:\r\n output += $path.moveTo({ x: x2, y: y2 });\r\n output += $path.closePath();\r\n break;\r\n case 2:\r\n output += $path.moveTo({ x: (x2 + 2 * x3) / 3, y: (y2 + 2 * y3) / 3 });\r\n output += $path.lineTo({ x: (x3 + 2 * x2) / 3, y: (y3 + 2 * y2) / 3 });\r\n output += $path.closePath();\r\n break;\r\n case 3:\r\n pushPoint({ x: x2, y: y2 });\r\n pushPoint({ x: x3, y: y3 });\r\n pushPoint({ x: x4, y: y4 });\r\n break;\r\n }\r\n }\r\n else {\r\n switch (point) {\r\n case 3:\r\n pushCurve(x1, y1);\r\n // fall-through\r\n case 2:\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n break;\r\n }\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Basis;\r\n}());\r\nexport { Basis };\r\n//# sourceMappingURL=Smoothing.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Circular pattern\r\n */\r\nvar CirclePattern = /** @class */ (function (_super) {\r\n __extends(CirclePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CirclePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"radius\"] = 2;\r\n _this._circle = _this.paper.add(\"circle\");\r\n _this.addElement(_this._circle);\r\n _this.shapeRendering = \"auto\";\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle element.\r\n */\r\n CirclePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this._circle) {\r\n this._circle.attr({ \"r\": this.radius, \"cx\": this.width / 2, \"cy\": this.height / 2 });\r\n }\r\n };\r\n Object.defineProperty(CirclePattern.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.properties[\"radius\"];\r\n },\r\n /**\r\n * Circle radius in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"radius\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return CirclePattern;\r\n}(Pattern));\r\nexport { CirclePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CirclePattern\"] = CirclePattern;\r\n//# sourceMappingURL=CirclePattern.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ColorModifier = /** @class */ (function (_super) {\r\n __extends(ColorModifier, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Modifies color value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Original color\r\n * @return Modified\r\n */\r\n ColorModifier.prototype.modify = function (value) {\r\n return value;\r\n };\r\n return ColorModifier;\r\n}(BaseObject));\r\nexport { ColorModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorModifier\"] = ColorModifier;\r\n//# sourceMappingURL=ColorModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColorModifier } from \"./ColorModifier\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"GradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar GradientModifier = /** @class */ (function (_super) {\r\n __extends(GradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function GradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.lightnesses = [];\r\n _this.brightnesses = [];\r\n _this.opacities = [];\r\n _this.offsets = [];\r\n _this.className = \"GradientModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(GradientModifier.prototype, \"lightnesses\", {\r\n /**\r\n * @return Lightness values\r\n */\r\n get: function () {\r\n return this._lightnesses;\r\n },\r\n /**\r\n * An array of lightness values for each step.\r\n *\r\n * @param value Lightness values\r\n */\r\n set: function (value) {\r\n this._lightnesses = value;\r\n this._brightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"brightnesses\", {\r\n /**\r\n * @return Brightness values\r\n */\r\n get: function () {\r\n return this._brightnesses;\r\n },\r\n /**\r\n * An array of brightness values for each step.\r\n *\r\n * @param value Brightness values\r\n */\r\n set: function (value) {\r\n this._brightnesses = value;\r\n this._lightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"opacities\", {\r\n /**\r\n * @return Opacity values\r\n */\r\n get: function () {\r\n return this._opacities;\r\n },\r\n /**\r\n * An array of opacity values for each step.\r\n *\r\n * @param value Opacity values\r\n */\r\n set: function (value) {\r\n this._opacities = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"offsets\", {\r\n /**\r\n * @return Offsets\r\n */\r\n get: function () {\r\n return this._offsets;\r\n },\r\n /**\r\n * An array of relative position (0-1) for each step.\r\n *\r\n * If not set, all steps will be of equal relative length.\r\n *\r\n * @param value Offsets\r\n */\r\n set: function (value) {\r\n this._offsets = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Modifies the color based on step setting.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Source color\r\n * @return A gradient that matches set modification rules\r\n */\r\n GradientModifier.prototype.modify = function (value) {\r\n // Clear current gradient\r\n this.gradient.clear();\r\n // Get step count\r\n var count = 0;\r\n if (this.opacities) {\r\n count = $math.max(count, this.opacities.length);\r\n }\r\n if (this.lightnesses) {\r\n count = $math.max(count, this.lightnesses.length);\r\n }\r\n if (this.brightnesses) {\r\n count = $math.max(count, this.brightnesses.length);\r\n }\r\n // Init step values\r\n var opacity = 1, lightness, brightness;\r\n // Apply steps\r\n for (var i = 0; i < count; i++) {\r\n // Take base color\r\n var color = value;\r\n // Check if there are any parameters for this step\r\n if (this.opacities && $type.isNumber(this.opacities[i])) {\r\n opacity = this.opacities[i];\r\n }\r\n if (this.lightnesses && $type.isNumber(this.lightnesses[i])) {\r\n lightness = this.lightnesses[i];\r\n brightness = undefined;\r\n }\r\n if (this.brightnesses && $type.isNumber(this.brightnesses[i])) {\r\n brightness = this.brightnesses[i];\r\n lightness = undefined;\r\n }\r\n // Check if we need to brighten/lighten color\r\n if ($type.isNumber(brightness)) {\r\n color = value.brighten(this.brightnesses[i]);\r\n }\r\n else if ($type.isNumber(lightness)) {\r\n color = value.lighten(this.lightnesses[i]);\r\n }\r\n // Get offset (it's OK if it's undefined)\r\n var offset = this.offsets[i];\r\n // Apply step\r\n this.gradient.addColor(color, opacity, offset);\r\n }\r\n return this.gradient;\r\n };\r\n GradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this._offsets = source.offsets;\r\n this._brightnesses = source.brightnesses;\r\n this._lightnesses = source.lightnesses;\r\n this._opacities = source.opacities;\r\n };\r\n return GradientModifier;\r\n}(ColorModifier));\r\nexport { GradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GradientModifier\"] = GradientModifier;\r\n//# sourceMappingURL=GradientModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $path from \"../../rendering/Path\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Line pattern.\r\n */\r\nvar LinePattern = /** @class */ (function (_super) {\r\n __extends(LinePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LinePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"gap\"] = 0;\r\n _this._line = _this.paper.add(\"path\");\r\n _this.addElement(_this._line);\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n LinePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n this.properties[\"shapeRendering\"] = \"auto\";\r\n }\r\n if (this._line) {\r\n var w = this.width;\r\n var h = this.height;\r\n var path = \"\";\r\n if (!this.gap) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path = $path.moveTo({ x: -w, y: h / 2 }) + $path.lineTo({ x: w * 2, y: h / 2 });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n }\r\n }\r\n else {\r\n var step = this.gap + this.strokeWidth;\r\n var count = this.height / step;\r\n for (var i = -count / 2; i < count * 1.5; i++) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path += $path.moveTo({ x: -w, y: (i + 0.5) * step }) + $path.lineTo({ x: w * 2, y: (i + 0.5) * step });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path += $path.moveTo({ x: -w, y: i * step }) + $path.lineTo({ x: w * 2, y: i * step });\r\n }\r\n }\r\n }\r\n this._line.attr({ \"d\": path });\r\n }\r\n };\r\n Object.defineProperty(LinePattern.prototype, \"gap\", {\r\n /**\r\n * @return gap\r\n */\r\n get: function () {\r\n return this.properties[\"gap\"];\r\n },\r\n /**\r\n * Number of pixels between pattern lines.\r\n *\r\n * The pattern will automatically draw required number of lines to fill\r\n * pattern area maintaining `gap` distance between them.\r\n *\r\n * 0 (zero) means only single line will be drawn.\r\n *\r\n * @default 0\r\n * @since 4.7.7\r\n */\r\n set: function (value) {\r\n this.properties[\"gap\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinePattern;\r\n}(Pattern));\r\nexport { LinePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinePattern\"] = LinePattern;\r\n//# sourceMappingURL=LinePattern.js.map","/**\r\n * Contains code and logic for generating linear gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Linear gradient class.\r\n */\r\nvar LinearGradient = /** @class */ (function (_super) {\r\n __extends(LinearGradient, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradient() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n /**\r\n * Gradient direction.\r\n */\r\n _this._rotation = 0;\r\n _this.className = \"LinearGradient\";\r\n _this._stops.events.on(\"setIndex\", _this.validate, _this);\r\n _this._stops.events.on(\"inserted\", _this.validate, _this);\r\n // Create element\r\n _this.element = _this.paper.addGroup(\"linearGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.validate = function () {\r\n var _this = this;\r\n var rotation = (this._rotation + 90) * $math.RADIANS;\r\n var x1 = Math.round(50 + Math.sin(rotation + Math.PI) * 50) + '%';\r\n var y1 = Math.round(50 + Math.cos(rotation) * 50) + '%';\r\n var x2 = Math.round(50 + Math.sin(rotation) * 50) + '%';\r\n var y2 = Math.round(50 + Math.cos(rotation + Math.PI) * 50) + '%';\r\n var gradientElement = this.element;\r\n gradientElement.removeChildNodes();\r\n gradientElement.attr({ \"x1\": x1, \"x2\": x2, \"y1\": y1, \"y2\": y2 });\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n LinearGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.validate();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Rotation (direction) of the gradient in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n //this.element.attr({ \"gradientTransform\": \"rotate(\" + value + \" 10 100)\" });\r\n this._rotation = value;\r\n this.validate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LinearGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this._rotation = source.rotation;\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"gradientUnits\", {\r\n /**\r\n * Which units are used when drawing gradient filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying gradient on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.element.attr({ gradientUnits: value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinearGradient;\r\n}(BaseObject));\r\nexport { LinearGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradient\"] = LinearGradient;\r\n//# sourceMappingURL=LinearGradient.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar LinearGradientModifier = /** @class */ (function (_super) {\r\n __extends(LinearGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LinearGradientModifier\";\r\n _this.gradient = new LinearGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n LinearGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return LinearGradientModifier;\r\n}(GradientModifier));\r\nexport { LinearGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradientModifier\"] = LinearGradientModifier;\r\n//# sourceMappingURL=LinearGradientModifier.js.map","/**\r\n * Pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { List, ListDisposer } from \"../../utils/List\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { registry } from \"../../Registry\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $type from \"../../utils/Type\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define patterns.\r\n */\r\nvar Pattern = /** @class */ (function (_super) {\r\n __extends(Pattern, _super);\r\n //public propertyValues = new Dictionary();\r\n /**\r\n * Constructor\r\n */\r\n function Pattern() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of elements the pattern consists of.\r\n */\r\n _this._elements = new List();\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link PatternProperties}\r\n */\r\n _this.properties = {};\r\n _this.className = \"Pattern\";\r\n // Set defaults\r\n _this.width = 10;\r\n _this.height = 10;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.patternUnits = \"userSpaceOnUse\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.backgroundFill = interfaceColors.getFor(\"background\");\r\n _this.backgroundOpacity = 0;\r\n _this.fillOpacity = 1;\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.strokeOpacity = 1;\r\n _this.strokeWidth = 1;\r\n _this.shapeRendering = \"crispEdges\";\r\n _this.rotation = 0;\r\n // Create main group to store pattern elements inelements\r\n _this.element = _this.paper.addGroup(\"pattern\");\r\n _this.id = \"pattern-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Make elements disposable\r\n _this._disposers.push(new ListDisposer(_this._elements));\r\n // Request again to trigger getter/setter code\r\n _this.patternUnits = _this.patternUnits;\r\n _this.width = _this.width;\r\n _this.height = _this.height;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n Pattern.prototype.draw = function () {\r\n var _this = this;\r\n var patternElement = this.element;\r\n if (patternElement) {\r\n patternElement.removeChildNodes();\r\n var background = this.paper.add(\"rect\");\r\n background.attr({ \"width\": this.width, \"height\": this.height, \"shape-rendering\": \"crispEdges\", \"fill\": this.backgroundFill.hex, \"fill-opacity\": this.backgroundOpacity, \"stroke\": this.backgroundFill.hex, \"stroke-opacity\": 0 });\r\n patternElement.add(background);\r\n patternElement.attr({ \"x\": this.x, \"y\": this.y, \"width\": this.width, \"height\": this.height, \"stroke\": this.stroke.hex, \"fill\": this.fill.hex, \"fill-opacity\": this.fillOpacity, \"stroke-opacity\": this.strokeOpacity, \"stroke-width\": this.strokeWidth, \"shape-rendering\": this.shapeRendering, \"patternUnits\": this.patternUnits, \"stroke-dasharray\": this.strokeDasharray });\r\n $iter.each(this._elements.iterator(), function (element) {\r\n element.rotation = _this.rotation;\r\n element.rotationX = _this.properties[\"rotationX\"];\r\n element.rotationY = _this.properties[\"rotationY\"];\r\n _this.element.add(element);\r\n });\r\n }\r\n };\r\n /**\r\n * Animate pattern properties.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Pattern.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Adds an element to the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.addElement = function (element) {\r\n this._elements.push(element);\r\n this._disposers.push(element);\r\n };\r\n /**\r\n * Remove an element from the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.removeElement = function (element) {\r\n this._elements.removeValue(element);\r\n this.removeDispose(element);\r\n };\r\n Object.defineProperty(Pattern.prototype, \"elements\", {\r\n /**\r\n * Returns the list of SVG elements comprising the pattern.\r\n *\r\n * @return Pattern elements\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"fillOpacity\"];\r\n },\r\n /**\r\n * Pattern fill opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"fillOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fill\", {\r\n /**\r\n * @return Fill color\r\n */\r\n get: function () {\r\n return this.properties[\"fill\"];\r\n },\r\n /**\r\n * Fill color of the pattern.\r\n *\r\n * @param value Fill color\r\n */\r\n set: function (value) {\r\n this.properties[\"fill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundFill\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundFill\"];\r\n },\r\n /**\r\n * Pattern background fill color.\r\n *\r\n * @param value Background color\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundFill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundOpacity\", {\r\n /**\r\n * @return Background opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundOpacity\"];\r\n },\r\n /**\r\n * Pattern backgorund opacity. (0-1)\r\n *\r\n * @param value Background opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Pattern stroke (border) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeOpacity\"];\r\n },\r\n /**\r\n * Pattern stroke opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Stroke thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Pattern stroke thickness in pixels.\r\n *\r\n * @param value Stroke thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"shapeRendering\", {\r\n get: function () {\r\n return this.properties[\"shapeRendering\"];\r\n },\r\n /**\r\n * Shape rendering\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.properties[\"shapeRendering\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.properties[\"rotation\"];\r\n },\r\n /**\r\n * Pattern rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n this.properties[\"rotation\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"patternUnits\", {\r\n /**\r\n * @return Units\r\n */\r\n get: function () {\r\n return this.properties[\"patternUnits\"];\r\n },\r\n /**\r\n * Pattern measuring units.\r\n *\r\n * Available options: \"userSpaceOnUse\" | \"objectBoundingBox\".\r\n *\r\n * @param value Units\r\n */\r\n set: function (value) {\r\n this.properties[\"patternUnits\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"width\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Pattern width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"height\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Pattern height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"x\", {\r\n /**\r\n * @return X (px)\r\n */\r\n get: function () {\r\n return this.properties[\"x\"];\r\n },\r\n /**\r\n * X position. (pixels)\r\n *\r\n * @param value X (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"x\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"y\", {\r\n /**\r\n * @return Y (px)\r\n */\r\n get: function () {\r\n return this.properties[\"y\"];\r\n },\r\n /**\r\n * Y position (px).\r\n *\r\n * @param value Y (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"y\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instance to draw pattern in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another Pattern instance.\r\n *\r\n * @param source Source pattern\r\n */\r\n Pattern.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n $object.each(source.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Pattern.prototype, \"animations\", {\r\n /**\r\n * A list of animations currently running on the patter.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation list\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.properties[\"strokeDashArray\"];\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeDashArray\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Pattern.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.elements) && $type.isArray(config.elements)) {\r\n for (var i = 0, len = config.elements.length; i < len; i++) {\r\n var element = config.elements[i];\r\n if ($type.hasValue(element[\"type\"])) {\r\n var sprite = this.createEntryInstance(element);\r\n if (sprite instanceof BaseObject) {\r\n sprite.config = element;\r\n }\r\n this.addElement($type.hasValue(element[\"typeProperty\"])\r\n ? sprite[element[\"typeProperty\"]]\r\n : sprite.element);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return Pattern;\r\n}(BaseObject));\r\nexport { Pattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Pattern\"] = Pattern;\r\n//# sourceMappingURL=Pattern.js.map","/**\r\n * Contains code and logic for generating radial gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Percent } from \"../../utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Radial gradient class.\r\n */\r\nvar RadialGradient = /** @class */ (function (_super) {\r\n __extends(RadialGradient, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RadialGradient() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n _this.element = _this.paper.addGroup(\"radialGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n */\r\n RadialGradient.prototype.draw = function () {\r\n var _this = this;\r\n var gradientElement = this.element;\r\n if ($type.isNumber(this.cx)) {\r\n var value = this.cx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cx\": value });\r\n }\r\n if ($type.isNumber(this.cy)) {\r\n var value = this.cy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cy\": value });\r\n }\r\n if (this.fx) {\r\n var value = this.fx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fx\": value });\r\n }\r\n if (this.fy) {\r\n var value = this.fy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fy\": value });\r\n }\r\n gradientElement.removeChildNodes();\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n RadialGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n this.draw();\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cx\", {\r\n get: function () {\r\n return this._cx;\r\n },\r\n /**\r\n * Center x coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cy\", {\r\n get: function () {\r\n return this._cy;\r\n },\r\n /**\r\n * Center y coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fx\", {\r\n get: function () {\r\n return this._fx;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fy\", {\r\n get: function () {\r\n return this._fy;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RadialGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this.cx = source.cx;\r\n this.cy = source.cy;\r\n this.fx = source.fx;\r\n this.fy = source.fy;\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RadialGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n return RadialGradient;\r\n}(BaseObject));\r\nexport { RadialGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradient\"] = RadialGradient;\r\n//# sourceMappingURL=RadialGradient.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify radial gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar RadialGradientModifier = /** @class */ (function (_super) {\r\n __extends(RadialGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function RadialGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RadialGradientModifier\";\r\n _this.gradient = new RadialGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n RadialGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return RadialGradientModifier;\r\n}(GradientModifier));\r\nexport { RadialGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradientModifier\"] = RadialGradientModifier;\r\n//# sourceMappingURL=RadialGradientModifier.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Rectangular pattern\r\n */\r\nvar RectPattern = /** @class */ (function (_super) {\r\n __extends(RectPattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RectPattern() {\r\n var _this = _super.call(this) || this;\r\n _this.rectHeight = 1;\r\n _this.rectWidth = 1;\r\n _this._rect = _this.paper.add(\"rect\");\r\n _this.addElement(_this._rect);\r\n return _this;\r\n }\r\n /**\r\n * Draws the rectangular element.\r\n */\r\n RectPattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n if (this._rect) {\r\n this._rect.attr({ \"width\": this.rectWidth, \"height\": this.rectHeight, \"x\": (this.width - this.rectWidth) / 2, \"y\": (this.height - this.rectHeight) / 2 });\r\n }\r\n };\r\n Object.defineProperty(RectPattern.prototype, \"rectWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectWidth\"];\r\n },\r\n /**\r\n * Rectangle width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RectPattern.prototype, \"rectHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectHeight\"];\r\n },\r\n /**\r\n * Rectangle height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectHeight\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RectPattern;\r\n}(Pattern));\r\nexport { RectPattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RectPattern\"] = RectPattern;\r\n//# sourceMappingURL=RectPattern.js.map","/**\r\n * Module for \"Blur\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Blur\" filter.\r\n */\r\nvar BlurFilter = /** @class */ (function (_super) {\r\n __extends(BlurFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BlurFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BlurFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur value.\r\n *\r\n * The bigger the value, the blurrier the target element will become.\r\n *\r\n * @default 1.5\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BlurFilter;\r\n}(Filter));\r\nexport { BlurFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"BlurFilter\"] = BlurFilter;\r\n//# sourceMappingURL=BlurFilter.js.map","/**\r\n * Module for \"Colorize\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Colorize\" filter.\r\n */\r\nvar ColorizeFilter = /** @class */ (function (_super) {\r\n __extends(ColorizeFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorizeFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorizeFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n //this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.intensity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)applies colors to the already existing filter by modifying filyer's\r\n * color matrix element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ColorizeFilter.prototype.applyFilter = function () {\r\n var i = this.intensity;\r\n var ii = 1 - i;\r\n var r;\r\n var g;\r\n var b;\r\n var color = this.color;\r\n if (color && color.rgb) {\r\n r = color.rgb.r / 255 * i;\r\n g = color.rgb.g / 255 * i;\r\n b = color.rgb.b / 255 * i;\r\n }\r\n else {\r\n r = 0;\r\n g = 0;\r\n b = 0;\r\n }\r\n this.feColorMatrix.attr({ \"values\": ii + \" 0 0 0 \" + r + \" 0 \" + ii + \" 0 0 \" + g + \" 0 0 \" + ii + \" 0 \" + b + \" 0 0 0 1 0\" });\r\n };\r\n Object.defineProperty(ColorizeFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"color\"];\r\n },\r\n /**\r\n * Target color to apply to the element.\r\n *\r\n * Depending on the `intensity`, all colors of the target element will steer\r\n * towards this color.\r\n *\r\n * E.g. setting to `am4core.color(\"greener\")` will make all colors greener.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"color\"] = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorizeFilter.prototype, \"intensity\", {\r\n /**\r\n * @return Intensity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.intensity;\r\n },\r\n /**\r\n * Intensity of the color (0-1).\r\n *\r\n * The bigger the number the more of a `color` target's colors will become.\r\n *\r\n * 0 means the colors will remain as they are.\r\n * 1 means all colors will become the target `color`.\r\n *\r\n * @default 1\r\n * @param value Intensity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.intensity = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ColorizeFilter;\r\n}(Filter));\r\nexport { ColorizeFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorizeFilter\"] = ColorizeFilter;\r\n//# sourceMappingURL=ColorizeFilter.js.map","/**\r\n * Module for \"Desaturate\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Desaturate\" filter\r\n */\r\nvar DesaturateFilter = /** @class */ (function (_super) {\r\n __extends(DesaturateFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DesaturateFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DesaturateFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"saturate\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.width = 120;\r\n _this.height = 120;\r\n _this.saturation = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DesaturateFilter.prototype, \"saturation\", {\r\n /**\r\n * @return Saturation (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"saturation\"];\r\n },\r\n /**\r\n * Saturation.\r\n *\r\n * 0 - completely desaturated.\r\n * 1 - fully saturated (gray).\r\n *\r\n * @param value Saturation (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"saturation\"] = value;\r\n this.feColorMatrix.attr({ \"values\": value.toString() });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DesaturateFilter;\r\n}(Filter));\r\nexport { DesaturateFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DesaturateFilter\"] = DesaturateFilter;\r\n//# sourceMappingURL=DesaturateFilter.js.map","/**\r\n * Module for \"Drop Shadow\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Drop Shadow\" filter.\r\n */\r\nvar DropShadowFilter = /** @class */ (function (_super) {\r\n __extends(DropShadowFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DropShadowFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DropShadowFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.color = color(\"#000\");\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n _this.feOffset = _this.paper.add(\"feOffset\");\r\n _this.feOffset.attr({ \"result\": \"offsetBlur\" });\r\n _this.filterPrimitives.push(_this.feOffset);\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": _this.color });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"in2\": \"offsetBlur\", operator: \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feMerge = _this.paper.addGroup(\"feMerge\");\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\"));\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\").attr({ \"in\": \"SourceGraphic\" }));\r\n _this.filterPrimitives.push(_this.feMerge);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.dx = 3;\r\n _this.dy = 3;\r\n _this.opacity = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Shadow color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties.color = value;\r\n if (this.feFlood) {\r\n this.feFlood.attr({ \"flood-color\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.opacity;\r\n },\r\n /**\r\n * Opacity of the shadow. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.opacity = value;\r\n this.feFlood.attr({ \"flood-opacity\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dx;\r\n },\r\n /**\r\n * Horizontal offset in pixels.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dx = value;\r\n this.feOffset.attr({ \"dx\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dy;\r\n },\r\n /**\r\n * Vertical offset in pixels.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dy = value;\r\n this.feOffset.attr({ \"dy\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur.\r\n *\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [updateScale description]\r\n *\r\n * @todo Description\r\n */\r\n DropShadowFilter.prototype.updateScale = function () {\r\n this.dx = this.dx;\r\n this.dy = this.dy;\r\n this.blur = this.blur;\r\n };\r\n return DropShadowFilter;\r\n}(Filter));\r\nexport { DropShadowFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DropShadowFilter\"] = DropShadowFilter;\r\n//# sourceMappingURL=DropShadowFilter.js.map","/**\r\n * This module contains a base class for an SVG filter.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { List } from \"../../utils/List\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base filter class.\r\n *\r\n * This class while can be instantiated will not do anything. It is just a base\r\n * functionality for any other \"real\" filters to extend.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n *\r\n * @todo Example\r\n */\r\nvar Filter = /** @class */ (function (_super) {\r\n __extends(Filter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Filter() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link FilterProperties}\r\n */\r\n _this.properties = {};\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * [_scale description]\r\n *\r\n * @todo Description\r\n */\r\n _this._scale = 1;\r\n /**\r\n * [_nonScaling description]\r\n *\r\n * @todo Description\r\n */\r\n _this._nonScaling = true;\r\n _this.className = \"Filter\";\r\n // Create a list to hold primitives (effect elements)\r\n _this.filterPrimitives = new List();\r\n _this.properties.filterUnits = \"objectBoundingBox\";\r\n // Automatically add added primitives to `_disposers` so they are discarded\r\n // when Filter object is destroyed (disposed)\r\n _this.filterPrimitives.events.on(\"inserted\", function (ev) {\r\n _this._disposers.push(ev.newValue);\r\n });\r\n // Set default dimensions\r\n _this.width = 120;\r\n _this.height = 120;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Appends actual filter elements to the filter group.\r\n *\r\n * @ignore Exclude from docs\r\n * @param filterElement An SVG `` element to add filter element to\r\n */\r\n Filter.prototype.appendPrimitives = function (filterElement) {\r\n $iter.each(this.filterPrimitives.iterator(), function (filterPrimitive) {\r\n filterElement.add(filterPrimitive);\r\n });\r\n };\r\n /**\r\n * Uses Transitions filter's values from current to target. This is used to\r\n * smoothly appear filter, rather than it pop into effect.\r\n *\r\n * @ignore Exclude from docs\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Filter.prototype.animate = function (animationOptions, duration, easing) {\r\n var animation = new Animation(this, animationOptions, duration, easing).start();\r\n return animation;\r\n };\r\n Object.defineProperty(Filter.prototype, \"width\", {\r\n /**\r\n * @return Width (%)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Width of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"height\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Height of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Height (%)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another [[Filter]] object.\r\n *\r\n * @param filter Source [[Filter]] object\r\n */\r\n Filter.prototype.copyFrom = function (filter) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, filter);\r\n $object.each(filter.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Filter.prototype, \"paper\", {\r\n /**\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * Sets [[Paper]] instance to create filter's elements in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"animations\", {\r\n /**\r\n * All animations currently in play.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"scale\", {\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * [[Sprite]] uses this method to inform filter about it's scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n set: function (value) {\r\n this._scale = value;\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates filter properties which depend on scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Filter.prototype.updateScale = function () {\r\n // Dummy method for extending classes to override.\r\n };\r\n Object.defineProperty(Filter.prototype, \"filterUnits\", {\r\n /**\r\n * @return Filter units\r\n */\r\n get: function () {\r\n return this.properties.filterUnits;\r\n },\r\n /**\r\n * Which units are used when drawing filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying filters on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.properties.filterUnits = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"nonScaling\", {\r\n /**\r\n * @return Non scaling?\r\n */\r\n get: function () {\r\n return this._nonScaling;\r\n },\r\n /**\r\n * If a filter is non scaling, it will look the same even if the sprite is\r\n * scaled, otherwise filter will scale together with a [[Sprite]].\r\n *\r\n * @default false\r\n * @param value Non scaling?\r\n */\r\n set: function (value) {\r\n this._nonScaling = value;\r\n if (!value) {\r\n this._scale = 1;\r\n }\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"sprite\", {\r\n /**\r\n * A target element this filter is currently attached to.\r\n *\r\n * We need to keep track of it because one filter can be used for just one\r\n * element, so we have to remove it from the old \"parent\" when attaching to\r\n * the new one.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n this.setSprite(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n Filter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.filters.removeValue(this);\r\n }\r\n this._sprite = value;\r\n };\r\n return Filter;\r\n}(BaseObject));\r\nexport { Filter };\r\n//# sourceMappingURL=Filter.js.map","/**\r\n * Module for \"Focus\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Filter } from \"./Filter\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Focus\" filter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n */\r\nvar FocusFilter = /** @class */ (function (_super) {\r\n __extends(FocusFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function FocusFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"FocusFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": new InterfaceColorSet().getFor(\"primaryButtonHover\"), \"result\": \"base\" });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feMorphology = _this.paper.add(\"feMorphology\");\r\n _this.feMorphology.attr({ \"result\": \"bigger\", \"in\": \"SourceGraphic\", \"operator\": \"dilate\", \"radius\": \"2\" });\r\n _this.filterPrimitives.push(_this.feMorphology);\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"result\": \"mask\", \"in\": \"bigger\", \"type\": \"matrix\", \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"result\": \"drop\", \"in\": \"base\", \"in2\": \"mask\", \"operator\": \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feBlend = _this.paper.add(\"feBlend\");\r\n _this.feBlend.attr({ \"in\": \"SourceGraphic\", \"in2\": \"drop\", \"mode\": \"normal\" });\r\n _this.filterPrimitives.push(_this.feBlend);\r\n // Set default properties\r\n _this.width = 130;\r\n _this.height = 130;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(FocusFilter.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Stroke (outline) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.feFlood.attr({ \"flood-color\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Outline thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Outline thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.feMorphology.attr({ \"radius\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Outline opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"opacity\"];\r\n },\r\n /**\r\n * Opacity of the outline. (0-1)\r\n *\r\n * @param value Outline opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"opacity\"] = value;\r\n this.feColorMatrix.attr({ \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" + value + \" 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * In addition it also disables built-in focus outline on element this\r\n * filter is applied to.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n FocusFilter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.group.removeStyle(\"outline\");\r\n }\r\n value.group.addStyle({\r\n \"outline\": \"none\"\r\n });\r\n _super.prototype.setSprite.call(this, value);\r\n };\r\n return FocusFilter;\r\n}(Filter));\r\nexport { FocusFilter };\r\n//# sourceMappingURL=FocusFilter.js.map","/**\r\n * Module for \"Lighten\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Lighten\" filter.\r\n */\r\nvar LightenFilter = /** @class */ (function (_super) {\r\n __extends(LightenFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LightenFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LightenFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.lightness = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LightenFilter.prototype, \"lightness\", {\r\n /**\r\n * @return Lightness\r\n */\r\n get: function () {\r\n return this.properties[\"lightness\"];\r\n },\r\n /**\r\n * Lightness of the target colors.\r\n *\r\n * If `lightness` is a positive number, the filter will make all colors\r\n * lighter.\r\n *\r\n * If `lightness` is negative, colors will be darkened.\r\n *\r\n * @param value Lightness\r\n */\r\n set: function (value) {\r\n this.properties[\"lightness\"] = value;\r\n var v = value + 1;\r\n this.feColorMatrix.attr({ \"values\": v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 1 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LightenFilter;\r\n}(Filter));\r\nexport { LightenFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LightenFilter\"] = LightenFilter;\r\n//# sourceMappingURL=LightenFilter.js.map"],"names":["DateFormatter","_super","_this","call","this","_dateFormat","_inputDateFormat","_utc","timezoneMinutes","_firstDayOfWeek","months","monthsShort","weekdays","weekdaysShort","_outputFormat","capitalize","className","applyTheme","Object","defineProperty","prototype","get","_language","set","value","dateFormat","translate","enumerable","configurable","format","source","applyTimezone","formatted","date","language","sprite","parse","intlLocales","Intl","DateTimeFormat","undefined","e","info","parseFormat","timezoneOffset","setMinutes","getMinutes","getTimezoneOffset","timezone","getTime","applyFormat","replace","substr","toUpperCase","cached","getCache","chunks","chunk","i","length","type","text","match","matches","x","parts","push","template","setCache","fullYear","month","weekday","day","hours","minutes","seconds","milliseconds","res","offset","timestamp","utc","getUTCFullYear","getUTCMonth","getUTCDay","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getFullYear","getMonth","getDay","getDate","getHours","getSeconds","getMilliseconds","len","Math","abs","toString","week","year","ceil","translateFunc","firstDayOfWeek","round","pow","tz","tzh","floor","tzm","toISOString","toUTCString","inputDateFormat","Date","reg","parsedIndexes","resValues","indexAdjust","index","year3","year2","year1","getStringList","join","monthLong","monthShort","yearDay","weekdayLong","weekdayShort","am","hour12Base1","hourBase0","hour12Base0","hourBase1","minute","second","millisecond","millisecondDigits","zone","iso","regex","RegExp","parseInt","val","resolveMonth","resolveShortMonth","hour","isAm","ts","resolveTimezoneOffset","UTC","dir","originalOffset","diff","indexOf","isDefault","translateAll","list","invalidateSprite","invalidate","_intlLocales","_timezoneOffset","_timezone","toLowerCase","DurationFormatter","_negativeBase","_baseUnit","_unitValues","_unitAliases","base","baseUnit","durationFormat","getFormat","details","Number","positive","negative","zero","color","split","part","item","parsed","partFormat","dirs","absolute","tstamp","toTimeStamp","unit","toTimeUnit","digits","ints","code","outputFormat","maxValue","maxUnit","getValueUnit","durationFormats","currentUnit","ms","key","num","_durationFormat","_durationFormats","NumberFormatter","_numberFormat","_smallNumberThreshold","_forceLTR","dispose","precision","NumberFormat","mod","decimals","active","forceLTR","translateEmpty","mods","modSpacing","a","thousands","passive","b","interval","pop","prefix","suffix","a_1","applyPrefix","bytePrefixes","a_2","smallNumberThreshold","smallNumberPrefixes","bigNumberPrefixes","ol","min","parseFloat","toPrecision","exp","toExponential","d","Array","ip","intsr","reverse","c","unshift","separator","decs","prefixes","force","newvalue","applied","k","number","_bigNumberPrefixes","_smallNumberPrefixes","_bytePrefixes","escape","unescape","formatter","TextFormatter","adapter","debug","output","styles","wrap","texts","t","apply","s","cleanUp","style","wrapHtml","translateStyleShortcuts","wrapSvg","getSvgElement","element","textContent","node","setAttribute","styleSvgToHtml","getHtmlElement","document","createElement","innerHTML","q","quotedBlocks","noFormatting","chunks2","i2","chunk2","isImage","getTextFormatter","Inertia","interaction","point","startPoint","animations","_disposers","handleMove","y","events","isEnabled","imev","target","shift","touch","dispatchImmediately","done","inertias","removeKey","processDragStop","Interaction","_globalEventsAdded","_pointerEvents","_usePointerEventsOnly","_useTouchEventsOnly","_addHoverEvents","_passiveSupported","_delayedEvents","out","overObjects","downObjects","trackedObjects","transformedObjects","pointers","inertiaOptions","hitOptions","hoverOptions","swipeOptions","keyboardOptions","mouseOptions","body","getInteraction","window","hasOwnProperty","pointerdown","pointerup","pointermove","pointercancel","pointerover","pointerout","matchMedia","navigator","userAgent","fullFF","wheel","onmousewheel","setKey","passiveSupported","addGlobalEvents","ev","handleGlobalPointerDown","handleGlobalPointerMove","handleGlobalPointerUp","relatedTarget","buttons","which","handleDocumentLeave","handleGlobalTouchStart","handleGlobalTouchMove","handleGlobalTouchEnd","handleGlobalKeyDown","handleGlobalKeyUp","processClickable","io","processTouchable","processContextMenu","contextMenuDisabled","eventDisposers","hasKey","preventDefault","getKey","processHoverable","hoverable","trackable","applyCursorOverStyle","handlePointerOut","handlePointerOver","disposer","processMovable","draggable","swipeable","resizable","isGlobalElement","isTouchProtected","prepElement","processTrackable","moveValue","removeValue","processDraggable","processSwipeable","processResizable","processWheelable","wheelable","handleMouseWheel","on","unlockWheel","lockWheel","processFocusable","focusable","tabindex","handleFocus","handleBlur","handleFocusBlur","clickable","handleTouchDown","handlePointerDown","isFocused","event","getHitOption","once","disableType","enableType","focusedObject","disposerKey","ko","directionY","directionX","showTooltipOn","pointer","getPointer","getPointerPoint","addBreadCrumb","handleGlobalMove","processDelayed","preventTouchAction","defaultPrevented","cancelled","handleGlobalUp","changedTouches","button","resetPointer","handleDown","handleOver","handleOut","deltaX","deltaY","deltaMode","getMouseOption","WheelEvent","Error","wheelDeltaX","wheelDeltaY","handleWheel","maybePreventDefault","handleHit","now","lastHit","lastHitPointer","soft","hoversPaused","shouldCancelHovers","areTransformed","moved","cancelAllHovers","overPointers","isRealHover","isHover","handleTrack","hasDelayedOut","old","behavior","getHoverOption","keepUntil","timeout","setTimeout","isDisposed","clear","delayedEvent","inert","stopInertia","downPointers","applyCursorDownStyle","isDown","processDragStart","processResizeStart","sorted","values","slice","sort","pos","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","contains","handleUp","backwards","iterator","each","restoreCursorDownStyle","swiped","handleSwipe","handleInertia","processResizeStop","cancelable","getIndex","target_1","lastEvent","reset","swiping","handleTransform","skipCheck","handleMoveInertia","handleResizeInertia","inertia","ref","getTrailPoint","getInertiaOption","factor","animationOptions","animation","start","lastUpEvent","pointer2","point2","startPoint2","pointer1","point1","startPoint1","originalPosition","singlePoint","nextPointer","pointer1Moved","dragStartEvents","handleTransformMove","pointer2Moved","handleTransformResize","ctrlKey","pointerMoved","scale","dragTarget","getDragPointer","dragStart","lastDownEvent","dragStop","getPointerId","id","identifier","pointerId","clientX","clientY","isPointerTouch","lastPointer","Touch","PointerEvent","pointerType","MouseEvent","startTime","track","swipeCanceled","lockDocument","unlockDocument","restoreAllStyles","lockElement","unlockElement","addEventListener","wheelLockEvent","removeEventListener","isLocalElement","svg","doc","elementFromPoint","local","el","props","setTemporaryStyle","unprepElement","restoreStyle","option","getSwipeOption","getKeyboardOption","options","cursorOptions","overStyle","property","downStyle","setGlobalStyle","restoreGlobalStyle","tolerance","minTime","getShift","pointerExists","exists","replacedStyles","log","show","logTouch","TouchEvent","console","uid","except","count","ex","options_1","err","InteractionKeyboardObject","_disposed","keyboardEvent","_startedOn","update","speed","accelleration","accellerationDelay","shiftKey","accelleratedMs","accellerationFactor","InteractionObject","_eventDispatcher","_clickable","_contextMenuDisabled","_hoverable","_trackable","_draggable","_swipeable","_resizable","_wheelable","_inert","_isHover","_isHoverByTouch","_isDown","_isFocused","_isTouchProtected","_inertiaOptions","_hitOptions","_hoverOptions","_swipeOptions","_keyboardOptions","_mouseOptions","_cursorOptions","_element","isHoverByTouch","_overPointers","_downPointers","_focusable","_tabindex","_originalPosition","_originalScale","_originalAngle","_adapterO","copyFrom","setEventDisposer","f","InteractionObjectEventDispatcher","arguments","_domEvents","_addDOMEvent","listener","context","callback_1","increment","_dispatchKeyboardEvent","_on","callback","shouldClone","dispatch","disposers","MouseCursorStyle","grab","grabbing","default","horizontalResize","verticalResize","notAllowed","AMElement","_isDisposed","_x","_y","_rotationY","_rotationX","_rotation","_scale","createElementNS","removeNode","parentNode","removeChild","_transformString","transform","transfromString","rotateString","getBBox","bbox","width","height","svgbbox","moveTo","angle","removeAttr","attribute","removeAttribute","attr","attributes","attributeName","attributeValue","getAttr","getAttribute","attrNS","ns","setAttributeNS","getAttrNS","getAttributeNS","removeStyle","getStyle","addStyle","addClass","name","removeClass","setClass","removeChildNodes","childNodes","firstChild","Group","elementName","add","appendChild","addToBack","first","insertBefore","removeElement","hasChild","removeChildren","childNode","removeChildrenByTag","tag","remove","getElementsByTagName","Paper","container","defs","overflow","addGroup","groupName","append","appendDef","foreignObject","supportsForeignObject","implementation","hasFeature","ghostPaper","getGhostPaper","ghostDiv","hidden","position","zIndex","ghostSvgContainer","SVGContainer","polyline","points","path","lineTo","prevPoint","minStep","quadraticCurveTo","controlPoint","cubicCurveTo","controlPointA","controlPointB","closePath","arcTo","startAngle","arc","radius","radiusY","segments","l","pax","pay","cx","cy","endAngle","ax","ay","innerRadius","cornerRadius","innerCornerRadius","temp","crSin","innerRadiusY","cornerRadiusY","innerCornerRadiusY","crAngle","asin","crAngleY","crInnerAngle","crInnerAngleY","middleAngle","mPoint","a0","b0","c0","d0","b1","d1","arcToPoint","sweepFlag","largeArcFlag","xAxisRotation","Boolean","sweepFlagValue","largeArcFlagValue","rectangle","rectToPath","rect","ccw","L","svgContainers","htmlElement","ghost","autoResize","nonExportableSprites","cssScale","_printing","initSensor","svgContainer","resizeSensor","measure","maxWidth","maxHeight","checkTransform","_container","_modal","openModal","title","closeModal","modal","content","readerTitle","open","close","_popups","popupTemplate","openPopup","popup","popups","create","closeAllPopups","_readerAlertElement","div","opacity","top","readerAlert","readerAlertElement","getComputedStyle","matrix","getPropertyValue","sqrt","isNaN","HTMLElement","Tension","tensionX","tensionY","_tensionX","_tensionY","smooth","p0","p1","splice","last","closed","p2","p3","wavedLine","waveLength","waveHeight","tension","adjustWaveLength","x1","y1","x2","y2","distance","atan2","cos","sin","waveLengthX","waveLengthY","halfWaveCount","sign_1","Monotone","reversed","_reversed","_closed","_curve","x0","y0","t0","t1","dx","NaN","_a","slope2","slope3","sign","h","h0","h1","s0","s1","p","MonotoneX","MonotoneY","Basis","x3","x4","y3","y4","pushCurve","pushPoint","CirclePattern","properties","_circle","paper","addElement","shapeRendering","draw","ColorModifier","modify","GradientModifier","lightnesses","brightnesses","opacities","offsets","_lightnesses","_brightnesses","_opacities","_offsets","gradient","lightness","brightness","brighten","lighten","addColor","LinePattern","_line","rotation","w","gap","step","strokeWidth","LinearGradient","_stops","validate","PI","gradientElement","stop","gradientStop","_paper","stops","gradientUnits","LinearGradientModifier","clone","Pattern","_elements","patternUnits","interfaceColors","backgroundFill","getFor","backgroundOpacity","fillOpacity","fill","stroke","strokeOpacity","patternElement","background","hex","strokeDasharray","rotationX","rotationY","animate","duration","easing","removeDispose","_animations","processConfig","config","elements","createEntryInstance","RadialGradient","percent","fx","fy","_cx","_cy","_fx","_fy","RadialGradientModifier","RectPattern","rectHeight","rectWidth","_rect","BlurFilter","feGaussianBlur","filterPrimitives","blur","ColorizeFilter","feColorMatrix","intensity","applyFilter","r","g","ii","rgb","DesaturateFilter","saturation","DropShadowFilter","feOffset","feFlood","feComposite","operator","feMerge","dy","updateScale","Filter","isTemplate","_nonScaling","filterUnits","newValue","appendPrimitives","filterElement","filterPrimitive","filter","setSprite","_sprite","filters","FocusFilter","feMorphology","feBlend","group","LightenFilter","v"],"sourceRoot":""}