{"version":3,"sources":["webpack:///./node_modules/@amcharts/amcharts4/.internal/core/Base.js"],"names":["__webpack_require__","d","__webpack_exports__","BaseObject","BaseObjectEvents","tslib__WEBPACK_IMPORTED_MODULE_0__","_utils_List__WEBPACK_IMPORTED_MODULE_1__","_utils_SortedList__WEBPACK_IMPORTED_MODULE_2__","_utils_Dictionary__WEBPACK_IMPORTED_MODULE_3__","_utils_Disposer__WEBPACK_IMPORTED_MODULE_4__","_utils_EventDispatcher__WEBPACK_IMPORTED_MODULE_5__","_utils_Adapter__WEBPACK_IMPORTED_MODULE_6__","_utils_Color__WEBPACK_IMPORTED_MODULE_7__","_utils_Percent__WEBPACK_IMPORTED_MODULE_8__","_Registry__WEBPACK_IMPORTED_MODULE_9__","_utils_Cache__WEBPACK_IMPORTED_MODULE_10__","_utils_Array__WEBPACK_IMPORTED_MODULE_11__","_utils_Object__WEBPACK_IMPORTED_MODULE_12__","_utils_Type__WEBPACK_IMPORTED_MODULE_13__","this","_disposed","_disposers","className","prototype","debug","Object","defineProperty","get","_uid","getUniqueId","map","setKey","enumerable","configurable","_id","set","value","_map","applyTheme","_this","themes","getCurrentThemes","theme","index","_themes","isDisposed","dispose","a","length","disposer","shift","clearCache","clonedFrom","clones","removeValue","uid","removeKey","addDisposer","target","push","removeDispose","splice","clone","cloneId","newObject","constructor","copyFrom","_clones","object","_className","setCache","key","ttl","getCache","undefined","clear","setTimeout","fn","delay","id","clearTimeout","setInterval","config","processConfig","e","raiseCriticalError","configKey","item_1","configValue","call","hasProperty","createClassInstance","processAdapters","processEvents","document","asIs","processListTemplate","processOrderedTemplate","template","templateValue","entryKey","entryValue","listItem","processDictionaryTemplate","processList","maybeColorOrPercent","values","processDictionary","isReserved","configOrder","processingErrors","errors","join","_processingErrors","Error","match","item","entry","add","callback","priority","has","on","type","hasKey","getKey","create","getConfigEntryType","hasIndex","getIndex","setIndex","indexOf","pop","insert","parent","itemCount","createEntryInstance","b","field","registeredClasses","res","prop","_super","events","dispatch","eventType","data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,SAAAmF,EAAAN,SAEA3I,EA3EA,CA4ECD","file":"js/chunk-2d0b6e8e.5ac1b271.js","sourcesContent":["/**\r\n * Base functionality\r\n*/\r\nimport * as tslib_1 from \"tslib\";\r\nimport { List, ListTemplate } from \"./utils/List\";\r\nimport { OrderedListTemplate, SortedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary, DictionaryTemplate } from \"./utils/Dictionary\";\r\nimport { Disposer } from \"./utils/Disposer\";\r\nimport { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Color, color } from \"./utils/Color\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n//import * as $debug from \"./utils/Debug\";\r\n/**\r\n * Provides base functionality for all derivative objects, like generating ids,\r\n * handling cache, etc.\r\n */\r\nvar BaseObject = /** @class */ (function () {\r\n //protected _classes: { [index: string]: any } = {};\r\n /**\r\n * Constructor\r\n * * Sets class name\r\n */\r\n function BaseObject() {\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 * @ignore Exclude from docs\r\n */\r\n this._disposed = false;\r\n /**\r\n * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._disposers = [];\r\n this.className = \"BaseObject\";\r\n //this.debug();\r\n }\r\n BaseObject.prototype.debug = function () {\r\n //$debug.debug(this);\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"uid\", {\r\n /**\r\n * Returns object's internal unique ID.\r\n *\r\n * @return Unique ID\r\n */\r\n get: function () {\r\n if (!this._uid) {\r\n this._uid = registry.getUniqueId();\r\n registry.map.setKey(this._uid, this);\r\n }\r\n return this._uid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"id\", {\r\n /**\r\n * @return Id\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Sets the user-defined id of the element.\r\n *\r\n * @param value Id\r\n */\r\n set: function (value) {\r\n //registry.map.setKey(value, this); // registry.map only stores by uid\r\n this._id = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.applyTheme = function () {\r\n var _this = this;\r\n // TODO is this needed ?\r\n if (registry) {\r\n var themes = this.getCurrentThemes();\r\n // TODO is this needed ?\r\n if (themes) {\r\n $array.each(themes, function (theme, index) {\r\n theme(_this);\r\n });\r\n }\r\n }\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"themes\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return An array of themes\r\n */\r\n get: function () {\r\n return this._themes;\r\n },\r\n /**\r\n * A list of themes to be used for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value An array of themes\r\n */\r\n set: function (value) {\r\n this._themes = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a list of themes that should be applied to this element. It could\r\n * either be a list of themes set explicitly on this element, or system-wide.\r\n *\r\n * @return List of themes\r\n */\r\n BaseObject.prototype.getCurrentThemes = function () {\r\n return this.themes || registry.themes;\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 BaseObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n BaseObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._disposers;\r\n this._disposers = null;\r\n while (a.length !== 0) {\r\n var disposer = a.shift();\r\n disposer.dispose();\r\n }\r\n // Clear cache\r\n this.clearCache();\r\n // remove from clones list\r\n if (this.clonedFrom) {\r\n this.clonedFrom.clones.removeValue(this);\r\n }\r\n var uid = this._uid;\r\n if (uid != null) {\r\n registry.map.removeKey(uid);\r\n }\r\n }\r\n };\r\n /**\r\n * Adds an IDisposer, which will be disposed when this object is disposed.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.addDisposer = function (target) {\r\n this._disposers.push(target);\r\n };\r\n /**\r\n * Disposes disposable object and removes it from `_disposers`.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.removeDispose = function (target) {\r\n //if(target){\r\n if (!this._disposed) {\r\n var index = $array.indexOf(this._disposers, target);\r\n if (index > -1) {\r\n this._disposers.splice(index, 1);\r\n }\r\n }\r\n target.dispose();\r\n //}\r\n };\r\n /**\r\n * Makes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them.\r\n *\r\n * @param cloneId An id to use for clone (if not set a unique id will be generated)\r\n * @returns Clone\r\n */\r\n BaseObject.prototype.clone = function (cloneId) {\r\n if (!cloneId) {\r\n cloneId = \"clone-\" + registry.getUniqueId();\r\n }\r\n var newObject = new this.constructor();\r\n newObject.cloneId = cloneId;\r\n newObject.copyFrom(this);\r\n // add to clones list\r\n // this.clones.push(newObject); // moved this to copyFrom\r\n return newObject;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"clones\", {\r\n /**\r\n * Returns a collection of object's clones.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Clones\r\n */\r\n get: function () {\r\n if (!this._clones) {\r\n this._clones = new List();\r\n }\r\n return this._clones;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related data from different element.\r\n *\r\n * @param object Source element\r\n */\r\n BaseObject.prototype.copyFrom = function (object) {\r\n object.clones.push(this); // do not moveValue, as it is expensive! even if there will be several items in clones list, it's not that bad.\r\n this.clonedFrom = object;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"className\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Element's class name. (a class that was used to instantiate the element)\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n this._className = value;\r\n /*if (registry) {\r\n registry.registeredClasses[value] = typeof this;\r\n }*/\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n BaseObject.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * If optional second padarameter is specified, it will return that value\r\n * if cache is not available or is expired.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n BaseObject.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Clears object's local cache.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.clearCache = function () {\r\n cache.clear(this.uid);\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setTimeout` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setTimeout = function (fn, delay) {\r\n var _this = this;\r\n var id = setTimeout(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setInterval` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setInterval = function (fn, delay) {\r\n var _this = this;\r\n var id = setInterval(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"config\", {\r\n /**\r\n * ==========================================================================\r\n * JSON-BASED CONFIG PROCESSING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Use this property to set JSON-based config. When set, triggers processing\r\n * routine, which will go through all properties, and try to apply values,\r\n * create instances, etc.\r\n *\r\n * Use this with caution, as it is a time-consuming process. It's used for\r\n * initialchart setup only, not routine operations.\r\n *\r\n * @param json JSON config\r\n */\r\n set: function (config) {\r\n try {\r\n this.processConfig(config);\r\n }\r\n catch (e) {\r\n /*if (this instanceof Sprite) {\r\n this.raiseCriticalError(e);\r\n }*/\r\n this.raiseCriticalError(e);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes the JSON config.\r\n *\r\n * @param json JSON config\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.processConfig = function (config) {\r\n var _this = this;\r\n if (!config) {\r\n return;\r\n }\r\n // Get target\r\n var target = this;\r\n // Iterate through all of the items\r\n $object.eachOrdered(config, function (configKey, value) {\r\n var configValue = value;\r\n // Is this a callback?\r\n if (configKey == \"callback\" && typeof value == \"function\") {\r\n value.call(target);\r\n }\r\n // Check if there's a property in target\r\n if (_this.hasProperty(configKey)) {\r\n var item_1;\r\n // Do we have instructions to create an object?\r\n if ($type.isObject(configValue) && $type.hasValue(configValue[\"type\"])) {\r\n item_1 = _this.createClassInstance(configValue[\"type\"]);\r\n // Create new instance\r\n if (item_1) {\r\n target[configKey] = item_1;\r\n }\r\n else {\r\n item_1 = target[configKey];\r\n }\r\n }\r\n else {\r\n // Get item from the object\r\n item_1 = target[configKey];\r\n }\r\n /**\r\n * It is...\r\n * --------------------------------------------------------------------\r\n */\r\n if (item_1 instanceof Adapter) {\r\n // ... an Adapter, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processAdapters(item_1, configValue);\r\n }\r\n else if (item_1 instanceof EventDispatcher) {\r\n // ... an EventDispatcher, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processEvents(item_1, configValue);\r\n }\r\n else if (configKey == \"locale\" && $type.isString(configValue)) {\r\n // ... a locale specified as string, e.g. \"fr_FR\"\r\n // ------------------------------------------------------------------\r\n if (document[\"am4lang_\" + configValue]) {\r\n target[configKey] = document[\"am4lang_\" + configValue];\r\n }\r\n }\r\n else if (_this.asIs(configKey)) {\r\n // ... a special field, just set it to new value\r\n // ------------------------------------------------------------------\r\n // (no need to add each indvidual item)\r\n target[configKey] = configValue;\r\n }\r\n else if (configValue instanceof BaseObject) {\r\n // ... a BaseObject object, we just going to use it as it is\r\n // ------------------------------------------------------------------\r\n target[configKey] = configValue;\r\n }\r\n else if (item_1 instanceof BaseObject) {\r\n // ... another child BaseObject\r\n // ------------------------------------------------------------------\r\n // Let's just pass in config part in and let itself deal with it\r\n item_1.config = configValue;\r\n }\r\n else if (item_1 instanceof ListTemplate || item_1 instanceof OrderedListTemplate || item_1 instanceof SortedListTemplate) {\r\n // ... a list with template\r\n // ------------------------------------------------------------------\r\n // Let's see what we can do with it\r\n if ($type.isArray(configValue)) {\r\n // It's an array.\r\n // Create a list item for entry, or try to apply properties to an\r\n // existing entry if possible and it is present.\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue, item_1);\r\n }\r\n }\r\n else if ($type.isObject(configValue)) {\r\n // It's a single oject.\r\n // Treat it as a template.\r\n if (configValue instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item_1.template = configValue;\r\n }\r\n else {\r\n // Now let's find out if the whole object if a template, or we\r\n // need to get it from `template` key\r\n var templateValue = void 0;\r\n if ($type.hasValue(configValue.template)) {\r\n templateValue = configValue.template;\r\n }\r\n else {\r\n templateValue = configValue;\r\n }\r\n if (item_1.template instanceof BaseObject) {\r\n // Template is a BaseObject so we will just let its config\r\n // deal with the configuration\r\n item_1.template.config = templateValue;\r\n }\r\n else {\r\n $object.each(templateValue, function (entryKey, entryValue) {\r\n var listItem = item_1.template[entryKey];\r\n if (listItem instanceof Adapter) {\r\n _this.processAdapters(listItem, entryValue);\r\n }\r\n else if (listItem instanceof EventDispatcher) {\r\n _this.processEvents(listItem, entryValue);\r\n }\r\n else if (listItem instanceof DictionaryTemplate) {\r\n _this.processDictionaryTemplate(listItem, entryValue);\r\n }\r\n else if (item_1.template[entryKey] instanceof BaseObject) {\r\n // Template is a BaseObject. Let it deal with its own config.\r\n item_1.template[entryKey].config = entryValue;\r\n }\r\n else if ($type.isObject(entryValue) && $type.hasValue(entryValue[\"type\"])) {\r\n listItem = _this.createClassInstance(entryValue[\"type\"]);\r\n if (listItem) {\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n item_1.template[entryKey] = listItem;\r\n }\r\n else {\r\n item_1.template[entryKey] = entryValue;\r\n }\r\n }\r\n else if (listItem instanceof List) {\r\n // It's List, process it\r\n _this.processList(entryValue, listItem);\r\n }\r\n else {\r\n // Aything else. Just assing and be done with it.\r\n item_1.template[entryKey] = _this.maybeColorOrPercent(entryValue);\r\n }\r\n });\r\n }\r\n // Check maybe there are `values` to insert\r\n if ($type.hasValue(configValue.values)) {\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue.values, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue.values, item_1);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // Something else?\r\n // Not sure what to do with it on a list - ignore\r\n }\r\n }\r\n else if (item_1 instanceof List) {\r\n // ... a list\r\n // ------------------------------------------------------------------\r\n if (configKey == \"children\") {\r\n _this.processList(configValue, item_1, _this);\r\n }\r\n else {\r\n _this.processList(configValue, item_1);\r\n }\r\n }\r\n else if (item_1 instanceof DictionaryTemplate) {\r\n // ... a dictionary with template\r\n // ------------------------------------------------------------------\r\n _this.processDictionaryTemplate(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Dictionary) {\r\n // ... a dictionary\r\n // ------------------------------------------------------------------\r\n _this.processDictionary(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Color || item_1 instanceof Percent) {\r\n // ... it's a Color or Percent\r\n // ------------------------------------------------------------------\r\n target[configKey] = _this.maybeColorOrPercent(configValue);\r\n }\r\n else if ($type.isObject(item_1) && $type.isObject(configValue)) {\r\n // ... a regular object\r\n // ------------------------------------------------------------------\r\n $object.copyAllProperties(configValue, item_1);\r\n }\r\n else {\r\n // ... something else - probably a simple property or object\r\n // ------------------------------------------------------------------\r\n // Maybe convert to `Percent` or `Color`?\r\n configValue = _this.maybeColorOrPercent(configValue);\r\n // Assign\r\n target[configKey] = configValue;\r\n }\r\n }\r\n else if (!_this.isReserved(configKey)) {\r\n // Doesn't have property set. But we're going to assume JSON config\r\n // creator knows what he/she is doing and set it anyway.\r\n target[configKey] = configValue;\r\n }\r\n }, this.configOrder);\r\n // Any errors?\r\n if (this.processingErrors.length) {\r\n var errors = this.processingErrors.join(\"\\n\");\r\n this._processingErrors = [];\r\n throw Error(errors);\r\n }\r\n };\r\n /**\r\n * Tries to detect if value is color or percent and converts to proper object\r\n * if necessary.\r\n *\r\n * Returns the same source value if no color/percent detected\r\n *\r\n * @param value Source value\r\n * @return Converted value\r\n */\r\n BaseObject.prototype.maybeColorOrPercent = function (value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[\\-]?[0-9.]+\\%$/)) {\r\n return percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n return color(value);\r\n }\r\n }\r\n return value;\r\n };\r\n BaseObject.prototype.processAdapters = function (item, config) {\r\n var _this = this;\r\n if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.add(entry.key, entry.callback, entry.priority || 0, _this);\r\n });\r\n }\r\n else if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.add(key, entry);\r\n }\r\n });\r\n }\r\n };\r\n BaseObject.prototype.processEvents = function (item, config) {\r\n var _this = this;\r\n if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.on(key, entry);\r\n }\r\n });\r\n }\r\n else if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.on(entry.type, entry.callback, _this);\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[DictionaryTemplate]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionaryTemplate = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n $object.each(config, function (entryKey, entryValue) {\r\n var listItem;\r\n // Get existing one, or create a new one\r\n if (entryKey == \"template\") {\r\n listItem = item.template;\r\n }\r\n else if (item.hasKey(entryKey)) {\r\n listItem = item.getKey(entryKey);\r\n }\r\n else {\r\n listItem = item.create(entryKey);\r\n }\r\n // Set data\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entryValue)) {\r\n $object.copyAllProperties(entryValue, listItem);\r\n }\r\n else {\r\n listItem.setKey(entryKey, entryValue);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[Dictionary]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionary = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n // @todo support for non-basic types\r\n $object.each(config, function (entryKey, entryValue) {\r\n item.setKey(entryKey, entryValue);\r\n });\r\n }\r\n };\r\n /**\r\n * Processes [[ListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processListTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (item.hasIndex(index) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if (entry === listItem) {\r\n // It's already the same item, do nothing\r\n }\r\n else {\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.setIndex(item.indexOf(listItem), entry);\r\n }\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (configValue.length > item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * Processes [[OrdererListTemplate]] or [[SortedListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processOrderedTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.insert(entry);\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Processes [[List]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processList = function (configValue, item, parent) {\r\n var _this = this;\r\n // Convert to array if necessary\r\n if (!$type.isArray(configValue)) {\r\n configValue = [configValue];\r\n }\r\n // It's an array\r\n // Create a list item for entry\r\n var itemCount = item.length;\r\n $array.each(configValue, function (entry, index) {\r\n if ($type.isObject(entry)) {\r\n // An object.\r\n //\r\n // Let's see if we can instantiate a class out of it, or we need\r\n // to push it into list as it is.\r\n //\r\n // If there are items already at the specified index in the list,\r\n // apply properties rather than create a new one.\r\n var listItem = void 0;\r\n if ((index < itemCount) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else {\r\n listItem = _this.createEntryInstance(entry);\r\n if (parent) {\r\n listItem.parent = parent;\r\n }\r\n else {\r\n item.push(listItem);\r\n }\r\n }\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n }\r\n else {\r\n // Basic value.\r\n // Just push it into list, or override existing value\r\n if (item.hasIndex(index)) {\r\n item.setIndex(index, entry);\r\n }\r\n else {\r\n item.push(entry);\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (configValue.length > item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n BaseObject.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Language must come first, so it's all set up when the rest of the\r\n // elements are being instantiated\r\n else if (a == \"language\") {\r\n return -1;\r\n }\r\n else if (b == \"language\") {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n /**\r\n * Checks if field should be just assigned as is, without any checking when\r\n * processing JSON config.\r\n *\r\n * Extending functions can override this function to do their own checks.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n BaseObject.prototype.asIs = function (field) {\r\n return $array.indexOf([\"locale\"], field) != -1;\r\n };\r\n /**\r\n * Creates a relevant class instance if such class definition exists.\r\n *\r\n * @ignore Exclude from docs\r\n * @param className Class name\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createClassInstance = function (className) {\r\n if ($type.hasValue(registry.registeredClasses[className])) {\r\n return new registry.registeredClasses[className]();\r\n }\r\n return;\r\n };\r\n /**\r\n * Creates a class instance for a config entry using it's type. (as set in\r\n * `type` property)\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createEntryInstance = function (config) {\r\n var res;\r\n if ($type.hasValue(config[\"type\"])) {\r\n res = this.createClassInstance(config[\"type\"]);\r\n }\r\n if (!res) {\r\n return config;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Determines config object type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Type\r\n */\r\n BaseObject.prototype.getConfigEntryType = function (config) {\r\n if ($type.hasValue(config[\"type\"])) {\r\n if ($type.hasValue(registry.registeredClasses[config[\"type\"]])) {\r\n return registry.registeredClasses[config[\"type\"]];\r\n }\r\n else {\r\n throw Error(\"Invalid type: \\\"\" + config[\"type\"] + \"\\\".\");\r\n }\r\n }\r\n return;\r\n };\r\n /**\r\n * Checks if this element has a property.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prop Property name\r\n * @return Has property?\r\n */\r\n BaseObject.prototype.hasProperty = function (prop) {\r\n return prop in this ? true : false;\r\n };\r\n /**\r\n * Checkes whether JSON key is a reserved keyword.\r\n *\r\n * @param key Key\r\n * @return Reserved\r\n */\r\n BaseObject.prototype.isReserved = function (key) {\r\n return [\"type\", \"forceCreate\"].indexOf(key) !== -1;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"processingErrors\", {\r\n /**\r\n * A list of errors that happened during JSON processing.\r\n *\r\n * @return Errors\r\n */\r\n get: function () {\r\n if (!this._processingErrors) {\r\n this._processingErrors = [];\r\n }\r\n return this._processingErrors;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BaseObject;\r\n}());\r\nexport { BaseObject };\r\n;\r\n/**\r\n * A version of [[BaseObject]] with events properties and methods.\r\n * Classes that use [[EventDispatcher]] should extend this instead of\r\n * [[BaseObject]] directly.\r\n */\r\nvar BaseObjectEvents = /** @class */ (function (_super) {\r\n tslib_1.__extends(BaseObjectEvents, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BaseObjectEvents() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * An [[EventDispatcher]] instance\r\n */\r\n _this.events = new EventDispatcher();\r\n _this.className = \"BaseObjectEvents\";\r\n _this._disposers.push(_this.events);\r\n return _this;\r\n }\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source object\r\n */\r\n BaseObjectEvents.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.events.copyFrom(source.events);\r\n };\r\n return BaseObjectEvents;\r\n}(BaseObject));\r\nexport { BaseObjectEvents };\r\n//# sourceMappingURL=Base.js.map"],"sourceRoot":""}