\";\n return div.innerHTML.indexOf('
') > 0\n}\n\n// #3663: IE encodes newlines inside attribute values while other browsers don't\nvar shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;\n// #6828: chrome encodes content in a[href]\nvar shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;\n\n/* */\n\nvar idToTemplate = cached(function (id) {\n var el = query(id);\n return el && el.innerHTML\n});\n\nvar mount = Vue.prototype.$mount;\nVue.prototype.$mount = function (\n el,\n hydrating\n) {\n el = el && query(el);\n\n /* istanbul ignore if */\n if (el === document.body || el === document.documentElement) {\n process.env.NODE_ENV !== 'production' && warn(\n \"Do not mount Vue to or - mount to normal elements instead.\"\n );\n return this\n }\n\n var options = this.$options;\n // resolve template/el and convert to render function\n if (!options.render) {\n var template = options.template;\n if (template) {\n if (typeof template === 'string') {\n if (template.charAt(0) === '#') {\n template = idToTemplate(template);\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !template) {\n warn(\n (\"Template element not found or is empty: \" + (options.template)),\n this\n );\n }\n }\n } else if (template.nodeType) {\n template = template.innerHTML;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn('invalid template option:' + template, this);\n }\n return this\n }\n } else if (el) {\n template = getOuterHTML(el);\n }\n if (template) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n mark('compile');\n }\n\n var ref = compileToFunctions(template, {\n outputSourceRange: process.env.NODE_ENV !== 'production',\n shouldDecodeNewlines: shouldDecodeNewlines,\n shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,\n delimiters: options.delimiters,\n comments: options.comments\n }, this);\n var render = ref.render;\n var staticRenderFns = ref.staticRenderFns;\n options.render = render;\n options.staticRenderFns = staticRenderFns;\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n mark('compile end');\n measure((\"vue \" + (this._name) + \" compile\"), 'compile', 'compile end');\n }\n }\n }\n return mount.call(this, el, hydrating)\n};\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML (el) {\n if (el.outerHTML) {\n return el.outerHTML\n } else {\n var container = document.createElement('div');\n container.appendChild(el.cloneNode(true));\n return container.innerHTML\n }\n}\n\nVue.compile = compileToFunctions;\n\nexport default Vue;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Symbol factory\nimport { each, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from './graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { parsePercent } from './number.js';\n/**\r\n * Triangle shape\r\n * @inner\r\n */\n\nvar Triangle = graphic.Path.extend({\n type: 'triangle',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy + height);\n path.lineTo(cx - width, cy + height);\n path.closePath();\n }\n});\n/**\r\n * Diamond shape\r\n * @inner\r\n */\n\nvar Diamond = graphic.Path.extend({\n type: 'diamond',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy);\n path.lineTo(cx, cy + height);\n path.lineTo(cx - width, cy);\n path.closePath();\n }\n});\n/**\r\n * Pin shape\r\n * @inner\r\n */\n\nvar Pin = graphic.Path.extend({\n type: 'pin',\n shape: {\n // x, y on the cusp\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var x = shape.x;\n var y = shape.y;\n var w = shape.width / 5 * 3; // Height must be larger than width\n\n var h = Math.max(w, shape.height);\n var r = w / 2; // Dist on y with tangent point and circle center\n\n var dy = r * r / (h - r);\n var cy = y - h + r + dy;\n var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center\n\n var dx = Math.cos(angle) * r;\n var tanX = Math.sin(angle);\n var tanY = Math.cos(angle);\n var cpLen = r * 0.6;\n var cpLen2 = r * 0.7;\n path.moveTo(x - dx, cy + dy);\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n path.closePath();\n }\n});\n/**\r\n * Arrow shape\r\n * @inner\r\n */\n\nvar Arrow = graphic.Path.extend({\n type: 'arrow',\n shape: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var height = shape.height;\n var width = shape.width;\n var x = shape.x;\n var y = shape.y;\n var dx = width / 3 * 2;\n ctx.moveTo(x, y);\n ctx.lineTo(x + dx, y + height);\n ctx.lineTo(x, y + height / 4 * 3);\n ctx.lineTo(x - dx, y + height);\n ctx.lineTo(x, y);\n ctx.closePath();\n }\n});\n/**\r\n * Map of path contructors\r\n */\n// TODO Use function to build symbol path.\n\nvar symbolCtors = {\n line: graphic.Line,\n rect: graphic.Rect,\n roundRect: graphic.Rect,\n square: graphic.Rect,\n circle: graphic.Circle,\n diamond: Diamond,\n pin: Pin,\n arrow: Arrow,\n triangle: Triangle\n};\nvar symbolShapeMakers = {\n line: function (x, y, w, h, shape) {\n shape.x1 = x;\n shape.y1 = y + h / 2;\n shape.x2 = x + w;\n shape.y2 = y + h / 2;\n },\n rect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n },\n roundRect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n shape.r = Math.min(w, h) / 4;\n },\n square: function (x, y, w, h, shape) {\n var size = Math.min(w, h);\n shape.x = x;\n shape.y = y;\n shape.width = size;\n shape.height = size;\n },\n circle: function (x, y, w, h, shape) {\n // Put circle in the center of square\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.r = Math.min(w, h) / 2;\n },\n diamond: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n pin: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n arrow: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n triangle: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n }\n};\nexport var symbolBuildProxies = {};\neach(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, config, rect) {\n var res = calculateTextPosition(out, config, rect);\n var shape = this.shape;\n\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (!proxySymbol) {\n // Default rect\n symbolType = 'rect';\n proxySymbol = symbolBuildProxies[symbolType];\n }\n\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n }\n }\n}); // Provide setColor helper method to avoid determine if set the fill or stroke outside\n\nfunction symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView\n\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n\n this.markRedraw();\n }\n}\n/**\r\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\r\n */\n\n\nexport function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\nkeepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n\n var symbolPath;\n\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n\n symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor\n\n symbolPath.setColor = symbolPathSetColor;\n\n if (color) {\n symbolPath.setColor(color);\n }\n\n return symbolPath;\n}\nexport function normalizeSymbolSize(symbolSize) {\n if (!isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return [symbolSize[0] || 0, symbolSize[1] || 0];\n}\nexport function normalizeSymbolOffset(symbolOffset, symbolSize) {\n if (symbolOffset == null) {\n return;\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n\n return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];\n}","export const cilChevronBottom = [\"24 24\",\"
\"]","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\r\n * Base axis pointer class in 2D.\r\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\r\n * In px, arbitrary value. Do not set too small,\r\n * no animation is ok for most cases.\r\n */\n\n this.animationThreshold = 15;\n }\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\r\n * add {pointer, label, graphicKey} to elOption\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Shoule be implemenented by sub-class.\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // Fot mobile devicem, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\r\n * Throttled method.\r\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\n\nvar CartesianAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisPointer, _super);\n\n function CartesianAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: pos[0],\n y: pos[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n };\n\n return CartesianAxisPointer;\n}(BaseAxisPointer);\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nexport default CartesianAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar AxisPointerModel =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerModel, _super);\n\n function AxisPointerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerModel.type;\n return _this;\n }\n\n AxisPointerModel.type = 'axisPointer';\n AxisPointerModel.defaultOption = {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n // zlevel: 0,\n z: 50,\n type: 'line',\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n value: null,\n status: null,\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#B9BEC9',\n width: 1,\n type: 'dashed'\n },\n shadowStyle: {\n color: 'rgba(210,219,238,0.2)'\n },\n label: {\n show: true,\n formatter: null,\n precision: 'auto',\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n borderColor: null,\n borderWidth: 0,\n borderRadius: 3\n },\n handle: {\n show: false,\n // eslint-disable-next-line\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n };\n return AxisPointerModel;\n}(ComponentModel);\n\nexport default AxisPointerModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener.js';\nimport ComponentView from '../../view/Component.js';\n\nvar AxisPointerView =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerView, _super);\n\n function AxisPointerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerView.type;\n return _this;\n }\n\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable\n // AxisPointerView to be independent to Tooltip.\n\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n };\n\n AxisPointerView.prototype.remove = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.prototype.dispose = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.type = 'axisPointer';\n return AxisPointerView;\n}(ComponentView);\n\nexport default AxisPointerView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\nimport * as modelHelper from './modelHelper.js';\nimport findPointFromSeries from './findPointFromSeries.js';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util.js';\nvar inner = makeInner();\n/**\r\n * Basic logic: check all axis, if they do not demand show/highlight,\r\n * then hide/downplay them.\r\n *\r\n * @return content of event obj for echarts.connect.\r\n */\n\nexport default function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}\n\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n var axis = axisInfo.axis;\n\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n } // Heavy calculation. So put it after axis.containData checking.\n\n\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect.\n // By default use the first involved series data as a sample to connect.\n\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n extend(outputFinder, payloadBatch[0]);\n } // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n\n\n if (!noSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n\n updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\n\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimensionsAll(dim);\n var seriesNestestValue;\n var dataIndices;\n\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex\n // when data length is not same.\n // false,\n axis.type === 'category' ? 0.5 : null);\n\n if (!dataIndices.length) {\n return;\n }\n\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff); // Consider category case\n\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\n\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\n\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n // depends that all models have been updated. So it should not be performed\n // here. Considering axisPointerModel used here is volatile, which is hard\n // to be retrieve in TooltipView, we prepare parameters here.\n valueLabelOpt: {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\n\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value; // For label formatter param and highlight.\n\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n } // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n } // If status is 'hide', should be no info in payload.\n\n\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\n\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n } // In most case only one axis (or event one series is used). It is\n // convinient to fetch payload.seriesIndex and payload.dataIndex\n // dirtectly. So put the first seriesIndex and dataIndex of the first\n // axis on the payload.\n\n\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\n\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification shoule be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n }); // Diff.\n\n var toHighlight = [];\n var toDownplay = [];\n each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toHighlight\n });\n}\n\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\n\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\n\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport AxisView from '../axis/AxisView.js';\nimport CartesianAxisPointer from './CartesianAxisPointer.js';\nimport AxisPointerModel from './AxisPointerModel.js';\nimport AxisPointerView from './AxisPointerView.js';\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { collect } from './modelHelper.js';\nimport axisTrigger from './axisTrigger.js';\nexport function install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n registers.registerComponentModel(AxisPointerModel);\n registers.registerComponentView(AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !isArray(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\n\nvar ComponentView =\n/** @class */\nfunction () {\n function ComponentView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewComponent');\n }\n\n ComponentView.prototype.init = function (ecModel, api) {};\n\n ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n\n ComponentView.prototype.dispose = function (ecModel, api) {};\n\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing;\n };\n /**\r\n * Hook for toggle blur target series.\r\n * Can be used in marker for blur or leave blur the markers\r\n */\n\n\n ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {// Do nothing;\n };\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\n\n\n ComponentView.prototype.eachRendered = function (cb) {\n var group = this.group;\n\n if (group) {\n group.traverse(cb);\n }\n };\n\n return ComponentView;\n}();\n\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nimport SeriesDimensionDefine from '../SeriesDimensionDefine.js';\nimport { createHashMap, defaults, each, extend, isObject, isString } from 'zrender/lib/core/util.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { CtorInt32Array } from '../DataStore.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper.js';\nimport { createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions } from './SeriesDataSchema.js';\n/**\r\n * For outside usage compat (like echarts-gl are using it).\r\n */\n\nexport function createDimensions(source, opt) {\n return prepareSeriesDataSchema(source, opt).dimensions;\n}\n/**\r\n * This method builds the relationship between:\r\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\r\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\r\n * + \"what the data source provids (see `source`)\".\r\n *\r\n * Some guess strategy will be adapted if user does not define something.\r\n * If no 'value' dimension specified, the first no-named dimension will be\r\n * named as 'value'.\r\n *\r\n * @return The results are always sorted by `storeDimIndex` asc.\r\n */\n\nexport default function prepareSeriesDataSchema( // TODO: TYPE completeDimensions type\nsource, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n opt = opt || {};\n var sysDims = opt.coordDimensions || [];\n var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\n var coordDimNameMap = createHashMap();\n var resultList = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); // Try to ignore unsed dimensions if sharing a high dimension datastore\n // 30 is an experience value.\n\n var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\n var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\n var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\n var encodeDef = opt.encodeDefine;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n var encodeDefMap = createHashMap(encodeDef);\n var indicesMap = new CtorInt32Array(dimCount);\n\n for (var i = 0; i < indicesMap.length; i++) {\n indicesMap[i] = -1;\n }\n\n function getResultItem(dimIdx) {\n var idx = indicesMap[dimIdx];\n\n if (idx < 0) {\n var dimDefItemRaw = dimsDef[dimIdx];\n var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n };\n var resultItem = new SeriesDimensionDefine();\n var userDimName = dimDefItem.name;\n\n if (userDimName != null && dataDimNameMap.get(userDimName) != null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n var newIdx = resultList.length;\n indicesMap[dimIdx] = newIdx;\n resultItem.storeDimIndex = dimIdx;\n resultList.push(resultItem);\n return resultItem;\n }\n\n return resultList[idx];\n }\n\n if (!omitUnusedDimensions) {\n for (var i = 0; i < dimCount; i++) {\n getResultItem(i);\n }\n } // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n\n\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(getResultItem(resultDimIdx), coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = extend({}, sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < dimCount && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = getResultItem(resultDimIdx); // Coordinate system has a higher priority on dim type than source.\n\n if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\n resultItem.type = sysDimItem.type;\n }\n\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value';\n\n function ifNoNameFillWithCoordName(resultItem) {\n if (resultItem.name == null) {\n // Duplication will be removed in the next step.\n resultItem.name = resultItem.coordDim;\n }\n } // Set dim `name` and other `coordDim` and other props.\n\n\n if (!omitUnusedDimensions) {\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = getResultItem(resultDimIdx);\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n // TODO no need to generate coordDim for isExtraCoord?\n resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0; // Series specified generateCoord is using out.\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n ifNoNameFillWithCoordName(resultItem);\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first colum should better be treated as a \"ordinal\" although it\n // might not able to be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n } else {\n each(resultList, function (resultItem) {\n // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\n ifNoNameFillWithCoordName(resultItem);\n }); // Sort dimensions: there are some rule that use the last dim as label,\n // and for some latter travel process easier.\n\n resultList.sort(function (item0, item1) {\n return item0.storeDimIndex - item1.storeDimIndex;\n });\n }\n\n removeDuplication(resultList);\n return new SeriesDataSchema({\n source: source,\n dimensions: resultList,\n fullDimensionCount: dimCount,\n dimensionOmitted: omitUnusedDimensions\n });\n}\n\nfunction removeDuplication(result) {\n var duplicationMap = createHashMap();\n\n for (var i = 0; i < result.length; i++) {\n var dim = result[i];\n var dimOriginalName = dim.name;\n var count = duplicationMap.get(dimOriginalName) || 0;\n\n if (count > 0) {\n // Starts from 0.\n dim.name = dimOriginalName + (count - 1);\n }\n\n count++;\n duplicationMap.set(dimOriginalName, count);\n }\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in data store?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\n\nfunction genCoordDimName(name, map, fromZero) {\n var mapData = map.data;\n\n if (fromZero || mapData.hasOwnProperty(name)) {\n var i = 0;\n\n while (mapData.hasOwnProperty(name + i)) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}","export const cilChartPie = [\"24 24\",\"
\"]","export const cifUs = [\"300 159\",\"
\"]","export const cibFlickr = [\"32 32\",\"
\"]","export const cilWc = [\"24 24\",\"
\"]","export const cibVk = [\"32 32\",\"
\"]","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh
\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\n\nfunction defaultKeyGetter(item) {\n return item;\n}\n\nvar DataDiffer =\n/** @class */\nfunction () {\n /**\r\n * @param context Can be visited by this.context in callback.\r\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`;\n\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\r\n * Callback function when add a data\r\n */\n\n\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\r\n * Callback function when update a data\r\n */\n\n\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToMany = function (func) {\n this._updateManyToMany = func;\n return this;\n };\n /**\r\n * Callback function when remove a data\r\n */\n\n\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below.\n\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\r\n * For example, consider the case:\r\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\r\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\r\n * Where:\r\n * o0, o1, n0 has key 'a' (many to one)\r\n * o5, n4, n5, n6 has key 'b' (one to many)\r\n * o2, n1 has key 'c' (one to one)\r\n * n2, n3 has key 'd' (add)\r\n * o3, o4 has key 'e' (remove)\r\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\r\n * Then:\r\n * (The order of the following directives are not ensured.)\r\n * this._updateManyToOne(n0, [o0, o1]);\r\n * this._updateOneToMany([n4, n5, n6], o5);\r\n * this._update(n1, o2);\r\n * this._remove(o3);\r\n * this._remove(o4);\r\n * this._remove(o6);\r\n * this._remove(o7);\r\n * this._add(n2);\r\n * this._add(n3);\r\n * this._add(n7);\r\n * this._add(n8);\r\n */\n\n\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n } // Support both `newDataKeyArr` are duplication removed or not removed.\n\n\n newDataIndexMap[newKey] = null;\n }\n };\n\n DataDiffer.prototype._initIndexMap = function (arr, // Can be null.\n map, // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n\n if (!map) {\n continue;\n }\n\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n\n return DataDiffer;\n}();\n\nexport default DataDiffer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../model/Model.js';\nimport DataDiffer from './DataDiffer.js';\nimport { DefaultDataProvider } from './helper/dataProvider.js';\nimport { summarizeDimensions } from './helper/dimensionHelper.js';\nimport SeriesDimensionDefine from './SeriesDimensionDefine.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types.js';\nimport { convertOptionIdName, isDataItemOption } from '../util/model.js';\nimport { setCommonECData } from '../util/innerStore.js';\nimport { isSourceInstance } from './Source.js';\nimport DataStore from './DataStore.js';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema.js';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird udpate animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1; // type SeriesDimensionIndex = DimensionIndex;\n\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\n\nvar SeriesData =\n/** @class */\nfunction () {\n /**\r\n * @param dimensionsInput.dimensions\r\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\r\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\r\n */\n function SeriesData(dimensionsInput, hostModel) {\n this.type = 'list';\n this._dimOmitted = false;\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Globel layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elemnents\n\n this._graphicEls = []; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = false; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n var dimensions;\n var assignStoreDimIdx = false;\n\n if (isSeriesDataSchema(dimensionsInput)) {\n dimensions = dimensionsInput.dimensions;\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\n this._schema = dimensionsInput;\n } else {\n assignStoreDimIdx = true;\n dimensions = dimensionsInput;\n }\n\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n var needsHasOwn = false;\n var emptyObj = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n\n if (emptyObj[dimensionName] != null) {\n needsHasOwn = true;\n }\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n }\n\n if (assignStoreDimIdx) {\n dimensionInfo.storeDimIndex = i;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimInfos = dimensionInfos;\n\n this._initGetDimensionInfo(needsHasOwn);\n\n this.hostModel = hostModel;\n this._invertedIndicesMap = invertedIndicesMap;\n\n if (this._dimOmitted) {\n var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n zrUtil.each(dimensionNames, function (dimName) {\n dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n });\n }\n }\n /**\r\n *\r\n * Get concrete dimension name by dimension name or dimension index.\r\n * If input a dimension name, do not validate whether the dimension name exits.\r\n *\r\n * @caution\r\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\r\n * Because only those dimensions will have auto-generated dimension names if not\r\n * have a user-specified name, and other dimensions will get a return of null/undefined.\r\n *\r\n * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples:\r\n * ```js\r\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\r\n * ```\r\n *\r\n * @return Concrete dim name.\r\n */\n\n\n SeriesData.prototype.getDimension = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx == null) {\n return dim;\n }\n\n dimIdx = dim;\n\n if (!this._dimOmitted) {\n return this.dimensions[dimIdx];\n } // Retrieve from series dimension definition becuase it probably contains\n // generated dimension name (like 'x', 'y').\n\n\n var dimName = this._dimIdxToName.get(dimIdx);\n\n if (dimName != null) {\n return dimName;\n }\n\n var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n\n if (sourceDimDef) {\n return sourceDimDef.name;\n }\n };\n /**\r\n * Get dimension index in data store. Return -1 if not found.\r\n * Can be used to index value from getRawValue.\r\n */\n\n\n SeriesData.prototype.getDimensionIndex = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx != null) {\n return dimIdx;\n }\n\n if (dim == null) {\n return -1;\n }\n\n var dimInfo = this._getDimInfo(dim);\n\n return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n };\n /**\r\n * The meanings of the input parameter `dim`:\r\n *\r\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\r\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\r\n * + If dim is a number-like string (e.g., `\"1\"`):\r\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\r\n * it means that concrete name.\r\n * + If not, it will be converted to a number, which means the index of the dimension.\r\n * (why? because of the backward compatbility. We have been tolerating number-like string in\r\n * dimension setting, although now it seems that it is not a good idea.)\r\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\r\n * if no dimension name is defined as `\"1\"`.\r\n * + If dim is a not-number-like string, it means the concrete dim name.\r\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\r\n * or customized in `dimensions` property of option like `\"age\"`.\r\n *\r\n * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\r\n */\n\n\n SeriesData.prototype._recognizeDimIndex = function (dim) {\n if (zrUtil.isNumber(dim) // If being a number-like string but not being defined as a dimension name.\n || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n return +dim;\n }\n };\n\n SeriesData.prototype._getStoreDimIndex = function (dim) {\n var dimIdx = this.getDimensionIndex(dim);\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimIdx == null) {\n throw new Error('Unkown dimension ' + dim);\n }\n }\n\n return dimIdx;\n };\n /**\r\n * Get type and calculation info of particular dimension\r\n * @param dim\r\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\r\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\r\n */\n\n\n SeriesData.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._getDimInfo(this.getDimension(dim));\n };\n\n SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n var dimensionInfos = this._dimInfos;\n this._getDimInfo = needsHasOwn ? function (dimName) {\n return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n } : function (dimName) {\n return dimensionInfos[dimName];\n };\n };\n /**\r\n * concrete dimension name list on coord.\r\n */\n\n\n SeriesData.prototype.getDimensionsOnCoord = function () {\n return this._dimSummary.dataDimsOnCoord.slice();\n };\n\n SeriesData.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n\n SeriesData.prototype.getStore = function () {\n return this._store;\n };\n /**\r\n * Initialize from data\r\n * @param data source or data or data store.\r\n * @param nameList The name of a datum is used on data diff and\r\n * default label/tooltip.\r\n * A name can be specified in encode.itemName,\r\n * or dataItem.name (only for series option data),\r\n * or provided in nameList from outside.\r\n */\n\n\n SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n var _this = this;\n\n var store;\n\n if (data instanceof DataStore) {\n store = data;\n }\n\n if (!store) {\n var dimensions = this.dimensions;\n var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n store = new DataStore();\n var dimensionInfos = map(dimensions, function (dimName) {\n return {\n type: _this._dimInfos[dimName].type,\n property: dimName\n };\n });\n store.initData(provider, dimensionInfos, dimValueGetter);\n }\n\n this._store = store; // Reset\n\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n this._doInit(0, store.count()); // Cache summary info for fast visit. See \"dimensionHelper\".\n // Needs to be initialized after store is prepared.\n\n\n this._dimSummary = summarizeDimensions(this, this._schema);\n this.userOutput = this._dimSummary.userOutput;\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\n\n\n SeriesData.prototype.appendData = function (data) {\n var range = this._store.appendData(data);\n\n this._doInit(range[0], range[1]);\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n * This method does not modify `rawData` (`dataProvider`), but only\r\n * add values to store.\r\n *\r\n * The final count will be increased by `Math.max(values.length, names.length)`.\r\n *\r\n * @param values That is the SourceType: 'arrayRows', like\r\n * [\r\n * [12, 33, 44],\r\n * [NaN, 43, 1],\r\n * ['-', 'asdf', 0]\r\n * ]\r\n * Each item is exaclty cooresponding to a dimension.\r\n */\n\n\n SeriesData.prototype.appendValues = function (values, names) {\n var _a = this._store.appendValues(values, names.length),\n start = _a.start,\n end = _a.end;\n\n var shouldMakeIdFromName = this._shouldMakeIdFromName();\n\n this._updateOrdinalMeta();\n\n if (names) {\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n this._nameList[idx] = names[sourceIdx];\n\n if (shouldMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n };\n\n SeriesData.prototype._updateOrdinalMeta = function () {\n var store = this._store;\n var dimensions = this.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = this._dimInfos[dimensions[i]];\n\n if (dimInfo.ordinalMeta) {\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n }\n }\n };\n\n SeriesData.prototype._shouldMakeIdFromName = function () {\n var provider = this._store.getProvider();\n\n return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n };\n\n SeriesData.prototype._doInit = function (start, end) {\n if (start >= end) {\n return;\n }\n\n var store = this._store;\n var provider = store.getProvider();\n\n this._updateOrdinalMeta();\n\n var nameList = this._nameList;\n var idList = this._idList;\n var sourceFormat = provider.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n if (isFormatOriginal && !provider.pure) {\n var sharedDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n var dataItem = provider.getItem(idx, sharedDataItem);\n\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n if (dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n }\n }\n\n if (this._shouldMakeIdFromName()) {\n for (var idx = start; idx < end; idx++) {\n makeIdFromName(this, idx);\n }\n }\n\n prepareInvertedIndex(this);\n };\n /**\r\n * PENDING: In fact currently this function is only used to short-circuit\r\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\r\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\r\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\r\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\r\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\r\n * be still needed.\r\n *\r\n * Optimize for the scenario that data is filtered by a given extent.\r\n * Consider that if data amount is more than hundreds of thousand,\r\n * extent calculation will cost more than 10ms and the cache will\r\n * be erased because of the filtering.\r\n */\n\n\n SeriesData.prototype.getApproximateExtent = function (dim) {\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n /**\r\n * Calculate extent on a filtered data might be time consuming.\r\n * Approximate extent is only used for: calculte extent of filtered data outside.\r\n */\n\n\n SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n SeriesData.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n SeriesData.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\r\n * @return Never be null/undefined. `number` will be converted to string. Becuase:\r\n * In most cases, name is used in display, where returning a string is more convenient.\r\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\r\n * rule that name `2` equals to name `'2'`.\r\n */\n\n\n SeriesData.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n\n SeriesData.prototype._getCategory = function (dimIdx, idx) {\n var ordinal = this._store.get(dimIdx, idx);\n\n var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n\n if (ordinalMeta) {\n return ordinalMeta.categories[ordinal];\n }\n\n return ordinal;\n };\n /**\r\n * @return Never null/undefined. `number` will be converted to string. Becuase:\r\n * In all cases having encountered at present, id is used in making diff comparison, which\r\n * are usually based on hash map. We can keep the rule that the internal id are always string\r\n * (treat `2` is the same as `'2'`) to make the related logic simple.\r\n */\n\n\n SeriesData.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n SeriesData.prototype.count = function () {\n return this._store.count();\n };\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n *\r\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.get = function (dim, idx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.get(dimInfo.storeDimIndex, idx);\n }\n };\n /**\r\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n }\n };\n\n SeriesData.prototype.getIndices = function () {\n return this._store.getIndices();\n };\n\n SeriesData.prototype.getDataExtent = function (dim) {\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getSum = function (dim) {\n return this._store.getSum(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getMedian = function (dim) {\n return this._store.getMedian(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getValues = function (dimensions, idx) {\n var _this = this;\n\n var store = this._store;\n return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n return _this._getStoreDimIndex(dim);\n }), idx) : store.getValues(dimensions);\n };\n /**\r\n * If value is NaN. Inlcuding '-'\r\n * Only check the coord dimensions.\r\n */\n\n\n SeriesData.prototype.hasValue = function (idx) {\n var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n\n for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\r\n * Retreive the index with given name\r\n */\n\n\n SeriesData.prototype.indexOfName = function (name) {\n for (var i = 0, len = this._store.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n\n SeriesData.prototype.getRawIndex = function (idx) {\n return this._store.getRawIndex(idx);\n };\n\n SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n return this._store.indexOfRawIndex(rawIndex);\n };\n /**\r\n * Only support the dimension which inverted index created.\r\n * Do not support other cases until required.\r\n * @param dim concrete dim\r\n * @param value ordinal index\r\n * @return rawIndex\r\n */\n\n\n SeriesData.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\r\n * Retreive the index of nearest value\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices has\r\n * the same value, they are put to the result.\r\n */\n\n\n SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);\n };\n\n SeriesData.prototype.each = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n\n this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n\n SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return this;\n };\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\n\n\n SeriesData.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var innerRange = {};\n var dims = zrUtil.keys(range);\n var dimIndices = [];\n zrUtil.each(dims, function (dim) {\n var dimIdx = _this._getStoreDimIndex(dim);\n\n innerRange[dimIdx] = range[dim];\n dimIndices.push(dimIdx);\n });\n this._store = this._store.selectRange(innerRange);\n return this;\n };\n /* eslint-enable max-len */\n\n\n SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n var list = cloneListForMapAndSample(this);\n list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return list;\n };\n\n SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n var _this = this; // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(normalizeDimensions(dims), function (dim) {\n var dimInfo = _this.getDimensionInfo(dim);\n\n if (!dimInfo.isCalculationCoord) {\n console.error('Danger: only stack dimension can be modified');\n }\n });\n }\n\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series,\n // it still cost lots of memory, becuase `_store.dimensions` are not shared.\n // We should consider there probably be shallow clone happen in each sereis\n // in consequent filter/map.\n\n this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\n\n\n SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n return list;\n };\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\n\n\n SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n return list;\n };\n\n SeriesData.prototype.getRawDataItem = function (idx) {\n return this._store.getRawDataItem(idx);\n };\n /**\r\n * Get model of one data item.\r\n */\n // TODO: Type of data item\n\n\n SeriesData.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\r\n * Create a data differ\r\n */\n\n\n SeriesData.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\r\n * Get visual property.\r\n */\n\n\n SeriesData.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n SeriesData.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\r\n * Get visual property of single data item\r\n */\n // eslint-disable-next-line\n\n\n SeriesData.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\r\n * If exists visual property of single data item\r\n */\n\n\n SeriesData.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\r\n * Make sure itemVisual property is unique\r\n */\n // TODO: use key to save visual to reduce memory.\n\n\n SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n SeriesData.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\r\n * Clear itemVisuals and list visual.\r\n */\n\n\n SeriesData.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n SeriesData.prototype.setLayout = function (key, val) {\n isObject(key) ? zrUtil.extend(this._layout, key) : this._layout[key] = val;\n };\n /**\r\n * Get layout property.\r\n */\n\n\n SeriesData.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\r\n * Get layout of single data item\r\n */\n\n\n SeriesData.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\r\n * Set layout of single data item\r\n */\n\n\n SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\r\n * Clear all layout of single data item\r\n */\n\n\n SeriesData.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\r\n * Set graphic element relative to data. It can be set as null\r\n */\n\n\n SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n setCommonECData(seriesIndex, this.dataType, idx, el);\n this._graphicEls[idx] = el;\n };\n\n SeriesData.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\r\n * Shallow clone a new list except visual and layout properties, and graph elements.\r\n * New list only change the indices.\r\n */\n\n\n SeriesData.prototype.cloneShallow = function (list) {\n if (!list) {\n list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n }\n\n transferProperties(list, this);\n list._store = this._store;\n return list;\n };\n /**\r\n * Wrap some method to add more feature\r\n */\n\n\n SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (!zrUtil.isFunction(originalMethod)) {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n SeriesData.internalField = function () {\n prepareInvertedIndex = function (data) {\n var invertedIndicesMap = data._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n var store = data._store;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < store.count(); i++) {\n // Only support the case that all values are distinct.\n invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (data, dimIdx, idx) {\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n };\n /**\r\n * @see the comment of `List['getId']`.\r\n */\n\n\n getId = function (data, rawIndex) {\n var id = data._idList[rawIndex];\n\n if (id == null && data._idDimIdx != null) {\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n /**\r\n * Data in excludeDimensions is copied, otherwise transfered.\r\n */\n\n\n cloneListForMapAndSample = function (original) {\n var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n return list;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (data, idx) {\n var nameList = data._nameList;\n var idList = data._idList;\n var nameDimIdx = data._nameDimIdx;\n var idDimIdx = data._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = data._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return SeriesData;\n}();\n\nexport default SeriesData;","export const cibYahoo = [\"32 32\",\"\"]","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseDate, numericToNumber } from '../../util/number.js';\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError } from '../../util/log.js';\n/**\r\n * Convert raw the value in to inner value in List.\r\n *\r\n * [Performance sensitive]\r\n *\r\n * [Caution]: this is the key logic of user value parser.\r\n * For backward compatibiliy, do not modify it until have to!\r\n */\n\nexport function parseDataValue(value, // For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n return value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && !isNumber(value) && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have by defualt `numericToNumber`.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return isString(val) ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\n\nvar FilterOrderComparator =\n/** @class */\nfunction () {\n function FilterOrderComparator(op, rval) {\n if (!isNumber(rval)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n\n throwError(errMsg);\n }\n\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n\n return FilterOrderComparator;\n}();\n\nvar SortOrderComparator =\n/** @class */\nfunction () {\n /**\r\n * @param order by defualt: 'asc'\r\n * @param incomparable by defualt: Always on the tail.\r\n * That is, if 'asc' => 'max', if 'desc' => 'min'\r\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE]\r\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n } // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n\n\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\n var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = isString(lval);\n var rvalIsStr = isString(rval);\n\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n\n return SortOrderComparator;\n}();\n\nexport { SortOrderComparator };\n\nvar FilterEqualityComparator =\n/** @class */\nfunction () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n\n return this._isEQ ? eqResult : !eqResult;\n };\n\n return FilterEqualityComparator;\n}();\n/**\r\n * [FILTER_COMPARISON_RULE]\r\n * `lt`|`lte`|`gt`|`gte`:\r\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\r\n * `eq`:\r\n * + If same type, compare with `===`.\r\n * + If there is one number, convert to number (`numericToNumber`) to compare.\r\n * + Else return `false`.\r\n * `ne`:\r\n * + Not `eq`.\r\n *\r\n *\r\n * [SORT_COMPARISON_RULE]\r\n * All the values are grouped into three categories:\r\n * + \"numeric\" (number and numeric string)\r\n * + \"non-numeric-string\" (string that excluding numeric string)\r\n * + \"others\"\r\n * \"numeric\" vs \"numeric\": values are ordered by number order.\r\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\r\n * \"others\" vs \"others\": do not change order (always return 0).\r\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\r\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\r\n * MEMO:\r\n * non-numeric string sort make sence when need to put the items with the same tag together.\r\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\r\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\r\n *\r\n *\r\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\r\n * + Do not support string comparison until required. And also need to\r\n * void the misleading of \"2\" > \"12\".\r\n * + Should avoid the misleading case:\r\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\r\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\r\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\r\n * See `util/number.ts#numericToNumber`.\r\n *\r\n * @return If `op` is not `RelationalOperator`, return null;\r\n */\n\n\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\n}","export const cilDrop = [\"24 24\",\"\"]","export const cilMoon = [\"24 24\",\"\"]","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic.js';\n/**\r\n * Sausage: similar to sector, but have half circle on both sides\r\n */\n\nvar SausageShape =\n/** @class */\nfunction () {\n function SausageShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n\n return SausageShape;\n}();\n\nvar SausagePath =\n/** @class */\nfunction (_super) {\n __extends(SausagePath, _super);\n\n function SausagePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'sausage';\n return _this;\n }\n\n SausagePath.prototype.getDefaultShape = function () {\n return new SausageShape();\n };\n\n SausagePath.prototype.buildPath = function (ctx, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var dr = (r - r0) * 0.5;\n var rCenter = r0 + dr;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var PI2 = Math.PI * 2;\n var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2;\n\n if (!lessThanCircle) {\n // Normalize angles\n startAngle = endAngle - (clockwise ? PI2 : -PI2);\n }\n\n var unitStartX = Math.cos(startAngle);\n var unitStartY = Math.sin(startAngle);\n var unitEndX = Math.cos(endAngle);\n var unitEndY = Math.sin(endAngle);\n\n if (lessThanCircle) {\n ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\n ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);\n } else {\n ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\n }\n\n ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\n ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n\n if (r0 !== 0) {\n ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\n } // ctx.closePath();\n\n };\n\n return SausagePath;\n}(Path);\n\nexport default SausagePath;","export const cilBarcode = [\"24 24\",\"\"]","export function buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4;\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n var total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundRectHelper from '../helper/roundRect.js';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize.js';\nvar RectShape = (function () {\n function RectShape() {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n }\n return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n __extends(Rect, _super);\n function Rect(opts) {\n return _super.call(this, opts) || this;\n }\n Rect.prototype.getDefaultShape = function () {\n return new RectShape();\n };\n Rect.prototype.buildPath = function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n };\n Rect.prototype.isZeroArea = function () {\n return !this.shape.width || !this.shape.height;\n };\n return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","import Point from './Point.js';\nvar extent = [0, 0];\nvar extent2 = [0, 0];\nvar minTv = new Point();\nvar maxTv = new Point();\nvar OrientedBoundingRect = (function () {\n function OrientedBoundingRect(rect, transform) {\n this._corners = [];\n this._axes = [];\n this._origin = [0, 0];\n for (var i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (var i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n var corners = this._corners;\n var axes = this._axes;\n var x = rect.x;\n var y = rect.y;\n var x2 = x + rect.width;\n var y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n if (transform) {\n for (var i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n for (var i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n };\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\n var overlapped = true;\n var noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\n var overlapped = true;\n for (var i = 0; i < 2; i++) {\n var axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n var axis = this._axes[dim];\n var origin = this._origin;\n var proj = corners[0].dot(axis) + origin[dim];\n var min = proj;\n var max = proj;\n for (var i = 1; i < corners.length; i++) {\n var proj_1 = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj_1, min);\n max = Math.max(proj_1, max);\n }\n out[0] = min;\n out[1] = max;\n };\n return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize.js';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n function LineShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n __extends(Line, _super);\n function Line(opts) {\n return _super.call(this, opts) || this;\n }\n Line.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Line.prototype.getDefaultShape = function () {\n return new LineShape();\n };\n Line.prototype.buildPath = function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n };\n Line.prototype.pointAt = function (p) {\n var shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n };\n return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n","export const cilUserFemale = [\"24 24\",\"\"]","export const cilGlobeAlt = [\"24 24\",\"\"]","export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n var _a = 0;\n var _b = x0;\n if ((y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)) {\n return false;\n }\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n var tmp = _a * x - y + _b;\n var _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}\n","import * as curve from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n return false;\n }\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n","import { quadraticProjectPoint } from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n return false;\n }\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n","var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}\n","import { normalizeRadian } from './util.js';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n return true;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n","export default function windingLine(x0, y0, x1, y1, x, y) {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n if (y1 === y0) {\n return 0;\n }\n var t = (y - y0) / (y1 - y0);\n var dir = y1 < y0 ? 1 : -1;\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n var x_ = t * (x1 - x0) + x0;\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n","import PathProxy from '../core/PathProxy.js';\nimport * as line from './line.js';\nimport * as cubic from './cubic.js';\nimport * as quadratic from './quadratic.js';\nimport * as arc from './arc.js';\nimport * as curve from '../core/curve.js';\nimport windingLine from './windingLine.js';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n if ((y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\n return 0;\n }\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var w = 0;\n var nExtrema = -1;\n var y0_ = void 0;\n var y1_ = void 0;\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i];\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) {\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n if ((y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)) {\n return 0;\n }\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n for (var i = 0; i < nRoots; i++) {\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) {\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) {\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n if (startAngle > endAngle) {\n var tmp_1 = startAngle;\n startAngle = endAngle;\n endAngle = tmp_1;\n }\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n var w = 0;\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if ((angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n var data = path.data;\n var len = path.len();\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (cmd === CMD.M && i > 1) {\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n }\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++];\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n x0 = x1;\n y0 = y1;\n }\n var _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n }\n else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n return containPath(pathProxy, lineWidth, true, x, y);\n}\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n]);\nvar Path = (function (_super) {\n __extends(Path, _super);\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n Path.prototype.update = function () {\n var _this = this;\n _super.prototype.update.call(this);\n var style = this.style;\n if (style.decal) {\n var decalEl = this._decalEl = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n decalEl.__dirty |= REDRAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n extend(this.style, value);\n }\n }\n else if (key === 'shape') {\n extend(this.shape, value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n if (fillLum > 0.5) {\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n }\n return DARK_LABEL_COLOR;\n };\n Path.prototype.getInsideTextStroke = function (textFill) {\n var pathFill = this.style.fill;\n if (isString(pathFill)) {\n var zr = this.__zr;\n var isDarkMode = !!(zr && zr.isDarkMode());\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n };\n Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };\n Path.prototype.pathUpdated = function () {\n this.__dirty &= ~SHAPE_CHANGED_BIT;\n };\n Path.prototype.getUpdatedPathProxy = function (inBatch) {\n !this.path && this.createPathProxy();\n this.path.beginPath();\n this.buildPath(this.path, this.shape, inBatch);\n return this.path;\n };\n Path.prototype.createPathProxy = function () {\n this.path = new PathProxy(false);\n };\n Path.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n };\n Path.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n Path.prototype.getBoundingRect = function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n if (needsUpdateRect) {\n var firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n this.createPathProxy();\n }\n var path = this.path;\n if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectStroke.copy(rect);\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n var w = style.lineWidth;\n if (!this.hasFill()) {\n var strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n if (lineScale > 1e-10) {\n rectStroke.width += w / lineScale;\n rectStroke.height += w / lineScale;\n rectStroke.x -= w / lineScale / 2;\n rectStroke.y -= w / lineScale / 2;\n }\n }\n return rectStroke;\n }\n return rect;\n };\n Path.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n if (rect.contain(x, y)) {\n var pathProxy = this.path;\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n if (lineScale > 1e-10) {\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n };\n Path.prototype.dirtyShape = function () {\n this.__dirty |= SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n };\n Path.prototype.dirty = function () {\n this.dirtyStyle();\n this.dirtyShape();\n };\n Path.prototype.animateShape = function (loop) {\n return this.animate('shape', loop);\n };\n Path.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n };\n Path.prototype.attrKV = function (key, value) {\n if (key === 'shape') {\n this.setShape(value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n };\n Path.prototype.setShape = function (keyOrObj, value) {\n var shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj);\n }\n this.dirtyShape();\n return this;\n };\n Path.prototype.shapeChanged = function () {\n return !!(this.__dirty & SHAPE_CHANGED_BIT);\n };\n Path.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n };\n Path.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n };\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetShape;\n if (state && state.shape) {\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n if (targetShape) {\n if (transition) {\n this.shape = extend({}, this.shape);\n var targetShapePrimaryProps = {};\n var shapeKeys = keys(targetShape);\n for (var i = 0; i < shapeKeys.length; i++) {\n var key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n this.shape[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n }, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n };\n Path.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedShape;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n };\n Path.prototype.getAnimationStyleProps = function () {\n return DEFAULT_PATH_ANIMATION_PROPS;\n };\n Path.prototype.isZeroArea = function () {\n return false;\n };\n Path.extend = function (defaultProps) {\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n defaultProps.init && defaultProps.init.call(_this, opts);\n return _this;\n }\n Sub.prototype.getDefaultStyle = function () {\n return clone(defaultProps.style);\n };\n Sub.prototype.getDefaultShape = function () {\n return clone(defaultProps.shape);\n };\n return Sub;\n }(Path));\n for (var key in defaultProps) {\n if (typeof defaultProps[key] === 'function') {\n Sub.prototype[key] = defaultProps[key];\n }\n }\n return Sub;\n };\n Path.initDefaultProps = (function () {\n var pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n })();\n return Path;\n}(Displayable));\nexport default Path;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\n/**\r\n * @return {string} If large mode changed, return string 'reset';\r\n */\n\nexport default function createRenderPlanner() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = !!fields.large;\n var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Model from '../../model/Model.js';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util.js'; // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\n\nexport function collect(ecModel, api) {\n var result = {\n /**\r\n * key: makeKey(axis.model)\r\n * value: {\r\n * axis,\r\n * coordSys,\r\n * axisPointerModel,\r\n * triggerTooltip,\r\n * involveSeries,\r\n * snap,\r\n * seriesModels,\r\n * seriesDataCount\r\n * }\r\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\r\n * key: makeKey(coordSys.model)\r\n * value: Object: key makeKey(axis.model), value: axisInfo\r\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}\n\nfunction collectAxesInfo(result, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global.\n\n var linksOption = globalAxisPointerModel.get('link', true) || [];\n var linkGroups = []; // Collect axes info.\n\n each(api.getCoordinateSystems(), function (coordSys) {\n // Some coordinate system do not support axes, like geo.\n if (!coordSys.axisPointerEnabled) {\n return;\n }\n\n var coordSysKey = makeKey(coordSys.model);\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convienent way to show axisPointer\n // for user. So we enable seting tooltip on coordSys model.\n\n var coordSysModel = coordSys.model;\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys.\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n\n if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not\n // show but axisPointer will show as normal.\n && baseTooltipModel.get('show')) {\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n\n if (triggerAxis || cross) {\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n }\n\n if (cross) {\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n }\n } // fromTooltip: true | false | 'cross'\n // triggerTooltip: true | false | null\n\n\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }\n });\n}\n\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n var volatileOption = {};\n each(fields, function (field) {\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n }); // category axis do not auto snap, otherwise some tick that do not\n // has value can not be hovered. value/time/log axis default snap if\n // triggered from tooltip and trigger tooltip.\n\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatibel with previous behavior, tooltip axis do not show label by default.\n // Only these properties can be overrided from tooltip to axisPointer.\n\n if (tooltipAxisPointerModel.get('type') === 'cross') {\n volatileOption.type = 'line';\n }\n\n var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default.\n\n labelOption.show == null && (labelOption.show = false);\n\n if (fromTooltip === 'cross') {\n // When 'cross', both axes show labels.\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style\n // (cross style is dashed by default)\n\n if (!triggerTooltip) {\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n crossStyle && defaults(labelOption, crossStyle.textStyle);\n }\n }\n\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\n\nfunction collectSeriesInfo(result, ecModel) {\n // Prepare data for axis trigger\n ecModel.eachSeries(function (seriesModel) {\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n var coordSys = seriesModel.coordinateSystem;\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n\n if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n return;\n }\n\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n var axis = axisInfo.axis;\n\n if (coordSys.getAxis(axis.dim) === axis) {\n axisInfo.seriesModels.push(seriesModel);\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n axisInfo.seriesDataCount += seriesModel.getData().count();\n }\n });\n });\n}\n/**\r\n * For example:\r\n * {\r\n * axisPointer: {\r\n * links: [{\r\n * xAxisIndex: [2, 4],\r\n * yAxisIndex: 'all'\r\n * }, {\r\n * xAxisId: ['a5', 'a7'],\r\n * xAxisName: 'xxx'\r\n * }]\r\n * }\r\n * }\r\n */\n\n\nfunction getLinkGroupIndex(linksOption, axis) {\n var axisModel = axis.model;\n var dim = axis.dim;\n\n for (var i = 0; i < linksOption.length; i++) {\n var linkOption = linksOption[i] || {};\n\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n return i;\n }\n }\n}\n\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\n\nexport function fixValue(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n\n if (!axisInfo) {\n return;\n }\n\n var axisPointerModel = axisInfo.axisPointerModel;\n var scale = axisInfo.axis.scale;\n var option = axisPointerModel.option;\n var status = axisPointerModel.get('status');\n var value = axisPointerModel.get('value'); // Parse init value for category and time axis.\n\n if (value != null) {\n value = scale.parse(value);\n }\n\n var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value\n // and status should be initialized.\n\n if (status == null) {\n option.status = useHandle ? 'show' : 'hide';\n }\n\n var extent = scale.getExtent().slice();\n extent[0] > extent[1] && extent.reverse();\n\n if ( // Pick a value on axis when initializing.\n value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n // where we should re-pick a value to keep `handle` displaying normally.\n || value > extent[1]) {\n // Make handle displayed on the end of the axis when init, which looks better.\n value = extent[1];\n }\n\n if (value < extent[0]) {\n value = extent[0];\n }\n\n option.value = value;\n\n if (useHandle) {\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n }\n}\nexport function getAxisInfo(axisModel) {\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n return axisInfo && axisInfo.axisPointerModel;\n}\n\nfunction isHandleTrigger(axisPointerModel) {\n return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\r\n * @param {module:echarts/model/Model} model\r\n * @return {string} unique key\r\n */\n\n\nexport function makeKey(model) {\n return model.type + '||' + model.id;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nvar SeriesDimensionDefine =\n/** @class */\nfunction () {\n /**\r\n * @param opt All of the fields will be shallow copied.\r\n */\n function SeriesDimensionDefine(opt) {\n /**\r\n * The format of `otherDims` is:\r\n * ```js\r\n * {\r\n * tooltip?: number\r\n * label?: number\r\n * itemName?: number\r\n * seriesName?: number\r\n * }\r\n * ```\r\n *\r\n * A `series.encode` can specified these fields:\r\n * ```js\r\n * encode: {\r\n * // \"3, 1, 5\" is the index of data dimension.\r\n * tooltip: [3, 1, 5],\r\n * label: [0, 3],\r\n * ...\r\n * }\r\n * ```\r\n * `otherDims` is the parse result of the `series.encode` above, like:\r\n * ```js\r\n * // Suppose the index of this data dimension is `3`.\r\n * this.otherDims = {\r\n * // `3` is at the index `0` of the `encode.tooltip`\r\n * tooltip: 0,\r\n * // `3` is at the index `1` of the `encode.label`\r\n * label: 1\r\n * };\r\n * ```\r\n *\r\n * This prop should never be `null`/`undefined` after initialized.\r\n */\n this.otherDims = {};\n\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n\n return SeriesDimensionDefine;\n}();\n\n;\nexport default SeriesDimensionDefine;","export const cilCart = [\"24 24\",\"\"]","module.exports =\r\n/******/ (function(modules) { // webpackBootstrap\r\n/******/ \t// The module cache\r\n/******/ \tvar installedModules = {};\r\n/******/\r\n/******/ \t// The require function\r\n/******/ \tfunction __webpack_require__(moduleId) {\r\n/******/\r\n/******/ \t\t// Check if module is in cache\r\n/******/ \t\tif(installedModules[moduleId]) {\r\n/******/ \t\t\treturn installedModules[moduleId].exports;\r\n/******/ \t\t}\r\n/******/ \t\t// Create a new module (and put it into the cache)\r\n/******/ \t\tvar module = installedModules[moduleId] = {\r\n/******/ \t\t\ti: moduleId,\r\n/******/ \t\t\tl: false,\r\n/******/ \t\t\texports: {}\r\n/******/ \t\t};\r\n/******/\r\n/******/ \t\t// Execute the module function\r\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\r\n/******/\r\n/******/ \t\t// Flag the module as loaded\r\n/******/ \t\tmodule.l = true;\r\n/******/\r\n/******/ \t\t// Return the exports of the module\r\n/******/ \t\treturn module.exports;\r\n/******/ \t}\r\n/******/\r\n/******/\r\n/******/ \t// expose the modules object (__webpack_modules__)\r\n/******/ \t__webpack_require__.m = modules;\r\n/******/\r\n/******/ \t// expose the module cache\r\n/******/ \t__webpack_require__.c = installedModules;\r\n/******/\r\n/******/ \t// define getter function for harmony exports\r\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\r\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\r\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\r\n/******/ \t\t}\r\n/******/ \t};\r\n/******/\r\n/******/ \t// define __esModule on exports\r\n/******/ \t__webpack_require__.r = function(exports) {\r\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\r\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\r\n/******/ \t\t}\r\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\r\n/******/ \t};\r\n/******/\r\n/******/ \t// create a fake namespace object\r\n/******/ \t// mode & 1: value is a module id, require it\r\n/******/ \t// mode & 2: merge all properties of value into the ns\r\n/******/ \t// mode & 4: return value when already ns object\r\n/******/ \t// mode & 8|1: behave like require\r\n/******/ \t__webpack_require__.t = function(value, mode) {\r\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\r\n/******/ \t\tif(mode & 8) return value;\r\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\r\n/******/ \t\tvar ns = Object.create(null);\r\n/******/ \t\t__webpack_require__.r(ns);\r\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\r\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\r\n/******/ \t\treturn ns;\r\n/******/ \t};\r\n/******/\r\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\r\n/******/ \t__webpack_require__.n = function(module) {\r\n/******/ \t\tvar getter = module && module.__esModule ?\r\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\r\n/******/ \t\t\tfunction getModuleExports() { return module; };\r\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\r\n/******/ \t\treturn getter;\r\n/******/ \t};\r\n/******/\r\n/******/ \t// Object.prototype.hasOwnProperty.call\r\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\r\n/******/\r\n/******/ \t// __webpack_public_path__\r\n/******/ \t__webpack_require__.p = \"\";\r\n/******/\r\n/******/\r\n/******/ \t// Load entry module and return exports\r\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"fb15\");\r\n/******/ })\r\n/************************************************************************/\r\n/******/ ({\r\n\r\n/***/ \"0f88\":\r\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\r\n\r\n\"use strict\";\r\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return getBoundingClientRect; });\r\nfunction getBoundingClientRect(element) {\r\n var rect = element.getBoundingClientRect();\r\n return {\r\n width: rect.width,\r\n height: rect.height,\r\n top: rect.top,\r\n right: rect.right,\r\n bottom: rect.bottom,\r\n left: rect.left,\r\n x: rect.left,\r\n y: rect.top\r\n };\r\n}\r\n\r\n/***/ }),\r\n\r\n/***/ \"1235\":\r\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\r\n\r\n\"use strict\";\r\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"popperGenerator\", function() { return popperGenerator; });\r\n/* unused harmony export createPopper */\r\n/* harmony import */ var _dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\"d116\");\r\n/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\"e2e9\");\r\n/* harmony import */ var _dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\"ea1a\");\r\n/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\"b62b\");\r\n/* harmony import */ var _utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\"b9e6\");\r\n/* harmony import */ var _utils_debounce_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\"b1e2\");\r\n/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\"2767\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided to Popper, they must be either a valid DOM element, virtual element, or a jQuery-wrapped DOM element.';\r\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\r\nvar DEFAULT_OPTIONS = {\r\n placement: 'bottom',\r\n modifiers: [],\r\n strategy: 'absolute'\r\n};\r\n\r\nfunction areValidElements() {\r\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\r\n args[_key] = arguments[_key];\r\n }\r\n\r\n return !args.some(function (element) {\r\n return !(element && typeof element.getBoundingClientRect === 'function');\r\n });\r\n}\r\n\r\nfunction popperGenerator(generatorOptions) {\r\n if (generatorOptions === void 0) {\r\n generatorOptions = {};\r\n }\r\n\r\n var _generatorOptions = generatorOptions,\r\n _generatorOptions$def = _generatorOptions.defaultModifiers,\r\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\r\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\r\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\r\n return function createPopper(reference, popper, options) {\r\n if (options === void 0) {\r\n options = defaultOptions;\r\n }\r\n\r\n var state = {\r\n placement: 'bottom',\r\n orderedModifiers: [],\r\n options: Object.assign({}, DEFAULT_OPTIONS, {}, defaultOptions),\r\n modifiersData: {},\r\n elements: {\r\n reference: reference,\r\n popper: popper\r\n },\r\n attributes: {},\r\n styles: {}\r\n };\r\n var effectCleanupFns = [];\r\n var isDestroyed = false;\r\n var instance = {\r\n state: state,\r\n setOptions: function setOptions(options) {\r\n cleanupModifierEffects();\r\n state.options = Object.assign({}, defaultOptions, {}, state.options, {}, options);\r\n state.scrollParents = {\r\n reference: Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_6__[/* isElement */ \"a\"])(reference) ? Object(_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(reference) : [],\r\n popper: Object(_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(popper)\r\n }; // Orders the modifiers based on their dependencies and `phase`\r\n // properties\r\n\r\n var orderedModifiers = Object(_utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])([].concat(state.options.modifiers.filter(function (modifier) {\r\n return !defaultModifiers.find(function (_ref) {\r\n var name = _ref.name;\r\n return name === modifier.name;\r\n });\r\n }), defaultModifiers.map(function (defaultModifier) {\r\n return Object.assign({}, defaultModifier, {}, state.options.modifiers.find(function (_ref2) {\r\n var name = _ref2.name;\r\n return name === defaultModifier.name;\r\n }));\r\n }))); // Validate the provided modifiers so that the consumer will get warned\r\n // if one of the modifiers is invalid for any reason\r\n\r\n if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } // Strip out disabled modifiers\r\n\r\n\r\n state.orderedModifiers = orderedModifiers.filter(function (m) {\r\n return m.enabled;\r\n });\r\n runModifierEffects();\r\n return instance.update();\r\n },\r\n // Sync update – it will always be executed, even if not necessary. This\r\n // is useful for low frequency updates where sync behavior simplifies the\r\n // logic.\r\n // For high frequency updates (e.g. `resize` and `scroll` events), always\r\n // prefer the async Popper#update method\r\n forceUpdate: function forceUpdate() {\r\n if (isDestroyed) {\r\n return;\r\n }\r\n\r\n var _state$elements = state.elements,\r\n reference = _state$elements.reference,\r\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\r\n // anymore\r\n\r\n if (!areValidElements(reference, popper)) {\r\n if (false) {}\r\n\r\n return;\r\n } // Store the reference and popper rects to be read by modifiers\r\n\r\n\r\n state.rects = {\r\n reference: Object(_dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(reference, Object(_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(popper), state.options.strategy === 'fixed'),\r\n popper: Object(_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(popper)\r\n }; // Modifiers have the ability to reset the current update cycle. The\r\n // most common use case for this is the `flip` modifier changing the\r\n // placement, which then needs to re-run all the modifiers, because the\r\n // logic was previously ran for the previous placement and is therefore\r\n // stale/incorrect\r\n\r\n state.reset = false;\r\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\r\n // is filled with the initial data specified by the modifier. This means\r\n // it doesn't persist and is fresh on each update.\r\n // To ensure persistent data, use `${name}#persistent`\r\n\r\n state.orderedModifiers.forEach(function (modifier) {\r\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\r\n });\r\n var __debug_loops__ = 0;\r\n\r\n for (var index = 0; index < state.orderedModifiers.length; index++) {\r\n if (false) {}\r\n\r\n if (state.reset === true) {\r\n state.reset = false;\r\n index = -1;\r\n continue;\r\n }\r\n\r\n var _state$orderedModifie = state.orderedModifiers[index],\r\n fn = _state$orderedModifie.fn,\r\n _state$orderedModifie2 = _state$orderedModifie.options,\r\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\r\n name = _state$orderedModifie.name;\r\n\r\n if (typeof fn === 'function') {\r\n state = fn({\r\n state: state,\r\n options: _options,\r\n name: name,\r\n instance: instance\r\n }) || state;\r\n }\r\n }\r\n },\r\n // Async and optimistically optimized update – it will not be executed if\r\n // not necessary (debounced to run at most once-per-tick)\r\n update: Object(_utils_debounce_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(function () {\r\n return new Promise(function (resolve) {\r\n instance.forceUpdate();\r\n resolve(state);\r\n });\r\n }),\r\n destroy: function destroy() {\r\n cleanupModifierEffects();\r\n isDestroyed = true;\r\n }\r\n };\r\n\r\n if (!areValidElements(reference, popper)) {\r\n if (false) {}\r\n\r\n return instance;\r\n }\r\n\r\n instance.setOptions(options).then(function (state) {\r\n if (!isDestroyed && options.onFirstUpdate) {\r\n options.onFirstUpdate(state);\r\n }\r\n }); // Modifiers have the ability to execute arbitrary code before the first\r\n // update cycle runs. They will be executed in the same order as the update\r\n // cycle. This is useful when a modifier adds some persistent data that\r\n // other modifiers need to use, but the modifier is run after the dependent\r\n // one.\r\n\r\n function runModifierEffects() {\r\n state.orderedModifiers.forEach(function (_ref5) {\r\n var name = _ref5.name,\r\n _ref5$options = _ref5.options,\r\n options = _ref5$options === void 0 ? {} : _ref5$options,\r\n effect = _ref5.effect;\r\n\r\n if (typeof effect === 'function') {\r\n var cleanupFn = effect({\r\n state: state,\r\n name: name,\r\n instance: instance,\r\n options: options\r\n });\r\n\r\n var noopFn = function noopFn() {};\r\n\r\n effectCleanupFns.push(cleanupFn || noopFn);\r\n }\r\n });\r\n }\r\n\r\n function cleanupModifierEffects() {\r\n effectCleanupFns.forEach(function (fn) {\r\n return fn();\r\n });\r\n effectCleanupFns = [];\r\n }\r\n\r\n return instance;\r\n };\r\n}\r\nvar createPopper =\r\n/*#__PURE__*/\r\npopperGenerator();\r\n\r\n/***/ }),\r\n\r\n/***/ \"1e7e\":\r\n/***/ (function(module, exports, __webpack_require__) {\r\n\r\n// style-loader: Adds some css to the DOM by adding a