@senx/discovery-plugin-marauder
Version:
Discovery plugin - Marauder's map
29 lines (25 loc) • 2.26 MB
JavaScript
var __awaiter=this&&this.__awaiter||function(e,t,r,i){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i["throw"](e))}catch(e){a(e)}}function u(e){e.done?r(e.value):n(e.value).then(o,s)}u((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return u([e,t])}}function u(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++){if(a||!(i in t)){if(!a)a=Array.prototype.slice.call(t,0,i);a[i]=t[i]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-324c6d3b.js";import{a as DataModel}from"./types-ffdee606.js";import{P as Param$1,_,G as GTSLib,U as Utils,L as Logger,v as v4,c as commonjsGlobal,d as dayjs,a as commonjsRequire,l as lodash,J as JsonLib,b as duration$1}from"./utils-7a8be8c0.js";import{g as global}from"./global-57908b51.js";import{C as ColorLib}from"./color-lib-3865b9f3.js";import{d as domtoimage,l as leafletSrc,L as Leaflet}from"./leaflet-src-81980202.js";import{L as LangUtils}from"./lang-utils-700756ea.js";import{M as MapLib}from"./map-lib-fb29883f.js";import{a as html2canvas}from"./html2canvas-ad623d3a.js";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var extendStatics$1=function(e,t){extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics$1(e,t)};function __extends$1(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics$1(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Browser=function(){function e(){this.firefox=false;this.ie=false;this.edge=false;this.newEdge=false;this.weChat=false}return e}();var Env=function(){function e(){this.browser=new Browser;this.node=false;this.wxa=false;this.worker=false;this.svgSupported=false;this.touchEventsSupported=false;this.pointerEventsSupported=false;this.domSupported=false;this.transformSupported=false;this.transform3dSupported=false;this.hasGlobalWindow=typeof window!=="undefined"}return e}();var env=new Env;if(typeof wx==="object"&&typeof wx.getSystemInfoSync==="function"){env.wxa=true;env.touchEventsSupported=true}else if(typeof document==="undefined"&&typeof self!=="undefined"){env.worker=true}else if(!env.hasGlobalWindow||"Deno"in window){env.node=true;env.svgSupported=true}else{detect(navigator.userAgent,env)}function detect(e,t){var r=t.browser;var i=e.match(/Firefox\/([\d.]+)/);var n=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/);var a=e.match(/Edge?\/([\d.]+)/);var o=/micromessenger/i.test(e);if(i){r.firefox=true;r.version=i[1]}if(n){r.ie=true;r.version=n[1]}if(a){r.edge=true;r.version=a[1];r.newEdge=+a[1].split(".")[0]>18}if(o){r.weChat=true}t.svgSupported=typeof SVGRect!=="undefined";t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge;t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);t.domSupported=typeof document!=="undefined";var s=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s);t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}var env$1=env;var DEFAULT_FONT_SIZE=12;var DEFAULT_FONT_FAMILY="sans-serif";var DEFAULT_FONT=DEFAULT_FONT_SIZE+"px "+DEFAULT_FONT_FAMILY;var OFFSET=20;var SCALE=100;var defaultWidthMapStr="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function getTextWidthMap(e){var t={};if(typeof JSON==="undefined"){return t}for(var r=0;r<e.length;r++){var i=String.fromCharCode(r+32);var n=(e.charCodeAt(r)-OFFSET)/SCALE;t[i]=n}return t}var DEFAULT_TEXT_WIDTH_MAP=getTextWidthMap(defaultWidthMapStr);var platformApi={createCanvas:function(){return typeof document!=="undefined"&&document.createElement("canvas")},measureText:function(){var e;var t;return function(r,i){if(!e){var n=platformApi.createCanvas();e=n&&n.getContext("2d")}if(e){if(t!==i){t=e.font=i||DEFAULT_FONT}return e.measureText(r)}else{r=r||"";i=i||DEFAULT_FONT;var a=/((?:\d+)?\.?\d*)px/.exec(i);var o=a&&+a[1]||DEFAULT_FONT_SIZE;var s=0;if(i.indexOf("mono")>=0){s=o*r.length}else{for(var u=0;u<r.length;u++){var l=DEFAULT_TEXT_WIDTH_MAP[r[u]];s+=l==null?o:l*o}}return{width:s}}}}(),loadImage:function(e,t,r){var i=new Image;i.onload=t;i.onerror=r;i.src=e;return i}};var BUILTIN_OBJECT=reduce(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(e,t){e["[object "+t+"]"]=true;return e}),{});var TYPED_ARRAY=reduce(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(e,t){e["[object "+t+"Array]"]=true;return e}),{});var objToString=Object.prototype.toString;var arrayProto=Array.prototype;var nativeForEach=arrayProto.forEach;var nativeFilter=arrayProto.filter;var nativeSlice=arrayProto.slice;var nativeMap=arrayProto.map;var ctorFunction=function(){}.constructor;var protoFunction=ctorFunction?ctorFunction.prototype:null;var protoKey="__proto__";var idStart=2311;function guid(){return idStart++}function logError(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}if(typeof console!=="undefined"){console.error.apply(console,e)}}function clone$4(e){if(e==null||typeof e!=="object"){return e}var t=e;var r=objToString.call(e);if(r==="[object Array]"){if(!isPrimitive(e)){t=[];for(var i=0,n=e.length;i<n;i++){t[i]=clone$4(e[i])}}}else if(TYPED_ARRAY[r]){if(!isPrimitive(e)){var a=e.constructor;if(a.from){t=a.from(e)}else{t=new a(e.length);for(var i=0,n=e.length;i<n;i++){t[i]=e[i]}}}}else if(!BUILTIN_OBJECT[r]&&!isPrimitive(e)&&!isDom(e)){t={};for(var o in e){if(e.hasOwnProperty(o)&&o!==protoKey){t[o]=clone$4(e[o])}}}return t}function merge(e,t,r){if(!isObject$3(t)||!isObject$3(e)){return r?clone$4(t):e}for(var i in t){if(t.hasOwnProperty(i)&&i!==protoKey){var n=e[i];var a=t[i];if(isObject$3(a)&&isObject$3(n)&&!isArray$2(a)&&!isArray$2(n)&&!isDom(a)&&!isDom(n)&&!isBuiltInObject(a)&&!isBuiltInObject(n)&&!isPrimitive(a)&&!isPrimitive(n)){merge(n,a,r)}else if(r||!(i in e)){e[i]=clone$4(t[i])}}}return e}function mergeAll(e,t){var r=e[0];for(var i=1,n=e.length;i<n;i++){r=merge(r,e[i],t)}return r}function extend(e,t){if(Object.assign){Object.assign(e,t)}else{for(var r in t){if(t.hasOwnProperty(r)&&r!==protoKey){e[r]=t[r]}}}return e}function defaults$1(e,t,r){var i=keys(t);for(var n=0,a=i.length;n<a;n++){var o=i[n];if(r?t[o]!=null:e[o]==null){e[o]=t[o]}}return e}function indexOf(e,t){if(e){if(e.indexOf){return e.indexOf(t)}for(var r=0,i=e.length;r<i;r++){if(e[r]===t){return r}}}return-1}function inherits(e,t){var r=e.prototype;function i(){}i.prototype=t.prototype;e.prototype=new i;for(var n in r){if(r.hasOwnProperty(n)){e.prototype[n]=r[n]}}e.prototype.constructor=e;e.superClass=t}function mixin(e,t,r){e="prototype"in e?e.prototype:e;t="prototype"in t?t.prototype:t;if(Object.getOwnPropertyNames){var i=Object.getOwnPropertyNames(t);for(var n=0;n<i.length;n++){var a=i[n];if(a!=="constructor"){if(r?t[a]!=null:e[a]==null){e[a]=t[a]}}}}else{defaults$1(e,t,r)}}function isArrayLike(e){if(!e){return false}if(typeof e==="string"){return false}return typeof e.length==="number"}function each$f(e,t,r){if(!(e&&t)){return}if(e.forEach&&e.forEach===nativeForEach){e.forEach(t,r)}else if(e.length===+e.length){for(var i=0,n=e.length;i<n;i++){t.call(r,e[i],i,e)}}else{for(var a in e){if(e.hasOwnProperty(a)){t.call(r,e[a],a,e)}}}}function map$1(e,t,r){if(!e){return[]}if(!t){return slice(e)}if(e.map&&e.map===nativeMap){return e.map(t,r)}else{var i=[];for(var n=0,a=e.length;n<a;n++){i.push(t.call(r,e[n],n,e))}return i}}function reduce(e,t,r,i){if(!(e&&t)){return}for(var n=0,a=e.length;n<a;n++){r=t.call(i,r,e[n],n,e)}return r}function filter(e,t,r){if(!e){return[]}if(!t){return slice(e)}if(e.filter&&e.filter===nativeFilter){return e.filter(t,r)}else{var i=[];for(var n=0,a=e.length;n<a;n++){if(t.call(r,e[n],n,e)){i.push(e[n])}}return i}}function find(e,t,r){if(!(e&&t)){return}for(var i=0,n=e.length;i<n;i++){if(t.call(r,e[i],i,e)){return e[i]}}}function keys(e){if(!e){return[]}if(Object.keys){return Object.keys(e)}var t=[];for(var r in e){if(e.hasOwnProperty(r)){t.push(r)}}return t}function bindPolyfill(e,t){var r=[];for(var i=2;i<arguments.length;i++){r[i-2]=arguments[i]}return function(){return e.apply(t,r.concat(nativeSlice.call(arguments)))}}var bind$1=protoFunction&&isFunction(protoFunction.bind)?protoFunction.call.bind(protoFunction.bind):bindPolyfill;function curry$1(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return function(){return e.apply(this,t.concat(nativeSlice.call(arguments)))}}function isArray$2(e){if(Array.isArray){return Array.isArray(e)}return objToString.call(e)==="[object Array]"}function isFunction(e){return typeof e==="function"}function isString(e){return typeof e==="string"}function isStringSafe(e){return objToString.call(e)==="[object String]"}function isNumber(e){return typeof e==="number"}function isObject$3(e){var t=typeof e;return t==="function"||!!e&&t==="object"}function isBuiltInObject(e){return!!BUILTIN_OBJECT[objToString.call(e)]}function isTypedArray(e){return!!TYPED_ARRAY[objToString.call(e)]}function isDom(e){return typeof e==="object"&&typeof e.nodeType==="number"&&typeof e.ownerDocument==="object"}function isGradientObject(e){return e.colorStops!=null}function isImagePatternObject(e){return e.image!=null}function isRegExp(e){return objToString.call(e)==="[object RegExp]"}function eqNaN(e){return e!==e}function retrieve(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}for(var r=0,i=e.length;r<i;r++){if(e[r]!=null){return e[r]}}}function retrieve2(e,t){return e!=null?e:t}function retrieve3(e,t,r){return e!=null?e:t!=null?t:r}function slice(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return nativeSlice.apply(e,t)}function normalizeCssArray$1(e){if(typeof e==="number"){return[e,e,e,e]}var t=e.length;if(t===2){return[e[0],e[1],e[0],e[1]]}else if(t===3){return[e[0],e[1],e[2],e[1]]}return e}function assert(e,t){if(!e){throw new Error(t)}}function trim$1(e){if(e==null){return null}else if(typeof e.trim==="function"){return e.trim()}else{return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}var primitiveKey="__ec_primitive__";function setAsPrimitive(e){e[primitiveKey]=true}function isPrimitive(e){return e[primitiveKey]}var MapPolyfill=function(){function e(){this.data={}}e.prototype["delete"]=function(e){var t=this.has(e);if(t){delete this.data[e]}return t};e.prototype.has=function(e){return this.data.hasOwnProperty(e)};e.prototype.get=function(e){return this.data[e]};e.prototype.set=function(e,t){this.data[e]=t;return this};e.prototype.keys=function(){return keys(this.data)};e.prototype.forEach=function(e){var t=this.data;for(var r in t){if(t.hasOwnProperty(r)){e(t[r],r)}}};return e}();var isNativeMapSupported=typeof Map==="function";function maybeNativeMap(){return isNativeMapSupported?new Map:new MapPolyfill}var HashMap=function(){function e(t){var r=isArray$2(t);this.data=maybeNativeMap();var i=this;t instanceof e?t.each(n):t&&each$f(t,n);function n(e,t){r?i.set(e,t):i.set(t,e)}}e.prototype.hasKey=function(e){return this.data.has(e)};e.prototype.get=function(e){return this.data.get(e)};e.prototype.set=function(e,t){this.data.set(e,t);return t};e.prototype.each=function(e,t){this.data.forEach((function(r,i){e.call(t,r,i)}))};e.prototype.keys=function(){var e=this.data.keys();return isNativeMapSupported?Array.from(e):e};e.prototype.removeKey=function(e){this.data["delete"](e)};return e}();function createHashMap(e){return new HashMap(e)}function concatArray(e,t){var r=new e.constructor(e.length+t.length);for(var i=0;i<e.length;i++){r[i]=e[i]}var n=e.length;for(var i=0;i<t.length;i++){r[i+n]=t[i]}return r}function createObject(e,t){var r;if(Object.create){r=Object.create(e)}else{var i=function(){};i.prototype=e;r=new i}if(t){extend(r,t)}return r}function disableUserSelect(e){var t=e.style;t.webkitUserSelect="none";t.userSelect="none";t.webkitTapHighlightColor="rgba(0,0,0,0)";t["-webkit-touch-callout"]="none"}function hasOwn(e,t){return e.hasOwnProperty(t)}function noop(){}var RADIAN_TO_DEGREE=180/Math.PI;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};function __extends(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function create$2(e,t){if(e==null){e=0}if(t==null){t=0}return[e,t]}function copy$1(e,t){e[0]=t[0];e[1]=t[1];return e}function clone$3(e){return[e[0],e[1]]}function set$1(e,t,r){e[0]=t;e[1]=r;return e}function add(e,t,r){e[0]=t[0]+r[0];e[1]=t[1]+r[1];return e}function scaleAndAdd$1(e,t,r,i){e[0]=t[0]+r[0]*i;e[1]=t[1]+r[1]*i;return e}function sub(e,t,r){e[0]=t[0]-r[0];e[1]=t[1]-r[1];return e}function len(e){return Math.sqrt(lenSquare(e))}function lenSquare(e){return e[0]*e[0]+e[1]*e[1]}function scale$2(e,t,r){e[0]=t[0]*r;e[1]=t[1]*r;return e}function normalize$3(e,t){var r=len(t);if(r===0){e[0]=0;e[1]=0}else{e[0]=t[0]/r;e[1]=t[1]/r}return e}function distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var dist$1=distance;function distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var distSquare=distanceSquare;function lerp$1(e,t,r,i){e[0]=t[0]+i*(r[0]-t[0]);e[1]=t[1]+i*(r[1]-t[1]);return e}function applyTransform$1(e,t,r){var i=t[0];var n=t[1];e[0]=r[0]*i+r[2]*n+r[4];e[1]=r[1]*i+r[3]*n+r[5];return e}function min$1(e,t,r){e[0]=Math.min(t[0],r[0]);e[1]=Math.min(t[1],r[1]);return e}function max$1(e,t,r){e[0]=Math.max(t[0],r[0]);e[1]=Math.max(t[1],r[1]);return e}var Param=function(){function e(e,t){this.target=e;this.topTarget=t&&t.topTarget}return e}();var Draggable=function(){function e(e){this.handler=e;e.on("mousedown",this._dragStart,this);e.on("mousemove",this._drag,this);e.on("mouseup",this._dragEnd,this)}e.prototype._dragStart=function(e){var t=e.target;while(t&&!t.draggable){t=t.parent||t.__hostTarget}if(t){this._draggingTarget=t;t.dragging=true;this._x=e.offsetX;this._y=e.offsetY;this.handler.dispatchToElement(new Param(t,e),"dragstart",e.event)}};e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var r=e.offsetX;var i=e.offsetY;var n=r-this._x;var a=i-this._y;this._x=r;this._y=i;t.drift(n,a,e);this.handler.dispatchToElement(new Param(t,e),"drag",e.event);var o=this.handler.findHover(r,i,t).target;var s=this._dropTarget;this._dropTarget=o;if(t!==o){if(s&&o!==s){this.handler.dispatchToElement(new Param(s,e),"dragleave",e.event)}if(o&&o!==s){this.handler.dispatchToElement(new Param(o,e),"dragenter",e.event)}}}};e.prototype._dragEnd=function(e){var t=this._draggingTarget;if(t){t.dragging=false}this.handler.dispatchToElement(new Param(t,e),"dragend",e.event);if(this._dropTarget){this.handler.dispatchToElement(new Param(this._dropTarget,e),"drop",e.event)}this._draggingTarget=null;this._dropTarget=null};return e}();var Draggable$1=Draggable;var Eventful=function(){function e(e){if(e){this._$eventProcessor=e}}e.prototype.on=function(e,t,r,i){if(!this._$handlers){this._$handlers={}}var n=this._$handlers;if(typeof t==="function"){i=r;r=t;t=null}if(!r||!e){return this}var a=this._$eventProcessor;if(t!=null&&a&&a.normalizeQuery){t=a.normalizeQuery(t)}if(!n[e]){n[e]=[]}for(var o=0;o<n[e].length;o++){if(n[e][o].h===r){return this}}var s={h:r,query:t,ctx:i||this,callAtLast:r.zrEventfulCallAtLast};var u=n[e].length-1;var l=n[e][u];l&&l.callAtLast?n[e].splice(u,0,s):n[e].push(s);return this};e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length};e.prototype.off=function(e,t){var r=this._$handlers;if(!r){return this}if(!e){this._$handlers={};return this}if(t){if(r[e]){var i=[];for(var n=0,a=r[e].length;n<a;n++){if(r[e][n].h!==t){i.push(r[e][n])}}r[e]=i}if(r[e]&&r[e].length===0){delete r[e]}}else{delete r[e]}return this};e.prototype.trigger=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}if(!this._$handlers){return this}var i=this._$handlers[e];var n=this._$eventProcessor;if(i){var a=t.length;var o=i.length;for(var s=0;s<o;s++){var u=i[s];if(n&&n.filter&&u.query!=null&&!n.filter(e,u.query)){continue}switch(a){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);break;case 2:u.h.call(u.ctx,t[0],t[1]);break;default:u.h.apply(u.ctx,t);break}}}n&&n.afterTrigger&&n.afterTrigger(e);return this};e.prototype.triggerWithContext=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}if(!this._$handlers){return this}var i=this._$handlers[e];var n=this._$eventProcessor;if(i){var a=t.length;var o=t[a-1];var s=i.length;for(var u=0;u<s;u++){var l=i[u];if(n&&n.filter&&l.query!=null&&!n.filter(e,l.query)){continue}switch(a){case 0:l.h.call(o);break;case 1:l.h.call(o,t[0]);break;case 2:l.h.call(o,t[0],t[1]);break;default:l.h.apply(o,t.slice(1,a-1));break}}}n&&n.afterTrigger&&n.afterTrigger(e);return this};return e}();var Eventful$1=Eventful;var LN2=Math.log(2);function determinant(e,t,r,i,n,a){var o=i+"-"+n;var s=e.length;if(a.hasOwnProperty(o)){return a[o]}if(t===1){var u=Math.round(Math.log((1<<s)-1&~n)/LN2);return e[r][u]}var l=i|1<<r;var f=r+1;while(i&1<<f){f++}var c=0;for(var h=0,d=0;h<s;h++){var v=1<<h;if(!(v&n)){c+=(d%2?-1:1)*e[r][h]*determinant(e,t-1,f,l,n|v,a);d++}}a[o]=c;return c}function buildTransformer(e,t){var r=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]];var i={};var n=determinant(r,8,0,0,0,i);if(n===0){return}var a=[];for(var o=0;o<8;o++){for(var s=0;s<8;s++){a[s]==null&&(a[s]=0);a[s]+=((o+s)%2?-1:1)*determinant(r,7,o===0?1:0,1<<o,1<<s,i)/n*t[o]}}return function(e,t,r){var i=t*a[6]+r*a[7]+1;e[0]=(t*a[0]+r*a[1]+a[2])/i;e[1]=(t*a[3]+r*a[4]+a[5])/i}}var EVENT_SAVED_PROP="___zrEVENTSAVED";var _calcOut$1=[];function transformLocalCoord(e,t,r,i,n){return transformCoordWithViewport(_calcOut$1,t,i,n,true)&&transformCoordWithViewport(e,r,_calcOut$1[0],_calcOut$1[1])}function transformCoordWithViewport(e,t,r,i,n){if(t.getBoundingClientRect&&env$1.domSupported&&!isCanvasEl(t)){var a=t[EVENT_SAVED_PROP]||(t[EVENT_SAVED_PROP]={});var o=prepareCoordMarkers(t,a);var s=preparePointerTransformer(o,a,n);if(s){s(e,r,i);return true}}return false}function prepareCoordMarkers(e,t){var r=t.markers;if(r){return r}r=t.markers=[];var i=["left","right"];var n=["top","bottom"];for(var a=0;a<4;a++){var o=document.createElement("div");var s=o.style;var u=a%2;var l=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[u]+":0",n[l]+":0",i[1-u]+":auto",n[1-l]+":auto",""].join("!important;");e.appendChild(o);r.push(o)}return r}function preparePointerTransformer(e,t,r){var i=r?"invTrans":"trans";var n=t[i];var a=t.srcCoords;var o=[];var s=[];var u=true;for(var l=0;l<4;l++){var f=e[l].getBoundingClientRect();var c=2*l;var h=f.left;var d=f.top;o.push(h,d);u=u&&a&&h===a[c]&&d===a[c+1];s.push(e[l].offsetLeft,e[l].offsetTop)}return u&&n?n:(t.srcCoords=o,t[i]=r?buildTransformer(s,o):buildTransformer(o,s))}function isCanvasEl(e){return e.nodeName.toUpperCase()==="CANVAS"}var replaceReg=/([&<>"'])/g;var replaceMap={"&":"&","<":"<",">":">",'"':""","'":"'"};function encodeHTML(e){return e==null?"":(e+"").replace(replaceReg,(function(e,t){return replaceMap[t]}))}var MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/;var _calcOut=[];var firefoxNotSupportOffsetXY=env$1.browser.firefox&&+env$1.browser.version.split(".")[0]<39;function clientToLocal(e,t,r,i){r=r||{};if(i){calculateZrXY(e,t,r)}else if(firefoxNotSupportOffsetXY&&t.layerX!=null&&t.layerX!==t.offsetX){r.zrX=t.layerX;r.zrY=t.layerY}else if(t.offsetX!=null){r.zrX=t.offsetX;r.zrY=t.offsetY}else{calculateZrXY(e,t,r)}return r}function calculateZrXY(e,t,r){if(env$1.domSupported&&e.getBoundingClientRect){var i=t.clientX;var n=t.clientY;if(isCanvasEl(e)){var a=e.getBoundingClientRect();r.zrX=i-a.left;r.zrY=n-a.top;return}else{if(transformCoordWithViewport(_calcOut,e,i,n)){r.zrX=_calcOut[0];r.zrY=_calcOut[1];return}}}r.zrX=r.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(e,t,r){t=getNativeEvent(t);if(t.zrX!=null){return t}var i=t.type;var n=i&&i.indexOf("touch")>=0;if(!n){clientToLocal(e,t,t,r);var a=getWheelDeltaMayPolyfill(t);t.zrDelta=a?a/120:-(t.detail||0)/3}else{var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&clientToLocal(e,o,t,r)}var s=t.button;if(t.which==null&&s!==undefined&&MOUSE_EVENT_REG.test(t.type)){t.which=s&1?1:s&2?3:s&4?2:0}return t}function getWheelDeltaMayPolyfill(e){var t=e.wheelDelta;if(t){return t}var r=e.deltaX;var i=e.deltaY;if(r==null||i==null){return t}var n=i!==0?Math.abs(i):Math.abs(r);var a=i>0?-1:i<0?1:r>0?-1:1;return 3*n*a}function addEventListener(e,t,r,i){e.addEventListener(t,r,i)}function removeEventListener(e,t,r,i){e.removeEventListener(t,r,i)}var stop=function(e){e.preventDefault();e.stopPropagation();e.cancelBubble=true};function isMiddleOrRightButtonOnMouseUpDown(e){return e.which===2||e.which===3}var GestureMgr=function(){function e(){this._track=[]}e.prototype.recognize=function(e,t,r){this._doTrack(e,t,r);return this._recognize(e)};e.prototype.clear=function(){this._track.length=0;return this};e.prototype._doTrack=function(e,t,r){var i=e.touches;if(!i){return}var n={points:[],touches:[],target:t,event:e};for(var a=0,o=i.length;a<o;a++){var s=i[a];var u=clientToLocal(r,s,{});n.points.push([u.zrX,u.zrY]);n.touches.push(s)}this._track.push(n)};e.prototype._recognize=function(e){for(var t in recognizers){if(recognizers.hasOwnProperty(t)){var r=recognizers[t](this._track,e);if(r){return r}}}};return e}();function dist(e){var t=e[1][0]-e[0][0];var r=e[1][1]-e[0][1];return Math.sqrt(t*t+r*r)}function center$1(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}var recognizers={pinch:function(e,t){var r=e.length;if(!r){return}var i=(e[r-1]||{}).points;var n=(e[r-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var a=dist(i)/dist(n);!isFinite(a)&&(a=1);t.pinchScale=a;var o=center$1(i);t.pinchX=o[0];t.pinchY=o[1];return{type:"pinch",target:e[0].target,event:t}}}};function create$1(){return[1,0,0,1,0,0]}function identity(e){e[0]=1;e[1]=0;e[2]=0;e[3]=1;e[4]=0;e[5]=0;return e}function copy(e,t){e[0]=t[0];e[1]=t[1];e[2]=t[2];e[3]=t[3];e[4]=t[4];e[5]=t[5];return e}function mul(e,t,r){var i=t[0]*r[0]+t[2]*r[1];var n=t[1]*r[0]+t[3]*r[1];var a=t[0]*r[2]+t[2]*r[3];var o=t[1]*r[2]+t[3]*r[3];var s=t[0]*r[4]+t[2]*r[5]+t[4];var u=t[1]*r[4]+t[3]*r[5]+t[5];e[0]=i;e[1]=n;e[2]=a;e[3]=o;e[4]=s;e[5]=u;return e}function translate(e,t,r){e[0]=t[0];e[1]=t[1];e[2]=t[2];e[3]=t[3];e[4]=t[4]+r[0];e[5]=t[5]+r[1];return e}function rotate(e,t,r,i){if(i===void 0){i=[0,0]}var n=t[0];var a=t[2];var o=t[4];var s=t[1];var u=t[3];var l=t[5];var f=Math.sin(r);var c=Math.cos(r);e[0]=n*c+s*f;e[1]=-n*f+s*c;e[2]=a*c+u*f;e[3]=-a*f+c*u;e[4]=c*(o-i[0])+f*(l-i[1])+i[0];e[5]=c*(l-i[1])-f*(o-i[0])+i[1];return e}function scale$1(e,t,r){var i=r[0];var n=r[1];e[0]=t[0]*i;e[1]=t[1]*n;e[2]=t[2]*i;e[3]=t[3]*n;e[4]=t[4]*i;e[5]=t[5]*n;return e}function invert(e,t){var r=t[0];var i=t[2];var n=t[4];var a=t[1];var o=t[3];var s=t[5];var u=r*o-a*i;if(!u){return null}u=1/u;e[0]=o*u;e[1]=-a*u;e[2]=-i*u;e[3]=r*u;e[4]=(i*s-o*n)*u;e[5]=(a*n-r*s)*u;return e}function clone$2(e){var t=create$1();copy(t,e);return t}var Point=function(){function e(e,t){this.x=e||0;this.y=t||0}e.prototype.copy=function(e){this.x=e.x;this.y=e.y;return this};e.prototype.clone=function(){return new e(this.x,this.y)};e.prototype.set=function(e,t){this.x=e;this.y=t;return this};e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y};e.prototype.add=function(e){this.x+=e.x;this.y+=e.y;return this};e.prototype.scale=function(e){this.x*=e;this.y*=e};e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t;this.y+=e.y*t};e.prototype.sub=function(e){this.x-=e.x;this.y-=e.y;return this};e.prototype.dot=function(e){return this.x*e.x+this.y*e.y};e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y};e.prototype.normalize=function(){var e=this.len();this.x/=e;this.y/=e;return this};e.prototype.distance=function(e){var t=this.x-e.x;var r=this.y-e.y;return Math.sqrt(t*t+r*r)};e.prototype.distanceSquare=function(e){var t=this.x-e.x;var r=this.y-e.y;return t*t+r*r};e.prototype.negate=function(){this.x=-this.x;this.y=-this.y;return this};e.prototype.transform=function(e){if(!e){return}var t=this.x;var r=this.y;this.x=e[0]*t+e[2]*r+e[4];this.y=e[1]*t+e[3]*r+e[5];return this};e.prototype.toArray=function(e){e[0]=this.x;e[1]=this.y;return e};e.prototype.fromArray=function(e){this.x=e[0];this.y=e[1]};e.set=function(e,t,r){e.x=t;e.y=r};e.copy=function(e,t){e.x=t.x;e.y=t.y};e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)};e.lenSquare=function(e){return e.x*e.x+e.y*e.y};e.dot=function(e,t){return e.x*t.x+e.y*t.y};e.add=function(e,t,r){e.x=t.x+r.x;e.y=t.y+r.y};e.sub=function(e,t,r){e.x=t.x-r.x;e.y=t.y-r.y};e.scale=function(e,t,r){e.x=t.x*r;e.y=t.y*r};e.scaleAndAdd=function(e,t,r,i){e.x=t.x+r.x*i;e.y=t.y+r.y*i};e.lerp=function(e,t,r,i){var n=1-i;e.x=n*t.x+i*r.x;e.y=n*t.y+i*r.y};return e}();var Point$1=Point;var mathMin$a=Math.min;var mathMax$a=Math.max;var lt=new Point$1;var rb=new Point$1;var lb=new Point$1;var rt=new Point$1;var minTv$1=new Point$1;var maxTv$1=new Point$1;var BoundingRect=function(){function e(e,t,r,i){if(r<0){e=e+r;r=-r}if(i<0){t=t+i;i=-i}this.x=e;this.y=t;this.width=r;this.height=i}e.prototype.union=function(e){var t=mathMin$a(e.x,this.x);var r=mathMin$a(e.y,this.y);if(isFinite(this.x)&&isFinite(this.width)){this.width=mathMax$a(e.x+e.width,this.x+this.width)-t}else{this.width=e.width}if(isFinite(this.y)&&isFinite(this.height)){this.height=mathMax$a(e.y+e.height,this.y+this.height)-r}else{this.height=e.height}this.x=t;this.y=r};e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)};e.prototype.calculateTransform=function(e){var t=this;var r=e.width/t.width;var i=e.height/t.height;var n=create$1();translate(n,n,[-t.x,-t.y]);scale$1(n,n,[r,i]);translate(n,n,[e.x,e.y]);return n};e.prototype.intersect=function(t,r){if(!t){return false}if(!(t instanceof e)){t=e.create(t)}var i=this;var n=i.x;var a=i.x+i.width;var o=i.y;var s=i.y+i.height;var u=t.x;var l=t.x+t.width;var f=t.y;var c=t.y+t.height;var h=!(a<u||l<n||s<f||c<o);if(r){var d=Infinity;var v=0;var m=Math.abs(a-u);var p=Math.abs(l-n);var _=Math.abs(s-f);var g=Math.abs(c-o);var y=Math.min(m,p);var b=Math.min(_,g);if(a<u||l<n){if(y>v){v=y;if(m<p){Point$1.set(maxTv$1,-m,0)}else{Point$1.set(maxTv$1,p,0)}}}else{if(y<d){d=y;if(m<p){Point$1.set(minTv$1,m,0)}else{Point$1.set(minTv$1,-p,0)}}}if(s<f||c<o){if(b>v){v=b;if(_<g){Point$1.set(maxTv$1,0,-_)}else{Point$1.set(maxTv$1,0,g)}}}else{if(y<d){d=y;if(_<g){Point$1.set(minTv$1,0,_)}else{Point$1.set(minTv$1,0,-g)}}}}if(r){Point$1.copy(r,h?minTv$1:maxTv$1)}return h};e.prototype.contain=function(e,t){var r=this;return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height};e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)};e.prototype.copy=function(t){e.copy(this,t)};e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}};e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};e.prototype.isZero=function(){return this.width===0||this.height===0};e.create=function(t){return new e(t.x,t.y,t.width,t.height)};e.copy=function(e,t){e.x=t.x;e.y=t.y;e.width=t.width;e.height=t.height};e.applyTransform=function(t,r,i){if(!i){if(t!==r){e.copy(t,r)}return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0];var a=i[3];var o=i[4];var s=i[5];t.x=r.x*n+o;t.y=r.y*a+s;t.width=r.width*n;t.height=r.height*a;if(t.width<0){t.x+=t.width;t.width=-t.width}if(t.height<0){t.y+=t.height;t.height=-t.height}return}lt.x=lb.x=r.x;lt.y=rt.y=r.y;rb.x=rt.x=r.x+r.width;rb.y=lb.y=r.y+r.height;lt.transform(i);rt.transform(i);rb.transform(i);lb.transform(i);t.x=mathMin$a(lt.x,rb.x,lb.x,rt.x);t.y=mathMin$a(lt.y,rb.y,lb.y,rt.y);var u=mathMax$a(lt.x,rb.x,lb.x,rt.x);var l=mathMax$a(lt.y,rb.y,lb.y,rt.y);t.width=u-t.x;t.height=l-t.y};return e}();var BoundingRect$1=BoundingRect;var SILENT="silent";function makeEventPacket(e,t,r){return{type:e,event:r,target:t.target,topTarget:t.topTarget,cancelBubble:false,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:stopEvent}}function stopEvent(){stop(this.event)}var EmptyProxy=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.handler=null;return t}t.prototype.dispose=function(){};t.prototype.setCursor=function(){};return t}(Eventful$1);var HoveredResult=function(){function e(e,t){this.x=e;this.y=t}return e}();var handlerNames=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"];var tmpRect$1=new BoundingRect$1(0,0,0,0);var Handler=function(e){__extends(t,e);function t(t,r,i,n,a){var o=e.call(this)||this;o._hovered=new HoveredResult(0,0);o.storage=t;o.painter=r;o.painterRoot=n;o._pointerSize=a;i=i||new EmptyProxy;o.proxy=null;o.setHandlerProxy(i);o._draggingMgr=new Draggable$1(o);return o}t.prototype.setHandlerProxy=function(e){if(this.proxy){this.proxy.dispose()}if(e){each$f(handlerNames,(function(t){e.on&&e.on(t,this[t],this)}),this);e.handler=this}this.proxy=e};t.prototype.mousemove=function(e){var t=e.zrX;var r=e.zrY;var i=isOutsideBoundary(this,t,r);var n=this._hovered;var a=n.target;if(a&&!a.__zr){n=this.findHover(n.x,n.y);a=n.target}var o=this._hovered=i?new HoveredResult(t,r):this.findHover(t,r);var s=o.target;var u=this.proxy;u.setCursor&&u.setCursor(s?s.cursor:"default");if(a&&s!==a){this.dispatchToElement(n,"mouseout",e)}this.dispatchToElement(o,"mousemove",e);if(s&&s!==a){this.dispatchToElement(o,"mouseover",e)}};t.prototype.mouseout=function(e){var t=e.zrEventControl;if(t!=="only_globalout"){this.dispatchToElement(this._hovered,"mouseout",e)}if(t!=="no_globalout"){this.trigger("globalout",{type:"globalout",event:e})}};t.prototype.resize=function(){this._hovered=new HoveredResult(0,0)};t.prototype.dispatch=function(e,t){var r=this[e];r&&r.call(this,t)};t.prototype.dispose=function(){this.proxy.dispose();this.storage=null;this.proxy=null;this.painter=null};t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)};t.prototype.dispatchToElement=function(e,t,r){e=e||{};var i=e.target;if(i&&i.silent){return}var n="on"+t;var a=makeEventPacket(t,e,r);while(i){i[n]&&(a.cancelBubble=!!i[n].call(i,a));i.trigger(t,a);i=i.__hostTarget?i.__hostTarget:i.parent;if(a.cancelBubble){break}}if(!a.cancelBubble){this.trigger(t,a);if(this.painter&&this.painter.eachOtherLayer){this.painter.eachOtherLayer((function(e){if(typeof e[n]==="function"){e[n].call(e,a)}if(e.trigger){e.trigger(t,a)}}))}}};t.prototype.findHover=function(e,t,r){var i=this.storage.getDisplayList();var n=new HoveredResult(e,t);setHoverTarget(i,n,e,t,r);if(this._pointerSize&&!n.target){var a=[];var o=this._pointerSize;var s=o/2;var u=new BoundingRect$1(e-s,t-s,o,o);for(var l=i.length-1;l>=0;l--){var f=i[l];if(f!==r&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)){tmpRect$1.copy(f.getBoundingRect());if(f.transform){tmpRect$1.applyTransform(f.transform)}if(tmpRect$1.intersect(u)){a.push(f)}}}if(a.length){var c=4;var h=Math.PI/12;var d=Math.PI*2;for(var v=0;v<s;v+=c){for(var m=0;m<d;m+=h){var p=e+v*Math.cos(m);var _=t+v*Math.sin(m);setHoverTarget(a,n,p,_,r);if(n.target){return n}}}}}return n};t.prototype.processGesture=function(e,t){if(!this._gestureMgr){this._gestureMgr=new GestureMgr}var r=this._gestureMgr;t==="start"&&r.clear();var i=r.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);t==="end"&&r.clear();if(i){var n=i.type;e.gestureEvent=n;var a=new HoveredResult;a.target=i.target;this.dispatchToElement(a,n,i.event)}};return t}(Eventful$1);each$f(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Handler.prototype[e]=function(t){var r=t.zrX;var i=t.zrY;var n=isOutsideBoundary(this,r,i);var a;var o;if(e!=="mouseup"||!n){a=this.findHover(r,i);o=a.target}if(e==="mousedown"){this._downEl=o;this._downPoint=[t.zrX,t.zrY];this._upEl=o}else if(e==="mouseup"){this._upEl=o}else if(e==="click"){if(this._downEl!==this._upEl||!this._downPoint||dist$1(this._downPoint,[t.zrX,t.zrY])>4){return}this._downPoint=null}this.dispatchToElement(a,e,t)}}));function isHover(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){var i=e;var n=void 0;var a=false;while(i){if(i.ignoreClip){a=true}if(!a){var o=i.getClipPath();if(o&&!o.contain(t,r)){return false}}if(i.silent){n=true}var s=i.__hostTarget;i=s?s:i.parent}return n?SILENT:true}return false}function setHoverTarget(e,t,r,i,n){for(var a=e.length-1;a>=0;a--){var o=e[a];var s=void 0;if(o!==n&&!o.ignore&&(s=isHover(o,r,i))){!t.topTarget&&(t.topTarget=o);if(s!==SILENT){t.target=o;break}}}}function isOutsideBoundary(e,t,r){var i=e.painter;return t<0||t>i.getWidth()||r<0||r>i.getHeight()}var Handler$1=Handler;var DEFAULT_MIN_MERGE=32;var DEFAULT_MIN_GALLOPING=7;function minRunLength(e){var t=0;while(e>=DEFAULT_MIN_MERGE){t|=e&1;e>>=1}return e+t}function makeAscendingRun(e,t,r,i){var n=t+1;if(n===r){return 1}if(i(e[n++],e[t])<0){while(n<r&&i(e[n],e[n-1])<0){n++}reverseRun(e,t,n)}else{while(n<r&&i(e[n],e[n-1])>=0){n++}}return n-t}function reverseRun(e,t,r){r--;while(t<r){var i=e[t];e[t++]=e[r];e[r--]=i}}function binaryInsertionSort(e,t,r,i,n){if(i===t){i++}for(;i<r;i++){var a=e[i];var o=t;var s=i;var u;while(o<s){u=o+s>>>1;if(n(a,e[u])<0){s=u}else{o=u+1}}var l=i-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:while(l>0){e[o+l]=e[o+l-1];l--}}e[o]=a}}function gallopLeft(e,t,r,i,n,a){var o=0;var s=0;var u=1;if(a(e,t[r+n])>0){s=i-n;while(u<s&&a(e,t[r+n+u])>0){o=u;u=(u<<1)+1;if(u<=0){u=s}}if(u>s){u=s}o+=n;u+=n}else{s=n+1;while(u<s&&a(e,t[r+n-u])<=0){o=u;u=(u<<1)+1;if(u<=0){u=s}}if(u>s){u=s}var l=o;o=n-u;u=n-l}o++;while(o<u){var f=o+(u-o>>>1);if(a(e,t[r+f])>0){o=f+1}else{u=f}}return u}function gallopRight(e,t,r,i,n,a){var o=0;var s=0;var u=1;if(a(e,t[r+n])<0){s=n+1;while(u<s&&a(e,t[r+n-u])<0){o=u;u=(u<<1)+1;if(u<=0){u=s}}if(u>s){u=s}var l=o;o=n-u;u=n-l}else{s=i-n;while(u<s&&a(e,t[r+n+u])>=0){o=u;u=(u<<1)+1;if(u<=0){u=s}}if(u>s){u=s}o+=n;u+=n}o++;while(o<u){var f=o+(u-o>>>1);if(a(e,t[r+f])<0){u=f}else{o=f+1}}return u}function TimSort(e,t){var r=DEFAULT_MIN_GALLOPING;var i;var n;var a=0;var o=[];i=[];n=[];function s(e,t){i[a]=e;n[a]=t;a+=1}function u(){while(a>1){var e=a-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1]){if(n[e-1]<n[e+1]){e--}}else if(n[e]>n[e+1]){break}f(e)}}function l(){while(a>1){var e=a-2;if(e>0&&n[e-1]<n[e+1]){e--}f(e)}}function f(r){var o=i[r];var s=n[r];var u=i[r+1];var l=n[r+1];n[r]=s+l;if(r===a-3){i[r+1]=i[r+2];n[r+1]=n[r+2]}a--;var f=gallopRight(e[u],e,o,s,0,t);o+=f;s-=f;if(s===0){return}l=gallopLeft(e[o+s-1],e,u,l,l-1,t);if(l===0){return}if(s<=l){c(o,s,u,l)}else{h(o,s,u,l)}}function c(i,n,a,s){var u=0;for(u=0;u<n;u++){o[u]=e[i+u]}var l=0;var f=a;var c=i;e[c++]=e[f++];if(--s===0){for(u=0;u<n;u++){e[c+u]=o[l+u]}return}if(n===1){for(u=0;u<s;u++){e[c+u]=e[f+u]}e[c+s]=o[l];return}var h=r;var d;var v;var m;while(1){d=0;v=0;m=false;do{if(t(e[f],o[l])<0){e[c++]=e[f++];v++;d=0;if(--s===0){m=true;break}}else{e[c++]=o[l++];d++;v=0;if(--n===1){m=true;break}}}while((d|v)<h);if(m){break}do{d=gallopRight(e[f],o,l,n,0,t);if(d!==0){for(u=0;u<d;u++){e[c+u]=o[l+u]}c+=d;l+=d;n-=d;if(n<=1){m=true;break}}e[c++]=e[f++];if(--s===0){m=true;break}v=gallopLeft(o[l],e,f,s,0,t);if(v!==0){for(u=0;u<v;u++){e[c+u]=e[f+u]}c+=v;f+=v;s-=v;if(s===0){m=true;break}}e[c++]=o[l++];if(--n===1){m=true;break}h--}while(d>=DEFAULT_MIN_GALLOPING||v>=DEFAULT_MIN_GALLOPING);if(m){break}if(h<0){h=0}h+=2}r=h;r<1&&(r=1);if(n===1){for(u=0;u<s;u++){e[c+u]=e[f+u]}e[c+s]=o[l]}else if(n===0){throw new Error}else{for(u=0;u<n;u++){e[c+u]=o[l+u]}}}function h(i,n,a,s){var u=0;for(u=0;u<s;u++){o[u]=e[a+u]}var l=i+n-1;var f=s-1;var c=a+s-1;var h=0;var d=0;e[c--]=e[l--];if(--n===0){h=c-(s-1);for(u=0;u<s;u++){e[h+u]=o[u]}return}if(s===1){c-=n;l-=n;d=c+1;h=l+1;for(u=n-1;u>=0;u--){e[d+u]=e[h+u]}e[c]=o[f];return}var v=r;while(true){var m=0;var p=0;var _=false;do{if(t(o[f],e[l])<0){e[c--]=e[l--];m++;p=0;if(--n===0){_=true;break}}else{e[c--]=o[f--];p++;m=0;if(--s===1){_=true;break}}}while((m|p)<v);if(_){break}do{m=n-gallopRight(o[f],e,i,n,n-1,t);if(m!==0){c-=m;l-=m;n-=m;d=c+1;h=l+1;for(u=m-1;u>=0;u--){e[d+u]=e[h+u]}if(n===0){_=true;break}}e[c--]=o[f--];if(--s===1){_=true;break}p=s-gallopLeft(e[l],o,0,s,s-1,t);if(p!==0){c-=p;f-=p;s-=p;d=c+1;h=f+1;for(u=0;u<p;u++){e[d+u]=o[h+u]}if(s<=1){_=true;break}}e[c--]=e[l--];if(--n===0){_=true;break}v--}while(m>=DEFAULT_MIN_GALLOPING||p>=DEFAULT_MIN_GALLOPING);if(_){break}if(v<0){v=0}v+=2}r=v;if(r<1){r=1}if(s===1){c-=n;l-=n;d=c+1;h=l+1;for(u=n-1;u>=0;u--){e[d+u]=e[h+u]}e[c]=o[f]}else if(s===0){throw new Error}else{h=c-(s-1);for(u=0;u<s;u++){e[h+u]=o[u]}}}return{mergeRuns:u,forceMergeRuns:l,pushRun:s}}function sort$2(e,t,r,i){if(!r){r=0}if(!i){i=e.length}var n=i-r;if(n<2){return}var a=0;if(n<DEFAULT_MIN_MERGE){a=makeAscendingRun(e,r,i,t);binaryInsertionSort(e,r,i,r+a,t);return}var o=TimSort(e,t);var s=minRunLength(n);do{a=makeAscendingRun(e,r,i,t);if(a<s){var u=n;if(u>s){u=s}binaryInsertionSort(e,r,r+u,r+a,t);a=u}o.pushRun(r,a);o.mergeRuns();n-=a;r+=a}while(n!==0);o.forceMergeRuns()}var REDRAW_BIT=1;var STYLE_CHANGED_BIT=2;var SHAPE_CHANGED_BIT=4;var invalidZErrorLogged=false;function logInvalidZError(){if(invalidZErrorLogged){return}invalidZErrorLogged=true;console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors")}function shapeCompareFunc(e,t){if(e.zlevel===t.zlevel){if(e.z===t.z){return e.z2-t.z2}return e.z-t.z}return e.zlevel-t.zlevel}var Storage=function(){function e(){this._roots=[];this._displayList=[];this._displayListLen=0;this.displayableSortFunc=shapeCompareFunc}e.prototype.traverse=function(e,t){for(var r=0;r<this._roots.length;r++){this._roots[r].traverse(e,t)}};e.prototype.getDisplayList=function(e,t){t=t||false;var r=this._displayList;if(e||!r.length){this.updateDisplayList(t)}return r};e.prototype.updateDisplayList=function(e){this._displayListLen=0;var t=this._roots;var r=this._displayList;for(var i=0,n=t.length;i<n;i++){this._updateAndAddDisplayable(t[i],null,e)}r.length=this._displayListLen;sort$2(r,shapeCompareFunc)};e.prototype._updateAndAddDisplayable=function(e,t,r){if(e.ignore&&!r){return}e.beforeUpdate();e.update();e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip){t=null}else if(i){if(t){t=t.slice()}else{t=[]}var n=i;var a=e;while(n){n.parent=a;n.updateTransform();t.push(n);a=n;n=n.getClipPath()}}if(e.childrenRef){var o=e.childrenRef();for(var s=0;s<o.length;s++){var u=o[s];if(e.__dirty){u.__dirty|=REDRAW_BIT}this._updateAndAddDisplayable(u,t,r)}e.__dirty=0}else{var l=e;if(t&&t.length){l.__clipPaths=t}else if(l.__clipPaths&&l.__clipPaths.length>0){l.__clipPaths=[]}if(isNaN(l.z)){logInvalidZError();l.z=0}if(isNaN(l.z2)){logInvalidZError();l.z2=0}if(isNaN(l.zlevel)){logInvalidZError();l.zlevel=0}this._displayList[this._displayListLen++]=l}var f=e.getDecalElement&&e.getDecalElement();if(f){this._updateAndAddDisplayable(f,t,r)}var c=e.getTextGuideLine();if(c){this._updateAndAddDisplayable(c,t,r)}var h=e.getTextContent();if(h){this._updateAndAddDisplayable(h,t,r)}};e.prototype.addRoot=function(e){if(e.__zr&&e.__zr.storage===this){return}this._roots.push(e)};e.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,r=e.length;t<r;t++){this.delRoot(e[t])}return}var i=indexOf(this._roots,e);if(i>=0){this._roots.splice(i,1)}};e.prototype.delAllRoots=function(){this._roots=[];this._displayList=[];this._displayListLen=0;return};e.prototype.getRoots=function(){return this._roots};e.prototype.dispose=function(){this._displayList=null;this._roots=null};return e}();var Storage$1=Storage;var requestAnimationFrame;requestAnimationFrame=env$1.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var requestAnimationFrame$1=requestAnimationFrame;var easingFuncs={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){if((e*=2)<1){return.5*e*e}return-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){if((e*=2)<1){return.5*e*e*e}return.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){if((e*=2)<1){return.5*e*e*e*e}return-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){if((e*=2)<1){return.5*e*e*e*e*e}return.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){if(e===0){return 0}if(e===1){return 1}if((e*=2)<1){return.5*Math.pow(1024,e-1)}return.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){if((e*=2)<1){return-.5*(Math.sqrt(1-e*e)-1)}return.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t;var r=.1;var i=.4;if(e===0){return 0}if(e===1){return 1}if(!r||r<1){r=1;t=i/4}else{t=i*Math.asin(1/r)/(2*Math.PI)}return-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i))},elasticOut:function(e){var t;var r=.1;var i=.4;if(e===0){return 0}if(e===1){return 1}if(!r||r<1){r=1;t=i/4}else{t=i*Math.asin(1/r)/(2*Math.PI)}return r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/i)+1},elasticInOut:function(e){var t;var r=.1;var i=.4;if(e===0){return 0}if(e===1){return 1}if(!r||r<1){r=1;t=i/4}else{t=i*Math.asin(1/r)/(2*Math.PI)}if((e*=2)<1){return-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i))}return r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=1.70158*1.525;if((e*=2)<1){return.5*(e*e*((t+1)*e-t))}return.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-easingFuncs.bounceOut(1-e)},bounceOut:function(e){if(e<1/2.75){return 7.5625*e*e}else if(e<2/2.75){return 7.5625*(e-=1.5/2.75)*e+.75}else if(e<2.5/2.75){return 7.5625*(e-=2.25/2.75)*e+.9375}else{return 7.5625*(e-=2.625/2.75)*e+.984375}},bounceInOut:function(e){if(e<.5){return easingFuncs.bounceIn(e*2)*.5}return easingFuncs.bounceOut(e*2-1)*.5+.5}};var easingFuncs$1=easingFuncs;var mathPow$2=Math.pow;var mathSqrt$3=Math.sqrt;var EPSILON$4=1e-8;var EPSILON_NUMERIC=1e-4;var THREE_SQRT=mathSqrt$3(3);var ONE_THIRD=1/3;var _v0=create$2();var _v1=create$2();var _v2=create$2();function isAroundZero$1(e){return e>-EPSILON$4&&e<EPSILON$4}function isNotAroundZero$1(e){return e>EPSILON$4||e<-EPSILON$4}function cubicAt(e,t,r,i,n){var a=1-n;return a*a*(a*e+3*n*t)+n*n*(n*i+3*a*r)}function cubicDerivativeAt(e,t,r,i,n){var a=1-n;return 3*(((t-e)*a+2*(r-t)*n)*a+(i-r)*n*n)}function cubicRootAt(e,t,r,i,n,a){var o=i+3*(t-r)-e;var s=3*(r-t*2+e);var u=3*(t-e);var l=e-n;var f=s*s-3*o*u;var c=s*u-9*o*l;var h=u*u-3*s*l;var d=0;if(isAroundZero$1(f)&&isAroundZero$1(c)){if(isAroundZero$1(s)){a[0]=0}else{var v=-u/s;if(v>=0&&v<=1){a[d++]=v}}}else{var m=c*c-4*f*h;if(isAroundZero$1(m)){var p=c/f;var v=-s/o+p;var _=-p/2;if(v>=0&&v<=1){a[d++]=v}if(_>=0&&_<=1){a[d++]=_}}else if(m>0){var g=mathSqrt$3(m);var y=f*s+1.5*o*(-c+g);var b=f*s+1.5*o*(-c-g);if(y<0){y=-mathPow$2(-y,ONE_THIRD)}else{y=mathPow$2(y,ONE_THIRD)}if(b<0){b=-mathPow$2(-b,ONE_THIRD)}else{b=mathPow$2(b,ONE_THIRD)}var v=(-s-(y+b))/(3*o);if(v>=0&&v<=1){a[d++]=v}}else{var w=(2*f*s-3*o*c)/(2*mathSqrt$3(f*f*f));var M=Math.acos(w)/3;var S=mathSqrt$3(f);var L=Math.cos(M);var v=(-s-2*S*L)/(3*o);var _=(-s+S*(L+THREE_SQRT*Math.sin(M)))/(3*o);var T=(-s+S*(L-THREE_SQRT*Math.sin(M)))/(3*o);if(v>=0&&v<=1){a[d++]=v}if(_>=0&&_<=1){a[d++]=_}if(T>=0&&T<=1){a[d++]=T}}}return d}function cubicExtrema(e,t,r,i,n){var a=6*r-12*t+6*e;var o=9*t+3*i-3*e-9*r;var s=3*t-3*e;var u=0;if(isAroundZero$1(o)){if(isNotAroundZero$1(a)){var l=-s/a;if(l>=0&&l<=1){n[u++]=l}}}else{var f=a*a-4*o*s;if(isAroundZero$1(f)){n[0]=-a/(2*o)}else if(f>0){var c=mathSqrt$3(f);var l=(-a+c)/(2*o);var h=(-a-c)/(2*o);if(l>=0&&l<=1){n[u++]=l}if(h>=0&&h<=1){n[u++]=h}}}return u}function cubicSubdivide(e,t,r,i,n,a){var o=(t-e)*n+e;var s=(r-t)*n+t;var u=(i-r)*n+r;var l=(s-o)*n+o;var f=(u-s)*n+s;var c=(f-l)*n+l;a[0]=e;a[1]=o;a[2]=l;a[3]=c;a[4]=c;a[5]=f;a[6]=u;a[7]=i}function cubicProjectPoint(e,t,r,i,n,a,o,s,u,l,f){var c;var h=.005;var d=Infinity;var v;var m;var p;var _;_v0[0]=u;_v0[1]=l;for(var g=0;g<1;g+=.05){_v1[0]=cubicAt(e,r,n,o,g);_v1[1]=cubicAt(t,i,a,s,g);p=distSquare(_v0,_v1);if(p<d){c=g;d=p}}d=Infinity;for(var y=0;y<32;y++){if(h<EPSILON_NUMERIC){break}v=c-h;m=c+h;_v1[0]=cubicAt(e,r,n,o,v);_v1[1]=cubicAt(t,i,a,s,v);p=distSquare(_v1,_v0);if(v>=0&&p<d){c=v;d=p}else{_v2[0]=cubicAt(e,r,n,o,m);_v2[1]=cubicAt(t,i,a,s,m);_=distSquare(_v2,_v0);if(m<=1&&_<d){c=m;d=_}else{h*=.5}}}if(f){f[0]=cubicAt(e,r,n,o,c);f[1]=cubicAt(t,i,a,s,c)}return mathSqrt$3(d)}function cubicLength(e,t,r,i,n,a,o,s,u){var l=e;var f=t;var c=0;var h=1/u;for(var d=1;d<=u;d++){var v=d*h;var m=cubicAt(e,r,n,o,v);var p=cubicAt(t,i,a,s,v);var _=m-l;var g=p-f;c+=Math.sqrt(_*_+g*g);l=m;f=p}return c}function quadraticAt$1(e,t,r,i){var n=1-i;return n*(n*e+2*i*t)+i*i*r}function quadraticDerivativeAt(e,t,r,i){return 2*((1-i)*(t-e)+i*(r-t))}function quadraticRootAt(e,t,r,i,n){var a=e-2*t+r;var o=2*(t-e);var s=e-i;var u=0;if(isAroundZero$1(a)){if(isNotAroundZero$1(o)){var l=-s/o;if(l>=0&&l<=1){n[u++]=l}}}else{var f=o*o-4*a*s;if(isAroundZero$1(f)){var l=-o/(2*a);if(l>=0&&l<=1){n[u++]=l}}else if(f>0){var c=mathSqrt$3(f);var l=(-o+c)/(2*a);var h=(-o-c)/(2*