win-chart 2.7.1 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ import e,{useRef as t,useDebugValue as n,createElement as r,useContext as i,useState as o,useEffect as a}from"react";function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,u={exports:{}},c={};var h,d={};
2
+ /**
3
+ * @license React
4
+ * react-jsx-runtime.development.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */"production"===process.env.NODE_ENV?u.exports=function(){if(l)return c;l=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,l={},u=null,c=null;for(s in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,s)&&!a.hasOwnProperty(s)&&(l[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===l[s]&&(l[s]=t[s]);return{$$typeof:n,type:e,key:u,ref:c,props:l,_owner:o.current}}return c.Fragment=r,c.jsx=s,c.jsxs=s,c}():u.exports=(h||(h=1,"production"!==process.env.NODE_ENV&&function(){var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator",y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=y.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var i=n.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,n)}var x,b=!1,w=!1,S=!1,T=!1,M=!1;function A(e){return e.displayName||"Context"}function C(e){if(null==e)return null;if("number"==typeof e.tag&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case i:return"Fragment";case r:return"Portal";case a:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return A(e)+".Consumer";case s:return A(e._context)+".Provider";case u:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:C(e.type)||"Memo";case f:var n=e,d=n._payload,g=n._init;try{return C(g(d))}catch(e){return null}}return null}x=Symbol.for("react.module.reference");var D,E,I,L,N,P,O,R=Object.assign,k=0;function z(){}z.__reactDisabledLog=!0;var B,V=y.ReactCurrentDispatcher;function F(e,t,n){if(void 0===B)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);B=r&&r[1]||""}return"\n"+B+e}var G,H=!1,U="function"==typeof WeakMap?WeakMap:Map;function W(e,t){if(!e||H)return"";var n,r=G.get(e);if(void 0!==r)return r;H=!0;var i,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=V.current,V.current=null,function(){if(0===k){D=console.log,E=console.info,I=console.warn,L=console.error,N=console.group,P=console.groupCollapsed,O=console.groupEnd;var e={configurable:!0,enumerable:!0,value:z,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}k++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),l=n.stack.split("\n"),u=s.length-1,c=l.length-1;u>=1&&c>=0&&s[u]!==l[c];)c--;for(;u>=1&&c>=0;u--,c--)if(s[u]!==l[c]){if(1!==u||1!==c)do{if(u--,--c<0||s[u]!==l[c]){var h="\n"+s[u].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),"function"==typeof e&&G.set(e,h),h}}while(u>=1&&c>=0);break}}}finally{H=!1,V.current=i,function(){if(0==--k){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},e,{value:D}),info:R({},e,{value:E}),warn:R({},e,{value:I}),error:R({},e,{value:L}),group:R({},e,{value:N}),groupCollapsed:R({},e,{value:P}),groupEnd:R({},e,{value:O})})}k<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=o}var d=e?e.displayName||e.name:"",p=d?F(d):"";return"function"==typeof e&&G.set(e,p),p}function X(e,t,n){if(null==e)return"";if("function"==typeof e)return W(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return F(e);switch(e){case c:return F("Suspense");case h:return F("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return W(e.render,!1);case p:return X(e.type,t,n);case f:var i=e,o=i._payload,a=i._init;try{return X(a(o),t,n)}catch(e){}}return""}G=new U;var j=Object.prototype.hasOwnProperty,Y={},Z=y.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,n=X(e.type,e._source,t?t.type:null);Z.setExtraStackFrame(n)}else Z.setExtraStackFrame(null)}var K=Array.isArray;function $(e){return K(e)}function J(e){return""+e}function Q(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var ee,te,ne,re=y.ReactCurrentOwner,ie={key:!0,ref:!0,__self:!0,__source:!0};ne={};var oe=function(e,t,r,i,o,a,s){var l={$$typeof:n,type:e,key:t,ref:r,props:s,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function ae(e,t,n,r,i){var o,a={},s=null,l=null;for(o in void 0!==n&&(Q(n),s=""+n),function(e){if(j.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),s=""+t.key),function(e){if(j.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(l=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var n=C(re.current.type);ne[n]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(re.current.type),e.ref),ne[n]=!0)}}(t,i)),t)j.call(t,o)&&!ie.hasOwnProperty(o)&&(a[o]=t[o]);if(e&&e.defaultProps){var u=e.defaultProps;for(o in u)void 0===a[o]&&(a[o]=u[o])}if(s||l){var c="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){ee||(ee=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,c),l&&function(e,t){var n=function(){te||(te=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,c)}return oe(e,s,l,i,r,re.current,a)}var se,le=y.ReactCurrentOwner,ue=y.ReactDebugCurrentFrame;function ce(e){if(e){var t=e._owner,n=X(e.type,e._source,t?t.type:null);ue.setExtraStackFrame(n)}else ue.setExtraStackFrame(null)}function he(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function de(){if(le.current){var e=C(le.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}se=!1;var pe={};function fe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=de();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!pe[n]){pe[n]=!0;var r="";e&&e._owner&&e._owner!==le.current&&(r=" It was passed a child from "+C(e._owner.type)+"."),ce(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ce(null)}}}function ge(e,t){if("object"==typeof e)if($(e))for(var n=0;n<e.length;n++){var r=e[n];he(r)&&fe(r,t)}else if(he(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e[v];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,a=i.call(e);!(o=a.next()).done;)he(o.value)&&fe(o.value,t)}}function me(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==u&&n.$$typeof!==p)return;t=n.propTypes}if(t){var r=C(n);!function(e,t,n,r,i){var o=Function.call.bind(j);for(var a in e)if(o(e,a)){var s=void 0;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(q(i),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,typeof s),q(null)),s instanceof Error&&!(s.message in Y)&&(Y[s.message]=!0,q(i),_("Failed %s type: %s",n,s.message),q(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||se||(se=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ve={};function ye(e,t,r,d,m,v){var y=function(e){return"string"==typeof e||"function"==typeof e||!!(e===i||e===a||M||e===o||e===c||e===h||T||e===g||b||w||S)||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===x||void 0!==e.getModuleId)}(e);if(!y){var A,D="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(D+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),D+=de(),null===e?A="null":$(e)?A="array":void 0!==e&&e.$$typeof===n?(A="<"+(C(e.type)||"Unknown")+" />",D=" Did you accidentally export a JSX literal instead of a component?"):A=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,D)}var E=ae(e,t,r,m,v);if(null==E)return E;if(y){var I=t.children;if(void 0!==I)if(d)if($(I)){for(var L=0;L<I.length;L++)ge(I[L],e);Object.freeze&&Object.freeze(I)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ge(I,e)}if(j.call(t,"key")){var N=C(e),P=Object.keys(t).filter((function(e){return"key"!==e})),O=P.length>0?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}";ve[N+O]||(_('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',O,N,P.length>0?"{"+P.join(": ..., ")+": ...}":"{}",N),ve[N+O]=!0)}return e===i?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ce(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ce(null);break}}null!==e.ref&&(ce(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),ce(null))}(E):me(E),E}var _e=function(e,t,n){return ye(e,t,n,!1)},xe=function(e,t,n){return ye(e,t,n,!0)};d.Fragment=i,d.jsx=_e,d.jsxs=xe}()),d);var p=u.exports,f=function(e,t){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},f(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},m.apply(this,arguments)};function v(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function y(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var _=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,x=y((function(e){return _.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),b="-ms-",w="-moz-",S="-webkit-",T="comm",M="rule",A="decl",C="@import",D="@keyframes",E="@layer",I=Math.abs,L=String.fromCharCode,N=Object.assign;function P(e){return e.trim()}function O(e,t){return(e=t.exec(e))?e[0]:e}function R(e,t,n){return e.replace(t,n)}function k(e,t,n){return e.indexOf(t,n)}function z(e,t){return 0|e.charCodeAt(t)}function B(e,t,n){return e.slice(t,n)}function V(e){return e.length}function F(e){return e.length}function G(e,t){return t.push(e),e}function H(e,t){return e.filter((function(e){return!O(e,t)}))}var U=1,W=1,X=0,j=0,Y=0,Z="";function q(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:U,column:W,length:a,return:"",siblings:s}}function K(e,t){return N(q("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function $(e){for(;e.root;)e=K(e.root,{children:[e]});G(e,e.siblings)}function J(){return Y=j>0?z(Z,--j):0,W--,10===Y&&(W=1,U--),Y}function Q(){return Y=j<X?z(Z,j++):0,W++,10===Y&&(W=1,U++),Y}function ee(){return z(Z,j)}function te(){return j}function ne(e,t){return B(Z,e,t)}function re(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ie(e){return P(ne(j-1,se(91===e?e+2:40===e?e+1:e)))}function oe(e){for(;(Y=ee())&&Y<33;)Q();return re(e)>2||re(Y)>3?"":" "}function ae(e,t){for(;--t&&Q()&&!(Y<48||Y>102||Y>57&&Y<65||Y>70&&Y<97););return ne(e,te()+(t<6&&32==ee()&&32==Q()))}function se(e){for(;Q();)switch(Y){case e:return j;case 34:case 39:34!==e&&39!==e&&se(Y);break;case 40:41===e&&se(e);break;case 92:Q()}return j}function le(e,t){for(;Q()&&e+Y!==57&&(e+Y!==84||47!==ee()););return"/*"+ne(t,j-1)+"*"+L(47===e?e:Q())}function ue(e){for(;!re(ee());)Q();return ne(e,j)}function ce(e){return function(e){return Z="",e}(he("",null,null,null,[""],e=function(e){return U=W=1,X=V(Z=e),j=0,[]}(e),0,[0],e))}function he(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,h=a,d=0,p=0,f=0,g=1,m=1,v=1,y=0,_="",x=i,b=o,w=r,S=_;m;)switch(f=y,y=Q()){case 40:if(108!=f&&58==z(S,h-1)){-1!=k(S+=R(ie(y),"&","&\f"),"&\f",I(u?s[u-1]:0))&&(v=-1);break}case 34:case 39:case 91:S+=ie(y);break;case 9:case 10:case 13:case 32:S+=oe(f);break;case 92:S+=ae(te()-1,7);continue;case 47:switch(ee()){case 42:case 47:G(pe(le(Q(),te()),t,n,l),l);break;default:S+="/"}break;case 123*g:s[u++]=V(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+c:-1==v&&(S=R(S,/\f/g,"")),p>0&&V(S)-h&&G(p>32?fe(S+";",r,n,h-1,l):fe(R(S," ","")+";",r,n,h-2,l),l);break;case 59:S+=";";default:if(G(w=de(S,t,n,u,c,i,s,_,x=[],b=[],h,o),o),123===y)if(0===c)he(S,t,w,w,x,o,h,s,b);else switch(99===d&&110===z(S,3)?100:d){case 100:case 108:case 109:case 115:he(e,w,w,r&&G(de(e,w,w,0,0,i,s,_,i,x=[],h,b),b),i,b,h,s,r?x:b);break;default:he(S,w,w,w,[""],b,0,s,b)}}u=c=p=0,g=v=1,_=S="",h=a;break;case 58:h=1+V(S),p=f;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==J())continue;switch(S+=L(y),y*g){case 38:v=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(V(S)-1)*v,v=1;break;case 64:45===ee()&&(S+=ie(Q())),d=ee(),c=h=V(_=S+=ue(te())),y++;break;case 45:45===f&&2==V(S)&&(g=0)}}return o}function de(e,t,n,r,i,o,a,s,l,u,c,h){for(var d=i-1,p=0===i?o:[""],f=F(p),g=0,m=0,v=0;g<r;++g)for(var y=0,_=B(e,d+1,d=I(m=a[g])),x=e;y<f;++y)(x=P(m>0?p[y]+" "+_:R(_,/&\f/g,p[y])))&&(l[v++]=x);return q(e,t,n,0===i?M:s,l,u,c,h)}function pe(e,t,n,r){return q(e,t,n,T,L(Y),B(e,2,-2),0,r)}function fe(e,t,n,r,i){return q(e,t,n,A,B(e,0,r),B(e,r+1,-1),r,i)}function ge(e,t,n){switch(function(e,t){return 45^z(e,0)?(((t<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3):0}(e,t)){case 5103:return S+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return S+e+e;case 4789:return w+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return S+e+w+e+b+e+e;case 5936:switch(z(e,t+11)){case 114:return S+e+b+R(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return S+e+b+R(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return S+e+b+R(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return S+e+b+e+e;case 6165:return S+e+b+"flex-"+e+e;case 5187:return S+e+R(e,/(\w+).+(:[^]+)/,S+"box-$1$2"+b+"flex-$1$2")+e;case 5443:return S+e+b+"flex-item-"+R(e,/flex-|-self/g,"")+(O(e,/flex-|baseline/)?"":b+"grid-row-"+R(e,/flex-|-self/g,""))+e;case 4675:return S+e+b+"flex-line-pack"+R(e,/align-content|flex-|-self/g,"")+e;case 5548:return S+e+b+R(e,"shrink","negative")+e;case 5292:return S+e+b+R(e,"basis","preferred-size")+e;case 6060:return S+"box-"+R(e,"-grow","")+S+e+b+R(e,"grow","positive")+e;case 4554:return S+R(e,/([^-])(transform)/g,"$1"+S+"$2")+e;case 6187:return R(R(R(e,/(zoom-|grab)/,S+"$1"),/(image-set)/,S+"$1"),e,"")+e;case 5495:case 3959:return R(e,/(image-set\([^]*)/,S+"$1$`$1");case 4968:return R(R(e,/(.+:)(flex-)?(.*)/,S+"box-pack:$3"+b+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+S+e+e;case 4200:if(!O(e,/flex-|baseline/))return b+"grid-column-align"+B(e,t)+e;break;case 2592:case 3360:return b+R(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,O(e.props,/grid-\w+-end/)}))?~k(e+(n=n[t].value),"span",0)?e:b+R(e,"-start","")+e+b+"grid-row-span:"+(~k(n,"span",0)?O(n,/\d+/):+O(n,/\d+/)-+O(e,/\d+/))+";":b+R(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return O(e.props,/grid-\w+-start/)}))?e:b+R(R(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return R(e,/(.+)-inline(.+)/,S+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(V(e)-1-t>6)switch(z(e,t+1)){case 109:if(45!==z(e,t+4))break;case 102:return R(e,/(.+:)(.+)-([^]+)/,"$1"+S+"$2-$3$1"+w+(108==z(e,t+3)?"$3":"$2-$3"))+e;case 115:return~k(e,"stretch",0)?ge(R(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return R(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,o,a,s){return b+n+":"+r+s+(i?b+n+"-span:"+(o?a:+a-+r)+s:"")+e}));case 4949:if(121===z(e,t+6))return R(e,":",":"+S)+e;break;case 6444:switch(z(e,45===z(e,14)?18:11)){case 120:return R(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+S+(45===z(e,14)?"inline-":"")+"box$3$1"+S+"$2$3$1"+b+"$2box$3")+e;case 100:return R(e,":",":"+b)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return R(e,"scroll-","scroll-snap-")+e}return e}function me(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ve(e,t,n,r){switch(e.type){case E:if(e.children.length)break;case C:case A:return e.return=e.return||e.value;case T:return"";case D:return e.return=e.value+"{"+me(e.children,r)+"}";case M:if(!V(e.value=e.props.join(",")))return""}return V(n=me(e.children,r))?e.return=e.value+"{"+n+"}":""}function ye(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case A:return void(e.return=ge(e.value,e.length,n));case D:return me([K(e,{value:R(e.value,"@","@"+S)})],r);case M:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(O(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":$(K(e,{props:[R(t,/:(read-\w+)/,":"+w+"$1")]})),$(K(e,{props:[t]})),N(e,{props:H(n,r)});break;case"::placeholder":$(K(e,{props:[R(t,/:(plac\w+)/,":"+S+"input-$1")]})),$(K(e,{props:[R(t,/:(plac\w+)/,":"+w+"$1")]})),$(K(e,{props:[R(t,/:(plac\w+)/,b+"input-$1")]})),$(K(e,{props:[t]})),N(e,{props:H(n,r)})}return""}))}}var _e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},xe="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",be="active",we="data-styled-version",Se="6.1.11",Te="/*!sc*/\n",Me="undefined"!=typeof window&&"HTMLElement"in window,Ae=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),Ce=/invalid hook call/i,De=new Set,Ee=function(e,n){if("production"!==process.env.NODE_ENV){var r=n?' with the id of "'.concat(n,'"'):"",i="The component ".concat(e).concat(r," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ce.test(e)?(a=!1,De.delete(i)):o.apply(void 0,v([e],t,!1))},t(),a&&!De.has(i)&&(console.warn(i),De.add(i))}catch(e){Ce.test(e.message)&&De.delete(i)}finally{console.error=o}}},Ie=Object.freeze([]),Le=Object.freeze({});var Ne=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Pe=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Oe=/(^-|-$)/g;function Re(e){return e.replace(Pe,"-").replace(Oe,"")}var ke=/(a)(d)/gi,ze=52,Be=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ve(e){var t,n="";for(t=Math.abs(e);t>ze;t=t/ze|0)n=Be(t%ze)+n;return(Be(t%ze)+n).replace(ke,"$1-$2")}var Fe,Ge=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},He=function(e){return Ge(5381,e)};function Ue(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function We(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Xe="function"==typeof Symbol&&Symbol.for,je=Xe?Symbol.for("react.memo"):60115,Ye=Xe?Symbol.for("react.forward_ref"):60112,Ze={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},qe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ke={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},$e=((Fe={})[Ye]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Fe[je]=Ke,Fe);function Je(e){return("type"in(t=e)&&t.type.$$typeof)===je?Ke:"$$typeof"in e?$e[e.$$typeof]:Ze;var t}var Qe=Object.defineProperty,et=Object.getOwnPropertyNames,tt=Object.getOwnPropertySymbols,nt=Object.getOwnPropertyDescriptor,rt=Object.getPrototypeOf,it=Object.prototype;function ot(e,t,n){if("string"!=typeof t){if(it){var r=rt(t);r&&r!==it&&ot(e,r,n)}var i=et(t);tt&&(i=i.concat(tt(t)));for(var o=Je(e),a=Je(t),s=0;s<i.length;++s){var l=i[s];if(!(l in qe||n&&n[l]||a&&l in a||o&&l in o)){var u=nt(t,l);try{Qe(e,l,u)}catch(e){}}}}return e}function at(e){return"function"==typeof e}function st(e){return"object"==typeof e&&"styledComponentId"in e}function lt(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function ut(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function ct(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ht(e,t,n){if(void 0===n&&(n=!1),!n&&!ct(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=ht(e[r],t[r]);else if(ct(t))for(var r in t)e[r]=ht(e[r],t[r]);return e}function dt(e,t){Object.defineProperty(e,"toString",{value:t})}var pt="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],i=1,o=e.length;i<o;i+=1)r.push(e[i]);return r.forEach((function(e){n=n.replace(/%[a-z]/,e)})),n}function gt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(ft.apply(void 0,v([pt[e]],t,!1)).trim())}var mt=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw gt(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),s=(o=0,t.length);o<s;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o<i;o++)t+="".concat(this.tag.getRule(o)).concat(Te);return t},e}(),vt=1<<30,yt=new Map,_t=new Map,xt=1,bt=function(e){if(yt.has(e))return yt.get(e);for(;_t.has(xt);)xt++;var t=xt++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>vt))throw gt(16,"".concat(t));return yt.set(e,t),_t.set(t,e),t},wt=function(e,t){xt=t+1,yt.set(e,t),_t.set(t,e)},St="style[".concat(xe,"][").concat(we,'="').concat(Se,'"]'),Tt=new RegExp("^".concat(xe,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Mt=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},At=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(Te),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var l=s.match(Tt);if(l){var u=0|parseInt(l[1],10),c=l[2];0!==u&&(wt(c,u),Mt(e,c,l[3]),e.getTag().insertRules(u,i)),i.length=0}else i.push(s)}}};var Ct=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(xe,"]")));return t[t.length-1]}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(xe,be),r.setAttribute(we,Se);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Dt=function(){function e(e){this.element=Ct(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw gt(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Et=function(){function e(e){this.element=Ct(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),It=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Lt=Me,Nt={isServer:!Me,useCSSOMInjection:!Ae},Pt=function(){function e(e,t,n){void 0===e&&(e=Le),void 0===t&&(t={});var r=this;this.options=m(m({},Nt),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Me&&Lt&&(Lt=!1,function(e){for(var t=document.querySelectorAll(St),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(xe)!==be&&(At(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),dt(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return _t.get(e)}(n);if(void 0===i)return"continue";var o=e.names.get(i),a=t.getGroup(n);if(void 0===o||0===a.length)return"continue";var s="".concat(xe,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==o&&o.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(Te)},o=0;o<n;o++)i(o);return r}(r)}))}return e.registerId=function(e){return bt(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(m(m({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new It(n):t?new Dt(n):new Et(n)}(this.options),new mt(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(bt(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(bt(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(bt(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Ot=/&/g,Rt=/^\s*\/\/.*$/gm;function kt(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=kt(e.children,t)),e}))}var zt=new Pt,Bt=function(e){var t,n,r,i=Le,o=i.options,a=void 0===o?Le:o,s=i.plugins,l=void 0===s?Ie:s,u=function(e,r,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},c=l.slice();c.push((function(e){e.type===M&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Ot,n).replace(r,u))})),a.prefix&&c.push(ye),c.push(ve);var h=function(e,i,o,s){void 0===i&&(i=""),void 0===o&&(o=""),void 0===s&&(s="&"),t=s,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(Rt,""),u=ce(o||i?"".concat(o," ").concat(i," { ").concat(l," }"):l);a.namespace&&(u=kt(u,a.namespace));var h,d=[];return me(u,function(e){var t=F(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}(c.concat((h=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&h(e)})))),d};return h.hash=l.length?l.reduce((function(e,t){return t.name||gt(15),Ge(e,t.name)}),5381).toString():"",h}(),Vt=e.createContext({shouldForwardProp:void 0,styleSheet:zt,stylis:Bt});function Ft(){return i(Vt)}Vt.Consumer,e.createContext(void 0);var Gt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Bt);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,dt(this,(function(){throw gt(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Bt),this.name+e.hash},e}(),Ht=function(e){return e>="A"&&e<="Z"};function Ut(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Ht(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Wt=function(e){return null==e||!1===e||""===e},Xt=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!Wt(o)&&(Array.isArray(o)&&o.isCss||at(o)?r.push("".concat(Ut(i),":"),o,";"):ct(o)?r.push.apply(r,v(v(["".concat(i," {")],Xt(o),!1),["}"],!1)):r.push("".concat(Ut(i),": ").concat((t=i,null==(n=o)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in _e||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function jt(e,t,n,r){if(Wt(e))return[];if(st(e))return[".".concat(e.styledComponentId)];if(at(e)){if(!at(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||i instanceof Gt||ct(i)||null===i||console.error("".concat(Ue(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),jt(i,t,n,r)}var o;return e instanceof Gt?n?(e.inject(n,r),[e.getName(r)]):[e]:ct(e)?Xt(e):Array.isArray(e)?Array.prototype.concat.apply(Ie,e.map((function(e){return jt(e,t,n,r)}))):[e.toString()]}var Yt=He(Se),Zt=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(at(n)&&!st(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Ge(Yt,t),this.baseStyle=n,Pt.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=lt(r,this.staticRulesId);else{var i=ut(jt(this.rules,e,t,n)),o=Ve(Ge(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}r=lt(r,o),this.staticRulesId=o}else{for(var s=Ge(this.baseHash,n.hash),l="",u=0;u<this.rules.length;u++){var c=this.rules[u];if("string"==typeof c)l+=c,"production"!==process.env.NODE_ENV&&(s=Ge(s,c));else if(c){var h=ut(jt(c,e,t,n));s=Ge(s,h+u),l+=h}}if(l){var d=Ve(s>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=lt(r,d)}}return r},e}(),qt=e.createContext(void 0);qt.Consumer;var Kt={},$t=new Set;function Jt(t,i,o){var a=st(t),s=t,l=!We(t),u=i.attrs,c=void 0===u?Ie:u,h=i.componentId,d=void 0===h?function(e,t){var n="string"!=typeof e?"sc":Re(e);Kt[n]=(Kt[n]||0)+1;var r="".concat(n,"-").concat(function(e){return Ve(He(e)>>>0)}(Se+n+Kt[n]));return t?"".concat(t,"-").concat(r):r}(i.displayName,i.parentComponentId):h,p=i.displayName,f=void 0===p?function(e){return We(e)?"styled.".concat(e):"Styled(".concat(Ue(e),")")}(t):p,g=i.displayName&&i.componentId?"".concat(Re(i.displayName),"-").concat(i.componentId):i.componentId||d,v=a&&s.attrs?s.attrs.concat(c).filter(Boolean):c,y=i.shouldForwardProp;if(a&&s.shouldForwardProp){var _=s.shouldForwardProp;if(i.shouldForwardProp){var b=i.shouldForwardProp;y=function(e,t){return _(e,t)&&b(e,t)}}else y=_}var w=new Zt(o,g,a?s.componentStyle:void 0);function S(t,i){return function(t,i,o){var a=t.attrs,s=t.componentStyle,l=t.defaultProps,u=t.foldedComponentIds,c=t.styledComponentId,h=t.target,d=e.useContext(qt),p=Ft(),f=t.shouldForwardProp||p.shouldForwardProp;"production"!==process.env.NODE_ENV&&n(c);var g=function(e,t,n){return void 0===n&&(n=Le),e.theme!==n.theme&&e.theme||t||n.theme}(i,d,l)||Le,v=function(e,t,n){for(var r,i=m(m({},t),{className:void 0,theme:n}),o=0;o<e.length;o+=1){var a=at(r=e[o])?r(i):r;for(var s in a)i[s]="className"===s?lt(i[s],a[s]):"style"===s?m(m({},i[s]),a[s]):a[s]}return t.className&&(i.className=lt(i.className,t.className)),i}(a,i,g),y=v.as||h,_={};for(var b in v)void 0===v[b]||"$"===b[0]||"as"===b||"theme"===b&&v.theme===g||("forwardedAs"===b?_.as=v.forwardedAs:f&&!f(b,y)||(_[b]=v[b],f||"development"!==process.env.NODE_ENV||x(b)||$t.has(b)||!Ne.has(y)||($t.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w=function(e,t){var r=Ft(),i=e.generateAndInjectStyles(t,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&n(i),i}(s,v);"production"!==process.env.NODE_ENV&&t.warnTooManyClasses&&t.warnTooManyClasses(w);var S=lt(u,c);return w&&(S+=" "+w),v.className&&(S+=" "+v.className),_[We(y)&&!Ne.has(y)?"class":"className"]=S,_.ref=o,r(y,_)}(T,t,i)}S.displayName=f;var T=e.forwardRef(S);return T.attrs=v,T.componentStyle=w,T.displayName=f,T.shouldForwardProp=y,T.foldedComponentIds=a?lt(s.foldedComponentIds,s.styledComponentId):"",T.styledComponentId=g,T.target=a?s.target:t,Object.defineProperty(T,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=a?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)ht(e,i[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(Ee(f,g),T.warnTooManyClasses=function(e,t){var n={},r=!1;return function(i){if(!r&&(n[i]=!0,Object.keys(n).length>=200)){var o=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(o,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,g)),dt(T,(function(){return".".concat(T.styledComponentId)})),l&&ot(T,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),T}function Qt(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var en=function(e){return Object.assign(e,{isCss:!0})};function tn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(at(e)||ct(e))return en(jt(Qt(Ie,v([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?jt(r):en(jt(Qt(r,t)))}function nn(e,t,n){if(void 0===n&&(n=Le),!t)throw gt(1,t);var r=function(r){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return e(t,n,tn.apply(void 0,v([r],i,!1)))};return r.attrs=function(r){return nn(e,t,m(m({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return nn(e,t,m(m({},n),r))},r}var rn=function(e){return nn(Jt,e)},on=rn;Ne.forEach((function(e){on[e]=rn(e)})),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var an="__sc-".concat(xe,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[an]||(window[an]=0),1===window[an]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[an]+=1);const sn=on.div`
11
+ height: 100%;
12
+ `;var ln;!function(e){e[e.MINI_AREA=0]="MINI_AREA",e[e.AREA=1]="AREA",e[e.DUAL_LINE_BAR=2]="DUAL_LINE_BAR",e[e.STACK_DUAL_LINE_BAR=3]="STACK_DUAL_LINE_BAR",e[e.COLUMN=4]="COLUMN",e[e.STACK_COLUMN=5]="STACK_COLUMN",e[e.LINE=6]="LINE",e[e.BAR=7]="BAR",e[e.STACK_BAR=8]="STACK_BAR",e[e.FUNNEL=9]="FUNNEL",e[e.PIE=10]="PIE",e[e.CYCLE=11]="CYCLE",e[e.RADAR=12]="RADAR"}(ln||(ln={}));const un=["#3D84FF","#00DCF0","#FCBC26","#00DB75","#BDB8FF","#40B4FF","#FFA101","#90ABE0","#6EE67A","#6B84FF","#FA6B69"],cn={grid:{top:24,left:0,right:12,bottom:32,containLabel:!0},color:un,legend:{itemWidth:10,itemHeight:10,bottom:0,type:"scroll",icon:"circle"}};function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(null,arguments)}function dn(e,t){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dn(e,t)}function pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pn(e)}function fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fn=function(){return!!e})()}function gn(e){var t="function"==typeof Map?new Map:void 0;return gn=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(fn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&dn(i,n.prototype),i}(e,arguments,pn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),dn(n,e)},gn(e)}var mn={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function vn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],o=[];for(r=1;r<t.length;r+=1)o.push(t[r]);return o.forEach((function(e){i=i.replace(/%[a-z]/,e)})),i}var yn=function(e){function t(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n=e.call(this,vn.apply(void 0,[mn[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,dn(e,t)}(t,e),t}(gn(Error));function _n(e){return Math.round(255*e)}function xn(e,t,n){return _n(e)+","+_n(t)+","+_n(n)}function bn(e,t,n,r){if(void 0===r&&(r=xn),0===t)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,a=o*(1-Math.abs(i%2-1)),s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);var c=n-o/2;return r(s+c,l+c,u+c)}var wn={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Sn=/^#[a-fA-F0-9]{6}$/,Tn=/^#[a-fA-F0-9]{8}$/,Mn=/^#[a-fA-F0-9]{3}$/,An=/^#[a-fA-F0-9]{4}$/,Cn=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,Dn=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,En=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,In=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Ln(e){if("string"!=typeof e)throw new yn(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return wn[t]?"#"+wn[t]:e}(e);if(t.match(Sn))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Tn)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(Mn))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(An)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=Cn.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=Dn.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var a=En.exec(t);if(a){var s="rgb("+bn(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=Cn.exec(s);if(!l)throw new yn(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=In.exec(t.substring(0,50));if(u){var c="rgb("+bn(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",h=Cn.exec(c);if(!h)throw new yn(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new yn(5)}function Nn(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,u=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:s,alpha:e.alpha}:{hue:t,saturation:u,lightness:s}}(Ln(e))}var Pn=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function On(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Rn(e){return On(Math.round(255*e))}function kn(e,t,n){return Pn("#"+Rn(e)+Rn(t)+Rn(n))}function zn(e,t,n){return bn(e,t,n,kn)}function Bn(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Pn("#"+On(e)+On(t)+On(n));if("object"==typeof e&&void 0===t&&void 0===n)return Pn("#"+On(e.red)+On(e.green)+On(e.blue));throw new yn(6)}function Vn(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=Ln(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?Bn(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?Bn(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new yn(7)}var Fn=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},Gn=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},Hn=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},Un=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};function Wn(e){if("object"!=typeof e)throw new yn(8);if(Gn(e))return Vn(e);if(Fn(e))return Bn(e);if(Un(e))return function(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return"rgba("+bn(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?zn(e.hue,e.saturation,e.lightness):"rgba("+bn(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new yn(2)}(e);if(Hn(e))return function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return zn(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return zn(e.hue,e.saturation,e.lightness);throw new yn(1)}(e);throw new yn(8)}function Xn(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):Xn(e,t,r)}}function jn(e){return Xn(e,e.length,[])}function Yn(e,t,n){return Math.max(e,Math.min(t,n))}jn((function(e,t){if("transparent"===t)return t;var n=Nn(t);return Wn(hn({},n,{hue:n.hue+parseFloat(e)}))})),jn((function(e,t){if("transparent"===t)return t;var n=Nn(t);return Wn(hn({},n,{lightness:Yn(0,1,n.lightness-parseFloat(e))}))})),jn((function(e,t){if("transparent"===t)return t;var n=Nn(t);return Wn(hn({},n,{saturation:Yn(0,1,n.saturation-parseFloat(e))}))})),jn((function(e,t){if("transparent"===t)return t;var n=Nn(t);return Wn(hn({},n,{lightness:Yn(0,1,n.lightness+parseFloat(e))}))}));var Zn=jn((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=Ln(t),i=hn({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),o=Ln(n),a=hn({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),s=i.alpha-a.alpha,l=2*parseFloat(e)-1,u=((l*s==-1?l:l+s)/(1+l*s)+1)/2,c=1-u;return Vn({red:Math.floor(i.red*u+a.red*c),green:Math.floor(i.green*u+a.green*c),blue:Math.floor(i.blue*u+a.blue*c),alpha:i.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})})),qn=Zn;function Kn(e){return Array.isArray(e)&&e.length>0}jn((function(e,t){if("transparent"===t)return t;var n=Ln(t);return Vn(hn({},n,{alpha:Yn(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))})),jn((function(e,t){if("transparent"===t)return t;var n=Nn(t);return Wn(hn({},n,{saturation:Yn(0,1,n.saturation+parseFloat(e))}))})),jn((function(e,t){return"transparent"===t?t:Wn(hn({},Nn(t),{hue:parseFloat(e)}))})),jn((function(e,t){return"transparent"===t?t:Wn(hn({},Nn(t),{lightness:parseFloat(e)}))})),jn((function(e,t){return"transparent"===t?t:Wn(hn({},Nn(t),{saturation:parseFloat(e)}))})),jn((function(e,t){return"transparent"===t?t:qn(parseFloat(e),"rgb(0, 0, 0)",t)})),jn((function(e,t){return"transparent"===t?t:qn(parseFloat(e),"rgb(255, 255, 255)",t)})),jn((function(e,t){if("transparent"===t)return t;var n=Ln(t);return Vn(hn({},n,{alpha:Yn(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));const $n=(e,t=2)=>"number"==typeof e?`${Number((100*e).toFixed(t))}%`:"-%";function Jn(e){return Array.isArray(e)?[...new Set(e)]:[]}const Qn=e=>Array.isArray(e)&&0!==e.length?e.reduce(((e,t)=>{const n=Number(t);return e+(Object.is(n,NaN)?0:n)}),0):0,er=e=>Array.isArray(e)?e.sort(((e,t)=>t.value-e.value)):e,tr=e=>{var t;return{boundaryGap:!0,axisTick:{alignWithLabel:!0},data:Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.label))),axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}}},nr=(e,t)=>(e.sort(((e,n)=>t.indexOf(e.label)-t.indexOf(n.label))),e);function rr(e,t){let n=null;return function(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(globalThis,r)}),t)}}const ir=e=>"dark"===e.theme?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)";var or=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},ar=new function(){this.browser=new or,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(ar.wxa=!0,ar.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?ar.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(ar.node=!0,ar.svgSupported=!0):function(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),o=e.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(e);r&&(n.firefox=!0,n.version=r[1]);i&&(n.ie=!0,n.version=i[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);t.svgSupported="undefined"!=typeof SVGRect,t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported="undefined"!=typeof document;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,ar);var sr=ar,lr=12,ur="sans-serif",cr=lr+"px "+ur;var hr,dr,pr=function(e){var t={};if("undefined"==typeof JSON)return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32),i=(e.charCodeAt(n)-20)/100;t[r]=i}return t}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),fr={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!hr){var n=fr.createCanvas();hr=n&&n.getContext("2d")}if(hr)return dr!==t&&(dr=hr.font=t||cr),hr.measureText(e);e=e||"";var r=/(\d+)px/.exec(t=t||cr),i=r&&+r[1]||lr,o=0;if(t.indexOf("mono")>=0)o=i*e.length;else for(var a=0;a<e.length;a++){var s=pr[e[a]];o+=null==s?i:s*i}return{width:o}},loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r}};function gr(e){for(var t in fr)e[t]&&(fr[t]=e[t])}var mr=Hr(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(e,t){return e["[object "+t+"]"]=!0,e}),{}),vr=Hr(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(e,t){return e["[object "+t+"Array]"]=!0,e}),{}),yr=Object.prototype.toString,_r=Array.prototype,xr=_r.forEach,br=_r.filter,wr=_r.slice,Sr=_r.map,Tr=function(){}.constructor,Mr=Tr?Tr.prototype:null,Ar="__proto__",Cr=2311;function Dr(){return Cr++}function Er(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"undefined"!=typeof console&&console.error.apply(console,e)}function Ir(e){if(null==e||"object"!=typeof e)return e;var t=e,n=yr.call(e);if("[object Array]"===n){if(!mi(e)){t=[];for(var r=0,i=e.length;r<i;r++)t[r]=Ir(e[r])}}else if(vr[n]){if(!mi(e)){var o=e.constructor;if(o.from)t=o.from(e);else{t=new o(e.length);for(r=0,i=e.length;r<i;r++)t[r]=e[r]}}}else if(!mr[n]&&!mi(e)&&!ni(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==Ar&&(t[a]=Ir(e[a]));return t}function Lr(e,t,n){if(!Qr(t)||!Qr(e))return n?Ir(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==Ar){var i=e[r],o=t[r];!Qr(o)||!Qr(i)||Zr(o)||Zr(i)||ni(o)||ni(i)||ei(o)||ei(i)||mi(o)||mi(i)?!n&&r in e||(e[r]=Ir(t[r])):Lr(i,o,n)}return e}function Nr(e,t){for(var n=e[0],r=1,i=e.length;r<i;r++)n=Lr(n,e[r],t);return n}function Pr(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==Ar&&(e[n]=t[n]);return e}function Or(e,t,n){for(var r=Xr(t),i=0;i<r.length;i++){var o=r[i];(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}return e}var Rr=fr.createCanvas;function kr(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function zr(e,t){var n=e.prototype;function r(){}for(var i in r.prototype=t.prototype,e.prototype=new r,n)n.hasOwnProperty(i)&&(e.prototype[i]=n[i]);e.prototype.constructor=e,e.superClass=t}function Br(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++){var o=r[i];"constructor"!==o&&(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}else Or(e,t,n)}function Vr(e){return!!e&&("string"!=typeof e&&"number"==typeof e.length)}function Fr(e,t,n){if(e&&t)if(e.forEach&&e.forEach===xr)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function Gr(e,t,n){if(!e)return[];if(!t)return ci(e);if(e.map&&e.map===Sr)return e.map(t,n);for(var r=[],i=0,o=e.length;i<o;i++)r.push(t.call(n,e[i],i,e));return r}function Hr(e,t,n,r){if(e&&t){for(var i=0,o=e.length;i<o;i++)n=t.call(r,n,e[i],i,e);return n}}function Ur(e,t,n){if(!e)return[];if(!t)return ci(e);if(e.filter&&e.filter===br)return e.filter(t,n);for(var r=[],i=0,o=e.length;i<o;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}function Wr(e,t,n){if(e&&t)for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]}function Xr(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}var jr=Mr&&qr(Mr.bind)?Mr.call.bind(Mr.bind):function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return e.apply(t,n.concat(wr.call(arguments)))}};function Yr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(wr.call(arguments)))}}function Zr(e){return Array.isArray?Array.isArray(e):"[object Array]"===yr.call(e)}function qr(e){return"function"==typeof e}function Kr(e){return"string"==typeof e}function $r(e){return"[object String]"===yr.call(e)}function Jr(e){return"number"==typeof e}function Qr(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function ei(e){return!!mr[yr.call(e)]}function ti(e){return!!vr[yr.call(e)]}function ni(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function ri(e){return null!=e.colorStops}function ii(e){return null!=e.image}function oi(e){return"[object RegExp]"===yr.call(e)}function ai(e){return e!=e}function si(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e.length;n<r;n++)if(null!=e[n])return e[n]}function li(e,t){return null!=e?e:t}function ui(e,t,n){return null!=e?e:null!=t?t:n}function ci(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return wr.apply(e,t)}function hi(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e}function di(e,t){if(!e)throw new Error(t)}function pi(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var fi="__ec_primitive__";function gi(e){e[fi]=!0}function mi(e){return e[fi]}var vi=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],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){return this.data[e]=t,this},e.prototype.keys=function(){return Xr(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),yi="function"==typeof Map;var _i=function(){function e(t){var n=Zr(t);this.data=yi?new Map:new vi;var r=this;function i(e,t){n?r.set(e,t):r.set(t,e)}t instanceof e?t.each(i):t&&Fr(t,i)}return 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){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach((function(n,r){e.call(t,n,r)}))},e.prototype.keys=function(){var e=this.data.keys();return yi?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function xi(e){return new _i(e)}function bi(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];var i=e.length;for(r=0;r<t.length;r++)n[r+i]=t[r];return n}function wi(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&Pr(n,t),n}function Si(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function Ti(e,t){return e.hasOwnProperty(t)}function Mi(){}var Ai=180/Math.PI,Ci=Object.freeze({__proto__:null,HashMap:_i,RADIAN_TO_DEGREE:Ai,assert:di,bind:jr,clone:Ir,concatArray:bi,createCanvas:Rr,createHashMap:xi,createObject:wi,curry:Yr,defaults:Or,disableUserSelect:Si,each:Fr,eqNaN:ai,extend:Pr,filter:Ur,find:Wr,guid:Dr,hasOwn:Ti,indexOf:kr,inherits:zr,isArray:Zr,isArrayLike:Vr,isBuiltInObject:ei,isDom:ni,isFunction:qr,isGradientObject:ri,isImagePatternObject:ii,isNumber:Jr,isObject:Qr,isPrimitive:mi,isRegExp:oi,isString:Kr,isStringSafe:$r,isTypedArray:ti,keys:Xr,logError:Er,map:Gr,merge:Lr,mergeAll:Nr,mixin:Br,noop:Mi,normalizeCssArray:hi,reduce:Hr,retrieve:si,retrieve2:li,retrieve3:ui,setAsPrimitive:gi,slice:ci,trim:pi});function Di(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function Ei(e,t){return e[0]=t[0],e[1]=t[1],e}function Ii(e){return[e[0],e[1]]}function Li(e,t,n){return e[0]=t,e[1]=n,e}function Ni(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Pi(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function Oi(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Ri(e){return Math.sqrt(zi(e))}var ki=Ri;function zi(e){return e[0]*e[0]+e[1]*e[1]}var Bi=zi;function Vi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function Fi(e,t){var n=Ri(t);return 0===n?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function Gi(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var Hi=Gi;function Ui(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Wi=Ui;function Xi(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e}function ji(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function Yi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function Zi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var qi=Object.freeze({__proto__:null,add:Ni,applyTransform:ji,clone:Ii,copy:Ei,create:Di,dist:Hi,distSquare:Wi,distance:Gi,distanceSquare:Ui,div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},len:Ri,lenSquare:zi,length:ki,lengthSquare:Bi,lerp:Xi,max:Zi,min:Yi,mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},normalize:Fi,scale:Vi,scaleAndAdd:Pi,set:Li,sub:Oi}),Ki=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},$i=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)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Ki(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,o=r-this._y;this._x=n,this._y=r,t.drift(i,o,e),this.handler.dispatchToElement(new Ki(t,e),"drag",e.event);var a=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=a,t!==a&&(s&&a!==s&&this.handler.dispatchToElement(new Ki(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new Ki(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new Ki(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Ki(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),Ji=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if("function"==typeof t&&(r=n,n=t,t=null),!n||!e)return this;var o=this._$eventProcessor;null!=t&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),i[e]||(i[e]=[]);for(var a=0;a<i[e].length;a++)if(i[e][a].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},l=i[e].length-1,u=i[e][l];return u&&u.callAtLast?i[e].splice(l,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=r.length,s=0;s<a;s++){var l=r[s];if(!i||!i.filter||null==l.query||i.filter(e,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,t[0]);break;case 2:l.h.call(l.ctx,t[0],t[1]);break;default:l.h.apply(l.ctx,t)}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var o=t.length,a=t[o-1],s=r.length,l=0;l<s;l++){var u=r[l];if(!i||!i.filter||null==u.query||i.filter(e,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,t[0]);break;case 2:u.h.call(a,t[0],t[1]);break;default:u.h.apply(a,t.slice(1,o-1))}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e}(),Qi=Math.log(2);function eo(e,t,n,r,i,o){var a=r+"-"+i,s=e.length;if(o.hasOwnProperty(a))return o[a];if(1===t){var l=Math.round(Math.log((1<<s)-1&~i)/Qi);return e[n][l]}for(var u=r|1<<n,c=n+1;r&1<<c;)c++;for(var h=0,d=0,p=0;d<s;d++){var f=1<<d;f&i||(h+=(p%2?-1:1)*e[n][d]*eo(e,t-1,c,u,i|f,o),p++)}return o[a]=h,h}function to(e,t){var n=[[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]]],r={},i=eo(n,8,0,0,0,r);if(0!==i){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*eo(n,7,0===a?1:0,1<<a,1<<s,r)/i*t[a];return function(e,t,n){var r=t*o[6]+n*o[7]+1;e[0]=(t*o[0]+n*o[1]+o[2])/r,e[1]=(t*o[3]+n*o[4]+o[5])/r}}}var no="___zrEVENTSAVED",ro=[];function io(e,t,n,r,i){if(t.getBoundingClientRect&&sr.domSupported&&!oo(t)){var o=t[no]||(t[no]={}),a=function(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=["left","right"],i=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[s]+":0",i[l]+":0",r[1-s]+":auto",i[1-l]+":auto",""].join("!important;"),e.appendChild(a),n.push(a)}return n}(t,o),s=function(e,t,n){for(var r=n?"invTrans":"trans",i=t[r],o=t.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,d=c.left,p=c.top;a.push(d,p),l=l&&o&&d===o[h]&&p===o[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=a,t[r]=n?to(s,a):to(a,s))}(a,o,i);if(s)return s(e,n,r),!0}return!1}function oo(e){return"CANVAS"===e.nodeName.toUpperCase()}var ao=/([&<>"'])/g,so={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function lo(e){return null==e?"":(e+"").replace(ao,(function(e,t){return so[t]}))}var uo=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,co=[],ho=sr.browser.firefox&&+sr.browser.version.split(".")[0]<39;function po(e,t,n,r){return n=n||{},r?fo(e,t,n):ho&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):fo(e,t,n),n}function fo(e,t,n){if(sr.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(oo(e)){var o=e.getBoundingClientRect();return n.zrX=r-o.left,void(n.zrY=i-o.top)}if(io(co,e,r,i))return n.zrX=co[0],void(n.zrY=co[1])}n.zrX=n.zrY=0}function go(e){return e||window.event}function mo(e,t,n){if(null!=(t=go(t)).zrX)return t;var r=t.type;if(r&&r.indexOf("touch")>=0){var i="touchend"!==r?t.targetTouches[0]:t.changedTouches[0];i&&po(e,i,t,n)}else{po(e,t,t,n);var o=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(null==n||null==r)return t;var i=0!==r?Math.abs(r):Math.abs(n),o=r>0?-1:r<0?1:n>0?-1:1;return 3*i*o}(t);t.zrDelta=o?o/120:-(t.detail||0)/3}var a=t.button;return null==t.which&&void 0!==a&&uo.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function vo(e,t,n,r){e.addEventListener(t,n,r)}var yo=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function _o(e){return 2===e.which||3===e.which}var xo=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},o=0,a=r.length;o<a;o++){var s=r[o],l=po(n,s,{});i.points.push([l.zrX,l.zrY]),i.touches.push(s)}this._track.push(i)}},e.prototype._recognize=function(e){for(var t in wo)if(wo.hasOwnProperty(t)){var n=wo[t](this._track,e);if(n)return n}},e}();function bo(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var wo={pinch:function(e,t){var n=e.length;if(n){var r,i=(e[n-1]||{}).points,o=(e[n-2]||{}).points||i;if(o&&o.length>1&&i&&i.length>1){var a=bo(i)/bo(o);!isFinite(a)&&(a=1),t.pinchScale=a;var s=[((r=i)[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}};function So(){return[1,0,0,1,0,0]}function To(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Mo(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ao(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e}function Co(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function Do(e,t,n,r){void 0===r&&(r=[0,0]);var i=t[0],o=t[2],a=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(n),h=Math.cos(n);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=o*h+l*c,e[3]=-o*c+h*l,e[4]=h*(a-r[0])+c*(u-r[1])+r[0],e[5]=h*(u-r[1])-c*(a-r[0])+r[1],e}function Eo(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function Io(e,t){var n=t[0],r=t[2],i=t[4],o=t[1],a=t[3],s=t[5],l=n*a-o*r;return l?(l=1/l,e[0]=a*l,e[1]=-o*l,e[2]=-r*l,e[3]=n*l,e[4]=(r*s-a*i)*l,e[5]=(o*i-n*s)*l,e):null}function Lo(e){var t=[1,0,0,1,0,0];return Mo(t,e),t}var No=Object.freeze({__proto__:null,clone:Lo,copy:Mo,create:So,identity:To,invert:Io,mul:Ao,rotate:Do,scale:Eo,translate:Co}),Po=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,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){return this.x-=e.x,this.y-=e.y,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();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},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,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),Oo=Math.min,Ro=Math.max,ko=new Po,zo=new Po,Bo=new Po,Vo=new Po,Fo=new Po,Go=new Po,Ho=function(){function e(e,t,n,r){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),this.x=e,this.y=t,this.width=n,this.height=r}return e.prototype.union=function(e){var t=Oo(e.x,this.x),n=Oo(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ro(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ro(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,r=e.height/t.height,i=[1,0,0,1,0,0];return Co(i,i,[-t.x,-t.y]),Eo(i,i,[n,r]),Co(i,i,[e.x,e.y]),i},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var r=this,i=r.x,o=r.x+r.width,a=r.y,s=r.y+r.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,d=!(o<l||u<i||s<c||h<a);if(n){var p=1/0,f=0,g=Math.abs(o-l),m=Math.abs(u-i),v=Math.abs(s-c),y=Math.abs(h-a),_=Math.min(g,m),x=Math.min(v,y);o<l||u<i?_>f&&(f=_,g<m?Po.set(Go,-g,0):Po.set(Go,m,0)):_<p&&(p=_,g<m?Po.set(Fo,g,0):Po.set(Fo,-m,0)),s<c||h<a?x>f&&(f=x,v<y?Po.set(Go,0,-v):Po.set(Go,0,y)):_<p&&(p=_,v<y?Po.set(Fo,0,v):Po.set(Fo,0,-y))}return n&&Po.copy(n,d?Fo:Go),d},e.prototype.contain=function(e,t){var n=this;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.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 0===this.width||0===this.height},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,n,r){if(r){if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],o=r[3],a=r[4],s=r[5];return t.x=n.x*i+a,t.y=n.y*o+s,t.width=n.width*i,t.height=n.height*o,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}ko.x=Bo.x=n.x,ko.y=Vo.y=n.y,zo.x=Vo.x=n.x+n.width,zo.y=Bo.y=n.y+n.height,ko.transform(r),Vo.transform(r),zo.transform(r),Bo.transform(r),t.x=Oo(ko.x,zo.x,Bo.x,Vo.x),t.y=Oo(ko.y,zo.y,Bo.y,Vo.y);var l=Ro(ko.x,zo.x,Bo.x,Vo.x),u=Ro(ko.y,zo.y,Bo.y,Vo.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),Uo=Ho,Wo="silent";function Xo(){yo(this.event)}var jo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return g(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Ji),Yo=function(e,t){this.x=e,this.y=t},Zo=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],qo=new Uo(0,0,0,0),Ko=function(e){function t(t,n,r,i,o){var a=e.call(this)||this;return a._hovered=new Yo(0,0),a.storage=t,a.painter=n,a.painterRoot=i,a._pointerSize=o,r=r||new jo,a.proxy=null,a.setHandlerProxy(r),a._draggingMgr=new $i(a),a}return g(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(Fr(Zo,(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,n=e.zrY,r=Qo(this,t,n),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=r?new Yo(t,n):this.findHover(t,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",e),this.dispatchToElement(a,"mousemove",e),s&&s!==o&&this.dispatchToElement(a,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Yo(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.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,n){var r=(e=e||{}).target;if(!r||!r.silent){for(var i="on"+t,o=function(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Xo}}(t,e,n);r&&(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(t,o),r=r.__hostTarget?r.__hostTarget:r.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(t,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[i]&&e[i].call(e,o),e.trigger&&e.trigger(t,o)})))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new Yo(e,t);if(Jo(r,i,e,t,n),this._pointerSize&&!i.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Uo(e-s,t-s,a,a),u=r.length-1;u>=0;u--){var c=r[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(qo.copy(c.getBoundingRect()),c.transform&&qo.applyTransform(c.transform),qo.intersect(l)&&o.push(c))}if(o.length)for(var h=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=h){if(Jo(o,i,e+p*Math.cos(f),t+p*Math.sin(f),n),i.target)return i}}return i},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new xo);var n=this._gestureMgr;"start"===t&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),r){var i=r.type;e.gestureEvent=i;var o=new Yo;o.target=r.target,this.dispatchToElement(o,i,r.event)}},t}(Ji);function $o(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var r=e,i=void 0,o=!1;r;){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s||r.parent}return!i||Wo}return!1}function Jo(e,t,n,r,i){for(var o=e.length-1;o>=0;o--){var a=e[o],s=void 0;if(a!==i&&!a.ignore&&(s=$o(a,n,r))&&(!t.topTarget&&(t.topTarget=a),s!==Wo)){t.target=a;break}}}function Qo(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}Fr(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Ko.prototype[e]=function(t){var n,r,i=t.zrX,o=t.zrY,a=Qo(this,i,o);if("mouseup"===e&&a||(r=(n=this.findHover(i,o)).target),"mousedown"===e)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===e)this._upEl=r;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Hi(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));var ea=32,ta=7;function na(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;!function(e,t,n){n--;for(;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function ra(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var o,a=e[r],s=t,l=r;s<l;)i(a,e[o=s+l>>>1])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=a}}function ia(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])>0){for(s=r-i;l<s&&o(e,t[n+i+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{for(s=i+1;l<s&&o(e,t[n+i-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])>0?a=c+1:l=c}return l}function oa(e,t,n,r,i,o){var a=0,s=0,l=1;if(o(e,t[n+i])<0){for(s=i+1;l<s&&o(e,t[n+i-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}else{for(s=r-i;l<s&&o(e,t[n+i+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])<0?l=c:a=c+1}return l}function aa(e,t){var n,r,i=ta,o=0,a=[];function s(s){var l=n[s],u=r[s],c=n[s+1],h=r[s+1];r[s]=u+h,s===o-3&&(n[s+1]=n[s+2],r[s+1]=r[s+2]),o--;var d=oa(e[c],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(h=ia(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,r,o,s){var l=0;for(l=0;l<r;l++)a[l]=e[n+l];var u=0,c=o,h=n;if(e[h++]=e[c++],0==--s){for(l=0;l<r;l++)e[h+l]=a[u+l];return}if(1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];return void(e[h+s]=a[u])}var d,p,f,g=i;for(;;){d=0,p=0,f=!1;do{if(t(e[c],a[u])<0){if(e[h++]=e[c++],p++,d=0,0==--s){f=!0;break}}else if(e[h++]=a[u++],d++,p=0,1==--r){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=oa(e[c],a,u,r,0,t))){for(l=0;l<d;l++)e[h+l]=a[u+l];if(h+=d,u+=d,(r-=d)<=1){f=!0;break}}if(e[h++]=e[c++],0==--s){f=!0;break}if(0!==(p=ia(a[u],e,c,s,0,t))){for(l=0;l<p;l++)e[h+l]=e[c+l];if(h+=p,c+=p,0===(s-=p)){f=!0;break}}if(e[h++]=a[u++],1==--r){f=!0;break}g--}while(d>=ta||p>=ta);if(f)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===r){for(l=0;l<s;l++)e[h+l]=e[c+l];e[h+s]=a[u]}else{if(0===r)throw new Error;for(l=0;l<r;l++)e[h+l]=a[u+l]}}(l,u,c,h):function(n,r,o,s){var l=0;for(l=0;l<s;l++)a[l]=e[o+l];var u=n+r-1,c=s-1,h=o+s-1,d=0,p=0;if(e[h--]=e[u--],0==--r){for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l];return}if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];return void(e[h]=a[c])}var f=i;for(;;){var g=0,m=0,v=!1;do{if(t(a[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--r){v=!0;break}}else if(e[h--]=a[c--],m++,g=0,1==--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=r-oa(a[c],e,n,r,r-1,t))){for(r-=g,p=(h-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===r){v=!0;break}}if(e[h--]=a[c--],1==--s){v=!0;break}if(0!==(m=s-ia(e[u],a,0,s,s-1,t))){for(s-=m,p=(h-=m)+1,d=(c-=m)+1,l=0;l<m;l++)e[p+l]=a[d+l];if(s<=1){v=!0;break}}if(e[h--]=e[u--],0==--r){v=!0;break}f--}while(g>=ta||m>=ta);if(v)break;f<0&&(f=0),f+=2}(i=f)<1&&(i=1);if(1===s){for(p=(h-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)e[p+l]=e[d+l];e[h]=a[c]}else{if(0===s)throw new Error;for(d=h-(s-1),l=0;l<s;l++)e[d+l]=a[l]}}(l,u,c,h))}return n=[],r=[],{mergeRuns:function(){for(;o>1;){var e=o-2;if(e>=1&&r[e-1]<=r[e]+r[e+1]||e>=2&&r[e-2]<=r[e]+r[e-1])r[e-1]<r[e+1]&&e--;else if(r[e]>r[e+1])break;s(e)}},forceMergeRuns:function(){for(;o>1;){var e=o-2;e>0&&r[e-1]<r[e+1]&&e--,s(e)}},pushRun:function(e,t){n[o]=e,r[o]=t,o+=1}}}function sa(e,t,n,r){n||(n=0),r||(r=e.length);var i=r-n;if(!(i<2)){var o=0;if(i<ea)ra(e,n,r,n+(o=na(e,n,r,t)),t);else{var a=aa(e,t),s=function(e){for(var t=0;e>=ea;)t|=1&e,e>>=1;return e+t}(i);do{if((o=na(e,n,r,t))<s){var l=i;l>s&&(l=s),ra(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}}var la=1,ua=4,ca=!1;function ha(){ca||(ca=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function da(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var pa,fa=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=da}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return!e&&n.length||this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,sa(n,da)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath();if(e.ignoreClip)t=null;else if(r){t=t?t.slice():[];for(var i=r,o=e;i;)i.parent=o,i.updateTransform(),t.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),s=0;s<a.length;s++){var l=a[s];e.__dirty&&(l.__dirty|=la),this._updateAndAddDisplayable(l,t,n)}e.__dirty=0}else{var u=e;t&&t.length?u.__clipPaths=t:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(ha(),u.z=0),isNaN(u.z2)&&(ha(),u.z2=0),isNaN(u.zlevel)&&(ha(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);else{var r=kr(this._roots,e);r>=0&&this._roots.splice(r,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();pa=sr.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var ga={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.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){return(e*=2)<1?.5*e*e*e*e:-.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){return(e*=2)<1?.5*e*e*e*e*e:.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 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.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=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-ga.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*ga.bounceIn(2*e):.5*ga.bounceOut(2*e-1)+.5}},ma=Math.pow,va=Math.sqrt,ya=1e-8,_a=1e-4,xa=va(3),ba=1/3,wa=Di(),Sa=Di(),Ta=Di();function Ma(e){return e>-ya&&e<ya}function Aa(e){return e>ya||e<-ya}function Ca(e,t,n,r,i){var o=1-i;return o*o*(o*e+3*i*t)+i*i*(i*r+3*o*n)}function Da(e,t,n,r,i){var o=1-i;return 3*(((t-e)*o+2*(n-t)*i)*o+(r-n)*i*i)}function Ea(e,t,n,r,i,o){var a=r+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-i,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Ma(c)&&Ma(h)){if(Ma(s))o[0]=0;else(T=-l/s)>=0&&T<=1&&(o[p++]=T)}else{var f=h*h-4*c*d;if(Ma(f)){var g=h/c,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var v=va(f),y=c*s+1.5*a*(-h+v),_=c*s+1.5*a*(-h-v);(T=(-s-((y=y<0?-ma(-y,ba):ma(y,ba))+(_=_<0?-ma(-_,ba):ma(_,ba))))/(3*a))>=0&&T<=1&&(o[p++]=T)}else{var x=(2*c*s-3*a*h)/(2*va(c*c*c)),b=Math.acos(x)/3,w=va(c),S=Math.cos(b),T=(-s-2*w*S)/(3*a),M=(m=(-s+w*(S+xa*Math.sin(b)))/(3*a),(-s+w*(S-xa*Math.sin(b)))/(3*a));T>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m),M>=0&&M<=1&&(o[p++]=M)}}return p}function Ia(e,t,n,r,i){var o=6*n-12*t+6*e,a=9*t+3*r-3*e-9*n,s=3*t-3*e,l=0;if(Ma(a)){if(Aa(o))(c=-s/o)>=0&&c<=1&&(i[l++]=c)}else{var u=o*o-4*a*s;if(Ma(u))i[0]=-o/(2*a);else if(u>0){var c,h=va(u),d=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function La(e,t,n,r,i,o){var a=(t-e)*i+e,s=(n-t)*i+t,l=(r-n)*i+n,u=(s-a)*i+a,c=(l-s)*i+s,h=(c-u)*i+u;o[0]=e,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=r}function Na(e,t,n,r,i,o,a,s,l,u,c){var h,d,p,f,g,m=.005,v=1/0;wa[0]=l,wa[1]=u;for(var y=0;y<1;y+=.05)Sa[0]=Ca(e,n,i,a,y),Sa[1]=Ca(t,r,o,s,y),(f=Wi(wa,Sa))<v&&(h=y,v=f);v=1/0;for(var _=0;_<32&&!(m<_a);_++)d=h-m,p=h+m,Sa[0]=Ca(e,n,i,a,d),Sa[1]=Ca(t,r,o,s,d),f=Wi(Sa,wa),d>=0&&f<v?(h=d,v=f):(Ta[0]=Ca(e,n,i,a,p),Ta[1]=Ca(t,r,o,s,p),g=Wi(Ta,wa),p<=1&&g<v?(h=p,v=g):m*=.5);return c&&(c[0]=Ca(e,n,i,a,h),c[1]=Ca(t,r,o,s,h)),va(v)}function Pa(e,t,n,r,i,o,a,s,l){for(var u=e,c=t,h=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Ca(e,n,i,a,f),m=Ca(t,r,o,s,f),v=g-u,y=m-c;h+=Math.sqrt(v*v+y*y),u=g,c=m}return h}function Oa(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function Ra(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function ka(e,t,n){var r=e+n-2*t;return 0===r?.5:(e-t)/r}function za(e,t,n,r,i){var o=(t-e)*r+e,a=(n-t)*r+t,s=(a-o)*r+o;i[0]=e,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function Ba(e,t,n,r,i,o,a,s,l){var u,c=.005,h=1/0;wa[0]=a,wa[1]=s;for(var d=0;d<1;d+=.05){Sa[0]=Oa(e,n,i,d),Sa[1]=Oa(t,r,o,d),(m=Wi(wa,Sa))<h&&(u=d,h=m)}h=1/0;for(var p=0;p<32&&!(c<_a);p++){var f=u-c,g=u+c;Sa[0]=Oa(e,n,i,f),Sa[1]=Oa(t,r,o,f);var m=Wi(Sa,wa);if(f>=0&&m<h)u=f,h=m;else{Ta[0]=Oa(e,n,i,g),Ta[1]=Oa(t,r,o,g);var v=Wi(Ta,wa);g<=1&&v<h?(u=g,h=v):c*=.5}}return l&&(l[0]=Oa(e,n,i,u),l[1]=Oa(t,r,o,u)),va(h)}function Va(e,t,n,r,i,o,a){for(var s=e,l=t,u=0,c=1/a,h=1;h<=a;h++){var d=h*c,p=Oa(e,n,i,d),f=Oa(t,r,o,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}var Fa=/cubic-bezier\(([0-9,\.e ]+)\)/;function Ga(e){var t=e&&Fa.exec(e);if(t){var n=t[1].split(","),r=+pi(n[0]),i=+pi(n[1]),o=+pi(n[2]),a=+pi(n[3]);if(isNaN(r+i+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:Ea(0,r,o,1,e,s)&&Ca(0,i,a,1,s[0])}}}var Ha=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Mi,this.ondestroy=e.ondestroy||Mi,this.onrestart=e.onrestart||Mi,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),!this._paused){var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,a=o?o(i):i;if(this.onframe(a),1===i){if(!this.loop)return!0;var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=t},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=qr(e)?e:ga[e]||Ga(e)},e}(),Ua=function(e){this.value=e},Wa=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Ua(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Xa=function(){function e(e){this._list=new Wa,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(null==r[e]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=t:a=new Ua(t),a.key=e,n.insertEntry(a),r[e]=a}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),ja={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ya(e){return(e=Math.round(e))<0?0:e>255?255:e}function Za(e){return e<0?0:e>1?1:e}function qa(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Ya(parseFloat(t)/100*255):Ya(parseInt(t,10))}function Ka(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Za(parseFloat(t)/100):Za(parseFloat(t))}function $a(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function Ja(e,t,n){return e+(t-e)*n}function Qa(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function es(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var ts=new Xa(20),ns=null;function rs(e,t){ns&&es(ns,t),ns=ts.put(e,ns||t.slice())}function is(e,t){if(e){t=t||[];var n=ts.get(e);if(n)return es(t,n);var r=(e+="").replace(/ /g,"").toLowerCase();if(r in ja)return es(t,ja[r]),rs(e,t),t;var i,o=r.length;if("#"===r.charAt(0))return 4===o||5===o?(i=parseInt(r.slice(1,4),16))>=0&&i<=4095?(Qa(t,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,5===o?parseInt(r.slice(4),16)/15:1),rs(e,t),t):void Qa(t,0,0,0,1):7===o||9===o?(i=parseInt(r.slice(1,7),16))>=0&&i<=16777215?(Qa(t,(16711680&i)>>16,(65280&i)>>8,255&i,9===o?parseInt(r.slice(7),16)/255:1),rs(e,t),t):void Qa(t,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&&s+1===o){var l=r.substr(0,a),u=r.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?Qa(t,+u[0],+u[1],+u[2],1):Qa(t,0,0,0,1);c=Ka(u.pop());case"rgb":return u.length>=3?(Qa(t,qa(u[0]),qa(u[1]),qa(u[2]),3===u.length?c:Ka(u[3])),rs(e,t),t):void Qa(t,0,0,0,1);case"hsla":return 4!==u.length?void Qa(t,0,0,0,1):(u[3]=Ka(u[3]),os(u,t),rs(e,t),t);case"hsl":return 3!==u.length?void Qa(t,0,0,0,1):(os(u,t),rs(e,t),t);default:return}}Qa(t,0,0,0,1)}}function os(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Ka(e[1]),i=Ka(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return Qa(t=t||[],Ya(255*$a(a,o,n+1/3)),Ya(255*$a(a,o,n)),Ya(255*$a(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function as(e,t){var n=is(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return ps(n,4===n.length?"rgba":"rgb")}}function ss(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=Ya(Ja(a[0],s[0],l)),n[1]=Ya(Ja(a[1],s[1],l)),n[2]=Ya(Ja(a[2],s[2],l)),n[3]=Za(Ja(a[3],s[3],l)),n}}var ls=ss;function us(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=is(t[i]),s=is(t[o]),l=r-i,u=ps([Ya(Ja(a[0],s[0],l)),Ya(Ja(a[1],s[1],l)),Ya(Ja(a[2],s[2],l)),Za(Ja(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}}var cs=us;function hs(e,t,n,r){var i=is(e);if(e)return i=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(i),null!=t&&(i[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(i[1]=Ka(n)),null!=r&&(i[2]=Ka(r)),ps(os(i),"rgba")}function ds(e,t){var n=is(e);if(n&&null!=t)return n[3]=Za(t),ps(n,"rgba")}function ps(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function fs(e,t){var n=is(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var gs=new Xa(100);function ms(e){if(Kr(e)){var t=gs.get(e);return t||(t=as(e,-.1),gs.put(e,t)),t}if(ri(e)){var n=Pr({},e);return n.colorStops=Gr(e.colorStops,(function(e){return{offset:e.offset,color:as(e.color,-.1)}})),n}return e}var vs=Object.freeze({__proto__:null,fastLerp:ss,fastMapToColor:ls,lerp:us,lift:as,liftColor:ms,lum:fs,mapToColor:cs,modifyAlpha:ds,modifyHSL:hs,parse:is,random:function(){return ps([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")},stringify:ps,toHex:function(e){var t=is(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}}),ys=Math.round;function _s(e){var t;if(e&&"transparent"!==e){if("string"==typeof e&&e.indexOf("rgba")>-1){var n=is(e);n&&(e="rgb("+n[0]+","+n[1]+","+n[2]+")",t=n[3])}}else e="none";return{color:e,opacity:null==t?1:t}}var xs=1e-4;function bs(e){return e<xs&&e>-xs}function ws(e){return ys(1e3*e)/1e3}function Ss(e){return ys(1e4*e)/1e4}var Ts={left:"start",right:"end",center:"middle",middle:"middle"};function Ms(e){return e&&!!e.image}function As(e){return Ms(e)||function(e){return e&&!!e.svgElement}(e)}function Cs(e){return"linear"===e.type}function Ds(e){return"radial"===e.type}function Es(e){return e&&("linear"===e.type||"radial"===e.type)}function Is(e){return"url(#"+e+")"}function Ls(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Ns(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Ai,i=li(e.scaleX,1),o=li(e.scaleY,1),a=e.skewX||0,s=e.skewY||0,l=[];return(t||n)&&l.push("translate("+t+"px,"+n+"px)"),r&&l.push("rotate("+r+")"),1===i&&1===o||l.push("scale("+i+","+o+")"),(a||s)&&l.push("skew("+ys(a*Ai)+"deg, "+ys(s*Ai)+"deg)"),l.join(" ")}var Ps=sr.hasGlobalWindow&&qr(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:"undefined"!=typeof Buffer?function(e){return Buffer.from(e).toString("base64")}:function(e){return"production"!==process.env.NODE_ENV&&Er("Base64 isn't natively supported in the current environment."),null},Os=Array.prototype.slice;function Rs(e,t,n){return(t-e)*n+e}function ks(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=Rs(t[o],n[o],r);return e}function zs(e,t,n,r){for(var i=t.length,o=0;o<i;o++)e[o]=t[o]+n[o]*r;return e}function Bs(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=t[a][s]+n[a][s]*r}return e}function Vs(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,o=Math.min(n,r),a=i[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,r);s++)i.push({offset:a.offset,color:a.color.slice()})}function Fs(e,t,n){var r=e,i=t;if(r.push&&i.push){var o=r.length,a=i.length;if(o!==a)if(o>a)r.length=a;else for(var s=o;s<a;s++)r.push(1===n?i[s]:Os.call(i[s]));var l=r[0]&&r[0].length;for(s=0;s<r.length;s++)if(1===n)isNaN(r[s])&&(r[s]=i[s]);else for(var u=0;u<l;u++)isNaN(r[s][u])&&(r[s][u]=i[s][u])}}function Gs(e){if(Vr(e)){var t=e.length;if(Vr(e[0])){for(var n=[],r=0;r<t;r++)n.push(Os.call(e[r]));return n}return Os.call(e)}return e}function Hs(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=null==e[3]?1:e[3],"rgba("+e.join(",")+")"}function Us(e){return 4===e||5===e}function Ws(e){return 1===e||2===e}var Xs=[0,0,0,0],js=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,o=!1,a=6,s=t;if(Vr(t)){var l=function(e){return Vr(e&&e[0])?2:1}(t);a=l,(1===l&&!Jr(t[0])||2===l&&!Jr(t[0][0]))&&(o=!0)}else if(Jr(t)&&!ai(t))a=0;else if(Kr(t))if(isNaN(+t)){var u=is(t);u&&(s=u,a=3)}else a=0;else if(ri(t)){var c=Pr({},s);c.colorStops=Gr(t.colorStops,(function(e){return{offset:e.offset,color:is(e.color)}})),Cs(t)?a=4:Ds(t)&&(a=5),s=c}0===i?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var h={time:e,value:s,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=qr(n)?n:ga[n]||Ga(n)),r.push(h),h},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort((function(e,t){return e.time-t.time}));for(var r=this.valType,i=n.length,o=n[i-1],a=this.discrete,s=Ws(r),l=Us(r),u=0;u<i;u++){var c=n[u],h=c.value,d=o.value;c.percent=c.time/e,a||(s&&u!==i-1?Fs(h,d,r):l&&Vs(h.colorStops,d.colorStops))}if(!a&&5!==r&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;var p=n[0].value;for(u=0;u<i;u++)0===r?n[u].additiveValue=n[u].value-p:3===r?n[u].additiveValue=zs([],n[u].value,p,-1):Ws(r)&&(n[u].additiveValue=1===r?zs([],n[u].value,p,-1):Bs([],n[u].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,r,i,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,c=this.propName,h=3===s,d=this._lastFr,p=Math.min;if(1===u)r=i=l[0];else{if(t<0)n=0;else if(t<this._lastFrP){for(n=p(d+1,u-1);n>=0&&!(l[n].percent<=t);n--);n=p(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>t);n++);n=p(n-1,u-2)}i=l[n+1],r=l[n]}if(r&&i){this._lastFr=n,this._lastFrP=t;var f=i.percent-r.percent,g=0===f?1:p((t-r.percent)/f,1);i.easingFunc&&(g=i.easingFunc(g));var m=o?this._additiveValue:h?Xs:e[c];if(!Ws(s)&&!h||m||(m=this._additiveValue=[]),this.discrete)e[c]=g<1?r.rawValue:i.rawValue;else if(Ws(s))1===s?ks(m,r[a],i[a],g):function(e,t,n,r){for(var i=t.length,o=i&&t[0].length,a=0;a<i;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=Rs(t[a][s],n[a][s],r)}}(m,r[a],i[a],g);else if(Us(s)){var v=r[a],y=i[a],_=4===s;e[c]={type:_?"linear":"radial",x:Rs(v.x,y.x,g),y:Rs(v.y,y.y,g),colorStops:Gr(v.colorStops,(function(e,t){var n=y.colorStops[t];return{offset:Rs(e.offset,n.offset,g),color:Hs(ks([],e.color,n.color,g))}})),global:y.global},_?(e[c].x2=Rs(v.x2,y.x2,g),e[c].y2=Rs(v.y2,y.y2,g)):e[c].r=Rs(v.r,y.r,g)}else if(h)ks(m,r[a],i[a],g),o||(e[c]=Hs(m));else{var x=Rs(r[a],i[a],g);o?this._additiveValue=x:e[c]=x}o&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;0===t?e[n]=e[n]+r:3===t?(is(e[n],Xs),zs(Xs,Xs,r,1),e[n]=Hs(Xs)):1===t?zs(e[n],e[n],r,1):2===t&&Bs(e[n],e[n],r,1)},e}(),Ys=function(){function e(e,t,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r?Er("Can' use additive animation on looped animation."):(this._additiveAnimators=r,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,Xr(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,o=0;o<n.length;o++){var a=n[o],s=i[a];if(!s){s=i[a]=new js(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var c=u.keyframes,h=c[c.length-1];l=h&&h.value,3===u.valType&&l&&(l=Hs(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,Gs(l),r),this._trackKeys.push(a)}s.addKeyframe(e,Gs(t[a]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(r,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var c=l[u-1];c&&(t._target[a.propName]=c.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new Ha({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,o=0;o<r.length;o++)if(r[o]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(o=0;o<n.length;o++)n[o].step(t._target,e);var a=t._onframeCbs;if(a)for(o=0;o<a.length;o++)a[o](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return Gr(this._trackKeys,(function(t){return e._tracks[t]}))},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(t?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(i=0;i<r.length;i++)if(!n[r[i]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},e.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],o=this._tracks[i];if(o&&!o.isFinished()){var a=o.keyframes,s=a[n?0:a.length-1];s&&(e[i]=Gs(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||Xr(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var o=i.keyframes;if(o.length>1){var a=o.pop();i.addKeyframe(a.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}();function Zs(){return(new Date).getTime()}var qs,Ks,$s=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return g(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Zs()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,pa((function t(){e._running&&(pa(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=Zs(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Zs(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Zs()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Ys(e,t.loop);return this.addAnimator(n),n},t}(Ji),Js=sr.domSupported,Qs=(Ks={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:qs=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Gr(qs,(function(e){var t=e.replace("mouse","pointer");return Ks.hasOwnProperty(t)?t:e}))}),el=["mousemove","mouseup"],tl=["pointermove","pointerup"],nl=!1;function rl(e){var t=e.pointerType;return"pen"===t||"touch"===t}function il(e){e&&(e.zrByTouch=!0)}function ol(e,t){for(var n=t,r=!1;n&&9!==n.nodeType&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var al=function(e,t){this.stopPropagation=Mi,this.stopImmediatePropagation=Mi,this.preventDefault=Mi,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},sl={mousedown:function(e){e=mo(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=mo(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=mo(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){ol(this,(e=mo(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){nl=!0,e=mo(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){nl||(e=mo(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){il(e=mo(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),sl.mousemove.call(this,e),sl.mousedown.call(this,e)},touchmove:function(e){il(e=mo(this.dom,e)),this.handler.processGesture(e,"change"),sl.mousemove.call(this,e)},touchend:function(e){il(e=mo(this.dom,e)),this.handler.processGesture(e,"end"),sl.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<300&&sl.click.call(this,e)},pointerdown:function(e){sl.mousedown.call(this,e)},pointermove:function(e){rl(e)||sl.mousemove.call(this,e)},pointerup:function(e){sl.mouseup.call(this,e)},pointerout:function(e){rl(e)||sl.mouseout.call(this,e)}};Fr(["click","dblclick","contextmenu"],(function(e){sl[e]=function(t){t=mo(this.dom,t),this.trigger(e,t)}}));var ll={pointermove:function(e){rl(e)||ll.mousemove.call(this,e)},pointerup:function(e){ll.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function ul(e,t){var n=t.domHandlers;sr.pointerEventsSupported?Fr(Qs.pointer,(function(r){hl(t,r,(function(t){n[r].call(e,t)}))})):(sr.touchEventsSupported&&Fr(Qs.touch,(function(r){hl(t,r,(function(i){n[r].call(e,i),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),Fr(Qs.mouse,(function(r){hl(t,r,(function(i){i=go(i),t.touching||n[r].call(e,i)}))})))}function cl(e,t){function n(n){hl(t,n,(function(r){r=go(r),ol(e,r.target)||(r=function(e,t){return mo(e.dom,new al(e,t),!0)}(e,r),t.domHandlers[n].call(e,r))}),{capture:!0})}sr.pointerEventsSupported?Fr(tl,n):sr.touchEventsSupported||Fr(el,n)}function hl(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,vo(e.domTarget,t,n,r)}function dl(e){var t,n,r,i,o=e.mounted;for(var a in o)o.hasOwnProperty(a)&&(t=e.domTarget,n=a,r=o[a],i=e.listenerOpts[a],t.removeEventListener(n,r,i));e.mounted={}}var pl=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},fl=function(e){function t(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new pl(t,sl),Js&&(r._globalHandlerScope=new pl(document,ll)),ul(r,r._localHandlerScope),r}return g(t,e),t.prototype.dispose=function(){dl(this._localHandlerScope),Js&&dl(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Js&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?cl(this,t):dl(t)}},t}(Ji),gl=1;sr.hasGlobalWindow&&(gl=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var ml=gl,vl="#333",yl="#ccc",_l=To,xl=5e-5;function bl(e){return e>xl||e<-5e-5}var wl=[],Sl=[],Tl=[1,0,0,1,0,0],Ml=Math.abs,Al=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return bl(this.rotation)||bl(this.x)||bl(this.y)||bl(this.scaleX-1)||bl(this.scaleY-1)||bl(this.skewX)||bl(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n=n||[1,0,0,1,0,0],t?this.getLocalTransform(n):_l(n),e&&(t?Ao(n,e,n):Mo(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(_l(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(wl);var n=wl[0]<0?-1:1,r=wl[1]<0?-1:1,i=((wl[0]-n)*t+n)/wl[0]||0,o=((wl[1]-r)*t+r)/wl[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],Io(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||[1,0,0,1,0,0],Ao(Sl,e.invTransform,t),t=Sl);var n=this.originX,r=this.originY;(n||r)&&(Tl[4]=n,Tl[5]=r,Ao(Sl,t,Tl),Sl[4]-=n,Sl[5]-=r,t=Sl),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&ji(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&ji(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&Ml(e[0]-1)>1e-10&&Ml(e[3]-1)>1e-10?Math.sqrt(Ml(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Dl(this,e)},e.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,o=e.scaleY,a=e.anchorX,s=e.anchorY,l=e.rotation||0,u=e.x,c=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||r||a||s){var p=n+a,f=r+s;t[4]=-p*i-h*f*o,t[5]=-f*o-d*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=o,t[1]=d*i,t[2]=h*o,l&&Do(t,t,l),t[4]+=n+u,t[5]+=r+c,t},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),Cl=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Dl(e,t){for(var n=0;n<Cl.length;n++){var r=Cl[n];e[r]=t[r]}}var El=Al,Il={};function Ll(e,t){var n=Il[t=t||cr];n||(n=Il[t]=new Xa(500));var r=n.get(e);return null==r&&(r=fr.measureText(e,t).width,n.put(e,r)),r}function Nl(e,t,n,r){var i=Ll(e,t),o=kl(t),a=Ol(0,i,n),s=Rl(0,o,r);return new Uo(a,s,i,o)}function Pl(e,t,n,r){var i=((e||"")+"").split("\n");if(1===i.length)return Nl(i[0],t,n,r);for(var o=new Uo(0,0,0,0),a=0;a<i.length;a++){var s=Nl(i[a],t,n,r);0===a?o.copy(s):o.union(s)}return o}function Ol(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function Rl(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function kl(e){return Ll("国",e)}function zl(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function Bl(e,t,n){var r=t.position||"inside",i=null!=t.distance?t.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(r instanceof Array)l+=zl(r[0],n.width),u+=zl(r[1],n.height),c=null,h=null;else switch(r){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+a,u+=s,h="middle";break;case"top":l+=a/2,u-=i,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+i,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=a-i,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=i,c="center";break;case"insideBottom":l+=a/2,u+=o-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=a-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=o-i,h="bottom";break;case"insideBottomRight":l+=a-i,u+=o-i,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var Vl="__zr_normal__",Fl=Cl.concat(["ignore"]),Gl=Hr(Cl,(function(e,t){return e[t]=!0,e}),{ignore:!1}),Hl={},Ul=new Uo(0,0,0,0),Wl=function(){function e(e){this.id=Dr(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=t.innerTransformable,o=void 0,a=void 0,s=!1;i.parent=r?this:null;var l=!1;if(i.copyTransform(t),null!=n.position){var u=Ul;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),r||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Hl,n,u):Bl(Hl,n,u),i.x=Hl.x,i.y=Hl.y,o=Hl.align,a=Hl.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,d=void 0;"center"===c?(h=.5*u.width,d=.5*u.height):(h=zl(c[0],u.width),d=zl(c[1],u.height)),l=!0,i.originX=-i.x+h+(r?0:u.x),i.originY=-i.y+d+(r?0:u.y)}}null!=n.rotation&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],l||(i.originX=-p[0],i.originY=-p[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,v=void 0,y=void 0;f&&this.canBeInsideText()?(m=n.insideFill,v=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(m),y=!0)):(m=n.outsideFill,v=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(m),y=!0)),(m=m||"#000")===g.fill&&v===g.stroke&&y===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=m,g.stroke=v,g.autoStroke=y,g.align=o,g.verticalAlign=a,t.setDefaultTextStyle(g)),t.__dirty|=la,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?yl:vl},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&is(t);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*r+(i?0:255)*(1-r);return n[3]=1,ps(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},Pr(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(Qr(e))for(var n=Xr(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==Vl)){var o=r.targetName,a=o?t[o]:t;r.saveTo(a)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Fl)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null==e[i]||i in t||(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Vl,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===Vl;if(this.hasState()||!i){var o=this.currentStates,a=this.stateTransition;if(!(kr(o,e)>=0)||!t&&1!==o.length){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||i){i||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||r);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,c=this._textGuide;return u&&u.useState(e,t,n,l),c&&c.useState(e,t,n,l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~la),s}Er("State "+e+" not exists.")}}},e.prototype.useStates=function(e,t,n){if(e.length){var r=[],i=this.currentStates,o=e.length,a=o===i.length;if(a)for(var s=0;s<o;s++)if(e[s]!==i[s]){a=!1;break}if(a)return;for(s=0;s<o;s++){var l=e[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,e)),u||(u=this.states[l]),u&&r.push(u)}var c=r[o-1],h=!!(c&&c.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(e,t,h),g&&g.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~la)}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=kr(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=kr(r,e),o=kr(r,t)>=0;i>=0?o?r.splice(i,1):r[i]=t:n&&!o&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},r=0;r<e.length;r++){var i=e[r];Pr(n,i),i.textConfig&&Pr(t=t||{},i.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,r,i,o){var a=!(t&&r);t&&t.textConfig?(this.textConfig=Pr({},r?this.textConfig:n.textConfig),Pr(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<Fl.length;u++){var c=Fl[u],h=i&&Gl[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:a&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!i)for(u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(t||n)[p]:t||n)}l&&this._transitionState(e,s,o)},e.prototype._attachComponent=function(e){if(!e.__zr||e.__hostTarget){if(e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}else if("production"!==process.env.NODE_ENV)throw new Error("Recursive component attachment.")}else if("production"!==process.env.NODE_ENV)throw new Error("Text element has been added to zrender.")},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;if(t!==e){if(t&&t!==e&&this.removeTextContent(),"production"!==process.env.NODE_ENV&&e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");e.innerTransformable=new El,this._attachComponent(e),this._textContent=e,this.markRedraw()}},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),Pr(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=la;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=e?this[e]:this;if("production"===process.env.NODE_ENV||r){var i=new Ys(r,t,n);return e&&(i.targetName=e),this.addAnimator(i,e),i}Er('Property "'+e+'" is not existed in element '+this.id)},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during((function(){r.updateDuringAnimation(t)})).done((function(){var t=r.animators,n=kr(t,e);n>=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],o=0;o<r;o++){var a=n[o];e&&e!==a.scope?i.push(a):a.stop(t)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Xl(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Xl(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Xl(this,t,n,r),o=0;o<i.length;o++)i[o].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=function(){var t=e.prototype;t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=la;var n={};function r(e,t,r){n[e+t+r]||(console.warn("DEPRECATED: '"+e+"' has been deprecated. use '"+t+"', '"+r+"' instead"),n[e+t+r]=!0)}function i(e,n,i,o){function a(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[o]},set:function(t){e[o]=t}})}Object.defineProperty(t,e,{get:function(){("production"!==process.env.NODE_ENV&&r(e,i,o),this[n])||a(this,this[n]=[]);return this[n]},set:function(t){"production"!==process.env.NODE_ENV&&r(e,i,o),this[i]=t[0],this[o]=t[1],this[n]=t,a(this,t)}})}Object.defineProperty&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),e}();function Xl(e,t,n,r,i){var o=[];Zl(e,"",e,t,n=n||{},r,o,i);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},h=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&n.during&&o[0].during((function(e,t){n.during(t)}));for(var d=0;d<o.length;d++){var p=o[d];c&&p.done(c),h&&p.aborted(h),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function jl(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function Yl(e,t,n){if(Vr(t[n]))if(Vr(e[n])||(e[n]=[]),ti(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),jl(e[n],t[n],r))}else{var i=t[n],o=e[n],a=i.length;if(Vr(i[0]))for(var s=i[0].length,l=0;l<a;l++)o[l]?jl(o[l],i[l],s):o[l]=Array.prototype.slice.call(i[l]);else jl(o,i,a);o.length=i.length}else e[n]=t[n]}function Zl(e,t,n,r,i,o,a,s){for(var l=Xr(r),u=i.duration,c=i.delay,h=i.additive,d=i.setToFinal,p=!Qr(o),f=e.animators,g=[],m=0;m<l.length;m++){var v=l[m],y=r[v];if(null!=y&&null!=n[v]&&(p||o[v]))if(!Qr(y)||Vr(y)||ri(y))g.push(v);else{if(t){s||(n[v]=y,e.updateDuringAnimation(t));continue}Zl(e,v,n[v],y,i,o&&o[v],a,s)}else s||(n[v]=y,e.updateDuringAnimation(t),g.push(v))}var _=g.length;if(!h&&_)for(var x=0;x<f.length;x++){if((w=f[x]).targetName===t)if(w.stopTracks(g)){var b=kr(f,w);f.splice(b,1)}}if(i.force||(g=Ur(g,(function(e){return t=r[e],i=n[e],!(t===i||Vr(t)&&Vr(i)&&function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(t,i));var t,i})),_=g.length),_>0||i.force&&!a.length){var w,S=void 0,T=void 0,M=void 0;if(s){T={},d&&(S={});for(x=0;x<_;x++){T[v=g[x]]=n[v],d?S[v]=r[v]:n[v]=r[v]}}else if(d){M={};for(x=0;x<_;x++){M[v=g[x]]=Gs(n[v]),Yl(n,r,v)}}(w=new Ys(n,!1,!1,h?Ur(f,(function(e){return e.targetName===t})):null)).targetName=t,i.scope&&(w.scope=i.scope),d&&S&&w.whenWithKeys(0,S,g),M&&w.whenWithKeys(0,M,g),w.whenWithKeys(null==u?500:u,s?T:r,g).delay(c||0),e.addAnimator(w,t),a.push(w)}}Br(Wl,Ji),Br(Wl,El);var ql=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return g(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){if(e&&(e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),"production"!==process.env.NODE_ENV&&e.__hostTarget))throw"This elemenet has been used as an attachment";return this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=kr(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=kr(n,e);return r<0||(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++){this._children[n].removeSelfFromZr(t)}},t.prototype.getBoundingRect=function(e){for(var t=new Uo(0,0,0,0),n=e||this._children,r=[],i=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(r);l?(Uo.applyTransform(t,s,l),(i=i||t.clone()).union(t)):(i=i||s.clone()).union(s)}}return i||t},t}(Wl);ql.prototype.type="group";var Kl=ql,$l={},Jl={};
13
+ /*!
14
+ * ZRender, a high performance 2d drawing library.
15
+ *
16
+ * Copyright (c) 2013, Baidu Inc.
17
+ * All rights reserved.
18
+ *
19
+ * LICENSE
20
+ * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
21
+ */var Ql,eu=function(){function e(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var i=new fa,o=n.renderer||"canvas";if($l[o]||(o=Xr($l)[0]),"production"!==process.env.NODE_ENV&&!$l[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var a=new $l[o](t,i,n,e),s=n.ssr||a.ssrOnly;this.storage=i,this.painter=a;var l,u=sr.node||sr.worker||s?null:new fl(a.getViewportRoot(),a.root),c=n.useCoarsePointer;(null==c||"auto"===c?sr.touchEventsSupported:!!c)&&(l=li(n.pointerSize,44)),this.handler=new Ko(i,a,u,a.root,l),this.animation=new $s({stage:{update:s?null:function(){return r._flush(!0)}}}),s||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=function(e){if(!e)return!1;if("string"==typeof e)return fs(e,1)<.4;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=fs(t[i].color,1);return(n/=r)<.4}return!1}(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=Zs();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var r=Zs();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:r-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Kl&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){var e;this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,e=this.id,delete Jl[e])},e}();function tu(e,t){var n=new eu(Dr(),e,t);return Jl[n.id]=n,n}function nu(e,t){$l[e]=t}function ru(e){if("function"==typeof Ql)return Ql(e)}function iu(e){Ql=e}var ou=Object.freeze({__proto__:null,dispose:function(e){e.dispose()},disposeAll:function(){for(var e in Jl)Jl.hasOwnProperty(e)&&Jl[e].dispose();Jl={}},getElementSSRData:ru,getInstance:function(e){return Jl[e]},init:tu,registerPainter:nu,registerSSRDataGetter:iu,version:"5.5.0"}),au=1e-4,su=20;function lu(e,t,n,r){var i=t[0],o=t[1],a=n[0],s=n[1],l=o-i,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(r)if(l>0){if(e<=i)return a;if(e>=o)return s}else{if(e>=i)return a;if(e<=o)return s}else{if(e===i)return a;if(e===o)return s}return(e-i)/l*u+a}function uu(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return Kr(e)?(n=e,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n}function cu(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),su),e=(+e).toFixed(t),n?e:+e}function hu(e){return e.sort((function(e,t){return e-t})),e}function du(e){if(e=+e,isNaN(e))return 0;if(e>1e-14)for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n;return pu(e)}function pu(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,o=t.indexOf("."),a=o<0?0:i-1-o;return Math.max(0,a-r)}function fu(e,t){var n=Math.log,r=Math.LN10,i=Math.floor(n(e[1]-e[0])/r),o=Math.round(n(Math.abs(t[1]-t[0]))/r),a=Math.min(Math.max(-i+o,0),20);return isFinite(a)?a:20}function gu(e,t){var n=Hr(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return[];for(var r=Math.pow(10,t),i=Gr(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,a=Gr(i,(function(e){return Math.floor(e)})),s=Hr(a,(function(e,t){return e+t}),0),l=Gr(i,(function(e,t){return e-a[t]}));s<o;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return Gr(a,(function(e){return e/r}))}function mu(e,t){var n=Math.max(du(e),du(t)),r=e+t;return n>su?r:cu(r,n)}var vu=9007199254740991;function yu(e){var t=2*Math.PI;return(e%t+t)%t}function _u(e){return e>-au&&e<au}var xu=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function bu(e){if(e instanceof Date)return e;if(Kr(e)){var t=xu.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}return null==e?new Date(NaN):new Date(Math.round(e))}function wu(e){return Math.pow(10,Su(e))}function Su(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function Tu(e,t){var n=Su(e),r=Math.pow(10,n),i=e/r;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,n>=-20?+e.toFixed(n<0?-n:0):e}function Mu(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i}function Au(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,r=0;r<e.length;){for(var i=e[r].interval,o=e[r].close,a=0;a<2;a++)i[a]<=t&&(i[a]=t,o[a]=a?1:1-n),t=i[a],n=o[a];i[0]===i[1]&&o[0]*o[1]!=1?e.splice(r,1):r++}return e;function s(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]==(n?-1:1)||!n&&s(e,t,1))}}function Cu(e){var t=parseFloat(e);return t==e&&(0!==t||!Kr(e)||e.indexOf("x")<=0)?t:NaN}function Du(e){return!isNaN(Cu(e))}function Eu(){return Math.round(9*Math.random())}function Iu(e,t){return 0===t?e:Iu(t,e%t)}function Lu(e,t){return null==e?t:null==t?e:e*t/Iu(e,t)}var Nu="[ECharts] ",Pu={},Ou="undefined"!=typeof console&&console.warn&&console.log;function Ru(e,t,n){if(Ou){if(n){if(Pu[t])return;Pu[t]=!0}console[e](Nu+t)}}function ku(e,t){Ru("warn",e,t)}function zu(e,t){Ru("error",e,t)}function Bu(e){"production"!==process.env.NODE_ENV&&Ru("warn","DEPRECATED: "+e,!0)}function Vu(e,t,n){"production"!==process.env.NODE_ENV&&Bu((n?"["+n+"]":"")+e+" is deprecated, use "+t+" instead.")}function Fu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";if("production"!==process.env.NODE_ENV){var r=function(e){return void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":ai(e)?"NaN":e instanceof Date?"Date("+e.toISOString()+")":qr(e)?"function () { ... }":oi(e)?e+"":null};n=Gr(e,(function(e){if(Kr(e))return e;var t=r(e);if(null!=t)return t;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(e,(function(e,t){var n=r(t);return null==n?t:n}))}catch(e){return"?"}})).join(" ")}return n}function Gu(e){throw new Error(e)}function Hu(e,t,n){return(t-e)*n+e}var Uu="series\0",Wu="\0_ec_\0";function Xu(e){return e instanceof Array?e:null==e?[]:[e]}function ju(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var o=n[r];!e.emphasis[t].hasOwnProperty(o)&&e[t].hasOwnProperty(o)&&(e.emphasis[t][o]=e[t][o])}}}var Yu=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Zu(e){return!Qr(e)||Zr(e)||e instanceof Date?e:e.value}function qu(e){return Qr(e)&&!(e instanceof Array)}function Ku(e,t,n){var r="normalMerge"===n,i="replaceMerge"===n,o="replaceAll"===n;e=e||[],t=(t||[]).slice();var a=xi();Fr(t,(function(e,n){Qr(e)?"production"!==process.env.NODE_ENV&&(null==e.id||tc(e.id)||ec(e.id),null==e.name||tc(e.name)||ec(e.name)):t[n]=null}));var s,l,u=function(e,t,n){var r=[];if("replaceAll"===n)return r;for(var i=0;i<e.length;i++){var o=e[i];o&&null!=o.id&&t.set(o.id,i),r.push({existing:"replaceMerge"===n||rc(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return r}(e,a,n);return(r||i)&&function(e,t,n,r){Fr(r,(function(i,o){if(i&&null!=i.id){var a=Ju(i.id),s=n.get(a);if(null!=s){var l=e[s];di(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=i,l.existing=t[s],r[o]=null}}}))}(u,e,a,t),r&&function(e,t){Fr(t,(function(n,r){if(n&&null!=n.name)for(var i=0;i<e.length;i++){var o=e[i].existing;if(!e[i].newOption&&o&&(null==o.id||null==n.id)&&!rc(n)&&!rc(o)&&$u("name",o,n))return e[i].newOption=n,void(t[r]=null)}}))}(u,t),r||i?function(e,t,n){Fr(t,(function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||rc(r.existing)||r.existing&&null!=t.id&&!$u("id",t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}}))}(u,t,i):o&&function(e,t){Fr(t,(function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})}))}(u,t),s=u,l=xi(),Fr(s,(function(e){var t=e.existing;t&&l.set(t.id,e)})),Fr(s,(function(e){var t=e.newOption;di(!t||null==t.id||!l.get(t.id)||l.get(t.id)===e,"id duplicates: "+(t&&t.id)),t&&null!=t.id&&l.set(t.id,e),!e.keyInfo&&(e.keyInfo={})})),Fr(s,(function(e,t){var n=e.existing,r=e.newOption,i=e.keyInfo;if(Qr(r)){if(i.name=null!=r.name?Ju(r.name):n?n.name:Uu+t,n)i.id=Ju(n.id);else if(null!=r.id)i.id=Ju(r.id);else{var o=0;do{i.id="\0"+i.name+"\0"+o++}while(l.get(i.id))}l.set(i.id,e)}})),u}function $u(e,t,n){var r=Qu(t[e],null),i=Qu(n[e],null);return null!=r&&null!=i&&r===i}function Ju(e){if("production"!==process.env.NODE_ENV&&null==e)throw new Error;return Qu(e,"")}function Qu(e,t){return null==e?t:Kr(e)?e:Jr(e)||$r(e)?e+"":t}function ec(e){"production"!==process.env.NODE_ENV&&ku("`"+e+"` is invalid id or name. Must be a string or number.")}function tc(e){return $r(e)||Du(e)}function nc(e){var t=e.name;return!(!t||!t.indexOf(Uu))}function rc(e){return e&&null!=e.id&&0===Ju(e.id).indexOf(Wu)}function ic(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?Zr(t.dataIndex)?Gr(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?Zr(t.name)?Gr(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}function oc(){var e="__ec_inner_"+ac++;return function(t){return t[e]||(t[e]={})}}var ac=Eu();function sc(e,t,n){var r=lc(t,n),i=r.mainTypeSpecified,o=r.queryOptionMap,a=r.others,s=n?n.defaultMainType:null;return!i&&s&&o.set(s,{}),o.each((function(t,r){var i=hc(e,r,t,{useDefault:s===r,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[r+"Models"]=i.models,a[r+"Model"]=i.models[0]})),a}function lc(e,t){var n;if(Kr(e)){var r={};r[e+"Index"]=0,n=r}else n=e;var i=xi(),o={},a=!1;return Fr(n,(function(e,n){if("dataIndex"!==n&&"dataIndexInside"!==n){var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],l=(r[2]||"").toLowerCase();if(s&&l&&!(t&&t.includeMainTypes&&kr(t.includeMainTypes,s)<0))a=a||!!s,(i.get(s)||i.set(s,{}))[l]=e}else o[n]=e})),{mainTypeSpecified:a,queryOptionMap:i,others:o}}var uc={useDefault:!0,enableAll:!1,enableNone:!1},cc={useDefault:!1,enableAll:!0,enableNone:!0};function hc(e,t,n,r){r=r||uc;var i=n.index,o=n.id,a=n.name,s={models:null,specified:null!=i||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=r.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===i||!1===i?(di(r.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):("all"===i&&(di(r.enableAll,'`"all"` is not a valid value on index option.'),i=o=a=null),s.models=e.queryComponents({mainType:t,index:i,id:o,name:a}),s)}function dc(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function pc(e,t){var n=xi(),r=[];return Fr(e,(function(e){var i=t(e);(n.get(i)||(r.push(i),n.set(i,[]))).push(e)})),{keys:r,buckets:n}}function fc(e,t,n,r,i){var o=null==t||"auto"===t;if(null==r)return r;if(Jr(r))return cu(f=Hu(n||0,r,i),o?Math.max(du(n||0),du(r)):t);if(Kr(r))return i<1?n:r;for(var a=[],s=n,l=r,u=Math.max(s?s.length:0,l.length),c=0;c<u;++c){var h=e.getDimensionInfo(c);if(h&&"ordinal"===h.type)a[c]=(i<1&&s?s:l)[c];else{var d=s&&s[c]?s[c]:0,p=l[c],f=Hu(d,p,i);a[c]=cu(f,o?Math.max(du(d),du(p)):t)}}return a}var gc=".",mc="___EC__COMPONENT__CONTAINER___",vc="___EC__EXTENDED_CLASS___";function yc(e){var t={main:"",sub:""};if(e){var n=e.split(gc);t.main=n[0]||"",t.sub=n[1]||""}return t}function _c(e,t){e.$constructor=e,e.extend=function(e){"production"!==process.env.NODE_ENV&&Fr(t,(function(t){e[t]||console.warn("Method `"+t+"` should be implemented"+(e.type?" in "+e.type:"")+".")}));var n,r,i=this;return qr(r=i)&&/^class\s/.test(Function.prototype.toString.call(r))?n=function(e){function t(){return e.apply(this,arguments)||this}return g(t,e),t}(i):(n=function(){(e.$constructor||i).apply(this,arguments)},zr(n,this)),Pr(n.prototype,e),n[vc]=!0,n.extend=this.extend,n.superCall=wc,n.superApply=Sc,n.superClass=i,n}}function xc(e,t){e.extend=t.extend}var bc=Math.round(10*Math.random());function wc(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[t].apply(e,n)}function Sc(e,t,n){return this.superClass.prototype[t].apply(e,n)}function Tc(e){var t={};e.registerClass=function(e){var n,r=e.type||e.prototype.type;if(r){di(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=r),'componentType "'+n+'" illegal'),e.prototype.type=r;var i=yc(r);if(i.sub){if(i.sub!==mc){var o=function(e){var n=t[e.main];n&&n[mc]||((n=t[e.main]={})[mc]=!0);return n}(i);o[i.sub]=e}}else"production"!==process.env.NODE_ENV&&t[i.main]&&console.warn(i.main+" exists."),t[i.main]=e}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[mc]&&(i=n?i[n]:null),r&&!i)throw new Error(n?"Component "+e+"."+(n||"")+" is used but not imported.":e+".type should be specified.");return i},e.getClassesByMainType=function(e){var n=yc(e),r=[],i=t[n.main];return i&&i[mc]?Fr(i,(function(e,t){t!==mc&&r.push(e)})):r.push(i),r},e.hasClass=function(e){var n=yc(e);return!!t[n.main]},e.getAllClassMainTypes=function(){var e=[];return Fr(t,(function(t,n){e.push(n)})),e},e.hasSubTypes=function(e){var n=yc(e),r=t[n.main];return r&&r[mc]}}function Mc(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,r,i){for(var o={},a=0;a<e.length;a++){var s=e[a][1];if(!(r&&kr(r,s)>=0||i&&kr(i,s)<0)){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var Ac=Mc([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Cc=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return Ac(this,e,t)},e}(),Dc=new Xa(50);function Ec(e){if("string"==typeof e){var t=Dc.get(e);return t&&t.image}return e}function Ic(e,t,n,r,i){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var o=Dc.get(e),a={hostEl:n,cb:r,cbPayload:i};return o?!Nc(t=o.image)&&o.pending.push(a):((t=fr.loadImage(e,Lc,Lc)).__zrImageSrc=e,Dc.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}return e}return t}function Lc(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function Nc(e){return e&&e.width&&e.height}var Pc=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Oc(e,t,n,r,i){if(!t)return"";var o=(e+"").split("\n");i=Rc(t,n,r,i);for(var a=0,s=o.length;a<s;a++)o[a]=kc(o[a],i);return o.join("\n")}function Rc(e,t,n,r){var i=Pr({},r=r||{});i.font=t,n=li(n,"..."),i.maxIterations=li(r.maxIterations,2);var o=i.minChar=li(r.minChar,0);i.cnCharWidth=Ll("国",t);var a=i.ascCharWidth=Ll("a",t);i.placeholder=li(r.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=Ll(n,t);return u>s&&(n="",u=0),s=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=e,i}function kc(e,t){var n=t.containerWidth,r=t.font,i=t.contentWidth;if(!n)return"";var o=Ll(e,r);if(o<=n)return e;for(var a=0;;a++){if(o<=i||a>=t.maxIterations){e+=t.ellipsis;break}var s=0===a?zc(e,i,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*i/o):0;o=Ll(e=e.substr(0,s),r)}return""===e&&(e=t.placeholder),e}function zc(e,t,n,r){for(var i=0,o=0,a=e.length;o<a&&i<t;o++){var s=e.charCodeAt(o);i+=0<=s&&s<=127?n:r}return o}var Bc=function(){},Vc=function(e){this.tokens=[],e&&(this.tokens=e)},Fc=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function Gc(e,t,n,r,i){var o,a,s=""===t,l=i&&n.rich[i]||{},u=e.lines,c=l.font||n.font,h=!1;if(r){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=zl(l.width,r.width)+p;u.length>0&&f+r.accumWidth>r.width&&(o=t.split("\n"),h=!0),r.accumWidth=f}else{var g=Wc(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=t.split("\n");for(var m=0;m<o.length;m++){var v=o[m],y=new Bc;if(y.styleName=i,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:Ll(v,c),m||h)u.push(new Vc([y]));else{var _=(u[u.length-1]||(u[0]=new Vc)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=y:(v||!x||s)&&_.push(y)}}}var Hc=Hr(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function Uc(e){return!function(e){var t=e.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}(e)||!!Hc[e]}function Wc(e,t,n,r,i){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var d=e.charAt(h);if("\n"!==d){var p=Ll(d,t),f=!r&&!Uc(d);(o.length?c+p>n:i+c+p>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),o.push(s),a.push(c-u),l+=d,s="",c=u+=p):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=d,c=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p)):(c+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0}return o.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=i),{accumWidth:c,lines:o,linesWidths:a}}var Xc="__zr_style_"+Math.round(10*Math.random()),jc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Yc={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};jc[Xc]=!0;var Zc=["z","z2","invisible"],qc=["invisible"],Kc=function(e){function t(t){return e.call(this,t)||this}var n;return g(t,e),t.prototype._init=function(t){for(var n=Xr(t),r=0;r<n.length;r++){var i=n[r];"style"===i?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(e,t,n){$c.copy(e.getBoundingRect()),e.transform&&$c.applyTransform(e.transform);return Jc.width=t,Jc.height=n,!$c.intersect(Jc)}(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(r&&this.parent)for(var a=this.parent;a;){if(a.ignore)return!1;a=a.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,o=r.shadowOffsetX||0,a=r.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new Uo(0,0,0,0)),t?Uo.applyTransform(e,n,t):e.copy(n),(i||o||a)&&(e.width+=2*i+Math.abs(o),e.height+=2*i+Math.abs(a),e.x=Math.min(e.x,e.x+o-i),e.y=Math.min(e.y,e.y+a-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+2*s),e.height=Math.ceil(e.height+1+2*s))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new Uo(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate("style",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){"style"!==t?e.prototype.attrKV.call(this,t,n):this.style?this.setStyle(n):this.useStyle(n)},t.prototype.setStyle=function(e,t){return"string"==typeof e?this.style[e]=t:Pr(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(2&this.__dirty)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return wi(jc,e)},t.prototype.useStyle=function(e){e[Xc]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[Xc]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,Zc)},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.style?o?i?s=n.style:(s=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(s,n.style)):l&&(s=r.style),s)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=Xr(u),h=0;h<c.length;h++){(p=c[h])in s&&(s[p]=s[p],this.style[p]=u[p])}var d=Xr(s);for(h=0;h<d.length;h++){var p=d[h];this.style[p]=this.style[p]}this._transitionState(t,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);var f=this.__inHover?qc:Zc;for(h=0;h<f.length;h++){p=f[h];n&&null!=n[p]?this[p]=n[p]:l&&null!=r[p]&&(this[p]=r[p])}},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(r.style=n),r},t.prototype._mergeStyle=function(e,t){return Pr(e,t),e},t.prototype.getAnimationStyleProps=function(){return Yc},t.initDefaultProps=((n=t.prototype).type="displayable",n.invisible=!1,n.z=0,n.z2=0,n.zlevel=0,n.culling=!1,n.cursor="pointer",n.rectHover=!1,n.incremental=!1,n._rect=null,n.dirtyRectTolerance=0,void(n.__dirty=2|la)),t}(Wl),$c=new Uo(0,0,0,0),Jc=new Uo(0,0,0,0);var Qc=Kc,eh=Math.min,th=Math.max,nh=Math.sin,rh=Math.cos,ih=2*Math.PI,oh=Di(),ah=Di(),sh=Di();function lh(e,t,n){if(0!==e.length){for(var r=e[0],i=r[0],o=r[0],a=r[1],s=r[1],l=1;l<e.length;l++)r=e[l],i=eh(i,r[0]),o=th(o,r[0]),a=eh(a,r[1]),s=th(s,r[1]);t[0]=i,t[1]=a,n[0]=o,n[1]=s}}function uh(e,t,n,r,i,o){i[0]=eh(e,n),i[1]=eh(t,r),o[0]=th(e,n),o[1]=th(t,r)}var ch=[],hh=[];function dh(e,t,n,r,i,o,a,s,l,u){var c=Ia,h=Ca,d=c(e,n,i,a,ch);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<d;p++){var f=h(e,n,i,a,ch[p]);l[0]=eh(f,l[0]),u[0]=th(f,u[0])}d=c(t,r,o,s,hh);for(p=0;p<d;p++){var g=h(t,r,o,s,hh[p]);l[1]=eh(g,l[1]),u[1]=th(g,u[1])}l[0]=eh(e,l[0]),u[0]=th(e,u[0]),l[0]=eh(a,l[0]),u[0]=th(a,u[0]),l[1]=eh(t,l[1]),u[1]=th(t,u[1]),l[1]=eh(s,l[1]),u[1]=th(s,u[1])}function ph(e,t,n,r,i,o,a,s){var l=ka,u=Oa,c=th(eh(l(e,n,i),1),0),h=th(eh(l(t,r,o),1),0),d=u(e,n,i,c),p=u(t,r,o,h);a[0]=eh(e,i,d),a[1]=eh(t,o,p),s[0]=th(e,i,d),s[1]=th(t,o,p)}function fh(e,t,n,r,i,o,a,s,l){var u=Yi,c=Zi,h=Math.abs(i-o);if(h%ih<1e-4&&h>1e-4)return s[0]=e-n,s[1]=t-r,l[0]=e+n,void(l[1]=t+r);if(oh[0]=rh(i)*n+e,oh[1]=nh(i)*r+t,ah[0]=rh(o)*n+e,ah[1]=nh(o)*r+t,u(s,oh,ah),c(l,oh,ah),(i%=ih)<0&&(i+=ih),(o%=ih)<0&&(o+=ih),i>o&&!a?o+=ih:i<o&&a&&(i+=ih),a){var d=o;o=i,i=d}for(var p=0;p<o;p+=Math.PI/2)p>i&&(sh[0]=rh(p)*n+e,sh[1]=nh(p)*r+t,u(s,sh,s),c(l,sh,l))}var gh={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},mh=[],vh=[],yh=[],_h=[],xh=[],bh=[],wh=Math.min,Sh=Math.max,Th=Math.cos,Mh=Math.sin,Ah=Math.abs,Ch=Math.PI,Dh=2*Ch,Eh="undefined"!=typeof Float32Array,Ih=[];function Lh(e){return Math.round(e/Ch*1e8)/1e8%2*Ch}function Nh(e,t){var n=Lh(e[0]);n<0&&(n+=Dh);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=Dh?i=n+Dh:t&&n-i>=Dh?i=n-Dh:!t&&n>i?i=n+(Dh-Lh(n-i)):t&&n<i&&(i=n-(Dh-Lh(i-n))),e[0]=n,e[1]=i}var Ph=function(){function e(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){(n=n||0)>0&&(this._ux=Ah(n/ml/e)||0,this._uy=Ah(n/ml/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(gh.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=Ah(e-this._xi),r=Ah(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(gh.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+r*r;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._drawPendingPt(),this.addData(gh.C,e,t,n,r,i,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,o),this._xi=i,this._yi=o,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(gh.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,o){this._drawPendingPt(),Ih[0]=r,Ih[1]=i,Nh(Ih,o),r=Ih[0];var a=(i=Ih[1])-r;return this.addData(gh.A,e,t,n,n,r,a,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,r,i,o),this._xi=Th(i)*n+e,this._yi=Mh(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(gh.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(gh.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!Eh||(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t},e.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();Eh&&this.data instanceof Float32Array&&(this.data=new Float32Array(r+n));for(i=0;i<t;i++)for(var o=e[i].data,a=0;a<o.length;a++)this.data[r++]=o[a];this._len=r},e.prototype.addData=function(e,t,n,r,i,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var c=0;c<arguments.length;c++)u[this._len++]=arguments[c]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,Eh&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){yh[0]=yh[1]=xh[0]=xh[1]=Number.MAX_VALUE,_h[0]=_h[1]=bh[0]=bh[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,r=0,i=0,o=0;for(e=0;e<this._len;){var a=t[e++],s=1===e;switch(s&&(i=n=t[e],o=r=t[e+1]),a){case gh.M:n=i=t[e++],r=o=t[e++],xh[0]=i,xh[1]=o,bh[0]=i,bh[1]=o;break;case gh.L:uh(n,r,t[e],t[e+1],xh,bh),n=t[e++],r=t[e++];break;case gh.C:dh(n,r,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],xh,bh),n=t[e++],r=t[e++];break;case gh.Q:ph(n,r,t[e++],t[e++],t[e],t[e+1],xh,bh),n=t[e++],r=t[e++];break;case gh.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],d=t[e++],p=t[e++]+d;e+=1;var f=!t[e++];s&&(i=Th(d)*c+l,o=Mh(d)*h+u),fh(l,u,c,h,d,p,f,xh,bh),n=Th(p)*c+l,r=Mh(p)*h+u;break;case gh.R:uh(i=n=t[e++],o=r=t[e++],i+t[e++],o+t[e++],xh,bh);break;case gh.Z:n=i,r=o}Yi(yh,yh,xh),Zi(_h,_h,bh)}return 0===e&&(yh[0]=yh[1]=_h[0]=_h[1]=0),new Uo(yh[0],yh[1],_h[0]-yh[0],_h[1]-yh[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var d=e[h++],p=1===h;p&&(a=i=e[h],s=o=e[h+1]);var f=-1;switch(d){case gh.M:i=a=e[h++],o=s=e[h++];break;case gh.L:var g=e[h++],m=(_=e[h++])-o;(Ah(E=g-i)>n||Ah(m)>r||h===t-1)&&(f=Math.sqrt(E*E+m*m),i=g,o=_);break;case gh.C:var v=e[h++],y=e[h++],_=(g=e[h++],e[h++]),x=e[h++],b=e[h++];f=Pa(i,o,v,y,g,_,x,b,10),i=x,o=b;break;case gh.Q:f=Va(i,o,v=e[h++],y=e[h++],g=e[h++],_=e[h++],10),i=g,o=_;break;case gh.A:var w=e[h++],S=e[h++],T=e[h++],M=e[h++],A=e[h++],C=e[h++],D=C+A;h+=1,p&&(a=Th(A)*T+w,s=Mh(A)*M+S),f=Sh(T,M)*wh(Dh,Math.abs(C)),i=Th(D)*T+w,o=Mh(D)*M+S;break;case gh.R:a=i=e[h++],s=o=e[h++],f=2*e[h++]+2*e[h++];break;case gh.Z:var E=a-i;m=s-o;f=Math.sqrt(E*E+m*m),i=a,o=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,r,i,o,a,s,l,u,c,h,d=this.data,p=this._ux,f=this._uy,g=this._len,m=t<1,v=0,y=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var x=0;x<g;){var b=d[x++],w=1===x;switch(w&&(n=i=d[x],r=o=d[x+1]),b!==gh.L&&_>0&&(e.lineTo(c,h),_=0),b){case gh.M:n=i=d[x++],r=o=d[x++],e.moveTo(i,o);break;case gh.L:a=d[x++],s=d[x++];var S=Ah(a-i),T=Ah(s-o);if(S>p||T>f){if(m){if(v+(Z=l[y++])>u){var M=(u-v)/Z;e.lineTo(i*(1-M)+a*M,o*(1-M)+s*M);break e}v+=Z}e.lineTo(a,s),i=a,o=s,_=0}else{var A=S*S+T*T;A>_&&(c=a,h=s,_=A)}break;case gh.C:var C=d[x++],D=d[x++],E=d[x++],I=d[x++],L=d[x++],N=d[x++];if(m){if(v+(Z=l[y++])>u){La(i,C,E,L,M=(u-v)/Z,mh),La(o,D,I,N,M,vh),e.bezierCurveTo(mh[1],vh[1],mh[2],vh[2],mh[3],vh[3]);break e}v+=Z}e.bezierCurveTo(C,D,E,I,L,N),i=L,o=N;break;case gh.Q:C=d[x++],D=d[x++],E=d[x++],I=d[x++];if(m){if(v+(Z=l[y++])>u){za(i,C,E,M=(u-v)/Z,mh),za(o,D,I,M,vh),e.quadraticCurveTo(mh[1],vh[1],mh[2],vh[2]);break e}v+=Z}e.quadraticCurveTo(C,D,E,I),i=E,o=I;break;case gh.A:var P=d[x++],O=d[x++],R=d[x++],k=d[x++],z=d[x++],B=d[x++],V=d[x++],F=!d[x++],G=R>k?R:k,H=Ah(R-k)>.001,U=z+B,W=!1;if(m)v+(Z=l[y++])>u&&(U=z+B*(u-v)/Z,W=!0),v+=Z;if(H&&e.ellipse?e.ellipse(P,O,R,k,V,z,U,F):e.arc(P,O,G,z,U,F),W)break e;w&&(n=Th(z)*R+P,r=Mh(z)*k+O),i=Th(U)*R+P,o=Mh(U)*k+O;break;case gh.R:n=i=d[x],r=o=d[x+1],a=d[x++],s=d[x++];var X=d[x++],j=d[x++];if(m){if(v+(Z=l[y++])>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+wh(Y,X),s),(Y-=X)>0&&e.lineTo(a+X,s+wh(Y,j)),(Y-=j)>0&&e.lineTo(a+Sh(X-Y,0),s+j),(Y-=X)>0&&e.lineTo(a,s+Sh(j-Y,0));break e}v+=Z}e.rect(a,s,X,j);break;case gh.Z:if(m){var Z;if(v+(Z=l[y++])>u){M=(u-v)/Z;e.lineTo(i*(1-M)+n*M,o*(1-M)+r*M);break e}v+=Z}e.closePath(),i=n,o=r}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=gh,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Oh(e,t,n,r,i,o,a){if(0===i)return!1;var s=i,l=0;if(a>t+s&&a>r+s||a<t-s&&a<r-s||o>e+s&&o>n+s||o<e-s&&o<n-s)return!1;if(e===n)return Math.abs(o-e)<=s/2;var u=(l=(t-r)/(e-n))*o-a+(e*r-n*t)/(e-n);return u*u/(l*l+1)<=s/2*s/2}function Rh(e,t,n,r,i,o,a,s,l,u,c){if(0===l)return!1;var h=l;return!(c>t+h&&c>r+h&&c>o+h&&c>s+h||c<t-h&&c<r-h&&c<o-h&&c<s-h||u>e+h&&u>n+h&&u>i+h&&u>a+h||u<e-h&&u<n-h&&u<i-h&&u<a-h)&&Na(e,t,n,r,i,o,a,s,u,c,null)<=h/2}function kh(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;return!(l>t+u&&l>r+u&&l>o+u||l<t-u&&l<r-u&&l<o-u||s>e+u&&s>n+u&&s>i+u||s<e-u&&s<n-u&&s<i-u)&&Ba(e,t,n,r,i,o,s,l,null)<=u/2}var zh=2*Math.PI;function Bh(e){return(e%=zh)<0&&(e+=zh),e}var Vh=2*Math.PI;function Fh(e,t,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;s-=e,l-=t;var c=Math.sqrt(s*s+l*l);if(c-u>n||c+u<n)return!1;if(Math.abs(r-i)%Vh<1e-4)return!0;if(o){var h=r;r=Bh(i),i=Bh(h)}else r=Bh(r),i=Bh(i);r>i&&(i+=Vh);var d=Math.atan2(l,s);return d<0&&(d+=Vh),d>=r&&d<=i||d+Vh>=r&&d+Vh<=i}function Gh(e,t,n,r,i,o){if(o>t&&o>r||o<t&&o<r)return 0;if(r===t)return 0;var a=(o-t)/(r-t),s=r<t?1:-1;1!==a&&0!==a||(s=r<t?.5:-.5);var l=a*(n-e)+e;return l===i?1/0:l>i?s:0}var Hh=Ph.CMD,Uh=2*Math.PI,Wh=1e-4;var Xh=[-1,-1,-1],jh=[-1,-1];function Yh(e,t,n,r,i,o,a,s,l,u){if(u>t&&u>r&&u>o&&u>s||u<t&&u<r&&u<o&&u<s)return 0;var c,h=Ea(t,r,o,s,u,Xh);if(0===h)return 0;for(var d=0,p=-1,f=void 0,g=void 0,m=0;m<h;m++){var v=Xh[m],y=0===v||1===v?.5:1;Ca(e,n,i,a,v)<l||(p<0&&(p=Ia(t,r,o,s,jh),jh[1]<jh[0]&&p>1&&(c=void 0,c=jh[0],jh[0]=jh[1],jh[1]=c),f=Ca(t,r,o,s,jh[0]),p>1&&(g=Ca(t,r,o,s,jh[1]))),2===p?v<jh[0]?d+=f<t?y:-y:v<jh[1]?d+=g<f?y:-y:d+=s<g?y:-y:v<jh[0]?d+=f<t?y:-y:d+=s<f?y:-y)}return d}function Zh(e,t,n,r,i,o,a,s){if(s>t&&s>r&&s>o||s<t&&s<r&&s<o)return 0;var l=function(e,t,n,r,i){var o=e-2*t+n,a=2*(t-e),s=e-r,l=0;if(Ma(o))Aa(a)&&(c=-s/a)>=0&&c<=1&&(i[l++]=c);else{var u=a*a-4*o*s;if(Ma(u))(c=-a/(2*o))>=0&&c<=1&&(i[l++]=c);else if(u>0){var c,h=va(u),d=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}(t,r,o,s,Xh);if(0===l)return 0;var u=ka(t,r,o);if(u>=0&&u<=1){for(var c=0,h=Oa(t,r,o,u),d=0;d<l;d++){var p=0===Xh[d]||1===Xh[d]?.5:1;Oa(e,n,i,Xh[d])<a||(Xh[d]<u?c+=h<t?p:-p:c+=o<h?p:-p)}return c}p=0===Xh[0]||1===Xh[0]?.5:1;return Oa(e,n,i,Xh[0])<a?0:o<t?p:-p}function qh(e,t,n,r,i,o,a,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Xh[0]=-l,Xh[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=Uh-1e-4){r=0,i=Uh;var c=o?1:-1;return a>=Xh[0]+e&&a<=Xh[1]+e?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=Uh,i+=Uh);for(var d=0,p=0;p<2;p++){var f=Xh[p];if(f+e>a){var g=Math.atan2(s,f);c=o?1:-1;g<0&&(g=Uh+g),(g>=r&&g<=i||g+Uh>=r&&g+Uh<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}function Kh(e,t,n,r,i){for(var o,a,s,l,u=e.data,c=e.len(),h=0,d=0,p=0,f=0,g=0,m=0;m<c;){var v=u[m++],y=1===m;switch(v===Hh.M&&m>1&&(n||(h+=Gh(d,p,f,g,r,i))),y&&(f=d=u[m],g=p=u[m+1]),v){case Hh.M:d=f=u[m++],p=g=u[m++];break;case Hh.L:if(n){if(Oh(d,p,u[m],u[m+1],t,r,i))return!0}else h+=Gh(d,p,u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Hh.C:if(n){if(Rh(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=Yh(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Hh.Q:if(n){if(kh(d,p,u[m++],u[m++],u[m],u[m+1],t,r,i))return!0}else h+=Zh(d,p,u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case Hh.A:var _=u[m++],x=u[m++],b=u[m++],w=u[m++],S=u[m++],T=u[m++];m+=1;var M=!!(1-u[m++]);o=Math.cos(S)*b+_,a=Math.sin(S)*w+x,y?(f=o,g=a):h+=Gh(d,p,o,a,r,i);var A=(r-_)*w/b+_;if(n){if(Fh(_,x,w,S,S+T,M,t,A,i))return!0}else h+=qh(_,x,w,S,S+T,M,A,i);d=Math.cos(S+T)*b+_,p=Math.sin(S+T)*w+x;break;case Hh.R:if(f=d=u[m++],g=p=u[m++],o=f+u[m++],a=g+u[m++],n){if(Oh(f,g,o,g,t,r,i)||Oh(o,g,o,a,t,r,i)||Oh(o,a,f,a,t,r,i)||Oh(f,a,f,g,t,r,i))return!0}else h+=Gh(o,g,o,a,r,i),h+=Gh(f,a,f,g,r,i);break;case Hh.Z:if(n){if(Oh(d,p,f,g,t,r,i))return!0}else h+=Gh(d,p,f,g,r,i);d=f,p=g}}return n||(s=p,l=g,Math.abs(s-l)<Wh)||(h+=Gh(d,p,f,g,r,i)||0),0!==h}var $h=Or({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},jc),Jh={style:Or({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Yc.style)},Qh=Cl.concat(["invisible","culling","z","z2","zlevel","parent"]),ed=function(e){function t(t){return e.call(this,t)||this}var n;return g(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var o=i.style;for(var a in r)o[a]!==r[a]&&(o[a]=r[a]);o.fill=r.fill?r.decal:null,o.decal=null,o.shadowColor=null,r.strokeFirst&&(o.stroke=null);for(var s=0;s<Qh.length;++s)i[Qh[s]]=this[Qh[s]];i.__dirty|=la}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=Xr(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var o=n[i],a=t[o];"style"===o?this.style?Pr(this.style,a):this.useStyle(a):"shape"===o?Pr(this.shape,a):e.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if("none"!==e){if(Kr(e)){var t=fs(e,0);return t>.5?vl:t>.2?"#eee":yl}if(e)return yl}return vl},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(Kr(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===fs(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=~ua},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Ph(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&ua)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){o.copy(e);var a=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var o=this.path;if(this.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(e,t,n,r){return Kh(e,t,!0,n,r)}(o,a/s,e,t)))return!0}if(this.hasFill())return function(e,t,n){return Kh(e,0,!1,t,n)}(o,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=ua,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:Pr(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&ua)},t.prototype.createStyle=function(e){return wi($h,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=Pr({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,o,a){e.prototype._applyStateObj.call(this,t,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.shape?o?i?s=n.shape:(s=Pr({},r.shape),Pr(s,n.shape)):(s=Pr({},i?this.shape:r.shape),Pr(s,n.shape)):l&&(s=r.shape),s)if(o){this.shape=Pr({},this.shape);for(var u={},c=Xr(s),h=0;h<c.length;h++){var d=c[h];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(t,{shape:u},a)}else this.shape=s,this.dirtyShape()},t.prototype._mergeStates=function(t){for(var n,r=e.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var o=t[i];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(r.shape=n),r},t.prototype.getAnimationStyleProps=function(){return Jh},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return g(n,t),n.prototype.getDefaultStyle=function(){return Ir(e.style)},n.prototype.getDefaultShape=function(){return Ir(e.shape)},n}(t);for(var r in e)"function"==typeof e[r]&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=((n=t.prototype).type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,void(n.__dirty=2|la|ua)),t}(Qc),td=Or({strokeFirst:!0,font:cr,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},$h),nd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return wi(td,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=Pl(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var r=e.lineWidth;n.x-=r/2,n.y-=r/2,n.width+=r,n.height+=r}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(Qc);nd.prototype.type="tspan";var rd=Or({x:0,y:0},jc),id={style:Or({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Yc.style)};var od=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.createStyle=function(e){return wi(rd,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var r,i=(r=t.image)&&"string"!=typeof r&&r.width&&r.height?t.image:this.__image;if(!i)return 0;var o="width"===e?"height":"width",a=t[o];return null==a?i[e]:i[e]/i[o]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return id},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new Uo(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Qc);od.prototype.type="image";var ad=od;var sd=Math.round;function ld(e,t,n){if(t){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;e.x1=r,e.x2=i,e.y1=o,e.y2=a;var s=n&&n.lineWidth;return s?(sd(2*r)===sd(2*i)&&(e.x1=e.x2=cd(r,s,!0)),sd(2*o)===sd(2*a)&&(e.y1=e.y2=cd(o,s,!0)),e):e}}function ud(e,t,n){if(t){var r=t.x,i=t.y,o=t.width,a=t.height;e.x=r,e.y=i,e.width=o,e.height=a;var s=n&&n.lineWidth;return s?(e.x=cd(r,s,!0),e.y=cd(i,s,!0),e.width=Math.max(cd(r+o,s,!1)-e.x,0===o?0:1),e.height=Math.max(cd(i+a,s,!1)-e.y,0===a?0:1),e):e}}function cd(e,t,n){if(!t)return e;var r=sd(2*e);return(r+sd(t))%2==0?r/2:(r+(n?1:-1))/2}var hd=function(){this.x=0,this.y=0,this.width=0,this.height=0},dd={},pd=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new hd},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=ud(dd,t,this.style);n=a.x,r=a.y,i=a.width,o=a.height,a.r=t.r,t=a}else n=t.x,r=t.y,i=t.width,o=t.height;t.r?function(e,t){var n,r,i,o,a,s=t.x,l=t.y,u=t.width,c=t.height,h=t.r;u<0&&(s+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof h?n=r=i=o=h:h instanceof Array?1===h.length?n=r=i=o=h[0]:2===h.length?(n=i=h[0],r=o=h[1]):3===h.length?(n=h[0],r=o=h[1],i=h[2]):(n=h[0],r=h[1],i=h[2],o=h[3]):n=r=i=o=0,n+r>u&&(n*=u/(a=n+r),r*=u/a),i+o>u&&(i*=u/(a=i+o),o*=u/a),r+i>c&&(r*=c/(a=r+i),i*=c/a),n+o>c&&(n*=c/(a=n+o),o*=c/a),e.moveTo(s+n,l),e.lineTo(s+u-r,l),0!==r&&e.arc(s+u-r,l+r,r,-Math.PI/2,0),e.lineTo(s+u,l+c-i),0!==i&&e.arc(s+u-i,l+c-i,i,0,Math.PI/2),e.lineTo(s+o,l+c),0!==o&&e.arc(s+o,l+c-o,o,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(e,t):e.rect(n,r,i,o)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(ed);pd.prototype.type="rect";var fd=pd,gd={fill:"#000"},md={style:Or({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Yc.style)},vd=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=gd,n.attr(t),n}return g(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){var e;this._childCursor=0,Td(e=this.style),Fr(e.rich,Td),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new Uo(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var o=t[i],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(e.copy(a),e.applyTransform(s),(r=r||e.clone()).union(e)):(r=r||a.clone()).union(a)}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||gd},t.prototype.setTextContent=function(e){if("production"!==process.env.NODE_ENV)throw new Error("Can't attach text on another text")},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return Pr(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=Xr(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},Pr(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return md},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||cr,n=e.padding,r=function(e,t){null!=e&&(e+="");var n,r=t.overflow,i=t.padding,o=t.font,a="truncate"===r,s=kl(o),l=li(t.lineHeight,s),u=!!t.backgroundColor,c="truncate"===t.lineOverflow,h=t.width,d=(n=null==h||"break"!==r&&"breakAll"!==r?e?e.split("\n"):[]:e?Wc(e,t.font,h,"breakAll"===r,0).lines:[]).length*l,p=li(t.height,d);if(d>p&&c){var f=Math.floor(p/l);n=n.slice(0,f)}if(e&&a&&null!=h)for(var g=Rc(h,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),m=0;m<n.length;m++)n[m]=kc(n[m],g);var v=p,y=0;for(m=0;m<n.length;m++)y=Math.max(Ll(n[m],o),y);null==h&&(h=y);var _=y;return i&&(v+=i[0]+i[2],_+=i[1]+i[3],h+=i[1]+i[3]),u&&(_=h),{lines:n,height:p,outerWidth:_,outerHeight:v,lineHeight:l,calculatedLineHeight:s,contentWidth:y,contentHeight:d,width:h}}(Dd(e),e),i=Ed(e),o=!!e.backgroundColor,a=r.outerHeight,s=r.outerWidth,l=r.contentWidth,u=r.lines,c=r.lineHeight,h=this._defaultStyle,d=e.x||0,p=e.y||0,f=e.align||h.align||"left",g=e.verticalAlign||h.verticalAlign||"top",m=d,v=Rl(p,r.contentHeight,g);if(i||n){var y=Ol(d,s,f),_=Rl(p,a,g);i&&this._renderBackground(e,e,y,_,s,a)}v+=c/2,n&&(m=Cd(d,f,n),"top"===g?v+=n[0]:"bottom"===g&&(v-=n[2]));for(var x=0,b=!1,w=(Ad("fill"in e?e.fill:(b=!0,h.fill))),S=(Md("stroke"in e?e.stroke:o||h.autoStroke&&!b?null:(x=2,h.stroke))),T=e.textShadowBlur>0,M=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=r.calculatedLineHeight,C=0;C<u.length;C++){var D=this._getOrCreateChild(nd),E=D.createStyle();D.useStyle(E),E.text=u[C],E.x=m,E.y=v,f&&(E.textAlign=f),E.textBaseline="middle",E.opacity=e.opacity,E.strokeFirst=!0,T&&(E.shadowBlur=e.textShadowBlur||0,E.shadowColor=e.textShadowColor||"transparent",E.shadowOffsetX=e.textShadowOffsetX||0,E.shadowOffsetY=e.textShadowOffsetY||0),E.stroke=S,E.fill=w,S&&(E.lineWidth=e.lineWidth||x,E.lineDash=e.lineDash,E.lineDashOffset=e.lineDashOffset||0),E.font=t,wd(E,e),v+=c,M&&D.setBoundingRect(new Uo(Ol(E.x,e.width,E.textAlign),Rl(E.y,A,E.textBaseline),l,A))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n=new Fc;if(null!=e&&(e+=""),!e)return n;for(var r,i=t.width,o=t.height,a=t.overflow,s="break"!==a&&"breakAll"!==a||null==i?null:{width:i,accumWidth:0,breakAll:"breakAll"===a},l=Pc.lastIndex=0;null!=(r=Pc.exec(e));){var u=r.index;u>l&&Gc(n,e.substring(l,u),t,s),Gc(n,r[2],t,s,r[1]),l=Pc.lastIndex}l<e.length&&Gc(n,e.substring(l,e.length),t,s);var c=[],h=0,d=0,p=t.padding,f="truncate"===a,g="truncate"===t.lineOverflow;function m(e,t,n){e.width=t,e.lineHeight=n,h+=n,d=Math.max(d,t)}e:for(var v=0;v<n.lines.length;v++){for(var y=n.lines[v],_=0,x=0,b=0;b<y.tokens.length;b++){var w=(N=y.tokens[b]).styleName&&t.rich[N.styleName]||{},S=N.textPadding=w.padding,T=S?S[1]+S[3]:0,M=N.font=w.font||t.font;N.contentHeight=kl(M);var A=li(w.height,N.contentHeight);if(N.innerHeight=A,S&&(A+=S[0]+S[2]),N.height=A,N.lineHeight=ui(w.lineHeight,t.lineHeight,A),N.align=w&&w.align||t.align,N.verticalAlign=w&&w.verticalAlign||"middle",g&&null!=o&&h+N.lineHeight>o){b>0?(y.tokens=y.tokens.slice(0,b),m(y,x,_),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v);break e}var C=w.width,D=null==C||"auto"===C;if("string"==typeof C&&"%"===C.charAt(C.length-1))N.percentWidth=C,c.push(N),N.contentWidth=Ll(N.text,M);else{if(D){var E=w.backgroundColor,I=E&&E.image;I&&Nc(I=Ec(I))&&(N.width=Math.max(N.width,I.width*A/I.height))}var L=f&&null!=i?i-x:null;null!=L&&L<N.width?!D||L<T?(N.text="",N.width=N.contentWidth=0):(N.text=Oc(N.text,L-T,M,t.ellipsis,{minChar:t.truncateMinChar}),N.width=N.contentWidth=Ll(N.text,M)):N.contentWidth=Ll(N.text,M)}N.width+=T,x+=N.width,w&&(_=Math.max(_,N.lineHeight))}m(y,x,_)}for(n.outerWidth=n.width=li(i,d),n.outerHeight=n.height=li(o,h),n.contentHeight=h,n.contentWidth=d,p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),v=0;v<c.length;v++){var N,P=(N=c[v]).percentWidth;N.width=parseInt(P,10)/100*n.width}return n}(Dd(e),e),n=t.width,r=t.outerWidth,i=t.outerHeight,o=e.padding,a=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign,h=Ol(a,r,u),d=Rl(s,i,c),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;Ed(e)&&this._renderBackground(e,e,h,d,r,i);for(var m=!!e.backgroundColor,v=0;v<t.lines.length;v++){for(var y=t.lines[v],_=y.tokens,x=_.length,b=y.lineHeight,w=y.width,S=0,T=p,M=g,A=x-1,C=void 0;S<x&&(!(C=_[S]).align||"left"===C.align);)this._placeToken(C,e,b,f,T,"left",m),w-=C.width,T+=C.width,S++;for(;A>=0&&"right"===(C=_[A]).align;)this._placeToken(C,e,b,f,M,"right",m),w-=C.width,M-=C.width,A--;for(T+=(n-(T-p)-(g-M)-w)/2;S<=A;)C=_[S],this._placeToken(C,e,b,f,T+C.width/2,"center",m),T+=C.width,S++;f+=b}},t.prototype._placeToken=function(e,t,n,r,i,o,a){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=r+n/2;"top"===l?u=r+e.height/2:"bottom"===l&&(u=r+n-e.height/2),!e.isLineHolder&&Ed(s)&&this._renderBackground(s,t,"right"===o?i-e.width:"center"===o?i-e.width/2:i,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(i=Cd(i,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(nd),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,v=Ad("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),y=Md("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||a||f.autoStroke&&!g?null:(m=2,f.stroke)),_=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=u,_&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=e.font||cr,p.opacity=ui(s.opacity,t.opacity,1),wd(p,s),y&&(p.lineWidth=ui(s.lineWidth,t.lineWidth,m),p.lineDash=li(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v);var x=e.contentWidth,b=e.contentHeight;d.setBoundingRect(new Uo(Ol(p.x,x,p.textAlign),Rl(p.y,b,p.textBaseline),x,b))},t.prototype._renderBackground=function(e,t,n,r,i,o){var a,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,d=u&&u.image,p=u&&!d,f=e.borderRadius,g=this;if(p||e.lineHeight||c&&h){(a=this._getOrCreateChild(fd)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=r,m.width=i,m.height=o,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=li(e.fillOpacity,1);else if(d){(s=this._getOrCreateChild(ad)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=r,v.width=i,v.height=o}c&&h&&((l=a.style).lineWidth=c,l.stroke=h,l.strokeOpacity=li(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(a||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=ui(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";return Sd(e)&&(t=[e.fontStyle,e.fontWeight,bd(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),t&&pi(t)||e.textFont||e.font},t}(Qc),yd={left:!0,right:1,center:1},_d={top:1,bottom:1,middle:1},xd=["fontStyle","fontWeight","fontSize","fontFamily"];function bd(e){return"string"!=typeof e||-1===e.indexOf("px")&&-1===e.indexOf("rem")&&-1===e.indexOf("em")?isNaN(+e)?lr+"px":e+"px":e}function wd(e,t){for(var n=0;n<xd.length;n++){var r=xd[n],i=t[r];null!=i&&(e[r]=i)}}function Sd(e){return null!=e.fontSize||e.fontFamily||e.fontWeight}function Td(e){if(e){e.font=vd.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||yd[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||_d[n]?n:"top",e.padding&&(e.padding=hi(e.padding))}}function Md(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function Ad(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function Cd(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function Dd(e){var t=e.text;return null!=t&&(t+=""),t}function Ed(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var Id=vd,Ld=oc(),Nd=function(e,t,n,r){if(r){var i=Ld(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType="chart","group"===r.type&&r.traverse((function(r){var i=Ld(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType="chart"}))}},Pd=1,Od={},Rd=oc(),kd=oc(),zd=0,Bd=1,Vd=2,Fd=["emphasis","blur","select"],Gd=["normal","emphasis","blur","select"],Hd=10,Ud=9,Wd="highlight",Xd="downplay",jd="select",Yd="unselect",Zd="toggleSelect";function qd(e){return null!=e&&"none"!==e}function Kd(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function $d(e){Kd(e,"emphasis",Vd)}function Jd(e){e.hoverState===Vd&&Kd(e,"normal",zd)}function Qd(e){Kd(e,"blur",Bd)}function ep(e){e.hoverState===Bd&&Kd(e,"normal",zd)}function tp(e){e.selected=!0}function np(e){e.selected=!1}function rp(e,t,n){t(e,n)}function ip(e,t,n){rp(e,t,n),e.isGroup&&e.traverse((function(e){rp(e,t,n)}))}function op(e,t){switch(t){case"emphasis":e.hoverState=Vd;break;case"normal":e.hoverState=zd;break;case"blur":e.hoverState=Bd;break;case"select":e.selected=!0}}function ap(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return function(e,t,n,r){var i=n&&kr(n,"select")>=0,o=!1;if(e instanceof ed){var a=Rd(e),s=i&&a.selectFill||a.normalFill,l=i&&a.selectStroke||a.normalStroke;if(qd(s)||qd(l)){var u=(r=r||{}).style||{};"inherit"===u.fill?(o=!0,r=Pr({},r),(u=Pr({},u)).fill=s):!qd(u.fill)&&qd(s)?(o=!0,r=Pr({},r),(u=Pr({},u)).fill=ms(s)):!qd(u.stroke)&&qd(l)&&(o||(r=Pr({},r),u=Pr({},u)),u.stroke=ms(l)),r.style=u}}if(r&&null==r.z2){o||(r=Pr({},r));var c=e.z2EmphasisLift;r.z2=e.z2+(null!=c?c:Hd)}return r}(this,0,t,n);if("blur"===e)return function(e,t,n){var r=kr(e.currentStates,t)>=0,i=e.style.opacity,o=r?null:function(e,t,n,r){for(var i=e.style,o={},a=0;a<t.length;a++){var s=t[a],l=i[s];o[s]=null==l?r&&r[s]:l}for(a=0;a<e.animators.length;a++){var u=e.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(o,t)}return o}(e,["opacity"],t,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(n=Pr({},n),a=Pr({opacity:r?i:.1*o.opacity},a),n.style=a),n}(this,e,n);if("select"===e)return function(e,t,n){if(n&&null==n.z2){n=Pr({},n);var r=e.z2SelectLift;n.z2=e.z2+(null!=r?r:Ud)}return n}(this,0,n)}return n}function sp(e){e.stateProxy=ap;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=ap),n&&(n.stateProxy=ap)}function lp(e,t){!mp(e,t)&&!e.__highByOuter&&ip(e,$d)}function up(e,t){!mp(e,t)&&!e.__highByOuter&&ip(e,Jd)}function cp(e,t){e.__highByOuter|=1<<(t||0),ip(e,$d)}function hp(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&ip(e,Jd)}function dp(e){ip(e,Qd)}function pp(e){ip(e,ep)}function fp(e){ip(e,tp)}function gp(e){ip(e,np)}function mp(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function vp(e){var t=e.getModel(),n=[],r=[];t.eachComponent((function(t,i){var o=kd(i),a="series"===t,s=a?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!a&&r.push(s),o.isBlured&&(s.group.traverse((function(e){ep(e)})),a&&n.push(i)),o.isBlured=!1})),Fr(r,(function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)}))}function yp(e,t,n,r){var i=r.getModel();function o(e,t){for(var n=0;n<t.length;n++){var r=e.getItemGraphicEl(t[n]);r&&pp(r)}}if(n=n||"coordinateSystem",null!=e&&t&&"none"!==t){var a=i.getSeriesByIndex(e),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];i.eachSeries((function(e){var i=a===e,u=e.coordinateSystem;if(u&&u.master&&(u=u.master),!("series"===n&&!i||"coordinateSystem"===n&&!(u&&s?u===s:i)||"series"===t&&i)){if(r.getViewOfSeriesModel(e).group.traverse((function(e){e.__highByOuter&&i&&"self"===t||Qd(e)})),Vr(t))o(e.getData(),t);else if(Qr(t))for(var c=Xr(t),h=0;h<c.length;h++)o(e.getData(c[h]),t[c[h]]);l.push(e),kd(e).isBlured=!0}})),i.eachComponent((function(e,t){if("series"!==e){var n=r.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,i)}}))}}function _p(e,t,n){if(null!=e&&null!=t){var r=n.getModel().getComponent(e,t);if(r){kd(r).isBlured=!0;var i=n.getViewOfComponentModel(r);i&&i.focusBlurEnabled&&i.group.traverse((function(e){Qd(e)}))}}}function xp(e,t,n,r){var i={focusSelf:!1,dispatchers:null};if(null==e||"series"===e||null==t||null==n)return i;var o=r.getModel().getComponent(e,t);if(!o)return i;var a=r.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return i;for(var s,l=a.findHighDownDispatchers(n),u=0;u<l.length;u++)if("production"===process.env.NODE_ENV||Ip(l[u])||zu("param should be highDownDispatcher"),"self"===Ld(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function bp(e){Fr(e.getAllData(),(function(t){var n=t.data,r=t.type;n.eachItemGraphicEl((function(t,n){e.isSelected(n,r)?fp(t):gp(t)}))}))}function wp(e){var t=[];return e.eachSeries((function(e){Fr(e.getAllData(),(function(n){n.data;var r=n.type,i=e.getSelectedDataIndices();if(i.length>0){var o={dataIndex:i,seriesIndex:e.seriesIndex};null!=r&&(o.dataType=r),t.push(o)}}))})),t}function Sp(e,t,n){Ep(e,!0),ip(e,sp),Mp(e,t,n)}function Tp(e,t,n,r){r?function(e){Ep(e,!1)}(e):Sp(e,t,n)}function Mp(e,t,n){var r=Ld(e);null!=t?(r.focus=t,r.blurScope=n):r.focus&&(r.focus=null)}var Ap=["emphasis","blur","select"],Cp={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Dp(e,t,n,r){n=n||"itemStyle";for(var i=0;i<Ap.length;i++){var o=Ap[i],a=t.getModel([o,n]);e.ensureState(o).style=r?r(a):a[Cp[n]]()}}function Ep(e,t){var n=!1===t,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),n&&!r.__highDownDispatcher||(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function Ip(e){return!(!e||!e.__highDownDispatcher)}function Lp(e){var t=e.type;return t===jd||t===Yd||t===Zd}function Np(e){var t=e.type;return t===Wd||t===Xd}var Pp=Ph.CMD,Op=[[],[],[]],Rp=Math.sqrt,kp=Math.atan2;function zp(e,t){if(t){var n,r,i,o,a,s,l=e.data,u=e.len(),c=Pp.M,h=Pp.C,d=Pp.L,p=Pp.R,f=Pp.A,g=Pp.Q;for(i=0,o=0;i<u;){switch(n=l[i++],o=i,r=0,n){case c:case d:r=1;break;case h:r=3;break;case g:r=2;break;case f:var m=t[4],v=t[5],y=Rp(t[0]*t[0]+t[1]*t[1]),_=Rp(t[2]*t[2]+t[3]*t[3]),x=kp(-t[1]/_,t[0]/y);l[i]*=y,l[i++]+=m,l[i]*=_,l[i++]+=v,l[i++]*=y,l[i++]*=_,l[i++]+=x,l[i++]+=x,o=i+=2;break;case p:s[0]=l[i++],s[1]=l[i++],ji(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[i++],s[1]+=l[i++],ji(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<r;a++){var b=Op[a];b[0]=l[i++],b[1]=l[i++],ji(b,b,t),l[o++]=b[0],l[o++]=b[1]}}e.increaseVersion()}}var Bp=Math.sqrt,Vp=Math.sin,Fp=Math.cos,Gp=Math.PI;function Hp(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Up(e,t){return(e[0]*t[0]+e[1]*t[1])/(Hp(e)*Hp(t))}function Wp(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Up(e,t))}function Xp(e,t,n,r,i,o,a,s,l,u,c){var h=l*(Gp/180),d=Fp(h)*(e-n)/2+Vp(h)*(t-r)/2,p=-1*Vp(h)*(e-n)/2+Fp(h)*(t-r)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=Bp(f),s*=Bp(f));var g=(i===o?-1:1)*Bp((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,v=g*-s*d/a,y=(e+n)/2+Fp(h)*m-Vp(h)*v,_=(t+r)/2+Vp(h)*m+Fp(h)*v,x=Wp([1,0],[(d-m)/a,(p-v)/s]),b=[(d-m)/a,(p-v)/s],w=[(-1*d-m)/a,(-1*p-v)/s],S=Wp(b,w);if(Up(b,w)<=-1&&(S=Gp),Up(b,w)>=1&&(S=0),S<0){var T=Math.round(S/Gp*1e6)/1e6;S=2*Gp+T%2*Gp}c.addData(u,y,_,a,s,x,S,h,o)}var jp=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Yp=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Zp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.applyTransform=function(e){},t}(ed);function qp(e){return null!=e.setData}function Kp(e,t){var n=function(e){var t=new Ph;if(!e)return t;var n,r=0,i=0,o=r,a=i,s=Ph.CMD,l=e.match(jp);if(!l)return t;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,p=c.match(Yp)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=r,M=i,A=void 0,C=void 0;switch(h){case"l":r+=p[m++],i+=p[m++],d=s.L,t.addData(d,r,i);break;case"L":r=p[m++],i=p[m++],d=s.L,t.addData(d,r,i);break;case"m":r+=p[m++],i+=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="l";break;case"M":r=p[m++],i=p[m++],d=s.M,t.addData(d,r,i),o=r,a=i,h="L";break;case"h":r+=p[m++],d=s.L,t.addData(d,r,i);break;case"H":r=p[m++],d=s.L,t.addData(d,r,i);break;case"v":i+=p[m++],d=s.L,t.addData(d,r,i);break;case"V":i=p[m++],d=s.L,t.addData(d,r,i);break;case"C":d=s.C,t.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),r=p[m-2],i=p[m-1];break;case"c":d=s.C,t.addData(d,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i),r+=p[m-2],i+=p[m-1];break;case"S":v=r,y=i,A=t.len(),C=t.data,n===s.C&&(v+=r-C[A-4],y+=i-C[A-3]),d=s.C,T=p[m++],M=p[m++],r=p[m++],i=p[m++],t.addData(d,v,y,T,M,r,i);break;case"s":v=r,y=i,A=t.len(),C=t.data,n===s.C&&(v+=r-C[A-4],y+=i-C[A-3]),d=s.C,T=r+p[m++],M=i+p[m++],r+=p[m++],i+=p[m++],t.addData(d,v,y,T,M,r,i);break;case"Q":T=p[m++],M=p[m++],r=p[m++],i=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"q":T=p[m++]+r,M=p[m++]+i,r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,T,M,r,i);break;case"T":v=r,y=i,A=t.len(),C=t.data,n===s.Q&&(v+=r-C[A-4],y+=i-C[A-3]),r=p[m++],i=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"t":v=r,y=i,A=t.len(),C=t.data,n===s.Q&&(v+=r-C[A-4],y+=i-C[A-3]),r+=p[m++],i+=p[m++],d=s.Q,t.addData(d,v,y,r,i);break;case"A":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Xp(T=r,M=i,r=p[m++],i=p[m++],w,S,_,x,b,d=s.A,t);break;case"a":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Xp(T=r,M=i,r+=p[m++],i+=p[m++],w,S,_,x,b,d=s.A,t)}}"z"!==h&&"Z"!==h||(d=s.Z,t.addData(d),r=o,i=a),n=d}return t.toStatic(),t}(e),r=Pr({},t);return r.buildPath=function(e){if(qp(e)){e.setData(n.data),(t=e.getContext())&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},r.applyTransform=function(e){zp(n,e),this.dirtyShape()},r}function $p(e,t){return new Zp(Kp(e,t))}function Jp(e,t){t=t||{};var n=new ed;return e.shape&&n.setShape(e.shape),n.setStyle(e.style),t.bakeTransform?zp(n.path,e.getComputedTransform()):t.toLocal?n.setLocalTransform(e.getComputedTransform()):n.copyTransform(e),n.buildPath=e.buildPath,n.applyTransform=n.applyTransform,n.z=e.z,n.z2=e.z2,n.zlevel=e.zlevel,n}var Qp=function(){this.cx=0,this.cy=0,this.r=0},ef=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new Qp},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(ed);ef.prototype.type="circle";var tf=ef,nf=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},rf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new nf},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=o*n,l=a*n;e.moveTo(r-o,i),e.bezierCurveTo(r-o,i-l,r-s,i-a,r,i-a),e.bezierCurveTo(r+s,i-a,r+o,i-l,r+o,i),e.bezierCurveTo(r+o,i+l,r+s,i+a,r,i+a),e.bezierCurveTo(r-s,i+a,r-o,i+l,r-o,i),e.closePath()},t}(ed);rf.prototype.type="ellipse";var of=rf,af=Math.PI,sf=2*af,lf=Math.sin,uf=Math.cos,cf=Math.acos,hf=Math.atan2,df=Math.abs,pf=Math.sqrt,ff=Math.max,gf=Math.min,mf=1e-4;function vf(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/pf(s*s+l*l),c=u*l,h=-u*s,d=e+c,p=t+h,f=n+c,g=r+h,m=(d+f)/2,v=(p+g)/2,y=f-d,_=g-p,x=y*y+_*_,b=i-o,w=d*g-f*p,S=(_<0?-1:1)*pf(ff(0,b*b*x-w*w)),T=(w*_-y*S)/x,M=(-w*y-_*S)/x,A=(w*_+y*S)/x,C=(-w*y+_*S)/x,D=T-m,E=M-v,I=A-m,L=C-v;return D*D+E*E>I*I+L*L&&(T=A,M=C),{cx:T,cy:M,x0:-c,y0:-h,x1:T*(i/b-1),y1:M*(i/b-1)}}function yf(e,t){var n,r=ff(t.r,0),i=ff(t.r0||0,0),o=r>0;if(o||i>0){if(o||(r=i,i=0),i>r){var a=r;r=i,i=a}var s=t.startAngle,l=t.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=t.cx,c=t.cy,h=!!t.clockwise,d=df(l-s),p=d>sf&&d%sf;if(p>mf&&(d=p),r>mf)if(d>sf-mf)e.moveTo(u+r*uf(s),c+r*lf(s)),e.arc(u,c,r,s,l,!h),i>mf&&(e.moveTo(u+i*uf(l),c+i*lf(l)),e.arc(u,c,i,l,s,h));else{var f=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0,C=void 0,D=void 0,E=void 0,I=r*uf(s),L=r*lf(s),N=i*uf(l),P=i*lf(l),O=d>mf;if(O){var R=t.cornerRadius;R&&(n=function(e){var t;if(Zr(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var k=df(r-i)/2;if(y=gf(k,m),_=gf(k,v),x=gf(k,f),b=gf(k,g),T=w=ff(y,_),M=S=ff(x,b),(w>mf||S>mf)&&(A=r*uf(l),C=r*lf(l),D=i*uf(s),E=i*lf(s),d<af)){var z=function(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=h*l-c*u;if(!(d*d<mf))return[e+(d=(c*(t-o)-h*(e-i))/d)*l,t+d*u]}(I,L,D,E,A,C,N,P);if(z){var B=I-z[0],V=L-z[1],F=A-z[0],G=C-z[1],H=1/lf(cf((B*F+V*G)/(pf(B*B+V*V)*pf(F*F+G*G)))/2),U=pf(z[0]*z[0]+z[1]*z[1]);T=gf(w,(r-U)/(H+1)),M=gf(S,(i-U)/(H-1))}}}if(O)if(T>mf){var W=gf(m,T),X=gf(v,T),j=vf(D,E,I,L,r,W,h),Y=vf(A,C,N,P,r,X,h);e.moveTo(u+j.cx+j.x0,c+j.cy+j.y0),T<w&&W===X?e.arc(u+j.cx,c+j.cy,T,hf(j.y0,j.x0),hf(Y.y0,Y.x0),!h):(W>0&&e.arc(u+j.cx,c+j.cy,W,hf(j.y0,j.x0),hf(j.y1,j.x1),!h),e.arc(u,c,r,hf(j.cy+j.y1,j.cx+j.x1),hf(Y.cy+Y.y1,Y.cx+Y.x1),!h),X>0&&e.arc(u+Y.cx,c+Y.cy,X,hf(Y.y1,Y.x1),hf(Y.y0,Y.x0),!h))}else e.moveTo(u+I,c+L),e.arc(u,c,r,s,l,!h);else e.moveTo(u+I,c+L);if(i>mf&&O)if(M>mf){W=gf(f,M),j=vf(N,P,A,C,i,-(X=gf(g,M)),h),Y=vf(I,L,D,E,i,-W,h);e.lineTo(u+j.cx+j.x0,c+j.cy+j.y0),M<S&&W===X?e.arc(u+j.cx,c+j.cy,M,hf(j.y0,j.x0),hf(Y.y0,Y.x0),!h):(X>0&&e.arc(u+j.cx,c+j.cy,X,hf(j.y0,j.x0),hf(j.y1,j.x1),!h),e.arc(u,c,i,hf(j.cy+j.y1,j.cx+j.x1),hf(Y.cy+Y.y1,Y.cx+Y.x1),h),W>0&&e.arc(u+Y.cx,c+Y.cy,W,hf(Y.y1,Y.x1),hf(Y.y0,Y.x0),!h))}else e.lineTo(u+N,c+P),e.arc(u,c,i,l,s,h);else e.lineTo(u+N,c+P)}else e.moveTo(u,c);e.closePath()}}}var _f=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},xf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new _f},t.prototype.buildPath=function(e,t){yf(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(ed);xf.prototype.type="sector";var bf=xf,wf=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Sf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new wf},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=2*Math.PI;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(ed);Sf.prototype.type="ring";var Tf=Sf;function Mf(e,t,n){var r=t.smooth,i=t.points;if(i&&i.length>=2){if(r){var o=function(e,t,n,r){var i,o,a,s,l=[],u=[],c=[],h=[];if(r){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)Yi(a,a,e[d]),Zi(s,s,e[d]);Yi(a,a,r[0]),Zi(s,s,r[1])}for(d=0,p=e.length;d<p;d++){var f=e[d];if(n)i=e[d?d-1:p-1],o=e[(d+1)%p];else{if(0===d||d===p-1){l.push(Ii(e[d]));continue}i=e[d-1],o=e[d+1]}Oi(u,o,i),Vi(u,u,t);var g=Gi(f,i),m=Gi(f,o),v=g+m;0!==v&&(g/=v,m/=v),Vi(c,u,-g),Vi(h,u,m);var y=Ni([],f,c),_=Ni([],f,h);r&&(Zi(y,y,a),Yi(y,y,s),Zi(_,_,a),Yi(_,_,s)),l.push(y),l.push(_)}return n&&l.push(l.shift()),l}(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=i[(s+1)%a];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(i[0][0],i[0][1]);s=1;for(var h=i.length;s<h;s++)e.lineTo(i[s][0],i[s][1])}n&&e.closePath()}}var Af=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},Cf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new Af},t.prototype.buildPath=function(e,t){Mf(e,t,!0)},t}(ed);Cf.prototype.type="polygon";var Df=Cf,Ef=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},If=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Ef},t.prototype.buildPath=function(e,t){Mf(e,t,!1)},t}(ed);If.prototype.type="polyline";var Lf=If,Nf={},Pf=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Of=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Pf},t.prototype.buildPath=function(e,t){var n,r,i,o;if(this.subPixelOptimize){var a=ld(Nf,t,this.style);n=a.x1,r=a.y1,i=a.x2,o=a.y2}else n=t.x1,r=t.y1,i=t.x2,o=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,o=r*(1-s)+o*s),e.lineTo(i,o))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(ed);Of.prototype.type="line";var Rf=Of,kf=[],zf=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function Bf(e,t,n){var r=e.cpx2,i=e.cpy2;return null!=r||null!=i?[(n?Da:Ca)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?Da:Ca)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?Ra:Oa)(e.x1,e.cpx1,e.x2,t),(n?Ra:Oa)(e.y1,e.cpy1,e.y2,t)]}var Vf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new zf},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2,a=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,r),null==l||null==u?(c<1&&(za(n,a,i,c,kf),a=kf[1],i=kf[2],za(r,s,o,c,kf),s=kf[1],o=kf[2]),e.quadraticCurveTo(a,s,i,o)):(c<1&&(La(n,a,l,i,c,kf),a=kf[1],l=kf[2],i=kf[3],La(r,s,u,o,c,kf),s=kf[1],u=kf[2],o=kf[3]),e.bezierCurveTo(a,s,l,u,i,o)))},t.prototype.pointAt=function(e){return Bf(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=Bf(this.shape,e,!0);return Fi(t,t)},t}(ed);Vf.prototype.type="bezier-curve";var Ff=Vf,Gf=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Hf=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Gf},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),o=t.startAngle,a=t.endAngle,s=t.clockwise,l=Math.cos(o),u=Math.sin(o);e.moveTo(l*i+n,u*i+r),e.arc(n,r,i,o,a,!s)},t}(ed);Hf.prototype.type="arc";var Uf=Hf,Wf=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return g(t,e),t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t=t||e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),ed.prototype.getBoundingRect.call(this)},t}(ed),Xf=Wf,jf=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),Yf=function(e){function t(t,n,r,i,o,a){var s=e.call(this,o)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==r?1:r,s.y2=null==i?0:i,s.type="linear",s.global=a||!1,s}return g(t,e),t}(jf),Zf=Yf,qf=function(e){function t(t,n,r,i,o){var a=e.call(this,i)||this;return a.x=null==t?.5:t,a.y=null==n?.5:n,a.r=null==r?.5:r,a.type="radial",a.global=o||!1,a}return g(t,e),t}(jf),Kf=qf,$f=[0,0],Jf=[0,0],Qf=new Po,eg=new Po,tg=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Po;for(n=0;n<2;n++)this._axes[n]=new Po;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,o=e.y,a=i+e.width,s=o+e.height;if(n[0].set(i,o),n[1].set(a,o),n[2].set(a,s),n[3].set(i,s),t)for(var l=0;l<4;l++)n[l].transform(t);Po.sub(r[0],n[1],n[0]),Po.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(l=0;l<2;l++)this._origin[l]=r[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,r=!t;return Qf.set(1/0,1/0),eg.set(0,0),!this._intersectCheckOneSide(this,e,Qf,eg,r,1)&&(n=!1,r)||!this._intersectCheckOneSide(e,this,Qf,eg,r,-1)&&(n=!1,r)||r||Po.copy(t,n?Qf:eg),n},e.prototype._intersectCheckOneSide=function(e,t,n,r,i,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,$f),this._getProjMinMaxOnAxis(s,t._corners,Jf),$f[1]<Jf[0]||$f[0]>Jf[1]){if(a=!1,i)return a;var u=Math.abs(Jf[0]-$f[1]),c=Math.abs($f[0]-Jf[1]);Math.min(u,c)>r.len()&&(u<c?Po.scale(r,l,-u*o):Po.scale(r,l,c*o))}else if(n){u=Math.abs(Jf[0]-$f[1]),c=Math.abs($f[0]-Jf[1]);Math.min(u,c)<n.len()&&(u<c?Po.scale(n,l,u*o):Po.scale(n,l,-c*o))}}return a},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,o=t[0].dot(r)+i[e],a=o,s=o,l=1;l<t.length;l++){var u=t[l].dot(r)+i[e];a=Math.min(u,a),s=Math.max(u,s)}n[0]=a,n[1]=s},e}(),ng=tg,rg=[],ig=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return g(t,e),t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t=t||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){(t=this._displayables[e]).parent=this,t.update(),t.parent=null}for(e=0;e<this._temporaryDisplayables.length;e++){var t;(t=this._temporaryDisplayables[e]).parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new Uo(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(rg)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1]))for(var r=0;r<this._displayables.length;r++){if(this._displayables[r].contain(e,t))return!0}return!1},t}(Qc),og=ig,ag=oc();function sg(e,t,n,r,i){var o;if(t&&t.ecModel){var a=t.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===e;if(t&&t.isAnimationEnabled()){var l=void 0,u=void 0,c=void 0;return r?(l=li(r.duration,200),u=li(r.easing,"cubicOut"),c=0):(l=t.getShallow(s?"animationDurationUpdate":"animationDuration"),u=t.getShallow(s?"animationEasingUpdate":"animationEasing"),c=t.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(u=o.easing),null!=o.delay&&(c=o.delay)),qr(c)&&(c=c(n,i)),qr(l)&&(l=l(n)),{duration:l||0,delay:c,easing:u}}return null}function lg(e,t,n,r,i,o,a){var s,l=!1;qr(i)?(a=o,o=i,i=null):Qr(i)&&(o=i.cb,a=i.during,l=i.isFrom,s=i.removeOpt,i=i.dataIndex);var u="leave"===e;u||t.stopAnimation("leave");var c=sg(e,r,i,u?s||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,i):null);if(c&&c.duration>0){var h={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:e,during:a};l?t.animateFrom(n,h):t.animateTo(n,h)}else t.stopAnimation(),!l&&t.attr(n),a&&a(1),o&&o()}function ug(e,t,n,r,i,o){lg("update",e,t,n,r,i,o)}function cg(e,t,n,r,i,o){lg("enter",e,t,n,r,i,o)}function hg(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++){if("leave"===e.animators[t].scope)return!0}return!1}function dg(e,t,n,r,i,o){hg(e)||lg("leave",e,t,n,r,i,o)}function pg(e,t,n,r){e.removeTextContent(),e.removeTextGuideLine(),dg(e,{style:{opacity:0}},t,n,r)}function fg(e,t,n){function r(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||pg(e,t,n,r)})):pg(e,t,n,r)}function gg(e){ag(e).oldStyle=e.style}var mg=Math.max,vg=Math.min,yg={};function _g(e){return ed.extend(e)}var xg=function(e,t){var n=Kp(e,t);return function(e){function t(t){var r=e.call(this,t)||this;return r.applyTransform=n.applyTransform,r.buildPath=n.buildPath,r}return g(t,e),t}(Zp)};function bg(e,t){return xg(e,t)}function wg(e,t){yg[e]=t}function Sg(e){if(yg.hasOwnProperty(e))return yg[e]}function Tg(e,t,n,r){var i=$p(e,t);return n&&("center"===r&&(n=Ag(n,i.getBoundingRect())),Dg(i,n)),i}function Mg(e,t,n){var r=new ad({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var i={width:e.width,height:e.height};r.setStyle(Ag(t,i))}}});return r}function Ag(e,t){var n,r=t.width/t.height,i=e.height*r;return n=i<=e.width?e.height:(i=e.width)/r,{x:e.x+e.width/2-i/2,y:e.y+e.height/2-n/2,width:i,height:n}}var Cg=function(e,t){for(var n=[],r=e.length,i=0;i<r;i++){var o=e[i];n.push(o.getUpdatedPathProxy(!0))}var a=new ed(t);return a.createPathProxy(),a.buildPath=function(e){if(qp(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function Dg(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function Eg(e,t){return ld(e,e,{lineWidth:t}),e}var Ig=cd;function Lg(e,t){for(var n=To([]);e&&e!==t;)Ao(n,e.getLocalTransform(),n),e=e.parent;return n}function Ng(e,t,n){return t&&!Vr(t)&&(t=El.getLocalTransform(t)),n&&(t=Io([],t)),ji([],e,t)}function Pg(e,t,n){var r=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),i=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),o=["left"===e?-r:"right"===e?r:0,"top"===e?-i:"bottom"===e?i:0];return o=Ng(o,t,n),Math.abs(o[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function Og(e){return!e.isGroup}function Rg(e,t,n){if(e&&t){var r=function(e){var t={};return e.traverse((function(e){Og(e)&&e.anid&&(t[e.anid]=e)})),t}(e);t.traverse((function(e){if(Og(e)&&e.anid){var t=r[e.anid];if(t){var o=i(e);e.attr(i(t)),ug(e,o,n,Ld(e).dataIndex)}}}))}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return function(e){return null!=e.shape}(e)&&(t.shape=Pr({},e.shape)),t}}function kg(e,t){return Gr(e,(function(e){var n=e[0];n=mg(n,t.x),n=vg(n,t.x+t.width);var r=e[1];return r=mg(r,t.y),[n,r=vg(r,t.y+t.height)]}))}function zg(e,t){var n=mg(e.x,t.x),r=vg(e.x+e.width,t.x+t.width),i=mg(e.y,t.y),o=vg(e.y+e.height,t.y+t.height);if(r>=n&&o>=i)return{x:n,y:i,width:r-n,height:o-i}}function Bg(e,t,n){var r=Pr({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(i.image=e.slice(8),Or(i,n),new ad(r)):Tg(e.replace("path://",""),r,n,"center")}function Vg(e,t,n,r,i){for(var o=0,a=i[i.length-1];o<i.length;o++){var s=i[o];if(Fg(e,t,n,r,s[0],s[1],a[0],a[1]))return!0;a=s}}function Fg(e,t,n,r,i,o,a,s){var l,u=n-e,c=r-t,h=a-i,d=s-o,p=Gg(h,d,u,c);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-i,g=t-o,m=Gg(f,g,u,c)/p;if(m<0||m>1)return!1;var v=Gg(f,g,h,d)/p;return!(v<0||v>1)}function Gg(e,t,n,r){return e*r-n*t}function Hg(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=Kr(t)?{formatter:t}:t,o=n.mainType,a=n.componentIndex,s={componentType:o,name:r,$vars:["name"]};s[o+"Index"]=a;var l=e.formatterParamsExtra;l&&Fr(Xr(l),(function(e){Ti(s,e)||(s[e]=l[e],s.$vars.push(e))}));var u=Ld(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:r,option:Or({content:r,formatterParams:s},i)}}function Ug(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Wg(e,t){if(e)if(Zr(e))for(var n=0;n<e.length;n++)Ug(e[n],t);else Ug(e,t)}wg("circle",tf),wg("ellipse",of),wg("sector",bf),wg("ring",Tf),wg("polygon",Df),wg("polyline",Lf),wg("rect",fd),wg("line",Rf),wg("bezierCurve",Ff),wg("arc",Uf);var Xg=Object.freeze({__proto__:null,Arc:Uf,BezierCurve:Ff,BoundingRect:Uo,Circle:tf,CompoundPath:Xf,Ellipse:of,Group:Kl,Image:ad,IncrementalDisplayable:og,Line:Rf,LinearGradient:Zf,OrientedBoundingRect:ng,Path:ed,Point:Po,Polygon:Df,Polyline:Lf,RadialGradient:Kf,Rect:fd,Ring:Tf,Sector:bf,Text:Id,applyTransform:Ng,clipPointsByRect:kg,clipRectByRect:zg,createIcon:Bg,extendPath:bg,extendShape:_g,getShapeClass:Sg,getTransform:Lg,groupTransition:Rg,initProps:cg,isElementRemoved:hg,lineLineIntersect:Fg,linePolygonIntersect:Vg,makeImage:Mg,makePath:Tg,mergePath:Cg,registerShape:wg,removeElement:dg,removeElementWithFadeOut:fg,resizePath:Dg,setTooltipConfig:Hg,subPixelOptimize:Ig,subPixelOptimizeLine:Eg,subPixelOptimizeRect:function(e){return ud(e.shape,e.shape,e.style),e},transformDirection:Pg,traverseElements:Wg,updateProps:ug}),jg={};function Yg(e,t){for(var n=0;n<Fd.length;n++){var r=Fd[n],i=t[r],o=e.ensureState(r);o.style=o.style||{},o.style.text=i}var a=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(a,!0)}function Zg(e,t,n){var r,i=e.labelFetcher,o=e.labelDataIndex,a=e.labelDimIndex,s=t.normal;i&&(r=i.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==r&&(r=qr(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:r},u=0;u<Fd.length;u++){var c=Fd[u],h=t[c];l[c]=li(i?i.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,r)}return l}function qg(e,t,n,r){n=n||jg;for(var i=e instanceof Id,o=!1,a=0;a<Gd.length;a++){if((d=t[Gd[a]])&&d.getShallow("show")){o=!0;break}}var s=i?e:e.getTextContent();if(o){i||(s||(s=new Id,e.setTextContent(s)),e.stateProxy&&(s.stateProxy=e.stateProxy));var l=Zg(n,t),u=t.normal,c=!!u.getShallow("show"),h=$g(u,r&&r.normal,n,!1,!i);h.text=l.normal,i||e.setTextConfig(Jg(u,n,!1));for(a=0;a<Fd.length;a++){var d,p=Fd[a];if(d=t[p]){var f=s.ensureState(p),g=!!li(d.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=$g(d,r&&r[p],n,!0,!i),f.style.text=l[p],!i)e.ensureState(p).textConfig=Jg(d,n,!0)}}s.silent=!!u.getShallow("silent"),null!=s.style.x&&(h.x=s.style.x),null!=s.style.y&&(h.y=s.style.y),s.ignore=!c,s.useStyle(h),s.dirty(),n.enableTextSetter&&(im(s).setLabelText=function(e){var r=Zg(n,t,e);Yg(s,r)})}else s&&(s.ignore=!0);e.dirty()}function Kg(e,t){t=t||"label";for(var n={normal:e.getModel(t)},r=0;r<Fd.length;r++){var i=Fd[r];n[i]=e.getModel([i,t])}return n}function $g(e,t,n,r,i){var o={};return function(e,t,n,r,i){n=n||jg;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){var t;for(;e&&e!==e.ecModel;){var n=(e.option||jg).rich;if(n){t=t||{};for(var r=Xr(n),i=0;i<r.length;i++){t[r[i]]=1}}e=e.parentModel}return t}(t);if(l)for(var u in o={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);nm(o[u]={},c,s,n,r,i,!1,!0)}o&&(e.rich=o);var h=t.get("overflow");h&&(e.overflow=h);var d=t.get("minMargin");null!=d&&(e.margin=d);nm(e,t,s,n,r,i,!0,!1)}(o,e,n,r,i),t&&Pr(o,t),o}function Jg(e,t,n){t=t||{};var r,i={},o=e.getShallow("rotate"),a=li(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(r=e.getShallow("position")||(n?null:"inside"))&&(r=t.defaultOutsidePosition||"top"),null!=r&&(i.position=r),null!=s&&(i.offset=s),null!=o&&(o*=Math.PI/180,i.rotation=o),null!=a&&(i.distance=a),i.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",i}var Qg=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],em=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],tm=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function nm(e,t,n,r,i,o,a,s){n=!i&&n||jg;var l=r&&r.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=li(t.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||("production"!==process.env.NODE_ENV&&"auto"===u&&Vu("color: 'auto'","color: 'inherit'"),u=l||null),"inherit"!==c&&"auto"!==c||("production"!==process.env.NODE_ENV&&"auto"===c&&Vu("color: 'auto'","color: 'inherit'"),c=l||null),o||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var d=li(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var p=li(t.getShallow("textBorderType"),n.textBorderType);null!=p&&(e.lineDash=p);var f=li(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(e.lineDashOffset=f),i||null!=h||s||(h=r&&r.defaultOpacity),null!=h&&(e.opacity=h),i||o||null==e.fill&&r.inheritColor&&(e.fill=r.inheritColor);for(var g=0;g<Qg.length;g++){var m=Qg[g];null!=(y=li(t.getShallow(m),n[m]))&&(e[m]=y)}for(g=0;g<em.length;g++){m=em[g];null!=(y=t.getShallow(m))&&(e[m]=y)}if(null==e.verticalAlign){var v=t.getShallow("baseline");null!=v&&(e.verticalAlign=v)}if(!a||!r.disableBox){for(g=0;g<tm.length;g++){var y;m=tm[g];null!=(y=t.getShallow(m))&&(e[m]=y)}var _=t.getShallow("borderType");null!=_&&(e.borderDash=_),"auto"!==e.backgroundColor&&"inherit"!==e.backgroundColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.backgroundColor&&Vu("backgroundColor: 'auto'","backgroundColor: 'inherit'"),e.backgroundColor=l),"auto"!==e.borderColor&&"inherit"!==e.borderColor||!l||("production"!==process.env.NODE_ENV&&"auto"===e.borderColor&&Vu("borderColor: 'auto'","borderColor: 'inherit'"),e.borderColor=l)}}function rm(e,t){var n=t&&t.getModel("textStyle");return pi([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var im=oc();function om(e,t,n,r){if(e){var i=im(e);i.prevValue=i.value,i.value=n;var o=t.normal;i.valueAnimation=o.get("valueAnimation"),i.valueAnimation&&(i.precision=o.get("precision"),i.defaultInterpolatedText=r,i.statesModels=t)}}function am(e,t,n,r,i){var o=im(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=li(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?cg:ug)(e,{percent:1},r,t,null,(function(r){var u=fc(n,o.precision,s,l,r);o.interpolatedValue=1===r?null:u;var c=Zg({labelDataIndex:t,labelFetcher:i,defaultText:a?a(u):u+""},o.statesModels,u);Yg(e,c)}))}}var sm,lm,um=["textStyle","color"],cm=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],hm=new Id,dm=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(um):null)},e.prototype.getFont=function(){return rm({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<cm.length;n++)t[cm[n]]=this.getShallow(cm[n]);return hm.useStyle(t),hm.update(),hm.getBoundingRect()},e}(),pm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],fm=Mc(pm),gm=function(){function e(){}return e.prototype.getLineStyle=function(e){return fm(this,e)},e}(),mm=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],vm=Mc(mm),ym=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return vm(this,e,t)},e}(),_m=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){},e.prototype.mergeOption=function(e,t){Lr(this.option,e,!0)},e.prototype.get=function(e,t){return null==e?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=null==n?n:n[e];if(null==r&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=null!=t,i=r?this.parsePath(t):null;return new e(r?this._doGet(i):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new(0,this.constructor)(Ir(this.option))},e.prototype.parsePath=function(e){return"string"==typeof e?e.split("."):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!sr.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&(!e[r]||null!=(n=n&&"object"==typeof n?n[e[r]]:null));r++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();_c(_m),sm=_m,lm=["__\0is_clz",bc++].join("_"),sm.prototype[lm]=!0,"production"!==process.env.NODE_ENV&&di(!sm.isInstance,'The method "is" can not be defined.'),sm.isInstance=function(e){return!(!e||!e[lm])},Br(_m,gm),Br(_m,ym),Br(_m,Cc),Br(_m,dm);var xm=_m,bm=Math.round(10*Math.random());function wm(e){return[e||"",bm++].join("_")}function Sm(e,t){return Lr(Lr({},e,!0),t,!0)}var Tm="ZH",Mm="EN",Am=Mm,Cm={},Dm={},Em=sr.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||Am).toUpperCase().indexOf(Tm)>-1?Tm:Am;function Im(e,t){e=e.toUpperCase(),Dm[e]=new xm(t),Cm[e]=t}function Lm(e){return Dm[e]}Im(Mm,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Im(Tm,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Nm=1e3,Pm=60*Nm,Om=60*Pm,Rm=24*Om,km=365*Rm,zm={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Bm="{yyyy}-{MM}-{dd}",Vm={year:"{yyyy}",month:"{yyyy}-{MM}",day:Bm,hour:Bm+" "+zm.hour,minute:Bm+" "+zm.minute,second:Bm+" "+zm.second,millisecond:zm.none},Fm=["year","month","day","hour","minute","second","millisecond"],Gm=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Hm(e,t){return"0000".substr(0,t-(e+="").length)+e}function Um(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function Wm(e){return e===Um(e)}function Xm(e,t,n,r){var i=bu(e),o=i[Zm(n)](),a=i[qm(n)]()+1,s=Math.floor((a-1)/3)+1,l=i[Km(n)](),u=i["get"+(n?"UTC":"")+"Day"](),c=i[$m(n)](),h=(c-1)%12+1,d=i[Jm(n)](),p=i[Qm(n)](),f=i[ev(n)](),g=(r instanceof xm?r:Lm(r||Em)||Dm[Am]).getModel("time"),m=g.get("month"),v=g.get("monthAbbr"),y=g.get("dayOfWeek"),_=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,Hm(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[a-1]).replace(/{MMM}/g,v[a-1]).replace(/{MM}/g,Hm(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,Hm(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Hm(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Hm(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Hm(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,Hm(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Hm(f,3)).replace(/{S}/g,f+"")}function jm(e,t){var n=bu(e),r=n[qm(t)]()+1,i=n[Km(t)](),o=n[$m(t)](),a=n[Jm(t)](),s=n[Qm(t)](),l=0===n[ev(t)](),u=l&&0===s,c=u&&0===a,h=c&&0===o,d=h&&1===i;return d&&1===r?"year":d?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function Ym(e,t,n){var r=Jr(e)?bu(e):e;switch(t=t||jm(e,n)){case"year":return r[Zm(n)]();case"half-year":return r[qm(n)]()>=6?1:0;case"quarter":return Math.floor((r[qm(n)]()+1)/4);case"month":return r[qm(n)]();case"day":return r[Km(n)]();case"half-day":return r[$m(n)]()/24;case"hour":return r[$m(n)]();case"minute":return r[Jm(n)]();case"second":return r[Qm(n)]();case"millisecond":return r[ev(n)]()}}function Zm(e){return e?"getUTCFullYear":"getFullYear"}function qm(e){return e?"getUTCMonth":"getMonth"}function Km(e){return e?"getUTCDate":"getDate"}function $m(e){return e?"getUTCHours":"getHours"}function Jm(e){return e?"getUTCMinutes":"getMinutes"}function Qm(e){return e?"getUTCSeconds":"getSeconds"}function ev(e){return e?"getUTCMilliseconds":"getMilliseconds"}function tv(e){return e?"setUTCFullYear":"setFullYear"}function nv(e){return e?"setUTCMonth":"setMonth"}function rv(e){return e?"setUTCDate":"setDate"}function iv(e){return e?"setUTCHours":"setHours"}function ov(e){return e?"setUTCMinutes":"setMinutes"}function av(e){return e?"setUTCSeconds":"setSeconds"}function sv(e){return e?"setUTCMilliseconds":"setMilliseconds"}function lv(e){if(!Du(e))return Kr(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function uv(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var cv=hi;function hv(e,t,n){function r(e){return e&&pi(e)?e:"-"}function i(e){return!(null==e||isNaN(e)||!isFinite(e))}var o="time"===t,a=e instanceof Date;if(o||a){var s=o?bu(e):e;if(!isNaN(+s))return Xm(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return $r(e)?r(e):Jr(e)&&i(e)?e+"":"-";var l=Cu(e);return i(l)?lv(l):$r(e)?r(e):"boolean"==typeof e?e+"":"-"}var dv=["a","b","c","d","e","f","g"],pv=function(e,t){return"{"+e+(null==t?"":t)+"}"};function fv(e,t,n){Zr(t)||(t=[t]);var r=t.length;if(!r)return"";for(var i=t[0].$vars||[],o=0;o<i.length;o++){var a=dv[o];e=e.replace(pv(a),pv(a,0))}for(var s=0;s<r;s++)for(var l=0;l<i.length;l++){var u=t[s][i[l]];e=e.replace(pv(dv[l],s),n?lo(u):u)}return e}function gv(e,t){var n=Kr(e)?{color:e,extraCssText:t}:e||{},r=n.color,i=n.type;t=n.extraCssText;var o=n.renderMode||"html";return r?"html"===o?"subItem"===i?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+lo(r)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+lo(r)+";"+(t||"")+'"></span>':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:""}function mv(e,t,n){"production"!==process.env.NODE_ENV&&Vu("echarts.format.formatTime","echarts.time.format"),"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var r=bu(t),i=n?"getUTC":"get",o=r[i+"FullYear"](),a=r[i+"Month"]()+1,s=r[i+"Date"](),l=r[i+"Hours"](),u=r[i+"Minutes"](),c=r[i+"Seconds"](),h=r[i+"Milliseconds"]();return e=e.replace("MM",Hm(a,2)).replace("M",a).replace("yyyy",o).replace("yy",Hm(o%100+"",2)).replace("dd",Hm(s,2)).replace("d",s).replace("hh",Hm(l,2)).replace("h",l).replace("mm",Hm(u,2)).replace("m",u).replace("ss",Hm(c,2)).replace("s",c).replace("SSS",Hm(h,3))}function vv(e,t){return t=t||"transparent",Kr(e)?e:Qr(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function yv(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var _v=Fr,xv=["left","right","top","bottom","width","height"],bv=[["width","left","right"],["height","top","bottom"]];function wv(e,t,n,r,i){var o=0,a=0;null==r&&(r=1/0),null==i&&(i=1/0);var s=0;t.eachChild((function(l,u){var c,h,d=l.getBoundingRect(),p=t.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===e){var g=d.width+(f?-f.x+d.x:0);(c=o+g)>r||l.newline?(o=0,c=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(h=a+m)>i||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===e?o=c+n:a=h+n)}))}var Sv=wv;function Tv(e,t,n){n=cv(n||0);var r=t.width,i=t.height,o=uu(e.left,r),a=uu(e.top,i),s=uu(e.right,r),l=uu(e.bottom,i),u=uu(e.width,r),c=uu(e.height,i),h=n[2]+n[0],d=n[1]+n[3],p=e.aspect;switch(isNaN(u)&&(u=r-s-d-o),isNaN(c)&&(c=i-l-h-a),null!=p&&(isNaN(u)&&isNaN(c)&&(p>r/i?u=.8*r:c=.8*i),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(o)&&(o=r-s-u-d),isNaN(a)&&(a=i-l-c-h),e.left||e.right){case"center":o=r/2-u/2-n[3];break;case"right":o=r-u-d}switch(e.top||e.bottom){case"middle":case"center":a=i/2-c/2-n[0];break;case"bottom":a=i-c-h}o=o||0,a=a||0,isNaN(u)&&(u=r-d-o-(s||0)),isNaN(c)&&(c=i-h-a-(l||0));var f=new Uo(o+n[3],a+n[0],u,c);return f.margin=n,f}function Mv(e,t,n,r,i,o){var a,s=!i||!i.hv||i.hv[0],l=!i||!i.hv||i.hv[1],u=i&&i.boundingMode||"all";if((o=o||e).x=e.x,o.y=e.y,!s&&!l)return!1;if("raw"===u)a="group"===e.type?new Uo(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(a=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(a=a.clone()).applyTransform(c)}var h=Tv(Or({width:a.width,height:a.height},t),n,r),d=s?h.x-a.x:0,p=l?h.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===e&&e.markRedraw(),!0}function Av(e){var t=e.layoutMode||e.constructor.layoutMode;return Qr(t)?t:t?{type:t}:null}function Cv(e,t,n){var r=n&&n.ignoreSize;!Zr(r)&&(r=[r,r]);var i=a(bv[0],0),o=a(bv[1],1);function a(n,i){var o={},a=0,u={},c=0;if(_v(n,(function(t){u[t]=e[t]})),_v(n,(function(e){s(t,e)&&(o[e]=u[e]=t[e]),l(o,e)&&a++,l(u,e)&&c++})),r[i])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&a){if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(e,d)){o[d]=e[d];break}}return o}return u}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,n){_v(e,(function(e){t[e]=n[e]}))}u(bv[0],e,i),u(bv[1],e,o)}function Dv(e){return Ev({},e)}function Ev(e,t){return t&&e&&_v(xv,(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}Yr(wv,"vertical"),Yr(wv,"horizontal");var Iv=oc(),Lv=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=wm("ec_cpt_model"),i}return g(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Av(this),r=n?Dv(e):{};Lr(e,t.getTheme().get(this.mainType)),Lr(e,this.getDefaultOption()),n&&Cv(e,r,n)},t.prototype.mergeOption=function(e,t){Lr(this.option,e,!0);var n=Av(this);n&&Cv(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!function(e){return!(!e||!e[vc])}(e))return e.defaultOption;var t=Iv(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var o={},a=n.length-1;a>=0;a--)o=Lr(o,n[a],!0);t.defaultOption=o}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",r=e+"Id";return hc(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(xm);xc(Lv,xm),Tc(Lv),function(e){var t={};e.registerSubTypeDefaulter=function(e,n){var r=yc(e);t[r.main]=n},e.determineSubType=function(n,r){var i=r.type;if(!i){var o=yc(n).main;e.hasSubTypes(n)&&t[o]&&(i=t[o](r))}return i}}(Lv),function(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,r,i,o){if(e.length){var a=function(e){var r={},i=[];return Fr(e,(function(o){var a=n(r,o),s=function(e,t){var n=[];return Fr(e,(function(e){kr(t,e)>=0&&n.push(e)})),n}(a.originalDeps=t(o),e);a.entryCount=s.length,0===a.entryCount&&i.push(o),Fr(s,(function(e){kr(a.predecessor,e)<0&&a.predecessor.push(e);var t=n(r,e);kr(t.successor,e)<0&&t.successor.push(o)}))})),{graph:r,noEntryList:i}}(r),s=a.graph,l=a.noEntryList,u={};for(Fr(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],d=!!u[c];d&&(i.call(o,c,h.originalDeps.slice()),delete u[c]),Fr(h.successor,d?f:p)}Fr(u,(function(){var t="";throw"production"!==process.env.NODE_ENV&&(t=Fu("Circular dependency may exists: ",u,e,r)),new Error(t)}))}function p(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,p(e)}}}(Lv,(function(e){var t=[];Fr(Lv.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=Gr(t,(function(e){return yc(e).main})),"dataset"!==e&&kr(t,"dataset")<=0&&t.unshift("dataset");return t}));var Nv=Lv,Pv="";"undefined"!=typeof navigator&&(Pv=navigator.platform||"");var Ov="rgba(0, 0, 0, 0.2)",Rv={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Ov,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Ov,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Ov,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Ov,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Ov,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Ov,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Pv.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},kv=xi(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),zv="original",Bv="arrayRows",Vv="objectRows",Fv="keyedColumns",Gv="typedArray",Hv="unknown",Uv="column",Wv="row",Xv={Must:1,Might:2,Not:3},jv=oc();function Yv(e,t,n){var r={},i=qv(t);if(!i||!e)return r;var o,a,s=[],l=[],u=t.ecModel,c=jv(u).datasetMap,h=i.uid+"_"+n.seriesLayoutBy;Fr(e=e.slice(),(function(t,n){var i=Qr(t)?t:e[n]={name:t};"ordinal"===i.type&&null==o&&(o=n,a=f(i)),r[i.name]=[]}));var d=c.get(h)||c.set(h,{categoryWayDim:a,valueWayDim:0});function p(e,t,n){for(var r=0;r<n;r++)e.push(t+r)}function f(e){var t=e.dimsDef;return t?t.length:1}return Fr(e,(function(e,t){var n=e.name,i=f(e);if(null==o){var a=d.valueWayDim;p(r[n],a,i),p(l,a,i),d.valueWayDim+=i}else if(o===t)p(r[n],0,i),p(s,0,i);else{a=d.categoryWayDim;p(r[n],a,i),p(l,a,i),d.categoryWayDim+=i}})),s.length&&(r.itemName=s),l.length&&(r.seriesName=l),r}function Zv(e,t,n){var r={};if(!qv(e))return r;var i,o=t.sourceFormat,a=t.dimensionsDefine;o!==Vv&&o!==Fv||Fr(a,(function(e,t){"name"===(Qr(e)?e.name:e)&&(i=t)}));var s=function(){for(var e={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=$v(t.data,o,t.seriesLayoutBy,a,t.startIndex,l);s.push(c);var h=c===Xv.Not;if(h&&null==e.v&&l!==i&&(e.v=l),(null==e.n||e.n===e.v||!h&&s[e.n]===Xv.Not)&&(e.n=l),d(e)&&s[e.n]!==Xv.Not)return e;h||(c===Xv.Might&&null==r.v&&l!==i&&(r.v=l),null!=r.n&&r.n!==r.v||(r.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function qv(e){if(!e.get("data",!0))return hc(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},uc).models[0]}function Kv(e,t){return $v(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function $v(e,t,n,r,i,o){var a,s,l;if(ti(e))return Xv.Not;if(r){var u=r[o];Qr(u)?(s=u.name,l=u.type):Kr(u)&&(s=u)}if(null!=l)return"ordinal"===l?Xv.Must:Xv.Not;if(t===Bv){var c=e;if(n===Wv){for(var h=c[o],d=0;d<(h||[]).length&&d<5;d++)if(null!=(a=_(h[i+d])))return a}else for(d=0;d<c.length&&d<5;d++){var p=c[i+d];if(p&&null!=(a=_(p[o])))return a}}else if(t===Vv){var f=e;if(!s)return Xv.Not;for(d=0;d<f.length&&d<5;d++){if((v=f[d])&&null!=(a=_(v[s])))return a}}else if(t===Fv){var g=e;if(!s)return Xv.Not;if(!(h=g[s])||ti(h))return Xv.Not;for(d=0;d<h.length&&d<5;d++)if(null!=(a=_(h[d])))return a}else if(t===zv){var m=e;for(d=0;d<m.length&&d<5;d++){var v,y=Zu(v=m[d]);if(!Zr(y))return Xv.Not;if(null!=(a=_(y[o])))return a}}function _(e){var t=Kr(e);return null!=e&&isFinite(e)&&""!==e?t?Xv.Might:Xv.Not:t&&"-"!==e?Xv.Must:void 0}return Xv.Not}var Jv=xi();var Qv,ey,ty,ny=oc(),ry=oc(),iy=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=Xu(this.get("color",!0)),i=this.get("colorLayer",!0);return ay(this,ny,r,i,e,t,n)},e.prototype.clearColorPalette=function(){!function(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}(this,ny)},e}();function oy(e,t,n,r){var i=Xu(e.get(["aria","decal","decals"]));return ay(e,ry,i,null,t,n,r)}function ay(e,t,n,r,i,o,a){var s=t(o=o||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=null!=a&&r?function(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}(r,a):n;if((c=c||n)&&c.length){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}var sy="\0_ec_inner",ly={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},uy={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},cy={};var hy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.init=function(e,t,n,r,i,o){r=r||{},this.option=null,this._theme=new xm(r),this._locale=new xm(i),this._optionManager=o},t.prototype.setOption=function(e,t,n){"production"!==process.env.NODE_ENV&&(di(null!=e,"option is null/undefined"),di(1!==e[sy],"please use chart.getOption()"));var r=fy(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,fy(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||"recreate"===e){var i=r.mountOption("recreate"===e);"production"!==process.env.NODE_ENV&&Fr(i,(function(e,t){if(!Nv.hasClass(t)){var n=ly[t];n&&!cy[n]&&(zu("Component "+t+" is used but not imported.\nimport { "+n+" } from 'echarts/components';\necharts.use(["+n+"]);"),cy[n]=!0)}})),this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(i,t)):ty(this,i),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var o=r.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,t))}if(!e||"recreate"===e||"media"===e){var a=r.getMediaOption(this);a.length&&Fr(a,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,o=[],a=xi(),s=t&&t.replaceMergeMainTypeMap;jv(this).datasetMap=xi(),Fr(e,(function(e,t){null!=e&&(Nv.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?Ir(e):Lr(n[t],e,!0))})),s&&s.each((function(e,t){Nv.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))})),Nv.topologicalTravel(o,Nv.getAllClassMainTypes(),(function(t){var o=function(e,t,n){var r=Jv.get(t);if(!r)return n;var i=r(e);if(!i)return n;if("production"!==process.env.NODE_ENV)for(var o=0;o<i.length;o++)di(rc(i[o]));return n.concat(i)}(this,t,Xu(e[t])),a=r.get(t),l=a?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=Ku(a,o,l);(function(e,t,n){Fr(e,(function(e){var r=e.newOption;Qr(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=function(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}(t,r,e.existing,n))}))})(u,t,Nv),n[t]=null,r.set(t,null),i.set(t,0);var c,h,d=[],p=[],f=0;Fr(u,(function(e,n){var r=e.existing,i=e.newOption;if(i){var o="series"===t,a=Nv.getClass(t,e.keyInfo.subType,!o);if(!a){if("production"!==process.env.NODE_ENV){var s=e.keyInfo.subType,l=uy[s];cy[s]||(cy[s]=!0,zu(l?"Series "+s+" is used but not imported.\nimport { "+l+" } from 'echarts/charts';\necharts.use(["+l+"]);":"Unknown series "+s))}return}if("tooltip"===t){if(c)return void("production"!==process.env.NODE_ENV&&(h||(ku("Currently only one tooltip component is allowed."),h=!0)));c=!0}if(r&&r.constructor===a)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var u=Pr({componentIndex:n},e.keyInfo);Pr(r=new a(i,this,this,u),u),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}else r&&(r.mergeOption({},this),r.optionUpdated({},!1));r?(d.push(r.option),p.push(r),f++):(d.push(void 0),p.push(void 0))}),this),n[t]=d,r.set(t,p),i.set(t,f),"series"===t&&Qv(this)}),this),this._seriesIndices||Qv(this)},t.prototype.getOption=function(){var e=Ir(this.option);return Fr(e,(function(t,n){if(Nv.hasClass(n)){for(var r=Xu(t),i=r.length,o=!1,a=i-1;a>=0;a--)r[a]&&!rc(r[a])?o=!0:(r[a]=null,!o&&i--);r.length=i,e[n]=r}})),delete e[sy],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(null==t)for(var i=0;i<n.length;i++)if(n[i])return n[i]}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n,r=e.index,i=e.id,o=e.name,a=this._componentsMap.get(t);return a&&a.length?(null!=r?(n=[],Fr(Xu(r),(function(e){a[e]&&n.push(a[e])}))):n=null!=i?dy("id",i,a):null!=o?dy("name",o,a):Ur(a,(function(e){return!!e})),py(n,e)):[]},t.prototype.findComponents=function(e){var t,n=e.query,r=e.mainType,i=function(e){var t=r+"Index",n=r+"Id",i=r+"Name";return!e||null==e[t]&&null==e[n]&&null==e[i]?null:{mainType:r,index:e[t],id:e[n],name:e[i]}}(n),o=i?this.queryComponents(i):Ur(this._componentsMap.get(r),(function(e){return!!e}));return t=py(o,e),e.filter?Ur(t,e.filter):t},t.prototype.eachComponent=function(e,t,n){var r=this._componentsMap;if(qr(e)){var i=t,o=e;r.each((function(e,t){for(var n=0;e&&n<e.length;n++){var r=e[n];r&&o.call(i,t,r,r.componentIndex)}}))}else for(var a=Kr(e)?r.get(e):Qr(e)?this.findComponents(e):null,s=0;a&&s<a.length;s++){var l=a[s];l&&t.call(n,l,l.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=Qu(e,null);return Ur(this._componentsMap.get("series"),(function(e){return!!e&&null!=t&&e.name===t}))},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return Ur(this._componentsMap.get("series"),(function(t){return!!t&&t.subType===e}))},t.prototype.getSeries=function(){return Ur(this._componentsMap.get("series"),(function(e){return!!e}))},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){ey(this),Fr(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];e.call(t,r,n)}),this)},t.prototype.eachRawSeries=function(e,t){Fr(this._componentsMap.get("series"),(function(n){n&&e.call(t,n,n.componentIndex)}))},t.prototype.eachSeriesByType=function(e,t,n){ey(this),Fr(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];i.subType===e&&t.call(n,i,r)}),this)},t.prototype.eachRawSeriesByType=function(e,t,n){return Fr(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return ey(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){ey(this);var n=[];Fr(this._seriesIndices,(function(r){var i=this._componentsMap.get("series")[r];e.call(t,i,r)&&n.push(r)}),this),this._seriesIndices=n,this._seriesIndicesMap=xi(n)},t.prototype.restoreData=function(e){Qv(this);var t=this._componentsMap,n=[];t.each((function(e,t){Nv.hasClass(t)&&n.push(t)})),Nv.topologicalTravel(n,Nv.getAllClassMainTypes(),(function(n){Fr(t.get(n),(function(t){!t||"series"===n&&function(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,i=t.seriesName;return null!=n&&e.componentIndex!==n||null!=r&&e.id!==r||null!=i&&e.name!==i}}(t,e)||t.restoreData()}))}))},t.internalField=(Qv=function(e){var t=e._seriesIndices=[];Fr(e._componentsMap.get("series"),(function(e){e&&t.push(e.componentIndex)})),e._seriesIndicesMap=xi(t)},ey=function(e){if("production"!==process.env.NODE_ENV&&!e._seriesIndices)throw new Error("Option should contains series.")},void(ty=function(e,t){e.option={},e.option[sy]=1,e._componentsMap=xi({series:[]}),e._componentsCount=xi();var n=t.aria;Qr(n)&&null==n.enabled&&(n.enabled=!0),function(e,t){var n=e.color&&!e.colorLayer;Fr(t,(function(t,r){"colorLayer"===r&&n||Nv.hasClass(r)||("object"==typeof t?e[r]=e[r]?Lr(e[r],t,!1):Ir(t):null==e[r]&&(e[r]=t))}))}(t,e._theme.option),Lr(t,Rv,!1),e._mergeOption(t,null)})),t}(xm);function dy(e,t,n){if(Zr(t)){var r=xi();return Fr(t,(function(e){null!=e&&(null!=Qu(e,null)&&r.set(e,!0))})),Ur(n,(function(t){return t&&r.get(t[e])}))}var i=Qu(t,null);return Ur(n,(function(t){return t&&null!=i&&t[e]===i}))}function py(e,t){return t.hasOwnProperty("subType")?Ur(e,(function(e){return e&&e.subType===t.subType})):e}function fy(e){var t=xi();return e&&Fr(Xu(e.replaceMerge),(function(e){"production"!==process.env.NODE_ENV&&di(Nv.hasClass(e),'"'+e+'" is not valid component main type in "replaceMerge"'),t.set(e,!0)})),{replaceMergeMainTypeMap:t}}Br(hy,iy);var gy=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],my=function(e){Fr(gy,(function(t){this[t]=jr(e[t],e)}),this)},vy={},yy=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];Fr(vy,(function(r,i){var o=r.create(e,t);n=n.concat(o||[])})),this._coordinateSystems=n},e.prototype.update=function(e,t){Fr(this._coordinateSystems,(function(n){n.update&&n.update(e,t)}))},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){vy[e]=t},e.get=function(e){return vy[e]},e}(),_y=/^(min|max)?(.+)$/,xy=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(Fr(Xu(e.series),(function(e){e&&e.data&&ti(e.data)&&gi(e.data)})),Fr(Xu(e.dataset),(function(e){e&&e.source&&ti(e.source)&&gi(e.source)}))),e=Ir(e);var r=this._optionBackup,i=function(e,t,n){var r,i,o=[],a=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||a&&a.timeline);a?(i=a).timeline||(i.timeline=s):((h||c)&&(e.options=e.media=null),i=e);c&&(Zr(u)?Fr(u,(function(e){"production"!==process.env.NODE_ENV&&e&&!e.option&&Qr(e.query)&&Qr(e.query.option)&&zu("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),e&&e.option&&(e.query?o.push(e):r||(r=e))})):"production"!==process.env.NODE_ENV&&zu("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function d(e){Fr(t,(function(t){t(e,n)}))}return d(i),Fr(l,(function(e){return d(e)})),Fr(o,(function(e){return d(e.option)})),{baseOption:i,timelineOptions:l||[],mediaDefault:r,mediaList:o}}(e,t,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],Ir(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var r=e.getComponent("timeline");r&&(t=Ir(n[r.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t,n,r=this._api.getWidth(),i=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,c=o.length;u<c;u++)by(o[u].query,r,i)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(t=s,n=this._currentMediaIndices,t.join(",")!==n.join(","))&&(l=Gr(s,(function(e){return Ir(-1===e?a.option:o[e].option)}))),this._currentMediaIndices=s,l},e}();function by(e,t,n){var r={width:t,height:n,aspectratio:t/n},i=!0;return Fr(e,(function(e,t){var n=t.match(_y);if(n&&n[1]&&n[2]){var o=n[1],a=n[2].toLowerCase();(function(e,t,n){return"min"===n?e>=t:"max"===n?e<=t:e===t})(r[a],e,o)||(i=!1)}})),i}var wy=Fr,Sy=Qr,Ty=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function My(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=Ty.length;n<r;n++){var i=Ty[n],o=t.normal,a=t.emphasis;o&&o[i]&&("production"!==process.env.NODE_ENV&&Vu("itemStyle.normal."+i,i),e[i]=e[i]||{},e[i].normal?Lr(e[i].normal,o[i]):e[i].normal=o[i],o[i]=null),a&&a[i]&&("production"!==process.env.NODE_ENV&&Vu("itemStyle.emphasis."+i,"emphasis."+i),e[i]=e[i]||{},e[i].emphasis?Lr(e[i].emphasis,a[i]):e[i].emphasis=a[i],a[i]=null)}}function Ay(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,i=e[t].emphasis;r&&("production"!==process.env.NODE_ENV&&Bu("'normal' hierarchy in "+t+" has been removed since 4.0. All style properties are configured in "+t+" directly now."),n?(e[t].normal=e[t].emphasis=null,Or(e[t],r)):e[t]=r),i&&("production"!==process.env.NODE_ENV&&Bu(t+".emphasis has been changed to emphasis."+t+" since 4.0"),e.emphasis=e.emphasis||{},e.emphasis[t]=i,i.focus&&(e.emphasis.focus=i.focus),i.blurScope&&(e.emphasis.blurScope=i.blurScope))}}function Cy(e){Ay(e,"itemStyle"),Ay(e,"lineStyle"),Ay(e,"areaStyle"),Ay(e,"label"),Ay(e,"labelLine"),Ay(e,"upperLabel"),Ay(e,"edgeLabel")}function Dy(e,t){var n=Sy(e)&&e[t],r=Sy(n)&&n.textStyle;if(r){"production"!==process.env.NODE_ENV&&Bu("textStyle hierarchy in "+t+" has been removed since 4.0. All textStyle properties are configured in "+t+" directly now.");for(var i=0,o=Yu.length;i<o;i++){var a=Yu[i];r.hasOwnProperty(a)&&(n[a]=r[a])}}}function Ey(e){e&&(Cy(e),Dy(e,"label"),e.emphasis&&Dy(e.emphasis,"label"))}function Iy(e){return Zr(e)?e:e?[e]:[]}function Ly(e){return(Zr(e)?e[0]:e)||{}}function Ny(e,t){wy(Iy(e.series),(function(e){Sy(e)&&function(e){if(Sy(e)){My(e),Cy(e),Dy(e,"label"),Dy(e,"upperLabel"),Dy(e,"edgeLabel"),e.emphasis&&(Dy(e.emphasis,"label"),Dy(e.emphasis,"upperLabel"),Dy(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(My(t),Ey(t));var n=e.markLine;n&&(My(n),Ey(n));var r=e.markArea;r&&Ey(r);var i=e.data;if("graph"===e.type){i=i||e.nodes;var o=e.links||e.edges;if(o&&!ti(o))for(var a=0;a<o.length;a++)Ey(o[a]);Fr(e.categories,(function(e){Cy(e)}))}if(i&&!ti(i))for(a=0;a<i.length;a++)Ey(i[a]);if((t=e.markPoint)&&t.data){var s=t.data;for(a=0;a<s.length;a++)Ey(s[a])}if((n=e.markLine)&&n.data){var l=n.data;for(a=0;a<l.length;a++)Zr(l[a])?(Ey(l[a][0]),Ey(l[a][1])):Ey(l[a])}"gauge"===e.type?(Dy(e,"axisLabel"),Dy(e,"title"),Dy(e,"detail")):"treemap"===e.type?(Ay(e.breadcrumb,"itemStyle"),Fr(e.levels,(function(e){Cy(e)}))):"tree"===e.type&&Cy(e.leaves)}}(e)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),wy(n,(function(t){wy(Iy(e[t]),(function(e){e&&(Dy(e,"axisLabel"),Dy(e.axisPointer,"label"))}))})),wy(Iy(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;Dy(t,"axisLabel"),Dy(t&&t.axisPointer,"label")})),wy(Iy(e.calendar),(function(e){Ay(e,"itemStyle"),Dy(e,"dayLabel"),Dy(e,"monthLabel"),Dy(e,"yearLabel")})),wy(Iy(e.radar),(function(e){Dy(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name,"production"!==process.env.NODE_ENV&&Bu("name property in radar component has been changed to axisName")),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap,"production"!==process.env.NODE_ENV&&Bu("nameGap property in radar component has been changed to axisNameGap")),"production"!==process.env.NODE_ENV&&wy(e.indicator,(function(e){e.text&&Vu("text","name","radar.indicator")}))})),wy(Iy(e.geo),(function(e){Sy(e)&&(Ey(e),wy(Iy(e.regions),(function(e){Ey(e)})))})),wy(Iy(e.timeline),(function(e){Ey(e),Ay(e,"label"),Ay(e,"itemStyle"),Ay(e,"controlStyle",!0);var t=e.data;Zr(t)&&Fr(t,(function(e){Qr(e)&&(Ay(e,"label"),Ay(e,"itemStyle"))}))})),wy(Iy(e.toolbox),(function(e){Ay(e,"iconStyle"),wy(e.feature,(function(e){Ay(e,"iconStyle")}))})),Dy(Ly(e.axisPointer),"label"),Dy(Ly(e.tooltip).axisPointer,"label")}function Py(e){e&&Fr(Oy,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var Oy=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Ry=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],ky=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function zy(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<ky.length;n++){var r=ky[n][1],i=ky[n][0];null!=t[r]&&(t[i]=t[r],"production"!==process.env.NODE_ENV&&Vu(r,i))}}function By(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&("production"!==process.env.NODE_ENV&&Vu("label.margin","label.edgeDistance","pie"),e.edgeDistance=e.margin)}function Vy(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay,"production"!==process.env.NODE_ENV&&Vu("downplay","blur","sunburst"))}function Fy(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&Fy(e[n].children,t)}function Gy(e,t){Ny(e,t),e.series=Xu(e.series),Fr(e.series,(function(e){if(Qr(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow,"production"!==process.env.NODE_ENV&&Vu("clipOverflow","clip","line"));else if("pie"===t||"gauge"===t){if(null!=e.clockWise&&(e.clockwise=e.clockWise,"production"!==process.env.NODE_ENV&&Vu("clockWise","clockwise")),By(e.label),(i=e.data)&&!ti(i))for(var n=0;n<i.length;n++)By(i[n]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&("production"!==process.env.NODE_ENV&&Vu("hoverOffset","emphasis.scaleSize"),e.emphasis.scaleSize=e.hoverOffset))}else if("gauge"===t){var r=function(e,t){for(var n=t.split(","),r=e,i=0;i<n.length&&null!=(r=r&&r[n[i]]);i++);return r}(e,"pointer.color");null!=r&&function(e,t,n,r){for(var i,o=t.split(","),a=e,s=0;s<o.length-1;s++)null==a[i=o[s]]&&(a[i]={}),a=a[i];null==a[o[s]]&&(a[o[s]]=n)}(e,"itemStyle.color",r)}else if("bar"===t){var i;if(zy(e),zy(e.backgroundStyle),zy(e.emphasis),(i=e.data)&&!ti(i))for(n=0;n<i.length;n++)"object"==typeof i[n]&&(zy(i[n]),zy(i[n]&&i[n].emphasis))}else if("sunburst"===t){var o=e.highlightPolicy;o&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=o,"production"!==process.env.NODE_ENV&&Vu("highlightPolicy","emphasis.focus","sunburst"))),Vy(e),Fy(e.data,Vy)}else"graph"===t||"sankey"===t?function(e){e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&("production"!==process.env.NODE_ENV&&Vu("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),e.emphasis.focus="adjacency"))}(e):"map"===t&&(e.mapType&&!e.map&&("production"!==process.env.NODE_ENV&&Vu("mapType","map","map"),e.map=e.mapType),e.mapLocation&&("production"!==process.env.NODE_ENV&&Bu("`mapLocation` is not used anymore."),Or(e,e.mapLocation)));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&("production"!==process.env.NODE_ENV&&Vu("hoverAnimation","emphasis.scale"),e.emphasis.scale=e.hoverAnimation)),Py(e)}})),e.dataRange&&(e.visualMap=e.dataRange),Fr(Ry,(function(t){var n=e[t];n&&(Zr(n)||(n=[n]),Fr(n,(function(e){Py(e)})))}))}function Hy(e){Fr(e,(function(t,n){var r=[],i=[NaN,NaN],o=[t.stackResultDimension,t.stackedOverDimension],a=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";a.modify(o,(function(o,u,c){var h,d,p=a.get(t.stackedDimension,c);if(isNaN(p))return i;s?d=a.getRawIndex(c):h=a.get(t.stackedByDimension,c);for(var f=NaN,g=n-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=mu(p,v),f=v;break}}}return r[0]=p,r[1]=f,r}))}))}var Uy,Wy,Xy,jy,Yy,Zy=function(e){this.data=e.data||(e.sourceFormat===Fv?{}:[]),this.sourceFormat=e.sourceFormat||Hv,this.seriesLayoutBy=e.seriesLayoutBy||Uv,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];null==r.type&&Kv(this,n)===Xv.Must&&(r.type="ordinal")}};function qy(e){return e instanceof Zy}function Ky(e,t,n){n=n||Jy(e);var r=t.seriesLayoutBy,i=function(e,t,n,r,i){var o,a;if(!e)return{dimensionsDefine:Qy(i),startIndex:a,dimensionsDetectedCount:o};if(t===Bv){var s=e;"auto"===r||null==r?e_((function(e){null!=e&&"-"!==e&&(Kr(e)?null==a&&(a=1):a=0)}),n,s,10):a=Jr(r)?r:r?1:0,i||1!==a||(i=[],e_((function(e,t){i[t]=null!=e?e+"":""}),n,s,1/0)),o=i?i.length:n===Wv?s.length:s[0]?s[0].length:null}else if(t===Vv)i||(i=function(e){var t,n=0;for(;n<e.length&&!(t=e[n++]););if(t)return Xr(t)}(e));else if(t===Fv)i||(i=[],Fr(e,(function(e,t){i.push(t)})));else if(t===zv){var l=Zu(e[0]);o=Zr(l)&&l.length||1}else t===Gv&&"production"!==process.env.NODE_ENV&&di(!!i,"dimensions must be given if data is TypedArray.");return{startIndex:a,dimensionsDefine:Qy(i),dimensionsDetectedCount:o}}(e,n,r,t.sourceHeader,t.dimensions);return new Zy({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:Ir(t)})}function $y(e){return new Zy({data:e,sourceFormat:ti(e)?Gv:zv})}function Jy(e){var t=Hv;if(ti(e))t=Gv;else if(Zr(e)){0===e.length&&(t=Bv);for(var n=0,r=e.length;n<r;n++){var i=e[n];if(null!=i){if(Zr(i)||ti(i)){t=Bv;break}if(Qr(i)){t=Vv;break}}}}else if(Qr(e))for(var o in e)if(Ti(e,o)&&Vr(e[o])){t=Fv;break}return t}function Qy(e){if(e){var t=xi();return Gr(e,(function(e,n){var r={name:(e=Qr(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==r.name)return r;r.name+="",null==r.displayName&&(r.displayName=r.name);var i=t.get(r.name);return i?r.name+="-"+i.count++:t.set(r.name,{count:1}),r}))}}function e_(e,t,n,r){if(t===Wv)for(var i=0;i<n.length&&i<r;i++)e(n[i]?n[i][0]:null,i);else{var o=n[0]||[];for(i=0;i<o.length&&i<r;i++)e(o[i],i)}}function t_(e){var t=e.sourceFormat;return t===Vv||t===Fv}var n_=function(){function e(e,t){var n=qy(e)?e:$y(e);this._source=n;var r=this._data=n.data;if(n.sourceFormat===Gv){if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=t,this._data=r}Yy(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;Yy=function(e,i,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine,c=jy[d_(a,s)];if("production"!==process.env.NODE_ENV&&di(c,"Invalide sourceFormat: "+a),Pr(e,c),a===Gv)e.getItem=t,e.count=r,e.fillStorage=n;else{var h=o_(a,s);e.getItem=jr(h,null,i,l,u);var d=l_(a,s);e.count=jr(d,null,i,l,u)}};var t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,r=this._dimSize,i=r*e,o=0;o<r;o++)t[o]=n[i+o];return t},n=function(e,t,n,r){for(var i=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=r[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[a],d=0;d<c;d++){var p=i[d*o+a];h[e+d]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},r=function(){return this._data?this._data.length/this._dimSize:0};function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[Bv+"_"+Uv]={pure:!0,appendData:i},e[Bv+"_"+Wv]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Vv]={pure:!0,appendData:i},e[Fv]={pure:!0,appendData:function(e){var t=this._data;Fr(e,(function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])}))}},e[zv]={appendData:i},e[Gv]={persistent:!1,pure:!0,appendData:function(e){"production"!==process.env.NODE_ENV&&di(ti(e),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},jy=e}(),e}(),r_=function(e,t,n,r){return e[r]},i_=((Uy={})[Bv+"_"+Uv]=function(e,t,n,r){return e[r+t]},Uy[Bv+"_"+Wv]=function(e,t,n,r,i){r+=t;for(var o=i||[],a=e,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[r]:null}return o},Uy[Vv]=r_,Uy[Fv]=function(e,t,n,r,i){for(var o=i||[],a=0;a<n.length;a++){var s=n[a].name;if("production"!==process.env.NODE_ENV&&null==s)throw new Error;var l=e[s];o[a]=l?l[r]:null}return o},Uy[zv]=r_,Uy);function o_(e,t){var n=i_[d_(e,t)];return"production"!==process.env.NODE_ENV&&di(n,'Do not support get item on "'+e+'", "'+t+'".'),n}var a_=function(e,t,n){return e.length},s_=((Wy={})[Bv+"_"+Uv]=function(e,t,n){return Math.max(0,e.length-t)},Wy[Bv+"_"+Wv]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},Wy[Vv]=a_,Wy[Fv]=function(e,t,n){var r=n[0].name;if("production"!==process.env.NODE_ENV&&null==r)throw new Error;var i=e[r];return i?i.length:0},Wy[zv]=a_,Wy);function l_(e,t){var n=s_[d_(e,t)];return"production"!==process.env.NODE_ENV&&di(n,'Do not support count on "'+e+'", "'+t+'".'),n}var u_=function(e,t,n){return e[t]},c_=((Xy={})[Bv]=u_,Xy[Vv]=function(e,t,n){return e[n]},Xy[Fv]=u_,Xy[zv]=function(e,t,n){var r=Zu(e);return r instanceof Array?r[t]:r},Xy[Gv]=u_,Xy);function h_(e){var t=c_[e];return"production"!==process.env.NODE_ENV&&di(t,'Do not support get value on "'+e+'".'),t}function d_(e,t){return e===Bv?e+"_"+t:e}function p_(e,t,n){if(e){var r=e.getRawDataItem(t);if(null!=r){var i=e.getStore(),o=i.getSource().sourceFormat;if(null!=n){var a=e.getDimensionIndex(n),s=i.getDimensionProperty(a);return h_(o)(r,a,s)}var l=r;return o===zv&&(l=Zu(r)),l}}}var f_=/\{@(.+?)\}/g,g_=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),o=n.getName(e),a=n.getRawDataItem(e),s=n.getItemVisual(e,"style"),l=s&&s[n.getItemVisual(e,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,h="series"===c,d=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:a,dataType:t,value:r,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,o){t=t||"normal";var a=this.getData(n),s=this.getDataParams(e,n);(o&&(s.value=o.interpolatedValue),null!=r&&Zr(s.value)&&(s.value=s.value[r]),i)||(i=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"]));return qr(i)?(s.status=t,s.dimensionIndex=r,i(s)):Kr(i)?fv(i,s).replace(f_,(function(t,n){var r=n.length,i=n;"["===i.charAt(0)&&"]"===i.charAt(r-1)&&(i=+i.slice(1,r-1),"production"!==process.env.NODE_ENV&&isNaN(i)&&zu("Invalide label formatter: @"+n+", only support @[0], @[1], @[2], ..."));var s=p_(a,e,i);if(o&&Zr(o.interpolatedValue)){var l=a.getDimensionIndex(i);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},e.prototype.getRawValue=function(e,t){return p_(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function m_(e){var t,n;return Qr(e)?e.type?n=e:"production"!==process.env.NODE_ENV&&console.warn("The return type of `formatTooltip` is not supported: "+Fu(e)):t=e,{text:t,frag:n}}function v_(e){return new y_(e)}var y_=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n=this._upstream,r=e&&e.skip;if(this._dirty&&n){var i=this.context;i.data=i.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(t=this._plan(this.context));var o,a=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;function c(e){return!(e>=1)&&(e=1),e}a===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,o=this._doReset(r)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(n?("production"!==process.env.NODE_ENV&&di(null!=n._outputDueEnd),this._dueEnd=n._outputDueEnd):("production"!==process.env.NODE_ENV&&di(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var d=this._dueIndex,p=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!r&&(o||d<p)){var f=this._progress;if(Zr(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],d,p,l,u);else this._doProgress(f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;"production"!==process.env.NODE_ENV&&di(m>=this._outputDueEnd),this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){__.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:__.next},this.context)},e.prototype._doReset=function(e){var t,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!e&&this._reset&&((t=this._reset(this.context))&&t.progress&&(n=t.forceFirstProgress,t=t.progress),Zr(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){"production"!==process.env.NODE_ENV&&di(e&&!e._disposed&&e!==this),(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),__=function(){var e,t,n,r,i,o={reset:function(l,u,c,h){t=l,e=u,n=c,r=h,i=Math.ceil(r/n),o.next=n>1&&r>0?s:a}};return o;function a(){return t<e?t++:null}function s(){var o=t%i*n+Math.ceil(t/i),a=t>=e?null:o<r?o:t;return t++,a}}();function x_(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||Jr(e)||null==e||"-"===e||(e=+bu(e)),null==e||""===e?NaN:+e)}var b_=xi({number:function(e){return parseFloat(e)},time:function(e){return+bu(e)},trim:function(e){return Kr(e)?pi(e):e}});function w_(e){return b_.get(e)}var S_={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},T_=function(){function e(e,t){if(!Jr(t)){var n="";"production"!==process.env.NODE_ENV&&(n='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),Gu(n)}this._opFn=S_[e],this._rvalFloat=Cu(t)}return e.prototype.evaluate=function(e){return Jr(e)?this._opFn(e,this._rvalFloat):this._opFn(Cu(e),this._rvalFloat)},e}(),M_=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=Jr(e)?e:Cu(e),r=Jr(t)?t:Cu(t),i=isNaN(n),o=isNaN(r);if(i&&(n=this._incomparable),o&&(r=this._incomparable),i&&o){var a=Kr(e),s=Kr(t);a&&(n=s?e:0),s&&(r=a?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),A_=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Cu(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=Cu(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function C_(e,t){return"eq"===e||"ne"===e?new A_("eq"===e,t):Ti(S_,e)?new T_(e,t):null}var D_=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return x_(e,t)},e}();function E_(e){var t=e.sourceFormat;if(!R_(t)){var n="";"production"!==process.env.NODE_ENV&&(n="`getRawData` is not supported in source format "+t),Gu(n)}return e.data}function I_(e){var t=e.sourceFormat,n=e.data;if(!R_(t)){var r="";"production"!==process.env.NODE_ENV&&(r="`cloneRawData` is not supported in source format "+t),Gu(r)}if(t===Bv){for(var i=[],o=0,a=n.length;o<a;o++)i.push(n[o].slice());return i}if(t===Vv){for(i=[],o=0,a=n.length;o<a;o++)i.push(Pr({},n[o]));return i}}function L_(e,t,n){if(null!=n)return Jr(n)||!isNaN(n)&&!Ti(t,n)?e[n]:Ti(t,n)?t[n]:void 0}function N_(e){return Ir(e)}var P_=xi();function O_(e,t,n,r){var i="";t.length||("production"!==process.env.NODE_ENV&&(i="Must have at least one upstream dataset."),Gu(i)),Qr(e)||("production"!==process.env.NODE_ENV&&(i="transform declaration must be an object rather than "+typeof e+"."),Gu(i));var o=e.type,a=P_.get(o);a||("production"!==process.env.NODE_ENV&&(i='Can not find transform on type "'+o+'".'),Gu(i));var s,l=Gr(t,(function(e){return function(e,t){var n=new D_,r=e.data,i=n.sourceFormat=e.sourceFormat,o=e.startIndex,a="";e.seriesLayoutBy!==Uv&&("production"!==process.env.NODE_ENV&&(a='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),Gu(a));var s=[],l={},u=e.dimensionsDefine;if(u)Fr(u,(function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};if(s.push(r),null!=n){var i="";Ti(l,n)&&("production"!==process.env.NODE_ENV&&(i='dimension name "'+n+'" duplicated.'),Gu(i)),l[n]=r}}));else for(var c=0;c<e.dimensionsDetectedCount;c++)s.push({index:c});var h=o_(i,Uv);t.__isBuiltIn&&(n.getRawDataItem=function(e){return h(r,o,s,e)},n.getRawData=jr(E_,null,e)),n.cloneRawData=jr(I_,null,e);var d=l_(i,Uv);n.count=jr(d,null,r,o,s);var p=h_(i);n.retrieveValue=function(e,t){var n=h(r,o,s,e);return f(n,t)};var f=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=s[t];return n?p(e,t,n.name):void 0}};return n.getDimensionInfo=jr(L_,null,s,l),n.cloneAllDimensionInfo=jr(N_,null,s),n}(e,a)})),u=Xu(a.transform({upstream:l[0],upstreamList:l,config:Ir(e.config)}));if("production"!==process.env.NODE_ENV&&e.print){var c=Gr(u,(function(e){var t=null!=r?" === pipe index: "+r:"";return["=== dataset index: "+n.datasetIndex+t+" ===","- transform result data:",Fu(e.data),"- transform result dimensions:",Fu(e.dimensions)].join("\n")})).join("\n");Ru("log",c,s)}return Gr(u,(function(e,n){var r,i="";Qr(e)||("production"!==process.env.NODE_ENV&&(i="A transform should not return some empty results."),Gu(i)),e.data||("production"!==process.env.NODE_ENV&&(i="Transform result data should be not be null or undefined"),Gu(i)),R_(Jy(e.data))||("production"!==process.env.NODE_ENV&&(i="Transform result data should be array rows or object rows."),Gu(i));var o=t[0];if(o&&0===n&&!e.dimensions){var a=o.startIndex;a&&(e.data=o.data.slice(0,a).concat(e.data)),r={seriesLayoutBy:Uv,sourceHeader:a,dimensions:o.metaRawOption.dimensions}}else r={seriesLayoutBy:Uv,sourceHeader:0,dimensions:e.dimensions};return Ky(e.data,r,null)}))}function R_(e){return e===Bv||e===Vv}var k_,z_="undefined",B_=typeof Uint32Array===z_?Array:Uint32Array,V_=typeof Uint16Array===z_?Array:Uint16Array,F_=typeof Int32Array===z_?Array:Int32Array,G_=typeof Float64Array===z_?Array:Float64Array,H_={float:G_,int:F_,ordinal:Array,number:Array,time:G_};function U_(e){return e>65535?B_:V_}function W_(e,t,n,r,i){var o=H_[n||"float"];if(i){var a=e[t],s=a&&a.length;if(s!==r){for(var l=new o(r),u=0;u<s;u++)l[u]=a[u];e[t]=l}}else e[t]=new o(r)}var X_=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=xi()}return e.prototype.initData=function(e,t,n){"production"!==process.env.NODE_ENV&&di(qr(e.getItem)&&qr(e.count),"Invalid data provider."),this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=k_[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[];var o=t_(r);this._dimensions=Gr(t,(function(e){return"production"!==process.env.NODE_ENV&&o&&di(null!=e.property),{type:e.type,property:e.property}})),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(null!=i){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new H_[t||"float"](this._rawCount),this._rawExtent[i]=[1/0,-1/0],i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,o=r.ordinalOffset||0,a=n.length;0===o&&(i[e]=[1/0,-1/0]);for(var s=i[e],l=o;l<a;l++){var u=n[l]=t.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}r.ordinalMeta=t,r.ordinalOffset=a,r.type="ordinal"},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){"production"!==process.env.NODE_ENV&&di(!this._indices,"appendData can only be called on raw data.");var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,o=this._rawExtent,a=this.count(),s=a+Math.max(e.length,t||0),l=0;l<i;l++){W_(n,l,(p=r[l]).type,s,!0)}for(var u=[],c=a;c<s;c++)for(var h=c-a,d=0;d<i;d++){var p=r[d],f=k_.arrayRows.call(this,e[h]||u,p.property,h,d);n[d][c]=f;var g=o[d];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=Gr(o,(function(e){return e.property})),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=[1/0,-1/0]),W_(i,u,c.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var h=[],d=e;d<t;d++){h=r.getItem(d,h);for(var p=0;p<a;p++){var f=i[p],g=this._dimValueGetter(h,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(null==t){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;i=0;for(var o=r.length;i<o;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=0;if(this._chunks[e])for(var n=0,r=this.count();n<r;n++){var i=this.get(e,n);isNaN(i)||(t+=i)}return t},e.prototype.getMedian=function(e){var t=[];this.each([e],(function(e){isNaN(e)||t.push(e)}));var n=t.sort((function(e,t){return e-t})),r=this.count();return 0===r?0:r%2==1?n[(r-1)/2]:(n[r/2]+n[r/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var o=(r+i)/2|0;if(t[o]<e)r=o+1;else{if(!(t[o]>e))return o;i=o-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var r=this._chunks[e],i=[];if(!r)return i;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-r[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<o||h===o&&c>=0&&a<0)&&(o=h,a=c,s=0),c===a&&(i[s++]=l))}return i.length=s,i},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{e=new(n=U_(this._rawCount))(this.count());for(i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(U_(n._rawCount))(r),o=[],a=e.length,s=0,l=e[0],u=n._chunks,c=0;c<r;c++){var h=void 0,d=n.getRawIndex(c);if(0===a)h=t(c);else if(1===a){h=t(u[l][d],c)}else{for(var p=0;p<a;p++)o[p]=u[e[p]][d];o[p]=c,h=t.apply(null,o)}h&&(i[s++]=d)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=Xr(e),i=r.length;if(!i)return this;var o=t.count(),a=new(U_(t._rawCount))(o),s=0,l=r[0],u=e[l][0],c=e[l][1],h=t._chunks,d=!1;if(!t._indices){var p=0;if(1===i){for(var f=h[r[0]],g=0;g<n;g++){((_=f[g])>=u&&_<=c||isNaN(_))&&(a[s++]=p),p++}d=!0}else if(2===i){f=h[r[0]];var m=h[r[1]],v=e[r[1]][0],y=e[r[1]][1];for(g=0;g<n;g++){var _=f[g],x=m[g];(_>=u&&_<=c||isNaN(_))&&(x>=v&&x<=y||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===i)for(g=0;g<o;g++){var b=t.getRawIndex(g);((_=h[r[0]][b])>=u&&_<=c||isNaN(_))&&(a[s++]=b)}else for(g=0;g<o;g++){for(var w=!0,S=(b=t.getRawIndex(g),0);S<i;S++){var T=r[S];((_=h[T][b])<e[T][0]||_>e[T][1])&&(w=!1)}w&&(a[s++]=t.getRawIndex(g))}return s<o&&(t._indices=a),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],o=t.length,a=e.count(),s=[],l=e._rawExtent,u=0;u<t.length;u++)l[t[u]]=[1/0,-1/0];for(var c=0;c<a;c++){for(var h=e.getRawIndex(c),d=0;d<o;d++)s[d]=r[t[d]][h];s[o]=c;var p=n&&n.apply(null,s);if(null!=p){"object"!=typeof p&&(i[0]=p,p=i);for(u=0;u<p.length;u++){var f=t[u],g=p[u],m=l[f],v=r[f];v&&(v[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,r,i,o=this.clone([e],!0),a=o._chunks[e],s=this.count(),l=0,u=Math.floor(1/t),c=this.getRawIndex(0),h=new(U_(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));h[l++]=c;for(var d=1;d<s-1;d+=u){for(var p=Math.min(d+u,s-1),f=Math.min(d+2*u,s),g=(f+p)/2,m=0,v=p;v<f;v++){var y=a[M=this.getRawIndex(v)];isNaN(y)||(m+=y)}m/=f-p;var _=d,x=Math.min(d+u,s),b=d-1,w=a[c];n=-1,i=_;var S=-1,T=0;for(v=_;v<x;v++){var M;y=a[M=this.getRawIndex(v)];isNaN(y)?(T++,S<0&&(S=M)):(r=Math.abs((b-g)*(y-w)-(b-v)*(m-w)))>n&&(n=r,i=M)}T>0&&T<x-_&&(h[l++]=Math.min(S,i),i=Math.max(S,i)),h[l++]=i,c=i}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),o=i._chunks,a=[],s=Math.floor(1/t),l=o[e],u=this.count(),c=i._rawExtent[e]=[1/0,-1/0],h=new(U_(this._rawCount))(Math.ceil(u/s)),d=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(p+r(a,m)||0,u-1));l[v]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[d++]=v}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,o=this.count();i<o;i++){var a=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][a],i);break;case 2:t(r[e[0]][a],r[e[1]][a],i);break;default:for(var s=0,l=[];s<n;s++)l[s]=r[e[s]][a];l[s]=i,t.apply(null,l)}}},e.prototype.getDataExtent=function(e){var t=this._chunks[e],n=[1/0,-1/0];if(!t)return n;var r,i=this.count();if(!this._indices)return this._rawExtent[e].slice();if(r=this._extent[e])return r.slice();for(var o=(r=n)[0],a=r[1],s=0;s<i;s++){var l=t[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return r=[o,a],this._extent[e]=r,r},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r,i,o=new e,a=this._chunks,s=t&&Hr(t,(function(e,t){return e[t]=!0,e}),{});if(s)for(var l=0;l<a.length;l++)o._chunks[l]=s[l]?(r=a[l],i=void 0,(i=r.constructor)===Array?r.slice():new i(r)):a[l];else o._chunks=a;return this._copyCommonProps(o),n||(o._indices=this._cloneIndices()),o._updateGetRawIdx(),o},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Ir(this._extent),e._rawExtent=Ir(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return x_(e[r],this._dimensions[r])}k_={arrayRows:e,objectRows:function(e,t,n,r){return x_(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(null==e.value?e:e.value);return x_(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),j_=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length;if(Z_(n)){var o=n,a=void 0,s=void 0,l=void 0;if(i){var u=r[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=ti(a=o.get("data",!0))?Gv:zv,t=[];var c=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},d=li(c.seriesLayoutBy,h.seriesLayoutBy)||null,p=li(c.sourceHeader,h.sourceHeader),f=li(c.dimensions,h.dimensions);e=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||f?[Ky(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(i){var m=this._applyTransform(r);e=m.sourceList,t=m.upstreamSignList}else{e=[Ky(g.get("source",!0),this._getSourceMetaRawOption(),null)],t=[]}}"production"!==process.env.NODE_ENV&&di(e&&t),this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,r=n.get("transform",!0),i=n.get("fromTransformResult",!0);if("production"!==process.env.NODE_ENV&&di(null!=i||null!=r),null!=i){var o="";1!==e.length&&("production"!==process.env.NODE_ENV&&(o="When using `fromTransformResult`, there should be only one upstream dataset"),q_(o))}var a,s=[],l=[];return Fr(e,(function(e){e.prepareSource();var t=e.getSource(i||0),n="";null==i||t||("production"!==process.env.NODE_ENV&&(n="Can not retrieve result by `fromTransformResult`: "+i),q_(n)),s.push(t),l.push(e._getVersionSign())})),r?t=function(e,t,n){var r=Xu(e),i=r.length,o="";i||("production"!==process.env.NODE_ENV&&(o="If `transform` declared, it should at least contain one transform."),Gu(o));for(var a=0,s=i;a<s;a++)t=O_(r[a],t,n,1===i?null:a),a!==s-1&&(t.length=Math.max(t.length,1));return t}(r,s,{datasetIndex:n.componentIndex}):null!=i&&(t=[(a=s[0],new Zy({data:a.data,sourceFormat:a.sourceFormat,seriesLayoutBy:a.seriesLayoutBy,dimensionsDefine:Ir(a.dimensionsDefine),startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount}))]),{sourceList:t,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){"production"!==process.env.NODE_ENV&&di(Z_(this._sourceHost),"Can only call getDataStore on series source manager.");var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=this._storeList,i=r[0];i||(i=r[0]={});var o=i[n];if(!o){var a=this._getUpstreamSourceManagers()[0];Z_(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new X_).initData(new n_(t,e.length),e),i[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Z_(e)){var t=qv(e);return t?[t.getSourceManager()]:[]}return Gr(function(e){return e.get("transform",!0)||e.get("fromTransformResult",!0)?hc(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},uc).models:[]}(e),(function(e){return e.getSourceManager()}))},e.prototype._getSourceMetaRawOption=function(){var e,t,n,r=this._sourceHost;if(Z_(r))e=r.get("seriesLayoutBy",!0),t=r.get("sourceHeader",!0),n=r.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=r;e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)}return{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function Y_(e){e.option.transform&&gi(e.option.transform)}function Z_(e){return"series"===e.mainType}function q_(e){throw new Error(e)}var K_="line-height:1";function $_(e,t){var n=e.color||"#6e7079",r=e.fontSize||12,i=e.fontWeight||"400",o=e.color||"#464646",a=e.fontSize||14,s=e.fontWeight||"900";return"html"===t?{nameStyle:"font-size:"+lo(r+"")+"px;color:"+lo(n)+";font-weight:"+lo(i+""),valueStyle:"font-size:"+lo(a+"")+"px;color:"+lo(o)+";font-weight:"+lo(s+"")}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var J_=[0,10,20,30],Q_=["","\n","\n\n","\n\n\n"];function ex(e,t){return t.type=e,t}function tx(e){return"section"===e.type}function nx(e){return tx(e)?ix:ox}function rx(e){if(tx(e)){var t=0,n=e.blocks.length,r=n>1||n>0&&!e.noHeader;return Fr(e.blocks,(function(e){var n=rx(e);n>=t&&(t=n+ +(r&&(!n||tx(e)&&!e.noHeader)))})),t}return 0}function ix(e,t,n,r){var i,o=t.noHeader,a=(i=rx(t),{html:J_[i],richText:Q_[i]}),s=[],l=t.blocks||[];di(!l||Zr(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Ti(c,u)){var h=new M_(c[u],null);l.sort((function(e,t){return h.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===u&&l.reverse()}Fr(l,(function(n,i){var o=t.valueFormatter,l=nx(n)(o?Pr(Pr({},e),{valueFormatter:o}):e,n,i>0?a.html:0,r);null!=l&&s.push(l)}));var d="richText"===e.renderMode?s.join(a.richText):sx(s.join(""),o?n:a.html);if(o)return d;var p=hv(t.header,"ordinal",e.useUTC),f=$_(r,e.renderMode).nameStyle;return"richText"===e.renderMode?lx(e,p,f)+a.richText+d:sx('<div style="'+f+";"+K_+';">'+lo(p)+"</div>"+d,n)}function ox(e,t,n,r){var i=e.renderMode,o=t.noName,a=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return Gr(e=Zr(e)?e:[e],(function(e,t){return hv(e,Zr(p)?p[t]:p,u)}))};if(!o||!a){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),d=o?"":hv(l,"ordinal",u),p=t.valueType,f=a?[]:c(t.value,t.dataIndex),g=!s||!o,m=!s&&o,v=$_(r,i),y=v.nameStyle,_=v.valueStyle;return"richText"===i?(s?"":h)+(o?"":lx(e,d,y))+(a?"":function(e,t,n,r,i){var o=[i],a=r?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(Zr(t)?t.join(" "):t,o)}(e,f,g,m,_)):sx((s?"":h)+(o?"":function(e,t,n){return'<span style="'+n+";"+(t?"margin-left:2px":"")+'">'+lo(e)+"</span>"}(d,!s,y))+(a?"":function(e,t,n,r){var i=n?"10px":"20px",o=t?"float:right;margin-left:"+i:"";return e=Zr(e)?e:[e],'<span style="'+o+";"+r+'">'+Gr(e,(function(e){return lo(e)})).join("&nbsp;&nbsp;")+"</span>"}(f,g,m,_)),n)}}function ax(e,t,n,r,i,o){if(e)return nx(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function sx(e,t){return'<div style="'+("margin: "+t+"px 0 0")+";"+K_+';">'+e+'<div style="clear:both"></div></div>'}function lx(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function ux(e,t){return vv(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function cx(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var hx=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Eu()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r="richText"===n?this._generateStyleName():null,i=gv({color:t,type:e,renderMode:n,markerId:r});return Kr(i)?i:("production"!==process.env.NODE_ENV&&di(r),this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};Zr(t)?Fr(t,(function(e){return Pr(n,e)})):Pr(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,"{"+r+"|"+e+"}"},e}();function dx(e){var t,n,r,i,o=e.series,a=e.dataIndex,s=e.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),d=Zr(h),p=ux(o,a);if(c>1||d&&!c){var f=function(e,t,n,r,i){var o=t.getData(),a=Hr(e,(function(e,t,n){var r=o.getDimensionInfo(n);return e||r&&!1!==r.tooltip&&null!=r.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=o.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(a?u.push(ex("nameValue",{markerType:"subItem",markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return r.length?Fr(r,(function(e){c(p_(o,n,e),e)})):Fr(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}(h,o,a,u,p);t=f.inlineValues,n=f.inlineValueTypes,r=f.blocks,i=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);i=t=p_(l,a,u[0]),n=g.type}else i=t=d?h[0]:h;var m=nc(o),v=m&&o.name||"",y=l.getName(a),_=s?v:y;return ex("section",{header:v,noHeader:s||!m,sortParam:i,blocks:[ex("nameValue",{markerType:"item",markerColor:p,name:_,noName:!pi(_),value:t,valueType:n,dataIndex:a})].concat(r||[])})}var px=oc();function fx(e,t){return e.getName(t)||e.getId(t)}var gx="__universalTransitionEnabled",mx=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return g(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=v_({count:yx,reset:_x}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(px(this).sourceManager=new j_(this)).prepareSource();var r=this.getInitialData(e,n);bx(r,this),this.dataTask.context.data=r,"production"!==process.env.NODE_ENV&&di(r,"getInitialData returned invalid data."),px(this).dataBeforeProcessed=r,vx(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Av(this),r=n?Dv(e):{},i=this.subType;Nv.hasClass(i)&&(i+="Series"),Lr(e,t.getTheme().get(this.subType)),Lr(e,this.getDefaultOption()),ju(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Cv(e,r,n)},t.prototype.mergeOption=function(e,t){e=Lr(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Av(this);n&&Cv(this.option,e,n);var r=px(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);bx(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,px(this).dataBeforeProcessed=i,vx(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!ti(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&ju(e[n],"label",t)},t.prototype.getInitialData=function(e,t){},t.prototype.appendData=function(e){this.getRawData().appendData(e.data)},t.prototype.getData=function(e){var t=Tx(this);if(t){var n=t.context.data;return null==e?n:n.getLinkedData(e)}return px(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var t=Tx(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}px(this).data=e},t.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return xi(e)},t.prototype.getSourceManager=function(){return px(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return px(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get("colorBy")||"series"},t.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.formatTooltip=function(e,t,n){return dx({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(sr.node&&(!e||!e.ssr))return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=iy.prototype.getColorFromPalette.call(this,e,t,n);return i||(i=r.getColorFromPalette(e,t,n)),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if("series"===r||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<e.length;o++){var a=fx(i,e[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},t.prototype.toggleSelect=function(e,t){for(var n=[],r=0;r<e.length;r++)n[0]=e[r],this.isSelected(e[r],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=Xr(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];i>=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return("all"===n||n[fx(r,e)])&&!r.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[gx])return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,o=i.selectedMode,a=t.length;if(o&&a)if("series"===o)i.selectedMap="all";else if("multiple"===o){Qr(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,l=0;l<a;l++){var u=t[l];s[h=fx(e,u)]=!0,this._selectedDataIndicesMap[h]=e.getRawIndex(u)}}else if("single"===o||!0===o){var c=t[a-1],h=fx(e,c);i.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((r={})[h]=e.getRawIndex(c),r)}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each((function(n){var r=e.getRawDataItem(n);r&&r.selected&&t.push(n)})),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return Nv.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(Nv);function vx(e){var t=e.name;nc(e)||(e.name=function(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),r=[];return Fr(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)})),r.join(" ")}(e)||t)}function yx(e){return e.model.getRawData().count()}function _x(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),xx}function xx(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function bx(e,t){Fr(bi(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,Yr(Sx,t))}))}function Sx(e,t){var n=Tx(e);return n&&n.setOutputEnd((t||this).count()),t}function Tx(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}Br(mx,g_),Br(mx,iy),xc(mx,Nv);var Mx=mx,Ax=function(){function e(){this.group=new Kl,this.uid=wm("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();_c(Ax),Tc(Ax);var Cx=Ax;function Dx(){var e=oc();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,o=!!n.progressiveRender,a=n.large=!(!r||!r.large),s=n.progressiveRender=!(!r||!r.progressiveRender);return!(i===a&&o===s)&&"reset"}}var Ex=oc(),Ix=Dx(),Lx=function(){function e(){this.group=new Kl,this.uid=wm("viewChart"),this.renderTask=v_({plan:Ox,reset:Rx}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){if("production"!==process.env.NODE_ENV)throw new Error("render method must been implemented")},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?Px(i,r,"emphasis"):"production"!==process.env.NODE_ENV&&zu("Unknown dataType "+r.dataType)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i?Px(i,r,"normal"):"production"!==process.env.NODE_ENV&&zu("Unknown dataType "+r.dataType)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateLayout=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Wg(this.group,e)},e.markUpdateMethod=function(e,t){Ex(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function Nx(e,t,n){e&&Ip(e)&&("emphasis"===t?cp:hp)(e,n)}function Px(e,t,n){var r=ic(e,t),i=t&&null!=t.highlightKey?function(e){var t=Od[e];return null==t&&Pd<=32&&(t=Od[e]=Pd++),t}(t.highlightKey):null;null!=r?Fr(Xu(r),(function(t){Nx(e.getItemGraphicEl(t),n,i)})):e.eachItemGraphicEl((function(e){Nx(e,n,i)}))}function Ox(e){return Ix(e.model)}function Rx(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=i&&Ex(i).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,r,i),kx[l]}_c(Lx,["dispose"]),Tc(Lx);var kx={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},zx=Lx,Bx="\0__throttleOriginMethod",Vx="\0__throttleRate",Fx="\0__throttleType";function Gx(e,t,n){var r,i,o,a,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(o,a||[])}t=t||0;var d=function(){for(var e=[],d=0;d<arguments.length;d++)e[d]=arguments[d];r=(new Date).getTime(),o=this,a=e;var p=s||t,f=s||n;s=null,i=r-(f?l:u)-p,clearTimeout(c),f?c=setTimeout(h,p):i>=0?h():c=setTimeout(h,-i),l=r};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(e){s=e},d}function Hx(e,t,n,r){var i=e[t];if(i){var o=i[Bx]||i,a=i[Fx];if(i[Vx]!==n||a!==r){if(null==n||!r)return e[t]=o;(i=e[t]=Gx(o,n,"debounce"===r))[Bx]=o,i[Fx]=r,i[Vx]=n}return i}}function Ux(e,t){var n=e[t];n&&n[Bx]&&(n.clear&&n.clear(),e[t]=n[Bx])}var Wx=oc(),Xx={itemStyle:Mc(mm,!0),lineStyle:Mc(pm,!0)},jx={lineStyle:"stroke",itemStyle:"fill"};function Yx(e,t){var n=e.visualStyleMapper||Xx[t];return n||(console.warn("Unknown style type '"+t+"'."),Xx.itemStyle)}function Zx(e,t){var n=e.visualDrawType||jx[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var qx={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=e.getModel(r),o=Yx(e,r)(i),a=i.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=Zx(e,r),l=o[s],u=qr(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||c){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||qr(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||qr(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=Pr({},o);i[s]=u(r),t.setItemVisual(n,"style",i)}}}},Kx=new xm,$x={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",i=Yx(e,r),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){Kx.option=n[r];var a=i(Kx);Pr(e.ensureUniqueItemVisual(t,"style"),a),Kx.option.decal&&(e.setItemVisual(t,"decal",Kx.option.decal),Kx.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},Jx={performRawSeries:!0,overallReset:function(e){var t=xi();e.eachSeries((function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var r=e.type+"-"+n,i=t.get(r);i||(i={},t.set(r,i)),Wx(e).scope=i}})),e.eachSeries((function(t){if(!t.isColorBySeries()&&!e.isSeriesFiltered(t)){var n=t.getRawData(),r={},i=t.getData(),o=Wx(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=Zx(t,a);i.each((function(e){var t=i.getRawIndex(e);r[t]=e})),n.each((function(e){var a=r[e];if(i.getItemVisual(a,"colorFromPalette")){var l=i.ensureUniqueItemVisual(a,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,o,c)}}))}}))}},Qx=Math.PI;var eb=function(){function e(e,t,n,r){this._stageTaskMap=xi(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,o=r&&r.modDataCount;return{step:i,modBy:null!=o?Math.ceil(o/i):null,modDataCount:o}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),r=e.getData().count(),i=n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,o=e.get("large")&&r>=e.get("largeThreshold"),a="mod"===e.get("progressiveChunkMode")?r:null;e.pipelineContext=n.context={progressiveRender:i,modDataCount:a,large:o}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=xi();e.eachSeries((function(e){var r=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:r&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;Fr(this._allHandlers,(function(r){var i=e.get(r.uid)||e.set(r.uid,{}),o="";"production"!==process.env.NODE_ENV&&(o='"reset" and "overallReset" must not be both specified.'),di(!(r.reset&&r.overallReset),o),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)}),this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,o=i.context;o.model=t,o.ecModel=n,o.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r=r||{};var i=!1,o=this;function a(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}Fr(e,(function(e,s){if(!r.visualType||r.visualType===e.visualType){var l=o._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,d=c.agentStubMap;d.each((function(e){a(r,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),o.updatePayload(c,n);var p=o.getPerformArgs(c,r.block);d.each((function(e){e.perform(p)})),c.perform(p)&&(i=!0)}else u&&u.each((function(s,l){a(r,s)&&s.dirty();var u=o.getPerformArgs(s,r.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(i=!0)}))}})),this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,o=t.seriesTaskMap,a=t.seriesTaskMap=xi(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||v_({plan:ob,reset:ab,count:ub}));l.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,r).each(u)},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,o=t.overallTask=t.overallTask||v_({reset:tb});o.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var a=o.agentStubMap,s=o.agentStubMap=xi(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,d="";function p(e){var t=e.uid,n=s.set(t,a&&a.get(t)||(h=!0,v_({reset:nb,onDirty:ib})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,i._pipe(e,n)}"production"!==process.env.NODE_ENV&&(d='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),di(!e.createOnAllSeries,d),l?n.eachRawSeriesByType(l,p):u?u(n,r).each(p):(c=!1,Fr(n.getSeries(),p)),h&&o.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return qr(e)&&(e={overallReset:e,seriesType:cb(e)}),e.uid=wm("stageHandler"),t&&(e.visualType=t),e},e}();function tb(e){e.overallReset(e.ecModel,e.api,e.payload)}function nb(e){return e.overallProgress&&rb}function rb(){this.agent.dirty(),this.getDownstream().dirty()}function ib(){this.agent&&this.agent.dirty()}function ob(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function ab(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Xu(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Gr(t,(function(e,t){return lb(t)})):sb}var sb=lb(0);function lb(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var o=t.start;o<t.end;o++)i.dataEach(r,o);else i&&i.progress&&i.progress(t,r)}}function ub(e){return e.data.count()}function cb(e){hb=null;try{e(db,pb)}catch(e){}return hb}var hb,db={},pb={};function fb(e,t){for(var n in t.prototype)e[n]=Mi}fb(db,hy),fb(pb,my),db.eachSeriesByType=db.eachRawSeriesByType=function(e){hb=e},db.eachComponent=function(e){"series"===e.mainType&&e.subType&&(hb=e.subType)};var gb=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],mb={color:gb,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],gb]},vb="#B9B8CE",yb="#100C2A",_b=function(){return{axisLine:{lineStyle:{color:vb}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},xb=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],bb={darkMode:!0,color:xb,backgroundColor:yb,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:vb}},textStyle:{color:vb},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:vb}},dataZoom:{borderColor:"#71708A",textStyle:{color:vb},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:vb}},timeline:{lineStyle:{color:vb},label:{color:vb},controlStyle:{color:vb,borderColor:vb}},calendar:{itemStyle:{color:yb},dayLabel:{color:vb},monthLabel:{color:vb},yearLabel:{color:vb}},timeAxis:_b(),logAxis:_b(),valueAxis:_b(),categoryAxis:_b(),line:{symbol:"circle"},graph:{color:xb},gauge:{title:{color:vb},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:vb},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};bb.categoryAxis.splitLine.show=!1;var wb=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},r={};if(Kr(e)){var i=yc(e);t.mainType=i.main||null,t.subType=i.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};Fr(e,(function(e,i){for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=i.lastIndexOf(u);if(c>0&&c===i.length-u.length){var h=i.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}a.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,i,"name")&&u(l,i,"dataIndex")&&u(l,i,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(e,t.otherQuery,r,i));function u(e,t,n,r){return null==e[n]||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),Sb=["symbol","symbolSize","symbolRotate","symbolOffset"],Tb=Sb.concat(["symbolKeepAspect"]),Mb={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var r={},i={},o=!1,a=0;a<Sb.length;a++){var s=Sb[a],l=e.get(s);qr(l)?(o=!0,i[s]=l):r[s]=l}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(Pr({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},r)),!t.isSeriesFiltered(e)){var u=Xr(i);return{dataEach:o?function(t,n){for(var r=e.getRawValue(n),o=e.getDataParams(n),a=0;a<u.length;a++){var s=u[a];t.setItemVisual(n,s,i[s](r,o))}}:null}}}}},Ab={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){for(var n=e.getItemModel(t),r=0;r<Tb.length;r++){var i=Tb[r],o=n.getShallow(i,!0);null!=o&&e.setItemVisual(t,i,o)}}:null}}};function Cb(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Db(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+t)}}function Eb(e,t,n,r){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=r,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+n)}}function Ib(e,t){function n(t,n){var r=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){r.push(e.seriesIndex)})),r}Fr([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,r,i){t=Pr({},t),"production"!==process.env.NODE_ENV&&Vu(t.type,e[1]),i.dispatchAction(Pr(t,{type:e[1],seriesIndex:n(r,t)}))}))}))}function Lb(e,t,n,r,i){var o=e+t;n.isSilent(o)||("production"!==process.env.NODE_ENV&&Bu("event "+o+" is deprecated."),r.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,a=i.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===t){var l=e.getData(),u=ic(l,i.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:Zr(u)?l.getName(u[0]):l.getName(u),selected:Kr(r)?r:Pr({},r)})}})))}function Nb(e,t,n){for(var r;e&&(!t(e)||(r=e,!n));)e=e.__hostTarget||e.parent;return r}var Pb=Math.round(9*Math.random()),Ob="function"==typeof Object.defineProperty,Rb=function(){function e(){this._id="__ec_inner_"+Pb++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return Ob?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}(),kb=ed.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r+o),e.lineTo(n-i,r+o),e.closePath()}}),zb=ed.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,o=t.height/2;e.moveTo(n,r-o),e.lineTo(n+i,r),e.lineTo(n,r+o),e.lineTo(n-i,r),e.closePath()}}),Bb=ed.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,o=Math.max(i,t.height),a=i/2,s=a*a/(o-a),l=r-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),p=.6*a,f=.7*a;e.moveTo(n-c,l+s),e.arc(n,l,a,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*p,l+s+d*p,n,r-f,n,r),e.bezierCurveTo(n,r-f,n-c+h*p,l+s+d*p,n-c,l+s),e.closePath()}}),Vb=ed.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,o=t.y,a=r/3*2;e.moveTo(i,o),e.lineTo(i+a,o+n),e.lineTo(i,o+n/4*3),e.lineTo(i-a,o+n),e.lineTo(i,o),e.closePath()}}),Fb={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var o=Math.min(n,r);i.x=e,i.y=t,i.width=o,i.height=o},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},Gb={};Fr({line:Rf,rect:fd,roundRect:fd,square:fd,circle:tf,diamond:zb,pin:Bb,arrow:Vb,triangle:kb},(function(e,t){Gb[t]=new e}));var Hb=ed.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Bl(e,t,n),i=this.shape;return i&&"pin"===i.symbolType&&"inside"===t.position&&(r.y=n.y+.4*n.height),r},buildPath:function(e,t,n){var r=t.symbolType;if("none"!==r){var i=Gb[r];i||(i=Gb[r="rect"]),Fb[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function Ub(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=e:n.fill=e,this.markRedraw()}}function Wb(e,t,n,r,i,o,a){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?Mg(e.slice(8),new Uo(t,n,r,i),a?"center":"cover"):0===e.indexOf("path://")?Tg(e.slice(7),{},new Uo(t,n,r,i),a?"center":"cover"):new Hb({shape:{symbolType:e,x:t,y:n,width:r,height:i}})).__isEmptyBrush=l,s.setColor=Ub,o&&s.setColor(o),s}function Xb(e){return Zr(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function jb(e,t){if(null!=e)return Zr(e)||(e=[e,e]),[uu(e[0],t[0])||0,uu(li(e[1],e[0]),t[1])||0]}function Yb(e){return isFinite(e)}function Zb(e,t,n){for(var r="radial"===t.type?function(e,t,n){var r=n.width,i=n.height,o=Math.min(r,i),a=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(a=a*r+n.x,s=s*i+n.y,l*=o),a=Yb(a)?a:.5,s=Yb(s)?s:.5,l=l>=0&&Yb(l)?l:.5,e.createRadialGradient(a,s,0,a,s,l)}(e,t,n):function(e,t,n){var r=null==t.x?0:t.x,i=null==t.x2?1:t.x2,o=null==t.y?0:t.y,a=null==t.y2?0:t.y2;return t.global||(r=r*n.width+n.x,i=i*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),r=Yb(r)?r:0,i=Yb(i)?i:1,o=Yb(o)?o:0,a=Yb(a)?a:0,e.createLinearGradient(r,o,i,a)}(e,t,n),i=t.colorStops,o=0;o<i.length;o++)r.addColorStop(i[o].offset,i[o].color);return r}function qb(e){return parseInt(e,10)}function Kb(e,t,n){var r=["width","height"][t],i=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=n[r]&&"auto"!==n[r])return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(e);return(e[i]||qb(s[r])||qb(e.style[r]))-(qb(s[o])||0)-(qb(s[a])||0)|0}function $b(e){var t,n,r=e.style,i=r.lineDash&&r.lineWidth>0&&(t=r.lineDash,n=r.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:Jr(t)?[t]:Zr(t)?t:null:null),o=r.lineDashOffset;if(i){var a=r.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(i=Gr(i,(function(e){return e/a})),o/=a)}return[i,o]}var Jb=new Ph(!0);function Qb(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function ew(e){return"string"==typeof e&&"none"!==e}function tw(e){var t=e.fill;return null!=t&&"none"!==t}function nw(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function rw(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function iw(e,t,n){var r=Ic(t.image,t.__image,n);if(Nc(r)){var i=e.createPattern(r,t.repeat||"repeat");if("function"==typeof DOMMatrix&&i&&i.setTransform){var o=new DOMMatrix;o.translateSelf(t.x||0,t.y||0),o.rotateSelf(0,0,(t.rotation||0)*Ai),o.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(o)}return i}}var ow=["shadowBlur","shadowOffsetX","shadowOffsetY"],aw=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function sw(e,t,n,r,i){var o=!1;if(!r&&t===(n=n||{}))return!1;if(r||t.opacity!==n.opacity){fw(e,i),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?jc.opacity:a}(r||t.blend!==n.blend)&&(o||(fw(e,i),o=!0),e.globalCompositeOperation=t.blend||jc.blend);for(var s=0;s<ow.length;s++){var l=ow[s];(r||t[l]!==n[l])&&(o||(fw(e,i),o=!0),e[l]=e.dpr*(t[l]||0))}return(r||t.shadowColor!==n.shadowColor)&&(o||(fw(e,i),o=!0),e.shadowColor=t.shadowColor||jc.shadowColor),o}function lw(e,t,n,r,i){var o=gw(t,i.inHover),a=r?null:n&&gw(n,i.inHover)||{};if(o===a)return!1;var s=sw(e,o,a,r,i);if((r||o.fill!==a.fill)&&(s||(fw(e,i),s=!0),ew(o.fill)&&(e.fillStyle=o.fill)),(r||o.stroke!==a.stroke)&&(s||(fw(e,i),s=!0),ew(o.stroke)&&(e.strokeStyle=o.stroke)),(r||o.opacity!==a.opacity)&&(s||(fw(e,i),s=!0),e.globalAlpha=null==o.opacity?1:o.opacity),t.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(fw(e,i),s=!0),e.lineWidth=l)}for(var u=0;u<aw.length;u++){var c=aw[u],h=c[0];(r||o[h]!==a[h])&&(s||(fw(e,i),s=!0),e[h]=o[h]||c[1])}return s}function uw(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}var cw=1,hw=2,dw=3,pw=4;function fw(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function gw(e,t){return t&&e.__hoverStyle||e.style}function mw(e,t){vw(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function vw(e,t,n,r){var i=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return t.__dirty&=~la,void(t.__isRendered=!1);var o=t.__clipPaths,a=n.prevElClipPaths,s=!1,l=!1;if(a&&!function(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}(o,a)||(a&&a.length&&(fw(e,n),e.restore(),l=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),o&&o.length&&(fw(e,n),e.save(),function(e,t,n){for(var r=!1,i=0;i<e.length;i++){var o=e[i];r=r||o.isZeroArea(),uw(t,o),t.beginPath(),o.buildPath(t,o.shape),t.clip()}n.allClipped=r}(o,e,n),s=!0),n.prevElClipPaths=o),n.allClipped)t.__isRendered=!1;else{t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=n.prevEl;u||(l=s=!0);var c,h,d=t instanceof ed&&t.autoBatch&&function(e){var t=tw(e),n=Qb(e);return!(e.lineDash||!(+t^+n)||t&&"string"!=typeof e.fill||n&&"string"!=typeof e.stroke||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}(t.style);s||(c=i,h=u.transform,c&&h?c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||c[3]!==h[3]||c[4]!==h[4]||c[5]!==h[5]:c||h)?(fw(e,n),uw(e,t)):d||fw(e,n);var p=gw(t,n.inHover);t instanceof ed?(n.lastDrawType!==cw&&(l=!0,n.lastDrawType=cw),lw(e,t,u,l,n),d&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,r){var i,o=Qb(n),a=tw(n),s=n.strokePercent,l=s<1,u=!t.path;t.silent&&!l||!u||t.createPathProxy();var c=t.path||Jb,h=t.__dirty;if(!r){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,m=a&&!!d.image,v=o&&!!p.image,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=t.getBoundingRect()),f&&(y=h?Zb(e,d,w):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(_=h?Zb(e,p,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),m&&(x=h||!t.__canvasFillPattern?iw(e,d,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(b=h||!t.__canvasStrokePattern?iw(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),f?e.fillStyle=y:m&&(x?e.fillStyle=x:a=!1),g?e.strokeStyle=_:v&&(b?e.strokeStyle=b:o=!1)}var S,T,M=t.getGlobalScale();c.setScale(M[0],M[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(S=(i=$b(t))[0],T=i[1]);var A=!0;(u||h&ua)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),A=!1),c.reset(),t.buildPath(c,t.shape,r),c.toStatic(),t.pathUpdated()),A&&c.rebuildPath(e,l?s:1),S&&(e.setLineDash(S),e.lineDashOffset=T),r||(n.strokeFirst?(o&&rw(e,n),a&&nw(e,n)):(a&&nw(e,n),o&&rw(e,n))),S&&e.setLineDash([])}(e,t,p,d),d&&(n.batchFill=p.fill||"",n.batchStroke=p.stroke||"")):t instanceof nd?(n.lastDrawType!==dw&&(l=!0,n.lastDrawType=dw),lw(e,t,u,l,n),function(e,t,n){var r,i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||cr,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var o=void 0,a=void 0;e.setLineDash&&n.lineDash&&(o=(r=$b(t))[0],a=r[1]),o&&(e.setLineDash(o),e.lineDashOffset=a),n.strokeFirst?(Qb(n)&&e.strokeText(i,n.x,n.y),tw(n)&&e.fillText(i,n.x,n.y)):(tw(n)&&e.fillText(i,n.x,n.y),Qb(n)&&e.strokeText(i,n.x,n.y)),o&&e.setLineDash([])}}(e,t,p)):t instanceof ad?(n.lastDrawType!==hw&&(l=!0,n.lastDrawType=hw),function(e,t,n,r,i){sw(e,gw(t,i.inHover),n&&gw(n,i.inHover),r,i)}(e,t,u,l,n),function(e,t,n){var r=t.__image=Ic(n.image,t.__image,t,t.onload);if(r&&Nc(r)){var i=n.x||0,o=n.y||0,a=t.getWidth(),s=t.getHeight(),l=r.width/r.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=r.width,s=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(r,u,c,n.sWidth,n.sHeight,i,o,a,s)}else if(n.sx&&n.sy){var h=a-(u=n.sx),d=s-(c=n.sy);e.drawImage(r,u,c,h,d,i,o,a,s)}else e.drawImage(r,i,o,a,s)}}(e,t,p)):t.getTemporalDisplayables&&(n.lastDrawType!==pw&&(l=!0,n.lastDrawType=pw),function(e,t,n){var r=t.getDisplayables(),i=t.getTemporalDisplayables();e.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(o=t.getCursor(),a=r.length;o<a;o++){(c=r[o]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),vw(e,c,s,o===a-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}for(var l=0,u=i.length;l<u;l++){var c;(c=i[l]).beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),vw(e,c,s,l===u-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),s.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,n)),d&&r&&fw(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}}var yw=new Rb,_w=new Xa(100),xw=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function bw(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),r=t.getZr(),i="svg"===r.painter.type;e.dirty&&yw.delete(e);var o=yw.get(e);if(o)return o;var a=Or(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,o=[n],s=!0,l=0;l<xw.length;++l){var u=a[xw[l]];if(null!=u&&!Zr(u)&&!Kr(u)&&!Jr(u)&&"boolean"!=typeof u){s=!1;break}o.push(u)}if(s){t=o.join(",")+(i?"-svg":"");var c=_w.get(t);c&&(i?e.svgElement=c:e.image=c)}var h,d=Sw(a.dashArrayX),p=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if(Jr(e)){var t=Math.ceil(e);return[t,t]}var n=Gr(e,(function(e){return Math.ceil(e)}));return e.length%2?n.concat(n):n}(a.dashArrayY),f=ww(a.symbol),g=(x=d,Gr(x,(function(e){return Tw(e)}))),m=Tw(p),v=!i&&fr.createCanvas(),y=i&&{tag:"g",attrs:{},key:"dcl",children:[]},_=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=Lu(e,g[t]);var r=1;for(t=0,n=f.length;t<n;++t)r=Lu(r,f[t].length);e*=r;var i=m*g.length*f.length;if("production"!==process.env.NODE_ENV){var o=function(e){console.warn("Calculated decal size is greater than "+e+" due to decal option settings so "+e+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+e+" to be larger to avoid incontinuity.")};e>a.maxTileWidth&&o("maxTileWidth"),i>a.maxTileHeight&&o("maxTileHeight")}return{width:Math.max(1,Math.min(e,a.maxTileWidth)),height:Math.max(1,Math.min(i,a.maxTileHeight))}}();var x;v&&(v.width=_.width*n,v.height=_.height*n,h=v.getContext("2d"));(function(){h&&(h.clearRect(0,0,v.width,v.height),a.backgroundColor&&(h.fillStyle=a.backgroundColor,h.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<p.length;++t)e+=p[t];if(e<=0)return;var o=-m,s=0,l=0,u=0;for(;o<_.height;){if(s%2==0){for(var c=l/2%f.length,g=0,x=0,b=0;g<2*_.width;){var w=0;for(t=0;t<d[u].length;++t)w+=d[u][t];if(w<=0)break;if(x%2==0){var S=.5*(1-a.symbolSize),T=g+d[u][x]*S,M=o+p[s]*S,A=d[u][x]*a.symbolSize,C=p[s]*a.symbolSize,D=b/2%f[c].length;E(T,M,A,C,f[c][D])}g+=d[u][x],++b,++x===d[u].length&&(x=0)}++u===d.length&&(u=0)}o+=p[s],++l,++s===p.length&&(s=0)}function E(e,t,o,s,l){var u=i?1:n,c=Wb(l,e*u,t*u,o*u,s*u,a.color,a.symbolKeepAspect);if(i){var d=r.painter.renderOneToVNode(c);d&&y.children.push(d)}else mw(h,c)}})(),s&&_w.put(t,v||y);e.image=v,e.svgElement=y,e.svgWidth=_.width,e.svgHeight=_.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=i?1:1/n,yw.set(e,s),e.dirty=!1,s}function ww(e){if(!e||0===e.length)return[["rect"]];if(Kr(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!Kr(e[n])){t=!1;break}if(t)return ww([e]);var r=[];for(n=0;n<e.length;++n)Kr(e[n])?r.push([e[n]]):r.push(e[n]);return r}function Sw(e){if(!e||0===e.length)return[[0,0]];if(Jr(e))return[[i=Math.ceil(e),i]];for(var t=!0,n=0;n<e.length;++n)if(!Jr(e[n])){t=!1;break}if(t)return Sw([e]);var r=[];for(n=0;n<e.length;++n)if(Jr(e[n])){var i=Math.ceil(e[n]);r.push([i,i])}else{(i=Gr(e[n],(function(e){return Math.ceil(e)}))).length%2==1?r.push(i.concat(i)):r.push(i)}return r}function Tw(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var Mw=new Ji,Aw={};function Cw(e){return"production"!==process.env.NODE_ENV&&(Aw[e]||zu("Implementation of "+e+" doesn't exists.")),Aw[e]}var Dw=2e3,Ew=4500,Iw={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:Dw,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:Ew,ARIA:6e3,DECAL:7e3}},Lw="__flagInMainProcess",Nw="__pendingUpdate",Pw="__needsUpdateStatus",Ow=/^[a-zA-Z0-9_]+$/,Rw="__connectUpdateStatus";function kw(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!this.isDisposed())return Bw(this,e,t);lS(this.id)}}function zw(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Bw(this,e,t)}}function Bw(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),Ji.prototype[t].apply(e,n)}var Vw,Fw,Gw,Hw,Uw,Ww,Xw,jw,Yw,Zw,qw,Kw,$w,Jw,Qw,eS,tS,nS,rS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t}(Ji),iS=rS.prototype;iS.on=zw("on"),iS.off=zw("off");var oS=function(e){function t(t,n,r){var i=e.call(this,new wb)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],r=r||{},Kr(n)&&(n=fS[n]),i._dom=t;var o="canvas",a="auto",s=!1;if("production"!==process.env.NODE_ENV){var l=sr.hasGlobalWindow?window:global;l&&(o=li(l.__ECHARTS__DEFAULT__RENDERER__,o),a=li(l.__ECHARTS__DEFAULT__COARSE_POINTER,a),s=li(l.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,s))}r.ssr&&iu((function(e){var t=Ld(e),n=t.dataIndex;if(null!=n){var r=xi();return r.set("series_index",t.seriesIndex),r.set("data_index",n),t.ssrType&&r.set("ssr_type",t.ssrType),r}}));var u=i._zr=tu(t,{renderer:r.renderer||o,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:li(r.useDirtyRect,s),useCoarsePointer:li(r.useCoarsePointer,a),pointerSize:r.pointerSize});i._ssr=r.ssr,i._throttledZrFlush=Gx(jr(u.flush,u),17),(n=Ir(n))&&Gy(n,!0),i._theme=n,i._locale=function(e){if(Kr(e)){var t=Cm[e.toUpperCase()]||{};return e===Tm||e===Mm?Ir(t):Lr(Ir(t),Ir(Cm[Am]),!1)}return Lr(Ir(e),Ir(Cm[Am]),!1)}(r.locale||Em),i._coordSysMgr=new yy;var c=i._api=Qw(i);function h(e,t){return e.__prio-t.__prio}return sa(pS,h),sa(hS,h),i._scheduler=new eb(i,c,hS,pS),i._messageCenter=new rS,i._initEvents(),i.resize=jr(i.resize,i),u.animation.on("frame",i._onframe,i),Zw(u,i),qw(u,i),gi(i),i}return g(t,e),t.prototype._onframe=function(){if(!this._disposed){nS(this);var e=this._scheduler;if(this[Nw]){var t=this[Nw].silent;this[Lw]=!0;try{Vw(this),Hw.update.call(this,null,this[Nw].updateParams)}catch(e){throw this[Lw]=!1,this[Nw]=null,e}this._zr.flush(),this[Lw]=!1,this[Nw]=null,jw.call(this,t),Yw.call(this,t)}else if(e.unfinished){var n=1,r=this._model,i=this._api;e.unfinished=!1;do{var o=+new Date;e.performSeriesTasks(r),e.performDataProcessorTasks(r),Ww(this,r),e.performVisualTasks(r),Jw(this,this._model,i,"remain",{}),n-=+new Date-o}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(this[Lw])"production"!==process.env.NODE_ENV&&zu("`setOption` should not be called during main process.");else if(this._disposed)lS(this.id);else{var r,i,o;if(Qr(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,o=t.transition,t=t.notMerge),this[Lw]=!0,!this._model||t){var a=new xy(this._api),s=this._theme,l=this._model=new hy;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:i},dS);var u={seriesTransition:o,optionChanged:!0};if(n)this[Nw]={silent:r,updateParams:u},this[Lw]=!1,this.getZr().wakeUp();else{try{Vw(this),Hw.update.call(this,null,u)}catch(e){throw this[Nw]=null,this[Lw]=!1,e}this._ssr||this._zr.flush(),this[Nw]=null,this[Lw]=!1,jw.call(this,r),Yw.call(this,r)}}},t.prototype.setTheme=function(){Bu("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||sr.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return"production"!==process.env.NODE_ENV&&Vu("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"canvas"!==t.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return t.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var t=this._zr.painter;if("production"!==process.env.NODE_ENV&&"svg"!==t.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return t.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(sr.svgSupported){var e=this._zr;return Fr(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,r=[],i=this;Fr(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return Fr(r,(function(e){e.group.ignore=!1})),o}lS(this.id)},t.prototype.getConnectedDataURL=function(e){if(!this._disposed){var t="svg"===e.type,n=this.group,r=Math.min,i=Math.max,o=1/0;if(vS[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();Fr(mS,(function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(Ir(e)),p=o.getDom().getBoundingClientRect();a=r(p.left,a),s=r(p.top,s),l=i(p.right,l),u=i(p.bottom,u),c.push({dom:d,left:p.left,top:p.top})}}));var d=(l*=h)-(a*=h),p=(u*=h)-(s*=h),f=fr.createCanvas(),g=tu(f,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:p}),t){var m="";return Fr(c,(function(e){var t=e.left-a,n=e.top-s;m+='<g transform="translate('+t+","+n+')">'+e.dom+"</g>"})),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new fd({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),Fr(c,(function(e){var t=new ad({style:{x:e.left*h-a,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}lS(this.id)},t.prototype.convertToPixel=function(e,t){return Uw(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return Uw(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return Fr(sc(this._model,e),(function(e,r){r.indexOf("Models")>=0&&Fr(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n=n||!!i.containPoint(t);else if("seriesModels"===r){var o=this._chartsMap[e.__viewId];o&&o.containPoint?n=n||o.containPoint(t,e):"production"!==process.env.NODE_ENV&&ku(r+": "+(o?"The found component do not support containPoint.":"No view mapping to the found component."))}else"production"!==process.env.NODE_ENV&&ku(r+": containPoint is not supported")}),this)}),this),!!n;lS(this.id)},t.prototype.getVisual=function(e,t){var n=sc(this._model,e,{defaultMainType:"series"}),r=n.seriesModel;"production"!==process.env.NODE_ENV&&(r||ku("There is no specified series model"));var i=r.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?Cb(i,o,t):Db(i,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,r=this;Fr(sS,(function(e){var t=function(t){var n,i=r.getModel(),o=t.target,a="globalout"===e;if(a?n={}:o&&Nb(o,(function(e){var t=Ld(e);if(t&&null!=t.dataIndex){var r=t.dataModel||i.getSeriesByIndex(t.seriesIndex);return n=r&&r.getDataParams(t.dataIndex,t.dataType,o)||{},!0}if(t.eventData)return n=Pr({},t.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&i.getComponent(s,l),c=u&&r["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];"production"!==process.env.NODE_ENV&&(a||u&&c||ku("model or view can not be found by params")),n.event=t,n.type=e,r._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:u,view:c},r.trigger(e,n)}};t.zrEventfulCallAtLast=!0,r._zr.on(e,t,r)})),Fr(cS,(function(e,t){r._messageCenter.on(t,(function(e){this.trigger(t,e)}),r)})),Fr(["selectchanged"],(function(e){r._messageCenter.on(e,(function(t){this.trigger(e,t)}),r)})),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",(function(e){var r=n.getModel();e.isFromClick?(Lb("map","selectchanged",t,r,e),Lb("pie","selectchanged",t,r,e)):"select"===e.fromAction?(Lb("map","selected",t,r,e),Lb("pie","selected",t,r,e)):"unselect"===e.fromAction&&(Lb("map","unselected",t,r,e),Lb("pie","unselected",t,r,e))}))},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?lS(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)lS(this.id);else{this._disposed=!0,this.getDom()&&dc(this.getDom(),xS,"");var e=this,t=e._api,n=e._model;Fr(e._componentsViews,(function(e){e.dispose(n,t)})),Fr(e._chartsViews,(function(e){e.dispose(n,t)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete mS[e.id]}},t.prototype.resize=function(e){if(this[Lw])"production"!==process.env.NODE_ENV&&zu("`resize` should not be called during main process.");else if(this._disposed)lS(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),r=e&&e.silent;this[Nw]&&(null==r&&(r=this[Nw].silent),n=!0,this[Nw]=null),this[Lw]=!0;try{n&&Vw(this),Hw.update.call(this,{type:"resize",animation:Pr({duration:0},e&&e.animation)})}catch(e){throw this[Lw]=!1,e}this[Lw]=!1,jw.call(this,r),Yw.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed)lS(this.id);else if(Qr(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),gS[e]){var n=gS[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}else"production"!==process.env.NODE_ENV&&ku("Loading effects "+e+" not exists.")},t.prototype.hideLoading=function(){this._disposed?lS(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=Pr({},e);return t.type=cS[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)lS(this.id);else if(Qr(t)||(t={silent:!!t}),uS[e.type]&&this._model)if(this[Lw])this._pendingActions.push(e);else{var n=t.silent;Xw.call(this,e,n);var r=t.flush;r?this._zr.flush():!1!==r&&sr.browser.weChat&&this._throttledZrFlush(),jw.call(this,n),Yw.call(this,n)}},t.prototype.updateLabelLayout=function(){Mw.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)lS(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);"production"!==process.env.NODE_ENV&&di(e.data&&n),n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function t(e){for(var t=[],n=e.currentStates,r=0;r<n.length;r++){var i=n[r];"emphasis"!==i&&"blur"!==i&&"select"!==i&&t.push(i)}e.selected&&e.states.select&&t.push("select"),e.hoverState===Vd&&e.states.emphasis?t.push("emphasis"):e.hoverState===Bd&&e.states.blur&&t.push("blur"),e.useStates(t)}function n(e,t){if(!e.preventAutoZ){var n=e.get("z")||0,i=e.get("zlevel")||0;t.eachRendered((function(e){return r(e,n,i,-1/0),!0}))}}function r(e,t,n,i){var o=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var s=e.childrenRef(),l=0;l<s.length;l++)i=Math.max(r(s[l],t,n,i),i);else e.z=t,e.zlevel=n,i=Math.max(e.z2,i);if(o&&(o.z=t,o.zlevel=n,isFinite(i)&&(o.z2=i+2)),a){var u=e.textGuideLineConfig;a.z=t,a.zlevel=n,isFinite(i)&&(a.z2=i+(u&&u.showAbove?1:-1))}return i}function i(e,t){t.eachRendered((function(e){if(!hg(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&(e.stateTransition=null),t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&(e.prevStates=null)}}))}function o(e,n){var r=e.getModel("stateAnimation"),i=e.isAnimationEnabled(),o=r.get("duration"),a=o>0?{duration:o,delay:r.get("delay"),easing:r.get("easing")}:null;n.eachRendered((function(e){if(e.states&&e.states.emphasis){if(hg(e))return;if(e instanceof ed&&function(e){var t=Rd(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(i){e.stateTransition=a;var r=e.getTextContent(),o=e.getTextGuideLine();r&&(r.stateTransition=a),o&&(o.stateTransition=a)}e.__dirty&&t(e)}}))}Vw=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),Fw(e,!0),Fw(e,!1),t.plan()},Fw=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,o=t?e._componentsMap:e._chartsMap,a=e._zr,s=e._api,l=0;l<i.length;l++)i[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&o[u];if(!c){var h=yc(e.type),d=t?Cx.getClass(h.main,h.sub):zx.getClass(h.sub);"production"!==process.env.NODE_ENV&&di(d,h.sub+" does not exist."),(c=new d).init(n,s),o[u]=c,i.push(c),a.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&r.prepareView(c,e,n,s)}t?n.eachComponent((function(e,t){"series"!==e&&u(t)})):n.eachSeries(u);for(l=0;l<i.length;){var c=i[l];c.__alive?l++:(!t&&c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),i.splice(l,1),o[c.__id]===c&&delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}},Gw=function(e,t,n,r,i){var o=e._model;if(o.setUpdatePayload(n),r){var a={};a[r+"Id"]=n[r+"Id"],a[r+"Index"]=n[r+"Index"],a[r+"Name"]=n[r+"Name"];var s={mainType:r,query:a};i&&(s.subType=i);var l,u=n.excludeSeriesId;null!=u&&(l=xi(),Fr(Xu(u),(function(e){var t=Qu(e,null);null!=t&&l.set(t,!0)}))),o&&o.eachComponent(s,(function(t){if(!(l&&null!=l.get(t.id)))if(Np(n))if(t instanceof Mx)n.type!==Wd||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var r=e.seriesIndex,i=e.getData(t.dataType);if(i){var o=ic(i,t);o=(Zr(o)?o[0]:o)||0;var a=i.getItemGraphicEl(o);if(!a)for(var s=i.count(),l=0;!a&&l<s;)a=i.getItemGraphicEl(l++);if(a){var u=Ld(a);yp(r,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&yp(r,c,h,n)}}else"production"!==process.env.NODE_ENV&&zu("Unknown dataType "+t.dataType)}(t,n,e._api);else{var r=xp(t.mainType,t.componentIndex,n.name,e._api),i=r.focusSelf,o=r.dispatchers;n.type===Wd&&i&&!n.notBlur&&_p(t.mainType,t.componentIndex,e._api),o&&Fr(o,(function(e){n.type===Wd?cp(e):hp(e)}))}else Lp(n)&&t instanceof Mx&&(!function(e,t,n){if(Lp(t)){var r=t.dataType,i=ic(e.getData(r),t);Zr(i)||(i=[i]),e[t.type===Zd?"toggleSelect":t.type===jd?"select":"unselect"](i,r)}}(t,n,e._api),bp(t),tS(e))}),e),o&&o.eachComponent(s,(function(t){l&&null!=l.get(t.id)||c(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else Fr([].concat(e._componentsViews).concat(e._chartsViews),c);function c(r){r&&r.__alive&&r[t]&&r[t](r.__model,o,e._api,n)}},Hw={prepareAndUpdate:function(e){Vw(this),Hw.update.call(this,e,{optionChanged:null!=e.newOption})},update:function(t,n){var r=this._model,i=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(r){r.setUpdatePayload(t),s.restoreData(r,t),s.performSeriesTasks(r),a.create(r,i),s.performDataProcessorTasks(r,t),Ww(this,r),a.update(r,i),e(r),s.performVisualTasks(r,t),Kw(this,r,i,t,n);var l=r.get("backgroundColor")||"transparent",u=r.get("darkMode");o.setBackgroundColor(l),null!=u&&"auto"!==u&&o.setDarkMode(u),Mw.trigger("afterupdate",r,i)}},updateTransform:function(t){var n=this,r=this._model,i=this._api;if(r){r.setUpdatePayload(t);var o=[];r.eachComponent((function(e,a){if("series"!==e){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,r,i,t);l&&l.update&&o.push(s)}else o.push(s)}}));var a=xi();r.eachSeries((function(e){var o=n._chartsMap[e.__viewId];if(o.updateTransform){var s=o.updateTransform(e,r,i,t);s&&s.update&&a.set(e.uid,1)}else a.set(e.uid,1)})),e(r),this._scheduler.performVisualTasks(r,t,{setDirty:!0,dirtyMap:a}),Jw(this,r,i,t,{},a),Mw.trigger("afterupdate",r,i)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),zx.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),Kw(this,n,this._api,t,{}),Mw.trigger("afterupdate",n,this._api))},updateVisual:function(t){var n=this,r=this._model;r&&(r.setUpdatePayload(t),r.eachSeries((function(e){e.getData().clearAllVisual()})),zx.markUpdateMethod(t,"updateVisual"),e(r),this._scheduler.performVisualTasks(r,t,{visualType:"visual",setDirty:!0}),r.eachComponent((function(e,i){if("series"!==e){var o=n.getViewOfComponentModel(i);o&&o.__alive&&o.updateVisual(i,r,n._api,t)}})),r.eachSeries((function(e){n._chartsMap[e.__viewId].updateVisual(e,r,n._api,t)})),Mw.trigger("afterupdate",r,this._api))},updateLayout:function(e){Hw.update.call(this,e)}},Uw=function(e,t,n,r){if(e._disposed)lS(e.id);else{for(var i,o=e._model,a=e._coordSysMgr.getCoordinateSystems(),s=sc(o,n),l=0;l<a.length;l++){var u=a[l];if(u[t]&&null!=(i=u[t](o,s,r)))return i}"production"!==process.env.NODE_ENV&&ku("No coordinate system that supports "+t+" found by the given finder.")}},Ww=function(e,t){var n=e._chartsMap,r=e._scheduler;t.eachSeries((function(e){r.updateStreamModes(e,n[e.__viewId])}))},Xw=function(e,t){var n=this,r=this.getModel(),i=e.type,o=e.escapeConnect,a=uS[i],s=a.actionInfo,l=(s.update||"update").split(":"),u=l.pop(),c=null!=l[0]&&yc(l[0]);this[Lw]=!0;var h=[e],d=!1;e.batch&&(d=!0,h=Gr(e.batch,(function(t){return(t=Or(Pr({},t),e)).batch=null,t})));var p,f=[],g=Lp(e),m=Np(e);if(m&&vp(this._api),Fr(h,(function(t){if((p=(p=a.action(t,n._model,n._api))||Pr({},t)).type=s.event||p.type,f.push(p),m){var r=lc(e),i=r.queryOptionMap,o=r.mainTypeSpecified?i.keys()[0]:"series";Gw(n,u,t,o),tS(n)}else g?(Gw(n,u,t,"series"),tS(n)):c&&Gw(n,u,t,c.main,c.sub)})),"none"!==u&&!m&&!g&&!c)try{this[Nw]?(Vw(this),Hw.update.call(this,e),this[Nw]=null):Hw[u].call(this,e)}catch(e){throw this[Lw]=!1,e}if(p=d?{type:s.event||i,escapeConnect:o,batch:f}:f[0],this[Lw]=!1,!t){var v=this._messageCenter;if(v.trigger(p.type,p),g){var y={type:"selectchanged",escapeConnect:o,selected:wp(r),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};v.trigger(y.type,y)}}},jw=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();Xw.call(this,n,e)}},Yw=function(e){!e&&this.trigger("updated")},Zw=function(e,t){e.on("rendered",(function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[Nw]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))},qw=function(e,t){e.on("mouseover",(function(e){var n=Nb(e.target,Ip);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||Ip(e)||zu("param should be highDownDispatcher");var r=Ld(e),i=xp(r.componentMainType,r.componentIndex,r.componentHighDownName,n),o=i.dispatchers,a=i.focusSelf;o?(a&&_p(r.componentMainType,r.componentIndex,n),Fr(o,(function(e){return lp(e,t)}))):(yp(r.seriesIndex,r.focus,r.blurScope,n),"self"===r.focus&&_p(r.componentMainType,r.componentIndex,n),lp(e,t))}(n,e,t._api),tS(t))})).on("mouseout",(function(e){var n=Nb(e.target,Ip);n&&(!function(e,t,n){"production"===process.env.NODE_ENV||Ip(e)||zu("param should be highDownDispatcher"),vp(n);var r=Ld(e),i=xp(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?Fr(i,(function(e){return up(e,t)})):up(e,t)}(n,e,t._api),tS(t))})).on("click",(function(e){var n=Nb(e.target,(function(e){return null!=Ld(e).dataIndex}),!0);if(n){var r=n.selected?"unselect":"select",i=Ld(n);t._api.dispatchAction({type:r,dataType:i.dataType,dataIndexInside:i.dataIndex,seriesIndex:i.seriesIndex,isFromClick:!0})}}))},Kw=function(e,t,n,r,i){!function(e){var t=[],n=[],r=!1;if(e.eachComponent((function(e,i){var o=i.get("zlevel")||0,a=i.get("z")||0,s=i.getZLevelKey();r=r||!!s,("series"===e?n:t).push({zlevel:o,z:a,idx:i.componentIndex,type:e,key:s})})),r){var i,o,a=t.concat(n);sa(a,(function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel})),Fr(a,(function(t){var n=e.getComponent(t.type,t.idx),r=t.zlevel,a=t.key;null!=i&&(r=Math.max(i,r)),a?(r===i&&a!==o&&r++,o=a):o&&(r===i&&r++,o=""),i=r,n.setZLevel(r)}))}}(t),$w(e,t,n,r,i),Fr(e._chartsViews,(function(e){e.__alive=!1})),Jw(e,t,n,r,i),Fr(e._chartsViews,(function(e){e.__alive||e.remove(t,n)}))},$w=function(e,t,r,a,s,l){Fr(l||e._componentsViews,(function(e){var s=e.__model;i(s,e),e.render(s,t,r,a),n(s,e),o(s,e)}))},Jw=function(e,t,r,a,s,l){var u=e._scheduler;s=Pr(s||{},{updatedSeries:t.getSeries()}),Mw.trigger("series:beforeupdate",t,r,s);var c=!1;t.eachSeries((function(t){var n=e._chartsMap[t.__viewId];n.__alive=!0;var r=n.renderTask;u.updatePayload(r,a),i(t,n),l&&l.get(t.uid)&&r.dirty(),r.perform(u.getPerformArgs(r))&&(c=!0),n.group.silent=!!t.get("silent"),function(e,t){var n=e.get("blendMode")||null;t.eachRendered((function(e){e.isGroup||(e.style.blend=n)}))}(t,n),bp(t)})),u.unfinished=c||u.unfinished,Mw.trigger("series:layoutlabels",t,r,s),Mw.trigger("series:transition",t,r,s),t.eachSeries((function(t){var r=e._chartsMap[t.__viewId];n(t,r),o(t,r)})),function(e,t){var n=e._zr,r=n.storage,i=0;r.traverse((function(e){e.isGroup||i++})),i>t.get("hoverLayerThreshold")&&!sr.node&&!sr.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,t),Mw.trigger("series:afterupdate",t,r,s)},tS=function(e){e[Pw]=!0,e.getZr().wakeUp()},nS=function(e){e[Pw]&&(e.getZr().storage.traverse((function(e){hg(e)||t(e)})),e[Pw]=!1)},Qw=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return g(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){cp(t,n),tS(e)},n.prototype.leaveEmphasis=function(t,n){hp(t,n),tS(e)},n.prototype.enterBlur=function(t){dp(t),tS(e)},n.prototype.leaveBlur=function(t){pp(t),tS(e)},n.prototype.enterSelect=function(t){fp(t),tS(e)},n.prototype.leaveSelect=function(t){gp(t),tS(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(my))(e)},eS=function(e){function t(e,t){for(var n=0;n<e.length;n++){e[n][Rw]=t}}Fr(cS,(function(n,r){e._messageCenter.on(r,(function(n){if(vS[e.group]&&0!==e[Rw]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),i=[];Fr(mS,(function(t){t!==e&&t.group===e.group&&i.push(t)})),t(i,0),Fr(i,(function(e){1!==e[Rw]&&e.dispatchAction(r)})),t(i,2)}}))}))}}(),t}(Ji),aS=oS.prototype;aS.on=kw("on"),aS.off=kw("off"),aS.one=function(e,t,n){var r=this;Bu("ECharts#one is deprecated."),this.on.call(this,e,(function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];t&&t.apply&&t.apply(this,i),r.off(e,n)}),n)};var sS=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function lS(e){"production"!==process.env.NODE_ENV&&ku("Instance "+e+" has been disposed")}var uS={},cS={},hS=[],dS=[],pS=[],fS={},gS={},mS={},vS={},yS=+new Date-0,_S=+new Date-0,xS="_echarts_instance_";function bS(e,t,n){var r=!(n&&n.ssr);if(r){if("production"!==process.env.NODE_ENV&&!e)throw new Error("Initialize failed: invalid dom.");var i=TS(e);if(i)return"production"!==process.env.NODE_ENV&&ku("There is a chart instance already initialized on the dom."),i;"production"!==process.env.NODE_ENV&&(!ni(e)||"CANVAS"===e.nodeName.toUpperCase()||(e.clientWidth||n&&null!=n.width)&&(e.clientHeight||n&&null!=n.height)||ku("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."))}var o=new oS(e,t,n);return o.id="ec_"+yS++,mS[o.id]=o,r&&dc(e,xS,o.id),eS(o),Mw.trigger("afterinit",o),o}function wS(e){vS[e]=!1}var SS=wS;function TS(e){return mS[function(e,t){return e.getAttribute?e.getAttribute(t):e[t]}(e,xS)]}function MS(e,t){fS[e]=t}function AS(e){kr(dS,e)<0&&dS.push(e)}function CS(e,t){zS(hS,e,t,2e3)}function DS(e){IS("afterinit",e)}function ES(e){IS("afterupdate",e)}function IS(e,t){Mw.on(e,t)}function LS(e,t,n){qr(t)&&(n=t,t="");var r=Qr(e)?e.type:[e,e={event:t}][0];e.event=(e.event||r).toLowerCase(),t=e.event,cS[t]||(di(Ow.test(r)&&Ow.test(t)),uS[r]||(uS[r]={action:n,actionInfo:e}),cS[t]=r)}function NS(e,t){yy.register(e,t)}function PS(e){var t=yy.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()}function OS(e,t){zS(pS,e,t,1e3,"layout")}function RS(e,t){zS(pS,e,t,3e3,"visual")}var kS=[];function zS(e,t,n,r,i){if((qr(t)||Qr(t))&&(n=t,t=r),"production"!==process.env.NODE_ENV){if(isNaN(t)||null==t)throw new Error("Illegal priority");Fr(e,(function(e){di(e.__raw!==n)}))}if(!(kr(kS,n)>=0)){kS.push(n);var o=eb.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function BS(e,t){gS[e]=t}function VS(e,t,n){var r=Cw("registerMap");r&&r(e,t,n)}function FS(e){var t=Cw("getMap");return t&&t(e)}var GS=function(e){var t=(e=Ir(e)).type,n="";t||("production"!==process.env.NODE_ENV&&(n="Must have a `type` when `registerTransform`."),Gu(n));var r=t.split(":");2!==r.length&&("production"!==process.env.NODE_ENV&&(n='Name must include namespace like "ns:regression".'),Gu(n));var i=!1;"echarts"===r[0]&&(t=r[1],i=!0),e.__isBuiltIn=i,P_.set(t,e)};RS(Dw,qx),RS(Ew,$x),RS(Ew,Jx),RS(Dw,Mb),RS(Ew,Ab),RS(7e3,(function(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each((function(e){var n=r.getItemVisual(e,"decal");n&&(r.ensureUniqueItemVisual(e,"style").decal=bw(n,t))}));var i=r.getVisual("decal");if(i)r.getVisual("style").decal=bw(i,t)}}))})),AS(Gy),CS(900,(function(e){var t=xi();e.eachSeries((function(e){var n=e.get("stack");if(n){var r=t.get(n)||t.set(n,[]),i=e.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:e};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;r.length&&i.setCalculationInfo("stackedOnSeries",r[r.length-1].seriesModel),r.push(o)}})),t.each(Hy)})),BS("default",(function(e,t){Or(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Kl,r=new fd({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i,o=new Id({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new fd({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(a),t.showSpinner&&((i=new Uf({shape:{startAngle:-Qx/2,endAngle:-Qx/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Qx/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*Qx/2}).delay(300).start("circularInOut"),n.add(i)),n.resize=function(){var n=o.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),u=e.getHeight()/2;t.showSpinner&&i.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n})),LS({type:Wd,event:Wd,update:Wd},Mi),LS({type:Xd,event:Xd,update:Xd},Mi),LS({type:jd,event:jd,update:jd},Mi),LS({type:Yd,event:Yd,update:Yd},Mi),LS({type:Zd,event:Zd,update:Zd},Mi),MS("light",mb),MS("dark",bb);var HS=[],US={registerPreprocessor:AS,registerProcessor:CS,registerPostInit:DS,registerPostUpdate:ES,registerUpdateLifecycle:IS,registerAction:LS,registerCoordinateSystem:NS,registerLayout:OS,registerVisual:RS,registerTransform:GS,registerLoading:BS,registerMap:VS,registerImpl:function(e,t){"production"!==process.env.NODE_ENV&&Aw[e]&&zu("Already has an implementation of "+e+"."),Aw[e]=t},PRIORITY:Iw,ComponentModel:Nv,ComponentView:Cx,SeriesModel:Mx,ChartView:zx,registerComponentModel:function(e){Nv.registerClass(e)},registerComponentView:function(e){Cx.registerClass(e)},registerSeriesModel:function(e){Mx.registerClass(e)},registerChartView:function(e){zx.registerClass(e)},registerSubTypeDefaulter:function(e,t){Nv.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){nu(e,t)}};function WS(e){Zr(e)?Fr(e,(function(e){WS(e)})):kr(HS,e)>=0||(HS.push(e),qr(e)&&(e={install:e}),e.install(US))}function XS(e){return null==e?0:e.length||1}function jS(e){return e}var YS=function(){function e(e,t,n,r,i,o){this._old=e,this._new=t,this._oldKeyGetter=n||jS,this._newKeyGetter=r||jS,this.context=i,this._diffModeMultiple="multiple"===o}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=new Array(e.length),i=new Array(t.length);this._initIndexMap(e,null,r,"_oldKeyGetter"),this._initIndexMap(t,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var a=r[o],s=n[a],l=XS(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(t,r,o,"_newKeyGetter");for(var a=0;a<i.length;a++){var s=i[a],l=n[s],u=r[s],c=XS(l),h=XS(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),r[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),r[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),r[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),r[s]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],o=XS(i);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(i[a]);else 1===o&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var a="_ec_"+this[r](e[o],o);if(i||(n[o]=a),t){var s=t[a],l=XS(s);0===l?(t[a]=o,i&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),ZS=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e}();function qS(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function KS(e){return"category"===e?"ordinal":"time"===e?"time":"float"}var $S=function(e){this.otherDims={},null!=e&&Pr(this,e)},JS=oc(),QS={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},eT=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=rT(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return li(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=t_(this.source),n=!iT(e),r="",i=[],o=0,a=0;o<e;o++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];if(c&&c.storeDimIndex===o)s=t?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=t?h.name:null,l=h.type)}i.push({property:s,type:l,ordinalMeta:u}),!t||null==s||c&&c.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+="$",r+=QS[l]||"f",u&&(r+=u.uid),r+="$"}var d=this.source;return{dimensions:i,hash:[d.seriesLayoutBy,d.startIndex,r].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var o=this.getSourceDimension(t);o&&(r=o.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function tT(e){return e instanceof eT}function nT(e){for(var t=xi(),n=0;n<(e||[]).length;n++){var r=e[n],i=Qr(r)?r.name:r;null!=i&&null==t.get(i)&&t.set(i,n)}return t}function rT(e){var t=JS(e);return t.dimNameMap||(t.dimNameMap=nT(e.dimensionsDefine))}function iT(e){return e>30}var oT,aT,sT,lT,uT,cT,hT,dT=Qr,pT=Gr,fT="undefined"==typeof Int32Array?Array:Int32Array,gT=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],mT=["_approximateExtent"],vT=function(){function e(e,t){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var r=!1;tT(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n=n||["x","y"];for(var i={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var c=n[u],h=Kr(c)?new $S({name:c}):c instanceof $S?c:new $S(c),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===p.itemName&&(this._nameDimIdx=u),0===p.itemId&&(this._idDimIdx=u),"production"!==process.env.NODE_ENV&&di(r||h.storeDimIndex>=0),r&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=xi();Fr(o,(function(e){f.set(i[e].storeDimIndex,e)}))}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(null==t)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(null!=n)return n;var r=this._schema.getSourceDimension(t);return r?r.name:void 0},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(null!=t)return t;if(null==e)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(Jr(e)||null!=e&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);if("production"!==process.env.NODE_ENV&&null==t)throw new Error("Unknown dimension "+e);return t},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r,i=this;if(e instanceof X_&&(r=e),!r){var o=this.dimensions,a=qy(e)||Vr(e)?new n_(e,o.length):e;r=new X_;var s=pT(o,(function(e){return{type:i._dimInfos[e].type,property:e}}));r.initData(a,s,n)}this._store=r,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,r.count()),this._dimSummary=function(e,t){var n={},r=n.encode={},i=xi(),o=[],a=[],s={};Fr(e.dimensions,(function(t){var n,l=e.getDimensionInfo(t),u=l.coordDim;if(u){"production"!==process.env.NODE_ENV&&di(null==kv.get(u));var c=l.coordDimIndex;qS(r,u)[c]=t,l.isExtraCoord||(i.set(u,1),"ordinal"!==(n=l.type)&&"time"!==n&&(o[0]=t),qS(s,u)[c]=e.getDimensionIndex(l.name)),l.defaultTooltip&&a.push(t)}kv.each((function(e,t){var n=qS(r,t),i=l.otherDims[t];null!=i&&!1!==i&&(n[i]=l.name)}))}));var l=[],u={};i.each((function(e,t){var n=r[t];u[t]=n[0],l=l.concat(n)})),n.dataDimsOnCoord=l,n.dataDimIndicesOnCoord=Gr(l,(function(t){return e.getDimensionInfo(t).storeDimIndex})),n.encodeFirstDimNotExtra=u;var c=r.label;c&&c.length&&(o=c.slice());var h=r.tooltip;return h&&h.length?a=h.slice():a.length||(a=o.slice()),r.defaultedLabel=o,r.defaultedTooltip=a,n.userOutput=new ZS(s,t),n}(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t.length),r=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var a=r;a<i;a++){var s=a-r;this._nameList[a]=t[s],o&&hT(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return null==this._idDimIdx&&e.getSource().sourceFormat!==Gv&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===zv&&!n.pure)for(var o=[],a=e;a<t;a++){var s=n.getItem(a,o);if(!this.hasItemOption&&qu(s)&&(this.hasItemOption=!0),s){var l=s.name;null==r[a]&&null!=l&&(r[a]=Qu(l,null));var u=s.id;null==i[a]&&null!=u&&(i[a]=Qu(u,null))}}if(this._shouldMakeIdFromName())for(a=e;a<t;a++)hT(this,a);oT(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){dT(e)?Pr(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=sT(this,this._nameDimIdx,t)),null==n&&(n=""),n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return aT(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return Zr(e)?r.getValues(pT(e,(function(e){return n._getStoreDimIndex(e)})),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e];if("production"!==process.env.NODE_ENV&&!n)throw new Error("Do not supported yet");var r=n[t];return null==r||isNaN(r)?-1:r},e.prototype.indicesOfNearest=function(e,t,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,n)},e.prototype.each=function(e,t,n){qr(e)&&(n=t,t=e,e=[]);var r=n||this,i=pT(lT(e),this._getStoreDimIndex,this);this._store.each(i,r?jr(t,r):t)},e.prototype.filterSelf=function(e,t,n){qr(e)&&(n=t,t=e,e=[]);var r=n||this,i=pT(lT(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?jr(t,r):t),this},e.prototype.selectRange=function(e){var t=this,n={};return Fr(Xr(e),(function(r){var i=t._getStoreDimIndex(r);n[i]=e[r]})),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){qr(e)&&(n=t,t=e,e=[]),n=n||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),n),r},e.prototype.map=function(e,t,n,r){var i=n||r||this,o=pT(lT(e),this._getStoreDimIndex,this),a=cT(this);return a._store=this._store.map(o,i?jr(t,i):t),a},e.prototype.modify=function(e,t,n,r){var i=this,o=n||r||this;"production"!==process.env.NODE_ENV&&Fr(lT(e),(function(e){i.getDimensionInfo(e).isCalculationCoord||console.error("Danger: only stack dimension can be modified")}));var a=pT(lT(e),this._getStoreDimIndex,this);this._store.modify(a,o?jr(t,o):t)},e.prototype.downSample=function(e,t,n,r){var i=cT(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.lttbDownSample=function(e,t){var n=cT(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new xm(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new YS(e?e.getStore().getIndices():[],this.getStore().getIndices(),(function(t){return aT(e,t)}),(function(e){return aT(t,e)}))},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},dT(e)?Pr(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],r=n&&n[t];return null==r?this.getVisual(t):r},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||(r=n[e]={});var i=r[t];return null==i&&(Zr(i=this.getVisual(t))?i=i.slice():dT(i)&&(i=Pr({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,dT(t)?Pr(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){dT(e)?Pr(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?Pr(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;Nd(n,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){Fr(this._graphicEls,(function(n,r){n&&e&&e.call(t,n,r)}))},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:pT(this.dimensions,this._getDimInfo,this),this.hostModel)),uT(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];qr(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(ci(arguments)))})},e.internalField=(oT=function(e){var t=e._invertedIndicesMap;Fr(t,(function(n,r){var i=e._dimInfos[r],o=i.ordinalMeta,a=e._store;if(o){n=t[r]=new fT(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)n[a.get(i.storeDimIndex,s)]=s}}))},sT=function(e,t,n){return Qu(e._getCategory(t,n),null)},aT=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=sT(e,e._idDimIdx,t)),null==n&&(n="e\0\0"+t),n},lT=function(e){return Zr(e)||(e=null!=e?[e]:[]),e},cT=function(t){var n=new e(t._schema?t._schema:pT(t.dimensions,t._getDimInfo,t),t.hostModel);return uT(n,t),n},uT=function(e,t){Fr(gT.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,Fr(mT,(function(n){e[n]=Ir(t[n])})),e._calculationInfo=Pr({},t._calculationInfo)},void(hT=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,o=e._idDimIdx,a=n[t],s=r[t];if(null==a&&null!=i&&(n[t]=a=sT(e,i,t)),null==s&&null!=o&&(r[t]=s=sT(e,o,t)),null==s&&null!=a){var l=e._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),r[t]=s}})),e}(),yT=vT;function _T(e,t){return xT(e,t).dimensions}function xT(e,t){qy(e)||(e=$y(e));var n=(t=t||{}).coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=xi(),o=[],a=function(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return Fr(t,(function(e){var t;Qr(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))})),i}(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&iT(a),l=r===e.dimensionsDefine,u=l?rT(e):nT(r),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,a));for(var h=xi(c),d=new F_(a),p=0;p<d.length;p++)d[p]=-1;function f(e){var t=d[e];if(t<0){var n=r[e],i=Qr(n)?n:{name:n},a=new $S,s=i.name;null!=s&&null!=u.get(s)&&(a.name=a.displayName=s),null!=i.type&&(a.type=i.type),null!=i.displayName&&(a.displayName=i.displayName);var l=o.length;return d[e]=l,a.storeDimIndex=e,o.push(a),a}return o[t]}if(!s)for(p=0;p<a;p++)f(p);h.each((function(e,t){var n=Xu(e).slice();if(1===n.length&&!Kr(n[0])&&n[0]<0)h.set(t,!1);else{var r=h.set(t,[]);Fr(n,(function(e,n){var i=Kr(e)?u.get(e):e;null!=i&&i<a&&(r[n]=i,m(f(i),t,n))}))}}));var g=0;function m(e,t,n){null!=kv.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,i.set(t,!0))}Fr(n,(function(e){var t,n,r,i;if(Kr(e))t=e,i={};else{t=(i=e).name;var o=i.ordinalMeta;i.ordinalMeta=null,(i=Pr({},i)).ordinalMeta=o,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=h.get(t);if(!1!==s){if(!(s=Xu(s)).length)for(var u=0;u<(n&&n.length||1);u++){for(;g<a&&null!=f(g).coordDim;)g++;g<a&&s.push(g++)}Fr(s,(function(e,o){var a=f(e);if(l&&null!=i.type&&(a.type=i.type),m(Or(a,i),t,o),null==a.name&&n){var s=n[o];!Qr(s)&&(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}r&&Or(a.otherDims,r)}))}}));var v=t.generateCoord,y=t.generateCoordCount,_=null!=y;y=v?y||1:0;var x=v||"value";function b(e){null==e.name&&(e.name=e.coordDim)}if(s)Fr(o,(function(e){b(e)})),o.sort((function(e,t){return e.storeDimIndex-t.storeDimIndex}));else for(var w=0;w<a;w++){var S=f(w);null==S.coordDim&&(S.coordDim=bT(x,i,_),S.coordDimIndex=0,(!v||y<=0)&&(S.isExtraCoord=!0),y--),b(S),null!=S.type||Kv(e,w)!==Xv.Must&&(!S.isExtraCoord||null==S.otherDims.itemName&&null==S.otherDims.seriesName)||(S.type="ordinal")}return function(e){for(var t=xi(),n=0;n<e.length;n++){var r=e[n],i=r.name,o=t.get(i)||0;o>0&&(r.name=i+(o-1)),o++,t.set(i,o)}}(o),new eT({source:e,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function bT(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var wT=function(e){this.coordSysDims=[],this.axisMap=xi(),this.categoryAxisMap=xi(),this.coordSysName=e};var ST={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents("xAxis",uc).models[0],o=e.getReferringComponents("yAxis",uc).models[0];if("production"!==process.env.NODE_ENV){if(!i)throw new Error('xAxis "'+si(e.get("xAxisIndex"),e.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+si(e.get("xAxisIndex"),e.get("yAxisId"),0)+'" not found')}t.coordSysDims=["x","y"],n.set("x",i),n.set("y",o),TT(i)&&(r.set("x",i),t.firstCategoryDimIndex=0),TT(o)&&(r.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,r){var i=e.getReferringComponents("singleAxis",uc).models[0];if("production"!==process.env.NODE_ENV&&!i)throw new Error("singleAxis should be specified.");t.coordSysDims=["single"],n.set("single",i),TT(i)&&(r.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents("polar",uc).models[0],o=i.findAxisModel("radiusAxis"),a=i.findAxisModel("angleAxis");if("production"!==process.env.NODE_ENV){if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),TT(o)&&(r.set("radius",o),t.firstCategoryDimIndex=0),TT(a)&&(r.set("angle",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,r){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,r){var i=e.ecModel,o=i.getComponent("parallel",e.get("parallelIndex")),a=t.coordSysDims=o.dimensions.slice();Fr(o.parallelAxisIndex,(function(e,o){var s=i.getComponent("parallelAxis",e),l=a[o];n.set(l,s),TT(s)&&(r.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))}))}};function TT(e){return"category"===e.get("type")}function MT(e,t,n){var r,i,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(e){return!tT(e.schema)}(t)?(i=t.schema,r=i.dimensions,o=t.store):r=t;var l,u,c,h,d=!(!e||!e.get("stack"));if(Fr(r,(function(e,t){Kr(e)&&(r[t]=e={name:e}),d&&!e.isExtraCoord&&(a||l||!e.ordinalMeta||(l=e),u||"ordinal"===e.type||"time"===e.type||s&&s!==e.coordDim||(u=e))})),!u||a||l||(a=!0),u){c="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,f=u.type,g=0;Fr(r,(function(e){e.coordDim===p&&g++}));var m={name:c,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length},v={name:h,coordDim:h,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length+1};i?(o&&(m.storeDimIndex=o.ensureCalculationDimension(h,f),v.storeDimIndex=o.ensureCalculationDimension(c,f)),i.appendCalculationDimension(m),i.appendCalculationDimension(v)):(r.push(m),r.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:h,stackResultDimension:c}}function AT(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function CT(e,t){return AT(e,t)?e.getCalculationInfo("stackResultDimension"):t}function DT(e,t,n){n=n||{};var r,i=t.getSourceManager(),o=!1;e?(o=!0,r=$y(e)):o=(r=i.getSource()).sourceFormat===zv;var a=function(e){var t=e.get("coordinateSystem"),n=new wT(t),r=ST[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}(t),s=function(e,t){var n,r=e.get("coordinateSystem"),i=yy.get(r);return t&&t.coordSysDims&&(n=Gr(t.coordSysDims,(function(e){var n={name:e},r=t.axisMap.get(e);if(r){var i=r.get("type");n.type=KS(i)}return n}))),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}(t,a),l=n.useEncodeDefaulter,u=qr(l)?l:l?Yr(Yv,s,t):null,c=xT(r,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),h=function(e,t,n){var r,i;return n&&Fr(e,(function(e,o){var a=e.coordDim,s=n.categoryAxisMap.get(a);s&&(null==r&&(r=o),e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(i=!0)})),i||null==r||(e[r].otherDims.itemName=0),r}(c.dimensions,n.createInvertedIndices,a),d=o?null:i.getSharedDataStore(c),p=MT(t,{schema:c,store:d}),f=new yT(c,t);f.setCalculationInfo(p);var g=null!=h&&function(e){if(e.sourceFormat===zv){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return!Zr(Zu(t))}}(r)?function(e,t,n,r){return r===h?n:this.defaultDimValueGetter(e,t,n,r)}:null;return f.hasItemOption=!1,f.initData(o?r:d,null,g),f}var ET=function(){function e(e){this._setting=e||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();Tc(ET);var IT=0,LT=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++IT}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&Gr(r,NT);return new e({categories:i,needCollect:!i,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!Kr(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=this._getOrCreateMap();return null==(t=r.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=xi(this.categories))},e}();function NT(e){return Qr(e)&&null!=e.value?e.value:e+""}function PT(e){return"interval"===e.type||"log"===e.type}function OT(e,t,n,r){var i={},o=e[1]-e[0],a=i.interval=Tu(o/t,!0);null!=n&&a<n&&(a=i.interval=n),null!=r&&a>r&&(a=i.interval=r);var s=i.intervalPrecision=kT(a);return function(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),zT(e,0,t),zT(e,1,t),e[0]>e[1]&&(e[0]=e[1])}(i.niceTickExtent=[cu(Math.ceil(e[0]/a)*a,s),cu(Math.floor(e[1]/a)*a,s)],e),i}function RT(e){var t=Math.pow(10,Su(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,cu(n*t)}function kT(e){return du(e)+2}function zT(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function BT(e,t){return e>=t[0]&&e<=t[1]}function VT(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function FT(e,t){return e*(t[1]-t[0])+t[0]}var GT=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var r=n.getSetting("ordinalMeta");return r||(r=new LT({})),Zr(r)&&(r=new LT({categories:Gr(r,(function(e){return Qr(e)?e.value:e}))})),n._ordinalMeta=r,n._extent=n.getSetting("extent")||[0,r.categories.length-1],n}return g(t,e),t.prototype.parse=function(e){return null==e?NaN:Kr(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return BT(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return VT(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(FT(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null!=e){for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);i<a;++i){var s=t[i];n[i]=s,r[s]=i}for(var l=0;i<o;++i){for(;null!=r[l];)l++;n.push(l),r[l]=i}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(ET);ET.registerClass(GT);var HT=cu,UT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return g(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return BT(e,this._extent)},t.prototype.normalize=function(e){return VT(e,this._extent)},t.prototype.scale=function(e){return FT(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=kT(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,o=[];if(!t)return o;n[0]<r[0]&&(e?o.push({value:HT(r[0]-t,i)}):o.push({value:n[0]}));for(var a=r[0];a<=r[1]&&(o.push({value:a}),(a=HT(a+t,i))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:r[1];return n[1]>s&&(e?o.push({value:HT(s+t,i)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],r=this.getExtent(),i=1;i<t.length;i++){for(var o=t[i],a=t[i-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=HT(a.value+(s+1)*u);c>r[0]&&c<r[1]&&l.push(c),s++}n.push(l)}return n},t.prototype.getLabel=function(e,t){if(null==e)return"";var n=t&&t.precision;return null==n?n=du(e.value)||0:"auto"===n&&(n=this._intervalPrecision),lv(HT(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var r=this._extent,i=r[1]-r[0];if(isFinite(i)){i<0&&(i=-i,r.reverse());var o=OT(r,e,t,n);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;var r=t[1]-t[0];isFinite(r)||(t[0]=0,t[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval;e.fixMin||(t[0]=HT(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=HT(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(ET);ET.registerClass(UT);var WT="undefined"!=typeof Float32Array,XT=WT?Float32Array:Array;function jT(e){return Zr(e)?WT?new Float32Array(e):e:new XT(e)}var YT="__ec_stack_";function ZT(e){return e.get("stack")||YT+e.seriesIndex}function qT(e){return e.dim+e.index}function KT(e,t){var n=[];return t.eachSeriesByType(e,(function(e){tM(e)&&n.push(e)})),n}function $T(e){var t=function(e){var t={};Fr(e,(function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var r=e.getData(),i=n.dim+"_"+n.index,o=r.getDimensionIndex(r.mapDimension(n.dim)),a=r.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(o,s);t[i]?t[i].push(u):t[i]=[u]}}));var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i){i.sort((function(e,t){return e-t}));for(var o=null,a=1;a<i.length;++a){var s=i[a]-i[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[r]=o}}return n}(e),n=[];return Fr(e,(function(e){var r,i=e.coordinateSystem.getBaseAxis(),o=i.getExtent();if("category"===i.type)r=i.getBandWidth();else if("value"===i.type||"time"===i.type){var a=i.dim+"_"+i.index,s=t[a],l=Math.abs(o[1]-o[0]),u=i.scale.getExtent(),c=Math.abs(u[1]-u[0]);r=s?l/c*s:l}else{var h=e.getData();r=Math.abs(o[1]-o[0])/h.count()}var d=uu(e.get("barWidth"),r),p=uu(e.get("barMaxWidth"),r),f=uu(e.get("barMinWidth")||(nM(e)?.5:1),r),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:r,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:qT(i),stackId:ZT(e)})})),JT(n)}function JT(e){var t={};Fr(e,(function(e,n){var r=e.axisKey,i=e.bandWidth,o=t[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;t[r]=o;var s=e.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=e.barMaxWidth;u&&(a[s].maxWidth=u);var c=e.barMinWidth;c&&(a[s].minWidth=c);var h=e.barGap;null!=h&&(o.gap=h);var d=e.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return Fr(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=e.categoryGap;if(null==o){var a=Xr(r).length;o=Math.max(35-4*a,15)+"%"}var s=uu(o,i),l=uu(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),Fr(r,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){r=e.width;t&&(r=Math.min(r,t)),n&&(r=Math.max(r,n)),e.width=r,u-=r+l*r,c--}else{var r=h;t&&t<r&&(r=Math.min(t,u)),n&&n>r&&(r=n),r!==h&&(e.width=r,u-=r+l*r,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var d,p=0;Fr(r,(function(e,t){e.width||(e.width=h),d=e,p+=e.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;Fr(r,(function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function QT(e,t){var n=KT(e,t),r=$T(n);Fr(n,(function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),i=ZT(e),o=r[qT(n)][i],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})}))}function eM(e){return{seriesType:e,plan:Dx(),reset:function(e){if(tM(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),o=t.getDimensionIndex(t.mapDimension(i.dim)),a=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get("showBackground",!0),l=t.mapDimension(i.dim),u=t.getCalculationInfo("stackResultDimension"),c=AT(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=function(e,t){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}(0,i),p=nM(e),f=e.get("barMinHeight")||0,g=u&&t.getDimensionIndex(u),m=t.getLayout("size"),v=t.getLayout("offset");return{progress:function(e,t){for(var r,i=e.count,l=p&&jT(3*i),u=p&&s&&jT(3*i),y=p&&jT(i),_=n.master.getRect(),x=h?_.width:_.height,b=t.getStore(),w=0;null!=(r=e.next());){var S=b.get(c?g:o,r),T=b.get(a,r),M=d,A=void 0;c&&(A=+S-b.get(o,r));var C=void 0,D=void 0,E=void 0,I=void 0;if(h){var L=n.dataToPoint([S,T]);if(c)M=n.dataToPoint([A,T])[0];C=M,D=L[1]+v,E=L[0]-M,I=m,Math.abs(E)<f&&(E=(E<0?-1:1)*f)}else{L=n.dataToPoint([T,S]);if(c)M=n.dataToPoint([T,A])[1];C=L[0]+v,D=M,E=m,I=L[1]-M,Math.abs(I)<f&&(I=(I<=0?-1:1)*f)}p?(l[w]=C,l[w+1]=D,l[w+2]=h?E:I,u&&(u[w]=h?_.x:C,u[w+1]=h?D:_.y,u[w+2]=x),y[r]=r):t.setItemLayout(r,{x:C,y:D,width:E,height:I}),w+=3}p&&t.setLayout({largePoints:l,largeDataIndices:y,largeBackgroundPoints:u,valueAxisHorizontal:h})}}}}}}function tM(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function nM(e){return e.pipelineContext&&e.pipelineContext.large}var rM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return g(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return Xm(e.value,Vm[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(Um(this._minLevelUnit))]||Vm.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var r=this.getSetting("useUTC");return function(e,t,n,r,i){var o=null;if(Kr(n))o=n;else if(qr(n))o=n(e.value,t,{level:e.level});else{var a=Pr({},zm);if(e.level>0)for(var s=0;s<Fm.length;++s)a[Fm[s]]="{primary|"+a[Fm[s]]+"}";var l=n?!1===n.inherit?n:Or(n,a):a,u=jm(e.value,i);if(l[u])o=l[u];else if(l.inherit){for(s=Gm.indexOf(u)-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(Zr(o)){var c=null==e.level?0:e.level>=0?e.level:o.length+e.level;o=o[c=Math.min(c,o.length-1)]}}return Xm(new Date(e.value),o,i,r)}(e,t,n,this.getSetting("locale"),r)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var r=this.getSetting("useUTC"),i=function(e,t,n,r){var i=1e4,o=Gm,a=0;function s(e,t,n,i,o,a,s){for(var l=new Date(t),u=t,c=l[i]();u<n&&u<=r[1];)s.push({value:u}),c+=e,l[o](c),u=l.getTime();s.push({value:u,notAdd:!0})}function l(e,i,o){var a=[],l=!i.length;if(!function(e,t,n,r){var i=bu(t),o=bu(n),a=function(e){return Ym(i,e,r)===Ym(o,e,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},d=function(){return h()&&a("second")},p=function(){return d()&&a("millisecond")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return d();case"millisecond":return p()}}(Um(e),r[0],r[1],n)){l&&(i=[{value:cM(new Date(r[0]),e,n)},{value:r[1]}]);for(var u=0;u<i.length-1;u++){var c=i[u].value,h=i[u+1].value;if(c!==h){var d=void 0,p=void 0,f=void 0,g=!1;switch(e){case"year":d=Math.max(1,Math.round(t/Rm/365)),p=Zm(n),f=tv(n);break;case"half-year":case"quarter":case"month":d=aM(t),p=qm(n),f=nv(n);break;case"week":case"half-week":case"day":d=oM(t),p=Km(n),f=rv(n),g=!0;break;case"half-day":case"quarter-day":case"hour":d=sM(t),p=$m(n),f=iv(n);break;case"minute":d=lM(t,!0),p=Jm(n),f=ov(n);break;case"second":d=lM(t,!1),p=Qm(n),f=av(n);break;case"millisecond":d=uM(t),p=ev(n),f=sv(n)}s(d,c,h,p,f,g,a),"year"===e&&o.length>1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u<a.length;u++)o.push(a[u]);return a}}for(var u=[],c=[],h=0,d=0,p=0;p<o.length&&a++<i;++p){var f=Um(o[p]);if(Wm(o[p]))if(l(o[p],u[u.length-1]||[],c),f!==(o[p+1]?Um(o[p+1]):null)){if(c.length){d=h,c.sort((function(e,t){return e.value-t.value}));for(var g=[],m=0;m<c.length;++m){var v=c[m].value;0!==m&&c[m-1].value===v||(g.push(c[m]),v>=r[0]&&v<=r[1]&&h++)}var y=(r[1]-r[0])/t;if(h>1.5*y&&d>y/1.5)break;if(u.push(g),h>y||e===o[p])break}c=[]}}"production"!==process.env.NODE_ENV&&a>=i&&ku("Exceed safe limit.");var _=Ur(Gr(u,(function(e){return Ur(e,(function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd}))})),(function(e){return e.length>0})),x=[],b=_.length-1;for(p=0;p<_.length;++p)for(var w=_[p],S=0;S<w.length;++S)x.push({value:w[S].value,level:b-p});x.sort((function(e,t){return e.value-t.value}));var T=[];for(p=0;p<x.length;++p)0!==p&&x[p].value===x[p-1].value||T.push(x[p]);return T}(this._minLevelUnit,this._approxInterval,r,t);return(n=n.concat(i)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=Rm,t[1]+=Rm),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-Rm}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var r=this._extent,i=r[1]-r[0];this._approxInterval=i/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=iM.length,a=Math.min(function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n}(iM,this._approxInterval,0,o),o-1);this._interval=iM[a][1],this._minLevelUnit=iM[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return Jr(e)?e:+bu(e)},t.prototype.contain=function(e){return BT(this.parse(e),this._extent)},t.prototype.normalize=function(e){return VT(this.parse(e),this._extent)},t.prototype.scale=function(e){return FT(e,this._extent)},t.type="time",t}(UT),iM=[["second",Nm],["minute",Pm],["hour",Om],["quarter-day",6*Om],["half-day",12*Om],["day",1.2*Rm],["half-week",3.5*Rm],["week",7*Rm],["month",31*Rm],["quarter",95*Rm],["half-year",km/2],["year",km]];function oM(e,t){return(e/=Rm)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function aM(e){return(e/=30*Rm)>6?6:e>3?3:e>2?2:1}function sM(e){return(e/=Om)>12?12:e>6?6:e>3.5?4:e>2?2:1}function lM(e,t){return(e/=t?Pm:Nm)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function uM(e){return Tu(e,!0)}function cM(e,t,n){var r=new Date(e);switch(Um(t)){case"year":case"month":r[nv(n)](0);case"day":r[rv(n)](1);case"hour":r[iv(n)](0);case"minute":r[ov(n)](0);case"second":r[av(n)](0),r[sv(n)](0)}return r.getTime()}ET.registerClass(rM);var hM=ET.prototype,dM=UT.prototype,pM=cu,fM=Math.floor,gM=Math.ceil,mM=Math.pow,vM=Math.log,yM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new UT,t._interval=0,t}return g(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,r=t.getExtent();return Gr(dM.getTicks.call(this,e),(function(e){var t=e.value,i=cu(mM(this.base,t));return i=t===n[0]&&this._fixMin?xM(i,r[0]):i,{value:i=t===n[1]&&this._fixMax?xM(i,r[1]):i}}),this)},t.prototype.setExtent=function(e,t){var n=vM(this.base);e=vM(Math.max(0,e))/n,t=vM(Math.max(0,t))/n,dM.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=hM.getExtent.call(this);t[0]=mM(e,t[0]),t[1]=mM(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=xM(t[0],n[0])),this._fixMax&&(t[1]=xM(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=vM(e[0])/vM(t),e[1]=vM(e[1])/vM(t),hM.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var r=wu(n);for(e/n*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var i=[cu(gM(t[0]/r)*r),cu(fM(t[1]/r)*r)];this._interval=r,this._niceExtent=i}},t.prototype.calcNiceExtent=function(e){dM.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return BT(e=vM(e)/vM(this.base),this._extent)},t.prototype.normalize=function(e){return VT(e=vM(e)/vM(this.base),this._extent)},t.prototype.scale=function(e){return e=FT(e,this._extent),mM(this.base,e)},t.type="log",t}(ET),_M=yM.prototype;function xM(e,t){return pM(e,du(t))}_M.getMinorTicks=dM.getMinorTicks,_M.getLabel=dM.getLabel,ET.registerClass(yM);var bM=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var r=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var i=this._modelMinRaw=t.get("min",!0);qr(i)?this._modelMinNum=MM(e,i({min:n[0],max:n[1]})):"dataMin"!==i&&(this._modelMinNum=MM(e,i));var o=this._modelMaxRaw=t.get("max",!0);if(qr(o)?this._modelMaxNum=MM(e,o({min:n[0],max:n[1]})):"dataMax"!==o&&(this._modelMaxNum=MM(e,o)),r)this._axisDataLen=t.getCategories().length;else{var a=t.get("boundaryGap"),s=Zr(a)?a:[a||0,a||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?("production"!==process.env.NODE_ENV&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[zl(s[0],1),zl(s[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,r=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-t||Math.abs(t),a="dataMin"===this._modelMinRaw?t:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=e?r?0:NaN:t-i[0]*o),null==s&&(s=e?r?r-1:NaN:n+i[1]*o),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var c=ai(a)||ai(s)||e&&!r;this._needCrossZero&&(a>0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var h=this._determinedMin,d=this._determinedMax;return null!=h&&(a=h,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){"production"!==process.env.NODE_ENV&&di(!this.frozen),this[SM[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=wM[e];"production"!==process.env.NODE_ENV&&di(!this.frozen&&null==this[n]),this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),wM={min:"_determinedMin",max:"_determinedMax"},SM={min:"_dataMin",max:"_dataMax"};function TM(e,t,n){var r=e.rawExtentInfo;return r||(r=new bM(e,t,n),e.rawExtentInfo=r,r)}function MM(e,t){return null==t?null:ai(t)?NaN:e.parse(t)}function AM(e,t){var n=e.type,r=TM(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,o=r.max,a=t.ecModel;if(a&&"time"===n){var s=KT("bar",a),l=!1;if(Fr(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=$T(s),c=function(e,t,n,r){var i=n.axis.getExtent(),o=i[1]-i[0],a=function(e,t,n){if(e&&t){var r=e[qT(t)];return null!=r&&null!=n?r[ZT(n)]:r}}(r,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;Fr(a,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Fr(a,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=c/(1-(s+l)/o)-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}(i,o,t,u);i=c.min,o=c.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function CM(e,t){var n=t,r=AM(e,n),i=r.extent,o=n.get("splitNumber");e instanceof yM&&(e.base=n.get("logBase"));var a=e.type,s=n.get("interval"),l="interval"===a||"time"===a;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:o,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function DM(e,t){if(t=t||e.get("type"))switch(t){case"category":return new GT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new rM({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(ET.getClass(t)||UT)}}function EM(e){var t,n,r=e.getLabelModel().get("formatter"),i="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=r,function(t,r){return e.scale.getFormattedLabel(t,r,n)}):Kr(r)?function(t){return function(n){var r=e.scale.getLabel(n);return t.replace("{value}",null!=r?r:"")}}(r):qr(r)?(t=r,function(n,r){return null!=i&&(r=n.value-i),t(IM(e,n),r,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function IM(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function LM(e,t){var n=t*Math.PI/180,r=e.width,i=e.height,o=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),a=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new Uo(e.x,e.y,o,a)}function NM(e){var t=e.get("interval");return null==t?"auto":t}function PM(e){return"category"===e.type&&0===NM(e.getLabelModel())}function OM(e,t){var n={};return Fr(e.mapDimensionsAll(t),(function(t){n[CT(e,t)]=!0})),Xr(n)}var RM=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function kM(e){return DT(null,e)}var zM={isDimensionStacked:AT,enableDataStack:MT,getStackedDimension:CT};function BM(e,t){var n=t;t instanceof xm||(n=new xm(t));var r=DM(n);return r.setExtent(e[0],e[1]),CM(r,n),r}function VM(e){Br(e,RM)}var FM=Object.freeze({__proto__:null,createDimensions:_T,createList:kM,createScale:BM,createSymbol:Wb,createTextStyle:function(e,t){return $g(e,null,null,"normal"!==(t=t||{}).state)},dataStack:zM,enableHoverEmphasis:Sp,getECData:Ld,getLayoutRect:Tv,mixinAxisModelCommonMethods:VM}),GM=1e-8;function HM(e,t){return Math.abs(e-t)<GM}function UM(e,t,n){var r=0,i=e[0];if(!i)return!1;for(var o=1;o<e.length;o++){var a=e[o];r+=Gh(i[0],i[1],a[0],a[1],t,n),i=a}var s=e[0];return HM(i[0],s[0])&&HM(i[1],s[1])||(r+=Gh(i[0],i[1],s[0],s[1],t,n)),0!==r}var WM=[];function XM(e,t){for(var n=0;n<e.length;n++)ji(e[n],e[n],t)}function jM(e,t,n,r){for(var i=0;i<e.length;i++){var o=e[i];r&&(o=r.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&(Yi(t,t,o),Zi(n,n,o))}}var YM=function(){function e(e){this.name=e}return e.prototype.setCenter=function(e){this._center=e},e.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},e}(),ZM=function(e,t){this.type="polygon",this.exterior=e,this.interiors=t},qM=function(e){this.type="linestring",this.points=e},KM=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="geoJSON",i.geometries=n,i._center=r&&[r[0],r[1]],i}return g(t,e),t.prototype.calcCenter=function(){for(var e,t=this.geometries,n=0,r=0;r<t.length;r++){var i=t[r],o=i.exterior,a=o&&o.length;a>n&&(e=i,n=a)}if(e)return function(e){for(var t=0,n=0,r=0,i=e.length,o=e[i-1][0],a=e[i-1][1],s=0;s<i;s++){var l=e[s][0],u=e[s][1],c=o*u-l*a;t+=c,n+=(o+l)*c,r+=(a+u)*c,o=l,a=u}return t?[n/t/3,r/t/3,t]:[e[0][0]||0,e[0][1]||0]}(e.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0];return Fr(this.geometries,(function(t){"polygon"===t.type?jM(t.exterior,n,r,e):Fr(t.points,(function(t){jM(t,n,r,e)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new Uo(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var r=0,i=n.length;r<i;r++){var o=n[r];if("polygon"===o.type){var a=o.exterior,s=o.interiors;if(UM(a,e[0],e[1])){for(var l=0;l<(s?s.length:0);l++)if(UM(s[l],e[0],e[1]))continue e;return!0}}}return!1},t.prototype.transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=i.width/i.height;n?r||(r=n/o):n=o*r;for(var a=new Uo(e,t,n,r),s=i.calculateTransform(a),l=this.geometries,u=0;u<l.length;u++){var c=l[u];"polygon"===c.type?(XM(c.exterior,s),Fr(c.interiors,(function(e){XM(e,s)}))):Fr(c.points,(function(e){XM(e,s)}))}(i=this._rect).copy(a),this._center=[i.x+i.width/2,i.y+i.height/2]},t.prototype.cloneShallow=function(e){null==e&&(e=this.name);var n=new t(e,this.geometries,this._center);return n._rect=this._rect,n.transformTo=null,n},t}(YM),$M=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="geoSVG",r._elOnlyForCalculate=n,r}return g(t,e),t.prototype.calcCenter=function(){for(var e=this._elOnlyForCalculate,t=e.getBoundingRect(),n=[t.x+t.width/2,t.y+t.height/2],r=To(WM),i=e;i&&!i.isGeoSVGGraphicRoot;)Ao(r,i.getLocalTransform(),r),i=i.parent;return Io(r,r),ji(n,n,r),n},t}(YM);function JM(e,t,n){for(var r=0;r<e.length;r++)e[r]=QM(e[r],t[r],n)}function QM(e,t,n){for(var r=[],i=t[0],o=t[1],a=0;a<e.length;a+=2){var s=e.charCodeAt(a)-64,l=e.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),i=s+=i,o=l+=o,r.push([s/n,l/n])}return r}function eA(e,t){return Gr(Ur((e=function(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;return null==n&&(n=1024),Fr(t.features,(function(e){var t=e.geometry,r=t.encodeOffsets,i=t.coordinates;if(r)switch(t.type){case"LineString":t.coordinates=QM(i,r,n);break;case"Polygon":case"MultiLineString":JM(i,r,n);break;case"MultiPolygon":Fr(i,(function(e,t){return JM(e,r[t],n)}))}})),t.UTF8Encoding=!1,t}(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case"Polygon":var o=r.coordinates;i.push(new ZM(o[0],o.slice(1)));break;case"MultiPolygon":Fr(r.coordinates,(function(e){e[0]&&i.push(new ZM(e[0],e.slice(1)))}));break;case"LineString":i.push(new qM([r.coordinates]));break;case"MultiLineString":i.push(new qM(r.coordinates))}var a=new KM(n[t||"name"],i,n.cp);return a.properties=n,a}))}var tA=Object.freeze({__proto__:null,MAX_SAFE_INTEGER:vu,asc:hu,getPercentWithPrecision:function(e,t,n){return e[t]&&gu(e,n)[t]||0},getPixelPrecision:fu,getPrecision:du,getPrecisionSafe:pu,isNumeric:Du,isRadianAroundZero:_u,linearMap:lu,nice:Tu,numericToNumber:Cu,parseDate:bu,quantile:Mu,quantity:wu,quantityExponent:Su,reformIntervals:Au,remRadian:yu,round:cu}),nA=Object.freeze({__proto__:null,format:Xm,parse:bu}),rA=Object.freeze({__proto__:null,Arc:Uf,BezierCurve:Ff,BoundingRect:Uo,Circle:tf,CompoundPath:Xf,Ellipse:of,Group:Kl,Image:ad,IncrementalDisplayable:og,Line:Rf,LinearGradient:Zf,Polygon:Df,Polyline:Lf,RadialGradient:Kf,Rect:fd,Ring:Tf,Sector:bf,Text:Id,clipPointsByRect:kg,clipRectByRect:zg,createIcon:Bg,extendPath:bg,extendShape:_g,getShapeClass:Sg,getTransform:Lg,initProps:cg,makeImage:Mg,makePath:Tg,mergePath:Cg,registerShape:wg,resizePath:Dg,updateProps:ug}),iA=Object.freeze({__proto__:null,addCommas:lv,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},encodeHTML:lo,formatTime:mv,formatTpl:fv,getTextRect:function(e,t,n,r,i,o,a,s){return new Id({style:{text:e,font:t,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:gv,normalizeCssArray:cv,toCamelCase:uv,truncateText:Oc}),oA=Object.freeze({__proto__:null,bind:jr,clone:Ir,curry:Yr,defaults:Or,each:Fr,extend:Pr,filter:Ur,indexOf:kr,inherits:zr,isArray:Zr,isFunction:qr,isObject:Qr,isString:Kr,map:Gr,merge:Lr,reduce:Hr}),aA=oc();function sA(e){return"category"===e.type?function(e){var t=e.getLabelModel(),n=uA(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(e):function(e){var t=e.scale.getTicks(),n=EM(e);return{labels:Gr(t,(function(t,r){return{level:t.level,formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}(e)}function lA(e,t){return"category"===e.type?function(e,t){var n,r,i=cA(e,"ticks"),o=NM(t),a=hA(i,o);if(a)return a;t.get("show")&&!e.scale.isBlank()||(n=[]);if(qr(o))n=fA(e,o,!0);else if("auto"===o){var s=uA(e,e.getLabelModel());r=s.labelCategoryInterval,n=Gr(s.labels,(function(e){return e.tickValue}))}else n=pA(e,r=o,!0);return dA(i,o,{ticks:n,tickCategoryInterval:r})}(e,t):{ticks:Gr(e.scale.getTicks(),(function(e){return e.value}))}}function uA(e,t){var n,r,i=cA(e,"labels"),o=NM(t),a=hA(i,o);return a||(qr(o)?n=fA(e,o):(r="auto"===o?function(e){var t=aA(e).autoInterval;return null!=t?t:aA(e).autoInterval=e.calculateCategoryInterval()}(e):o,n=pA(e,r)),dA(i,o,{labels:n,labelCategoryInterval:r}))}function cA(e,t){return aA(e)[t]||(aA(e)[t]=[])}function hA(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function dA(e,t,n){return e.push({key:t,value:n}),n}function pA(e,t,n){var r=EM(e),i=e.scale,o=i.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=PM(e),d=a.get("showMinLabel")||h,p=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e})}return p&&f-l!==o[1]&&g(o[1]),s}function fA(e,t,n){var r=e.scale,i=EM(e),o=[];return Fr(r.getTicks(),(function(e){var a=r.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:i(e),rawLabel:a,tickValue:s})})),o}var gA=[0,1],mA=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return fu(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(e),this.onBand&&"ordinal"===r.type&&vA(n=n.slice(),r.count()),lu(e,gA,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&vA(n=n.slice(),r.count());var i=lu(e,n,gA,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=Gr(lA(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this);return function(e,t,n,r){var i=t.length;if(!e.onBand||n||!i)return;var o,a,s=e.getExtent();if(1===i)t[0].coord=s[0],o=t[1]={coord:s[1]};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;Fr(t,(function(e){e.coord-=u/2})),a=1+e.scale.getExtent()[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*a},t.push(o)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift());r&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]});h(s[1],o.coord)&&(r?o.coord=s[1]:t.pop());r&&h(o.coord,s[1])&&t.push({coord:s[1]});function h(e,t){return e=cu(e),t=cu(t),c?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),Gr(this.scale.getMinorTicks(e),(function(e){return Gr(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return sA(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(){return function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),n=EM(e),r=(t.axisRotate-t.labelRotate)/180*Math.PI,i=e.scale,o=i.getExtent(),a=i.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),d=0,p=0;l<=o[1];l+=s){var f,g,m=Pl(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/c,y=p/h;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=aA(e.model),b=e.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},e}();function vA(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var yA=mA;var _A=2*Math.PI,xA=Ph.CMD,bA=["top","right","bottom","left"];function wA(e,t,n,r,i){var o=n.width,a=n.height;switch(e){case"top":r.set(n.x+o/2,n.y-t),i.set(0,-1);break;case"bottom":r.set(n.x+o/2,n.y+a+t),i.set(0,1);break;case"left":r.set(n.x-t,n.y+a/2),i.set(-1,0);break;case"right":r.set(n.x+o+t,n.y+a/2),i.set(1,0)}}function SA(e,t,n,r,i,o,a,s,l){a-=e,s-=t;var u=Math.sqrt(a*a+s*s),c=(a/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(r-i)%_A<1e-4)return l[0]=c,l[1]=h,u-n;if(o){var d=r;r=Bh(i),i=Bh(d)}else r=Bh(r),i=Bh(i);r>i&&(i+=_A);var p=Math.atan2(s,a);if(p<0&&(p+=_A),p>=r&&p<=i||p+_A>=r&&p+_A<=i)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(r)+e,g=n*Math.sin(r)+t,m=n*Math.cos(i)+e,v=n*Math.sin(i)+t,y=(f-a)*(f-a)+(g-s)*(g-s),_=(m-a)*(m-a)+(v-s)*(v-s);return y<_?(l[0]=f,l[1]=g,Math.sqrt(y)):(l[0]=m,l[1]=v,Math.sqrt(_))}function TA(e,t,n,r,i,o,a,s){var l=i-e,u=o-t,c=n-e,h=r-t,d=Math.sqrt(c*c+h*h),p=(l*(c/=d)+u*(h/=d))/d;s&&(p=Math.min(Math.max(p,0),1)),p*=d;var f=a[0]=e+p*c,g=a[1]=t+p*h;return Math.sqrt((f-i)*(f-i)+(g-o)*(g-o))}function MA(e,t,n,r,i,o,a){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r);var s=e+n,l=t+r,u=a[0]=Math.min(Math.max(i,e),s),c=a[1]=Math.min(Math.max(o,t),l);return Math.sqrt((u-i)*(u-i)+(c-o)*(c-o))}var AA=[];function CA(e,t,n){var r=MA(t.x,t.y,t.width,t.height,e.x,e.y,AA);return n.set(AA[0],AA[1]),r}function DA(e,t,n){for(var r,i,o=0,a=0,s=0,l=0,u=1/0,c=t.data,h=e.x,d=e.y,p=0;p<c.length;){var f=c[p++];1===p&&(s=o=c[p],l=a=c[p+1]);var g=u;switch(f){case xA.M:o=s=c[p++],a=l=c[p++];break;case xA.L:g=TA(o,a,c[p],c[p+1],h,d,AA,!0),o=c[p++],a=c[p++];break;case xA.C:g=Na(o,a,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],h,d,AA),o=c[p++],a=c[p++];break;case xA.Q:g=Ba(o,a,c[p++],c[p++],c[p],c[p+1],h,d,AA),o=c[p++],a=c[p++];break;case xA.A:var m=c[p++],v=c[p++],y=c[p++],_=c[p++],x=c[p++],b=c[p++];p+=1;var w=!!(1-c[p++]);r=Math.cos(x)*y+m,i=Math.sin(x)*_+v,p<=1&&(s=r,l=i),g=SA(m,v,_,x,x+b,w,(h-m)*_/y+m,d,AA),o=Math.cos(x+b)*y+m,a=Math.sin(x+b)*_+v;break;case xA.R:g=MA(s=o=c[p++],l=a=c[p++],c[p++],c[p++],h,d,AA);break;case xA.Z:g=TA(o,a,s,l,h,d,AA,!0),o=s,a=l}g<u&&(u=g,n.set(AA[0],AA[1]))}return u}var EA=new Po,IA=new Po,LA=new Po,NA=new Po,PA=new Po;function OA(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var i=e.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],a=i.candidates||bA,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,c=e.getComputedTransform(),h=c&&Io([],c),d=t.get("length2")||0;u&&LA.copy(u);for(var p=0;p<a.length;p++){wA(a[p],0,s,EA,NA),Po.scaleAndAdd(IA,EA,NA,d),IA.transform(h);var f=e.getBoundingRect(),g=u?u.distance(IA):e instanceof ed?DA(IA,e.path,LA):CA(IA,f,LA);g<l&&(l=g,IA.transform(c),LA.transform(c),LA.toArray(o[0]),IA.toArray(o[1]),EA.toArray(o[2]))}zA(o,t.get("minTurnAngle")),n.setShape({points:o})}}}var RA=[],kA=new Po;function zA(e,t){if(t<=180&&t>0){t=t/180*Math.PI,EA.fromArray(e[0]),IA.fromArray(e[1]),LA.fromArray(e[2]),Po.sub(NA,EA,IA),Po.sub(PA,LA,IA);var n=NA.len(),r=PA.len();if(!(n<.001||r<.001)){NA.scale(1/n),PA.scale(1/r);var i=NA.dot(PA);if(Math.cos(t)<i){var o=TA(IA.x,IA.y,LA.x,LA.y,EA.x,EA.y,RA,!1);kA.fromArray(RA),kA.scaleAndAdd(PA,o/Math.tan(Math.PI-t));var a=LA.x!==IA.x?(kA.x-IA.x)/(LA.x-IA.x):(kA.y-IA.y)/(LA.y-IA.y);if(isNaN(a))return;a<0?Po.copy(kA,IA):a>1&&Po.copy(kA,LA),kA.toArray(e[1])}}}}function BA(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,EA.fromArray(e[0]),IA.fromArray(e[1]),LA.fromArray(e[2]),Po.sub(NA,IA,EA),Po.sub(PA,LA,IA);var r=NA.len(),i=PA.len();if(!(r<.001||i<.001))if(NA.scale(1/r),PA.scale(1/i),NA.dot(t)<Math.cos(n)){var o=TA(IA.x,IA.y,LA.x,LA.y,EA.x,EA.y,RA,!1);kA.fromArray(RA);var a=Math.PI/2,s=a+Math.acos(PA.dot(t))-n;if(s>=a)Po.copy(kA,LA);else{kA.scaleAndAdd(PA,o/Math.tan(Math.PI/2-s));var l=LA.x!==IA.x?(kA.x-IA.x)/(LA.x-IA.x):(kA.y-IA.y)/(LA.y-IA.y);if(isNaN(l))return;l<0?Po.copy(kA,IA):l>1&&Po.copy(kA,LA)}kA.toArray(e[1])}}}function VA(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):o.style=s}function FA(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Hi(r[0],r[1]),o=Hi(r[1],r[2]);if(!i||!o)return e.lineTo(r[1][0],r[1][1]),void e.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=Xi([],r[1],r[0],a/i),l=Xi([],r[1],r[2],a/o),u=Xi([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}function GA(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(i){for(var o=t.normal,a=o.get("show"),s=i.ignore,l=0;l<Gd.length;l++){var u=Gd[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:li(i.states[u]&&i.states[u].ignore,s))||!li(d,a)){var p=h?r:r&&r.states[u];p&&(p.ignore=!0),r&&VA(r,!0,u,c);continue}r||(r=new Lf,e.setTextGuideLine(r),h||!s&&a||VA(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),VA(r,!1,u,c)}}if(r){Or(r.style,n),r.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=FA}}else r&&e.removeTextGuideLine()}function HA(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<Fd.length;r++){var i=Fd[r];n[i]=e.getModel([i,t])}return n}function UA(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(!r.defaultAttr.ignore){var i=r.label,o=i.getComputedTransform(),a=i.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=i.style.margin||0,u=a.clone();u.applyTransform(o),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new ng(a,o):null;t.push({label:i,labelLine:r.labelLine,rect:u,localRect:a,obb:c,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:s,transform:o})}}return t}function WA(e,t,n,r,i,o){var a=e.length;if(!(a<2)){e.sort((function(e,n){return e.rect[t]-n.rect[t]}));for(var s,l=0,u=!1,c=0,h=0;h<a;h++){var d=e[h],p=d.rect;(s=p[t]-l)<0&&(p[t]-=s,d.label[t]-=s,u=!0),c+=Math.max(-s,0),l=p[t]+p[n]}c>0&&o&&x(-c/a,0,a);var f,g,m=e[0],v=e[a-1];return y(),f<0&&b(-f,.8),g<0&&b(g,.8),y(),_(f,g,1),_(g,f,-1),y(),f<0&&w(-f),g<0&&w(g),u}function y(){f=m.rect[t]-r,g=i-v.rect[t]-v.rect[n]}function _(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){x(r*n,0,a);var i=r+e;i<0&&b(-i*n,1)}else b(-e*n,1)}}function x(n,r,i){0!==n&&(u=!0);for(var o=r;o<i;o++){var a=e[o];a.rect[t]+=n,a.label[t]+=n}}function b(r,i){for(var o=[],s=0,l=1;l<a;l++){var u=e[l-1].rect,c=Math.max(e[l].rect[t]-u[t]-u[n],0);o.push(c),s+=c}if(s){var h=Math.min(Math.abs(r)/s,i);if(r>0)for(l=0;l<a-1;l++){x(o[l]*h,0,l+1)}else for(l=a-1;l>0;l--){x(-(o[l-1]*h),l,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r<a-1;r++)if(t>0?x(n,0,r+1):x(-n,a-r-1,a),(e-=n)<=0)return}}function XA(e,t,n,r){return WA(e,"y","height",t,n,r)}function jA(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new Uo(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var i=0;i<e.length;i++){var o=e[i],a=o.axisAligned,s=o.localRect,l=o.transform,u=o.label,c=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,p=0;p<t.length;p++){var f=t[p];if(n.intersect(f.rect)){if(a&&f.axisAligned){d=!0;break}if(f.obb||(f.obb=new ng(f.localRect,f.transform)),h||(h=new ng(s,l)),h.intersect(f.obb)){d=!0;break}}}d?(r(u),c&&r(c)):(u.attr("ignore",o.defaultAttr.ignore),c&&c.attr("ignore",o.defaultAttr.labelGuideIgnore),t.push(o))}}function YA(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function ZA(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:YA(r&&r.shape.points)}}var qA=["align","verticalAlign","width","height","fontSize"],KA=new El,$A=oc(),JA=oc();function QA(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];null!=t[i]&&(e[i]=t[i])}}var eC=["x","y","rotation"],tC=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var o=r.style,a=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),l=r.getBoundingRect().plain();Uo.applyTransform(l,l,s),s?KA.setLocalTransform(s):(KA.x=KA.y=KA.rotation=KA.originX=KA.originY=0,KA.scaleX=KA.scaleY=1),KA.rotation=Bh(KA.rotation);var u,c=r.__hostTarget;if(c){u=c.getBoundingRect().plain();var h=c.getComputedTransform();Uo.applyTransform(u,u,h)}var d=u&&c.getTextGuideLine();this._labelList.push({label:r,labelLine:d,seriesModel:n,dataIndex:e,dataType:t,layoutOption:i,computedLayoutOption:null,rect:l,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:d&&d.ignore,x:KA.x,y:KA.y,scaleX:KA.scaleX,scaleY:KA.scaleY,rotation:KA.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:r.cursor,attachedPos:a.position,attachedRot:a.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get("labelLayout");(qr(r)||Xr(r).length)&&e.group.traverse((function(e){if(e.ignore)return!0;var i=e.getTextContent(),o=Ld(e);i&&!i.disableLabelLayout&&t._addLabel(o.dataIndex,o.dataType,n,i,r)}))},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){OA(e,t)}}for(var i=0;i<this._labelList.length;i++){var o=this._labelList[i],a=o.label,s=a.__hostTarget,l=o.defaultAttr,u=void 0;u=(u=qr(o.layoutOption)?o.layoutOption(ZA(o,s)):o.layoutOption)||{},o.computedLayoutOption=u;var c=Math.PI/180;s&&s.setTextConfig({local:!1,position:null!=u.x||null!=u.y?null:l.attachedPos,rotation:null!=u.rotate?u.rotate*c:l.attachedRot,offset:[u.dx||0,u.dy||0]});var h=!1;if(null!=u.x?(a.x=uu(u.x,t),a.setStyle("x",0),h=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(a.y=uu(u.y,n),a.setStyle("y",0),h=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var d=s.getTextGuideLine();d&&(d.setShape({points:u.labelLinePoints}),h=!1)}$A(a).needsUpdateLabelLine=h,a.rotation=null!=u.rotate?u.rotate*c:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<qA.length;p++){var f=qA[p];a.setStyle(f,null!=u[f]?u[f]:l.style[f])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var g=o.seriesModel;if(null!=o.dataIndex)g=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex);a.on("drag",r(s,g.getModel("labelLine")))}}else a.off("drag"),a.cursor=l.cursor}},e.prototype.layout=function(e){var t,n=e.getWidth(),r=e.getHeight(),i=UA(this._labelList),o=Ur(i,(function(e){return"shiftX"===e.layoutOption.moveOverlap})),a=Ur(i,(function(e){return"shiftY"===e.layoutOption.moveOverlap}));WA(o,"x","width",0,n,t),XA(a,0,r),jA(Ur(i,(function(e){return e.layoutOption.hideOverlap})))},e.prototype.processLabelsOverall=function(){var e=this;Fr(this._chartViewList,(function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse((function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var o=!r,a=t.getTextContent();!o&&a&&(o=$A(a).needsUpdateLabelLine),o&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)}))}))},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=Ld(e),i=r.dataIndex;if(n&&null!=i){var o=t.getData(r.dataType),a=o.getItemModel(i),s={},l=o.getItemVisual(i,"style");if(l){var u=o.getVisual("drawType");s.stroke=l[u]}var c=a.getModel("labelLine");GA(e,HA(a),s),OA(e,c)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!hg(e))){var i=(p=$A(n)).oldLayout,o=Ld(e),a=o.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(i){n.attr(i);var u=e.prevStates;u&&(kr(u,"select")>=0&&n.attr(p.oldLayoutSelect),kr(u,"emphasis")>=0&&n.attr(p.oldLayoutEmphasis)),ug(n,s,t,a)}else if(n.attr(s),!im(n).valueAnimation){var c=li(n.style.opacity,1);n.style.opacity=0,cg(n,{style:{opacity:c}},t,a)}if(p.oldLayout=s,n.states.select){var h=p.oldLayoutSelect={};QA(h,s,eC),QA(h,n.states.select,eC)}if(n.states.emphasis){var d=p.oldLayoutEmphasis={};QA(d,s,eC),QA(d,n.states.emphasis,eC)}am(n,a,l,t,t)}if(r&&!r.ignore&&!r.invisible){i=(p=JA(r)).oldLayout;var p,f={points:r.shape.points};i?(r.attr({shape:i}),ug(r,{shape:f},t)):(r.setShape(f),r.style.strokePercent=0,cg(r,{style:{strokePercent:1}},t)),p.oldLayout=f}},e}(),nC=oc();function rC(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){var r=nC(t).labelManager;r||(r=nC(t).labelManager=new tC),r.clearLabels()})),e.registerUpdateLifecycle("series:layoutlabels",(function(e,t,n){var r=nC(t).labelManager;n.updatedSeries.forEach((function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))})),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()}))}var iC=Math.sin,oC=Math.cos,aC=Math.PI,sC=2*Math.PI,lC=180/aC,uC=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},e.prototype.moveTo=function(e,t){this._add("M",e,t)},e.prototype.lineTo=function(e,t){this._add("L",e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,o){this._add("C",e,t,n,r,i,o)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add("Q",e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,o){this.ellipse(e,t,n,n,0,r,i,o)},e.prototype.ellipse=function(e,t,n,r,i,o,a,s){var l=a-o,u=!s,c=Math.abs(l),h=bs(c-sC)||(u?l>=sC:-l>=sC),d=l>0?l%sC:l%sC+sC,p=!1;p=!!h||!bs(c)&&d>=aC==!!u;var f=e+n*oC(o),g=t+r*iC(o);this._start&&this._add("M",f,g);var m=Math.round(i*lC);if(h){var v=1/this._p,y=(u?1:-1)*(sC-v);this._add("A",n,r,m,1,+u,e+n*oC(o+y),t+r*iC(o+y)),v>.01&&this._add("A",n,r,m,0,+u,f,g)}else{var _=e+n*oC(a),x=t+r*iC(a);this._add("A",n,r,m,+p,+u,_,x)}},e.prototype.rect=function(e,t,n,r){this._add("M",e,t),this._add("l",n,0),this._add("l",0,r),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,r,i,o,a,s,l){for(var u=[],c=this._p,h=1;h<arguments.length;h++){var d=arguments[h];if(isNaN(d))return void(this._invalid=!0);u.push(Math.round(d*c)/c)}this._d.push(e+u.join(" ")),this._start="Z"===e},e.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),cC="none",hC=Math.round;var dC=["lineCap","miterLimit","lineJoin"],pC=Gr(dC,(function(e){return"stroke-"+e.toLowerCase()}));function fC(e,t,n,r){var i=null==t.opacity?1:t.opacity;if(n instanceof ad)e("opacity",i);else{if(function(e){var t=e.fill;return null!=t&&t!==cC}(t)){var o=_s(t.fill);e("fill",o.color);var a=null!=t.fillOpacity?t.fillOpacity*o.opacity*i:o.opacity*i;a<1&&e("fill-opacity",a)}else e("fill",cC);if(function(e){var t=e.stroke;return null!=t&&t!==cC}(t)){var s=_s(t.stroke);e("stroke",s.color);var l=t.strokeNoScale?n.getLineScale():1,u=l?(t.lineWidth||0)/l:0,c=null!=t.strokeOpacity?t.strokeOpacity*s.opacity*i:s.opacity*i,h=t.strokeFirst;if(1!==u&&e("stroke-width",u),h&&e("paint-order",h?"stroke":"fill"),c<1&&e("stroke-opacity",c),t.lineDash){var d=$b(n),p=d[0],f=d[1];p&&(f=hC(f||0),e("stroke-dasharray",p.join(",")),(f||r)&&e("stroke-dashoffset",f))}for(var g=0;g<dC.length;g++){var m=dC[g];if(t[m]!==$h[m]){var v=t[m]||$h[m];v&&e(pC[g],v)}}}}}var gC="http://www.w3.org/2000/svg",mC="http://www.w3.org/1999/xlink",vC="http://www.w3.org/2000/xmlns/",yC="http://www.w3.org/XML/1998/namespace",_C="ecmeta_";function xC(e){return document.createElementNS(gC,e)}function bC(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function wC(e,t){var n=(t=t||{}).newline?"\n":"";return function e(t){var r=t.children,i=t.tag,o=t.attrs,a=t.text;return function(e,t){var n=[];if(t)for(var r in t){var i=t[r],o=r;!1!==i&&(!0!==i&&null!=i&&(o+='="'+i+'"'),n.push(o))}return"<"+e+" "+n.join(" ")+">"}(i,o)+("style"!==i?lo(a):a||"")+(r?""+n+Gr(r,(function(t){return e(t)})).join(n)+n:"")+("</"+i+">")}(e)}function SC(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function TC(e,t,n,r){return bC("svg","root",{width:e,height:t,xmlns:gC,"xmlns:xlink":mC,version:"1.1",baseProfile:"full",viewBox:!!r&&"0 0 "+e+" "+t},n)}var MC=0;function AC(){return MC++}var CC={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},DC="transform-origin";function EC(e,t,n){var r=Pr({},e.shape);Pr(r,t),e.buildPath(n,r);var i=new uC;return i.reset(Ls(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function IC(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[DC]=n+"px "+r+"px")}var LC={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function NC(e,t){var n=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function PC(e){return Kr(e)?CC[e]?"cubic-bezier("+CC[e]+")":Ga(e)?e:"":""}function OC(e,t,n,r){var i=e.animators,o=i.length,a=[];if(e instanceof Xf){var s=function(e,t,n){var r,i,o=e.shape.paths,a={};if(Fr(o,(function(e){var t=SC(n.zrId);t.animation=!0,OC(e,{},t,!0);var o=t.cssAnims,s=t.cssNodes,l=Xr(o),u=l.length;if(u){var c=o[i=l[u-1]];for(var h in c){var d=c[h];a[h]=a[h]||{d:""},a[h].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(i)>=0&&(r=f)}}})),r){t.d=!1;var s=NC(a,n);return r.replace(i,s)}}(e,t,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u<o;u++){var c=i[u],h=[c.getMaxTime()/1e3+"s"],d=PC(c.getClip().easing),p=c.getDelay();d?h.push(d):h.push("linear"),p&&h.push(p/1e3+"s"),c.getLoop()&&h.push("infinite");var f=h.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(c)}function g(i){var o,a=i[1],s=a.length,l={},u={},c={},h="animation-timing-function";function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),o=0;o<r.length;o++){var a=r[o];if(a.needsAnimate()){var s=a.keyframes,l=a.propName;if(n&&(l=n(l)),l)for(var u=0;u<s.length;u++){var c=s[u],d=Math.round(c.time/i*100)+"%",p=PC(c.easing),f=c.rawValue;(Kr(f)||Jr(f))&&(t[d]=t[d]||{},t[d][l]=c.rawValue,p&&(t[d][h]=p))}}}}for(var p=0;p<s;p++){(S=(w=a[p]).targetName)?"shape"===S&&d(w,u):!r&&d(w,l)}for(var f in l){var g={};Dl(g,e),Pr(g,l[f]);var m=Ns(g),v=l[f][h];c[f]=m?{transform:m}:{},IC(c[f],g),v&&(c[f][h]=v)}var y=!0;for(var f in u){c[f]=c[f]||{};var _=!o;v=u[f][h];_&&(o=new Ph);var x=o.len();o.reset(),c[f].d=EC(e,u[f],o);var b=o.len();if(!_&&x!==b){y=!1;break}v&&(c[f][h]=v)}if(!y)for(var f in c)delete c[f].d;if(!r)for(p=0;p<s;p++){var w,S;"style"===(S=(w=a[p]).targetName)&&d(w,c,(function(e){return LC[e]}))}var T,M=Xr(c),A=!0;for(p=1;p<M.length;p++){var C=M[p-1],D=M[p];if(c[C][DC]!==c[D][DC]){A=!1;break}T=c[C][DC]}if(A&&T){for(var f in c)c[f][DC]&&delete c[f][DC];t[DC]=T}if(Ur(M,(function(e){return Xr(c[e]).length>0})).length)return NC(c,n)+" "+i[0]+" both"}for(var m in l){(s=g(l[m]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+AC();n.cssNodes["."+v]={animation:a.join(",")},t.class=v}}function RC(e,t,n,r){var i=JSON.stringify(e),o=n.cssStyleCache[i];o||(o=n.zrId+"-cls-"+AC(),n.cssStyleCache[i]=o,n.cssNodes["."+o+":hover"]=e),t.class=t.class?t.class+" "+o:o}var kC=Math.round;function zC(e){return e&&Kr(e.src)}function BC(e){return e&&qr(e.toDataURL)}function VC(e,t,n,r){fC((function(i,o){var a="fill"===i||"stroke"===i;a&&Es(o)?KC(t,e,i,r):a&&As(o)?$C(n,e,i,r):e[i]=a&&"none"===o?"transparent":o}),t,n,!1),function(e,t,n){var r=e.style;if(function(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}(r)){var i=function(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(e),o=n.shadowCache,a=o[i];if(!a){var s=e.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=r.shadowOffsetX||0,h=r.shadowOffsetY||0,d=r.shadowBlur,p=_s(r.shadowColor),f=p.opacity,g=p.color,m=d/2/l+" "+d/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=bC("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[bC("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:m,"flood-color":g,"flood-opacity":f})]),o[i]=a}t.filter=Is(a)}}(n,e,r)}function FC(e,t){var n=ru(t);n&&(n.each((function(t,n){null!=t&&(e[(_C+n).toLowerCase()]=t+"")})),t.isSilent()&&(e[_C+"silent"]="true"))}function GC(e){return bs(e[0]-1)&&bs(e[1])&&bs(e[2])&&bs(e[3]-1)}function HC(e,t,n){if(t&&(!function(e){return bs(e[4])&&bs(e[5])}(t)||!GC(t))){var r=1e4;e.transform=GC(t)?"translate("+kC(t[4]*r)/r+" "+kC(t[5]*r)/r+")":function(e){return"matrix("+ws(e[0])+","+ws(e[1])+","+ws(e[2])+","+ws(e[3])+","+Ss(e[4])+","+Ss(e[5])+")"}(t)}}function UC(e,t,n){for(var r=e.points,i=[],o=0;o<r.length;o++)i.push(kC(r[o][0]*n)/n),i.push(kC(r[o][1]*n)/n);t.points=i.join(" ")}function WC(e){return!e.smooth}var XC,jC,YC={circle:[(XC=["cx","cy","r"],jC=Gr(XC,(function(e){return"string"==typeof e?[e,e]:e})),function(e,t,n){for(var r=0;r<jC.length;r++){var i=jC[r],o=e[i[0]];null!=o&&(t[i[1]]=kC(o*n)/n)}})],polyline:[UC,WC],polygon:[UC,WC]};function ZC(e,t){var n=e.style,r=e.shape,i=YC[e.type],o={},a=t.animation,s="path",l=e.style.strokePercent,u=t.compress&&Ls(e)||4;if(!i||t.willUpdate||i[1]&&!i[1](r)||a&&function(e){for(var t=e.animators,n=0;n<t.length;n++)if("shape"===t[n].targetName)return!0;return!1}(e)||l<1){var c=!e.path||e.shapeChanged();e.path||e.createPathProxy();var h=e.path;c&&(h.beginPath(),e.buildPath(h,e.shape),e.pathUpdated());var d=h.getVersion(),p=e,f=p.__svgPathBuilder;p.__svgPathVersion===d&&f&&l===p.__svgPathStrokePercent||(f||(f=p.__svgPathBuilder=new uC),f.reset(u),h.rebuildPath(f,l),f.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),o.d=f.getStr()}else{s=e.type;var g=Math.pow(10,u);i[0](r,o,g)}return HC(o,e.transform),VC(o,n,e,t),FC(o,e),t.animation&&OC(e,o,t),t.emphasis&&function(e,t,n){if(!e.ignore)if(e.isSilent())RC(u={"pointer-events":"none"},t,n);else{var r=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},i=r.fill;if(!i){var o=e.style&&e.style.fill,a=e.states.select&&e.states.select.style&&e.states.select.style.fill,s=e.currentStates.indexOf("select")>=0&&a||o;s&&(i=ms(s))}var l=r.lineWidth;l&&(l/=!r.strokeNoScale&&e.transform?e.transform[0]:1);var u={cursor:"pointer"};i&&(u.fill=i),r.stroke&&(u.stroke=r.stroke),l&&(u["stroke-width"]=l),RC(u,t,n)}}(e,o,t),bC(s,e.id+"",o)}function qC(e,t){return e instanceof ed?ZC(e,t):e instanceof ad?function(e,t){var n=e.style,r=n.image;if(r&&!Kr(r)&&(zC(r)?r=r.src:BC(r)&&(r=r.toDataURL())),r){var i=n.x||0,o=n.y||0,a={href:r,width:n.width,height:n.height};return i&&(a.x=i),o&&(a.y=o),HC(a,e.transform),VC(a,n,e,t),FC(a,e),t.animation&&OC(e,a,t),bC("image",e.id+"",a)}}(e,t):e instanceof nd?function(e,t){var n=e.style,r=n.text;if(null!=r&&(r+=""),r&&!isNaN(n.x)&&!isNaN(n.y)){var i=n.font||cr,o=n.x||0,a=function(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}(n.y||0,kl(i),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Ts[n.textAlign]||n.textAlign};if(Sd(n)){var l="",u=n.fontStyle,c=bd(n.fontSize);if(!parseFloat(c))return;var h=n.fontFamily||ur,d=n.fontWeight;l+="font-size:"+c+";font-family:"+h+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),d&&"normal"!==d&&(l+="font-weight:"+d+";"),s.style=l}else s.style="font: "+i;return r.match(/\s/)&&(s["xml:space"]="preserve"),o&&(s.x=o),a&&(s.y=a),HC(s,e.transform),VC(s,n,e,t),FC(s,e),t.animation&&OC(e,s,t),bC("text",e.id+"",s,void 0,r)}}(e,t):void 0}function KC(e,t,n,r){var i,o=e[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(Cs(o))i="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!Ds(o))return void("production"!==process.env.NODE_ENV&&Er("Illegal gradient type."));i="radialGradient",a.cx=li(o.x,.5),a.cy=li(o.y,.5),a.r=li(o.r,.5)}for(var s=o.colorStops,l=[],u=0,c=s.length;u<c;++u){var h=100*Ss(s[u].offset)+"%",d=_s(s[u].color),p=d.color,f=d.opacity,g={offset:h};g["stop-color"]=p,f<1&&(g["stop-opacity"]=f),l.push(bC("stop",u+"",g))}var m=wC(bC(i,"",a,l)),v=r.gradientCache,y=v[m];y||(y=r.zrId+"-g"+r.gradientIdx++,v[m]=y,a.id=y,r.defs[y]=bC(i,y,a,l)),t[n]=Is(y)}function $C(e,t,n,r){var i,o=e.style[n],a=e.getBoundingRect(),s={},l=o.repeat,u="no-repeat"===l,c="repeat-x"===l,h="repeat-y"===l;if(Ms(o)){var d=o.imageWidth,p=o.imageHeight,f=void 0,g=o.image;if(Kr(g)?f=g:zC(g)?f=g.src:BC(g)&&(f=g.toDataURL()),"undefined"==typeof Image){var m="Image width/height must been given explictly in svg-ssr renderer.";di(d,m),di(p,m)}else if(null==d||null==p){var v=function(e,t){if(e){var n=e.elm,r=d||t.width,i=p||t.height;"pattern"===e.tag&&(c?(i=1,r/=a.width):h&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute("width",r),n.setAttribute("height",i))}},y=Ic(f,null,e,(function(e){u||v(w,e),v(i,e)}));y&&y.width&&y.height&&(d=d||y.width,p=p||y.height)}i=bC("image","img",{href:f,width:d,height:p}),s.width=d,s.height=p}else o.svgElement&&(i=Ir(o.svgElement),s.width=o.svgWidth,s.height=o.svgHeight);if(i){var _,x;u?_=x=1:c?(x=1,_=s.width/a.width):h?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(s.width=_),null==x||isNaN(x)||(s.height=x);var b=Ns(o);b&&(s.patternTransform=b);var w=bC("pattern","",s,[i]),S=wC(w),T=r.patternCache,M=T[S];M||(M=r.zrId+"-p"+r.patternIdx++,T[S]=M,s.id=M,w=r.defs[M]=bC("pattern",M,s,[i])),t[n]=Is(M)}}function JC(e,t,n){var r=n.clipPathCache,i=n.defs,o=r[e.id];if(!o){var a={id:o=n.zrId+"-c"+n.clipPathIdx++};r[e.id]=o,i[o]=bC("clipPath",o,a,[ZC(e,n)])}t["clip-path"]=Is(o)}function QC(e){return document.createTextNode(e)}function eD(e,t,n){e.insertBefore(t,n)}function tD(e,t){e.removeChild(t)}function nD(e,t){e.appendChild(t)}function rD(e){return e.parentNode}function iD(e){return e.nextSibling}function oD(e,t){e.textContent=t}var aD=58,sD=120,lD=bC("","");function uD(e){return void 0===e}function cD(e){return void 0!==e}function hD(e,t,n){for(var r={},i=t;i<=n;++i){var o=e[i].key;void 0!==o&&("production"!==process.env.NODE_ENV&&null!=r[o]&&console.error("Duplicate key "+o),r[o]=i)}return r}function dD(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function pD(e){var t,n=e.children,r=e.tag;if(cD(r)){var i=e.elm=xC(r);if(mD(lD,e),Zr(n))for(t=0;t<n.length;++t){var o=n[t];null!=o&&nD(i,pD(o))}else cD(e.text)&&!Qr(e.text)&&nD(i,QC(e.text))}else e.elm=QC(e.text);return e.elm}function fD(e,t,n,r,i){for(;r<=i;++r){var o=n[r];null!=o&&eD(e,pD(o),t)}}function gD(e,t,n,r){for(;n<=r;++n){var i=t[n];if(null!=i)if(cD(i.tag))tD(rD(i.elm),i.elm);else tD(e,i.elm)}}function mD(e,t){var n,r=t.elm,i=e&&e.attrs||{},o=t.attrs||{};if(i!==o){for(n in o){var a=o[n];i[n]!==a&&(!0===a?r.setAttribute(n,""):!1===a?r.removeAttribute(n):"style"===n?r.style.cssText=a:n.charCodeAt(0)!==sD?r.setAttribute(n,a):"xmlns:xlink"===n||"xmlns"===n?r.setAttributeNS(vC,n,a):n.charCodeAt(3)===aD?r.setAttributeNS(yC,n,a):n.charCodeAt(5)===aD?r.setAttributeNS(mC,n,a):r.setAttribute(n,a))}for(n in i)n in o||r.removeAttribute(n)}}function vD(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(mD(e,t),uD(t.text)?cD(r)&&cD(i)?r!==i&&function(e,t,n){for(var r,i,o,a=0,s=0,l=t.length-1,u=t[0],c=t[l],h=n.length-1,d=n[0],p=n[h];a<=l&&s<=h;)null==u?u=t[++a]:null==c?c=t[--l]:null==d?d=n[++s]:null==p?p=n[--h]:dD(u,d)?(vD(u,d),u=t[++a],d=n[++s]):dD(c,p)?(vD(c,p),c=t[--l],p=n[--h]):dD(u,p)?(vD(u,p),eD(e,u.elm,iD(c.elm)),u=t[++a],p=n[--h]):dD(c,d)?(vD(c,d),eD(e,c.elm,u.elm),c=t[--l],d=n[++s]):(uD(r)&&(r=hD(t,a,l)),uD(i=r[d.key])||(o=t[i]).tag!==d.tag?eD(e,pD(d),u.elm):(vD(o,d),t[i]=void 0,eD(e,o.elm,u.elm)),d=n[++s]);(a<=l||s<=h)&&(a>l?fD(e,null==n[h+1]?null:n[h+1].elm,n,s,h):gD(e,t,a,l))}(n,r,i):cD(i)?(cD(e.text)&&oD(n,""),fD(n,null,i,0,i.length-1)):cD(r)?gD(n,r,0,r.length-1):cD(e.text)&&oD(n,""):e.text!==t.text&&(cD(r)&&gD(n,r,0,r.length-1),oD(n,t.text)))}var yD=0,_D=function(){function e(e,t,n){if(this.type="svg",this.refreshHover=xD("refreshHover"),this.configLayer=xD("configLayer"),this.storage=t,this._opts=n=Pr({},n),this.root=e,this._id="zr"+yD++,this._oldVNode=TC(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement("div");r.style.cssText="position:relative;overflow:hidden";var i=this._svgDom=this._oldVNode.elm=xC("svg");mD(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",function(e,t){if(dD(e,t))vD(e,t);else{var n=e.elm,r=rD(n);pD(t),null!==r&&(eD(r,t.elm,iD(n)),gD(r,[e],0,0))}}(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return qC(e,SC(this._id))},e.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=SC(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis;var o=[],a=this._bgVNode=function(e,t,n,r){var i;if(n&&"none"!==n)if(i=bC("rect","bg",{width:e,height:t,x:"0",y:"0"}),Es(n))KC({fill:n},i.attrs,"fill",r);else if(As(n))$C({style:{fill:n},dirty:Mi,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,"fill",r);else{var o=_s(n),a=o.color,s=o.opacity;i.attrs.fill=a,s<1&&(i.attrs["fill-opacity"]=s)}return i}(n,r,this._backgroundColor,i);a&&o.push(a);var s=e.compress?null:this._mainVNode=bC("g","main",{},[]);this._paintList(t,i,s?s.children:o),s&&o.push(s);var l=Gr(Xr(i.defs),(function(e){return i.defs[e]}));if(l.length&&o.push(bC("defs","defs",{},l)),e.animation){var u=function(e,t,n){var r=(n=n||{}).newline?"\n":"",i=" {"+r,o=r+"}",a=Gr(Xr(e),(function(t){return t+i+Gr(Xr(e[t]),(function(n){return n+":"+e[t][n]+";"})).join(r)+o})).join(r),s=Gr(Xr(t),(function(e){return"@keyframes "+e+i+Gr(Xr(t[e]),(function(n){return n+i+Gr(Xr(t[e][n]),(function(r){var i=t[e][n][r];return"d"===r&&(i='path("'+i+'")'),r+":"+i+";"})).join(r)+o})).join(r)+o})).join(r);return a||s?["<![CDATA[",a,s,"]]>"].join(r):""}(i.cssNodes,i.cssAnims,{newline:!0});if(u){var c=bC("style","stl",{},[],u);o.push(c)}}return TC(n,r,o,e.useViewBox)},e.prototype.renderToString=function(e){return e=e||{},wC(this.renderToVNode({animation:li(e.cssAnimation,!0),emphasis:li(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:li(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r,i,o=e.length,a=[],s=0,l=0,u=0;u<o;u++){var c=e[u];if(!c.invisible){var h=c.__clipPaths,d=h&&h.length||0,p=i&&i.length||0,f=void 0;for(f=Math.max(d-1,p-1);f>=0&&(!h||!i||h[f]!==i[f]);f--);for(var g=p-1;g>f;g--)r=a[--s-1];for(var m=f+1;m<d;m++){var v={};JC(h[m],v,t);var y=bC("g","clip-g-"+l++,v,[]);(r?r.children:n).push(y),a[s++]=y,r=y}i=h;var _=qC(c,t);_&&(r?r.children:n).push(_)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(null!=e&&(n.width=e),null!=t&&(n.height=t),r&&i&&(i.style.display="none",e=Kb(r,0,n),t=Kb(r,1,n),i.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var o=i.style;o.width=e+"px",o.height=t+"px"}if(As(this._backgroundColor))this.refresh();else{var a=this._svgDom;a&&(a.setAttribute("width",e),a.setAttribute("height",t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute("width",e),s.setAttribute("height",t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n="data:image/svg+xml;";return e?(t=Ps(t))&&n+"base64,"+t:n+"charset=UTF-8,"+encodeURIComponent(t)},e}();function xD(e){return function(){"production"!==process.env.NODE_ENV&&Er('In SVG mode painter not support method "'+e+'"')}}function bD(e,t,n){var r=fr.createCanvas(),i=t.getWidth(),o=t.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",e)),r.width=i*n,r.height=o*n,r}var wD=function(e){function t(t,n,r){var i,o=e.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,r=r||ml,"string"==typeof t?i=bD(t,n,r):Qr(t)&&(t=(i=t).id),o.id=t,o.dom=i;var a=i.style;return a&&(Si(i),i.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=r,o}return g(t,e),t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=bD("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i,o=[],a=this.maxRepaintRectCount,s=!1,l=new Uo(0,0,0,0);function u(e){if(e.isFinite()&&!e.isZero())if(0===o.length){(t=new Uo(0,0,0,0)).copy(e),o.push(t)}else{for(var t,n=!1,r=1/0,i=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var h=new Uo(0,0,0,0);h.copy(c),h.union(e),o[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var d=e.width*e.height,p=c.width*c.height,f=l.width*l.height-d-p;f<r&&(r=f,i=u)}}if(s&&(o[i].union(e),n=!0),!n)(t=new Uo(0,0,0,0)).copy(e),o.push(t);s||(s=o.length>=a)}}for(var c=this.__startIndex;c<this.__endIndex;++c){if(p=e[c]){var h=p.shouldBePainted(n,r,!0,!0);(f=p.__isRendered&&(p.__dirty&la||!h)?p.getPrevPaintRect():null)&&u(f);var d=h&&(p.__dirty&la||!p.__isRendered)?p.getPaintRect():null;d&&u(d)}}for(c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var p,f;h=(p=t[c])&&p.shouldBePainted(n,r,!0,!0);if(p&&(!h||!p.__zr)&&p.__isRendered)(f=p.getPrevPaintRect())&&u(f)}do{i=!1;for(c=0;c<o.length;)if(o[c].isZero())o.splice(c,1);else{for(var g=c+1;g<o.length;)o[c].intersect(o[g])?(i=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(i);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,o=this.domBack;i&&(i.width=e+"px",i.height=t+"px"),r.width=e*n,r.height=t*n,o&&(o.width=e*n,o.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,o=r.width,a=r.height;t=t||this.clearColor;var s=this.motionBlur&&!e,l=this.lastFrameAlpha,u=this.dpr,c=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,o/u,a/u));var h=this.domBack;function d(e,n,r,o){if(i.clearRect(e,n,r,o),t&&"transparent"!==t){var a=void 0;if(ri(t))a=(t.global||t.__width===r&&t.__height===o)&&t.__canvasGradient||Zb(i,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=a,t.__width=r,t.__height=o;else ii(t)&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=iw(i,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}}));i.save(),i.fillStyle=a||t,i.fillRect(e,n,r,o),i.restore()}s&&(i.save(),i.globalAlpha=l,i.drawImage(h,e,n,r,o),i.restore())}!n||s?d(0,0,o,a):n.length&&Fr(n,(function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)}))},t}(Ji),SD=1e5,TD=314159,MD=.01;var AD=function(){function e(e,t,n,r){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=Pr({},n||{}),this.dpr=n.devicePixelRatio||ml,this._singleCanvas=i,this.root=e,e.style&&(Si(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(i){var s=e,l=s.width,u=s.height;null!=n.width&&(l=n.width),null!=n.height&&(u=n.height),this.dpr=n.devicePixelRatio||1,s.width=l*this.dpr,s.height=u*this.dpr,this._width=l,this._height=u;var c=new wD(s,this,this.dpr);c.__builtin__=!0,c.initContext(),a[314159]=c,c.zlevel=TD,o.push(TD),this._domRoot=e}else{this._width=Kb(e,0,n),this._height=Kb(e,1,n);var h=this._domRoot=function(e,t){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}(this._width,this._height);e.appendChild(h)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var o=r[i],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===i?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r,i={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<t;o++){var a=e[o];a.__inHover&&(n||(n=this._hoverlayer=this.getLayer(SD)),r||(r=n.ctx).save(),vw(r,a,i,o===t-1))}r&&r.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(SD)},e.prototype.paintOne=function(e,t){mw(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),o=i.finished,a=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer((function(e){e.afterBrush&&e.afterBrush()}));else{var s=this;pa((function(){s._paintList(e,t,n,r)}))}}},e.prototype._compositeManually=function(){var e=this.getLayer(TD).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer((function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)}))},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&i.push(l)}for(var u=!0,c=!1,h=function(a){var s,l=i[a],h=l.ctx,p=o&&l.createRepaintRects(e,t,d._width,d._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,v,p);else if(f===l.__startIndex){var y=e[f];y.incremental&&y.notClear&&!n||l.clear(!1,v,p)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var _=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(s=f;s<l.__endIndex;s++){var i=e[s];if(i.__inHover&&(c=!0),r._doPaintEl(i,l,o,t,n,s===l.__endIndex-1),g)if(Date.now()-m>15)break}n.prevElClipPaths&&h.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=d.dpr,b=0;b<p.length;++b){var w=p[b];h.save(),h.beginPath(),h.rect(w.x*x,w.y*x,w.width*x,w.height*x),h.clip(),_(w),h.restore()}else h.save(),_(),h.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)},d=this,p=0;p<i.length;p++)h(p);return sr.wxa&&Fr(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,r,i,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(vw(a,e,i,o),e.setPrevPaintRect(s))}else vw(a,e,i,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=TD);var n=this._layers[e];return n||((n=new wD("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?Lr(n,this._layerConfig[e],!0):this._layerConfig[e-MD]&&Lr(n,this._layerConfig[e-MD],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,o=this._domRoot,a=null,s=-1;if(n[e])"production"!==process.env.NODE_ENV&&Er("ZLevel "+e+" has been used already");else if(function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);a=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(t.dom,l.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}else"production"!==process.env.NODE_ENV&&Er("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__&&e.call(t,o,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__||e.call(t,o,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){o&&(o.__endIndex!==e&&(o.__dirty=!0),o.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var n=1;n<e.length;n++){if((s=e[n]).zlevel!==e[n-1].zlevel||s.incremental){this._needsManuallyCompositing=!0;break}}var r,i,o=null,a=0;for(i=0;i<e.length;i++){var s,l=(s=e[i]).zlevel,u=void 0;r!==l&&(r=l,a=0),s.incremental?((u=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):u=this.getLayer(l+(a>0?MD:0),this._needsManuallyCompositing),u.__builtin__||Er("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==i&&(u.__dirty=!0),u.__startIndex=i,u.incremental?u.__drawIndex=-1:u.__drawIndex=i,t(i),o=u),s.__dirty&la&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,Fr(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Lr(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+MD)Lr(this._layers[i],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(kr(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var r=this._opts,i=this.root;if(null!=e&&(r.width=e),null!=t&&(r.height=t),e=Kb(i,0,r),t=Kb(i,1,r),n.style.display="",this._width!==e||t!==this._height){for(var o in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(TD).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new wD("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer((function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())}))}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++){var u=a[s];vw(n,u,o,s===l-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function CD(e){e.registerPainter("canvas",AD)}var DD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return g(t,e),t.prototype.getInitialData=function(e){if("production"!==process.env.NODE_ENV){var t=e.coordinateSystem;if("polar"!==t&&"cartesian2d"!==t)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return DT(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Kl,n=Wb("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*e.itemHeight,s=Wb(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?i:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Mx);function ED(e,t){var n=e.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=p_(e,t,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a<n.length;a++)o.push(p_(e,t,n[a]));return o.join(" ")}}function ID(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!Zr(t))return t+"";for(var r=[],i=0;i<n.length;i++){var o=e.getDimensionIndex(n[i]);o>=0&&r.push(t[o])}return r.join(" ")}var LD=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.updateData(t,n,r,i),o}return g(t,e),t.prototype._createSymbol=function(e,t,n,r,i){this.removeAll();var o=Wb(e,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=ND,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){cp(this.childAt(0))},t.prototype.downplay=function(){hp(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=i&&i.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{(d=this.childAt(0)).silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};u?d.attr(h):ug(d,h,a,n),gg(d)}if(this._updateCommon(e,n,s,r,i),l){var d=this.childAt(0);if(!u){h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,cg(d,h,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,r,i){var o,a,s,l,u,c,h,d,p,f=this.childAt(0),g=e.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,h=r.labelStatesModels,d=r.hoverScale,p=r.cursorStyle,c=r.emphasisDisabled),!r||e.hasItemOption){var m=r&&r.itemModel?r.itemModel:e.getItemModel(t),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),h=Kg(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var _=jb(e.getItemVisual(t,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=e.getItemVisual(t,"style"),b=x.fill;if(f instanceof ad){var w=f.style;f.useStyle(Pr({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(Pr({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var S=e.getItemVisual(t,"liftZ"),T=this._z2;null!=S?null==T&&(this._z2=f.z2,f.z2+=S):null!=T&&(f.z2=T,this._z2=null);var M=i&&i.useNameLabel;qg(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):ED(e,t)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var A=f.ensureState("emphasis");A.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var C=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;A.scaleX=this._sizeX*C,A.scaleY=this._sizeY*C,this.setSymbolScale(1),Tp(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=Ld(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&dg(a,{style:{opacity:0}},t,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();dg(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return Xb(e.getItemVisual(t,"symbolSize"))},t}(Kl);function ND(e,t){this.parent.drift(e,t)}function PD(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function OD(e){return null==e||Qr(e)||(e={isIgnore:e}),e||{}}function RD(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Kg(t),cursorStyle:t.get("cursor")}}var kD=function(){function e(e){this.group=new Kl,this._SymbolCtor=e||LD}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=OD(t);var n=this.group,r=e.hostModel,i=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=RD(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add((function(r){var i=u(r);if(PD(e,i,r,t)){var a=new o(e,r,s,l);a.setPosition(i),e.setItemGraphicEl(r,a),n.add(a)}})).update((function(c,h){var d=i.getItemGraphicEl(h),p=u(c);if(PD(e,p,c,t)){var f=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(e,c,s,l)).setPosition(p);else{d.updateData(e,c,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):ug(d,m,r)}n.add(d),e.setItemGraphicEl(c,d)}else n.remove(d)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}),r)})).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=RD(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function r(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=OD(n);for(var i=e.start;i<e.end;i++){var o=t.getItemLayout(i);if(PD(t,o,i,n)){var a=new this._SymbolCtor(t,i,this._seriesScope);a.traverse(r),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}),n.hostModel)})):t.removeAll()},e}();function zD(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),o=function(e,t){var n=0,r=e.scale.getExtent();"start"===t?n=r[0]:"end"===t?n=r[1]:Jr(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]);return n}(i,n),a=r.dim,s=i.dim,l=t.mapDimension(s),u=t.mapDimension(a),c="x"===s||"radius"===s?1:0,h=Gr(e.dimensions,(function(e){return t.mapDimension(e)})),d=!1,p=t.getCalculationInfo("stackResultDimension");return AT(t,h[0])&&(d=!0,h[0]=p),AT(t,h[1])&&(d=!0,h[1]=p),{dataDimsForPoint:h,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function BD(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,r),a[1-o]=i,t.dataToPoint(a)}var VD=Math.min,FD=Math.max;function GD(e,t){return isNaN(e)||isNaN(t)}function HD(e,t,n,r,i,o,a,s,l){for(var u,c,h,d,p,f,g=n,m=0;m<r;m++){var v=t[2*g],y=t[2*g+1];if(g>=i||g<0)break;if(GD(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),h=v,d=y;else{var _=v-u,x=y-c;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var b=g+o,w=t[2*b],S=t[2*b+1];w===v&&S===y&&m<r;)m++,g+=o,w=t[2*(b+=o)],S=t[2*b+1],_=(v=t[2*g])-u,x=(y=t[2*g+1])-c;var T=m+1;if(l)for(;GD(w,S)&&T<r;)T++,w=t[2*(b+=o)],S=t[2*b+1];var M=.5,A=0,C=0,D=void 0,E=void 0;if(T>=r||GD(w,S))p=v,f=y;else{A=w-u,C=S-c;var I=v-u,L=w-v,N=y-c,P=S-y,O=void 0,R=void 0;if("x"===s){var k=A>0?1:-1;p=v-k*(O=Math.abs(I))*a,f=y,D=v+k*(R=Math.abs(L))*a,E=y}else if("y"===s){var z=C>0?1:-1;p=v,f=y-z*(O=Math.abs(N))*a,D=v,E=y+z*(R=Math.abs(P))*a}else O=Math.sqrt(I*I+N*N),p=v-A*a*(1-(M=(R=Math.sqrt(L*L+P*P))/(R+O))),f=y-C*a*(1-M),E=y+C*a*M,D=VD(D=v+A*a*M,FD(w,v)),E=VD(E,FD(S,y)),D=FD(D,VD(w,v)),f=y-(C=(E=FD(E,VD(S,y)))-y)*O/R,p=VD(p=v-(A=D-v)*O/R,FD(u,v)),f=VD(f,FD(c,y)),D=v+(A=v-(p=FD(p,VD(u,v))))*R/O,E=y+(C=y-(f=FD(f,VD(c,y))))*R/O}e.bezierCurveTo(h,d,p,f,v,y),h=D,d=E}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var UD=function(){this.smooth=0,this.smoothConstraint=!0},WD=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new UD},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&GD(n[2*i-2],n[2*i-1]);i--);for(;r<i&&GD(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=HD(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,r,i=this.path.data,o=Ph.CMD,a="x"===t,s=[],l=0;l<i.length;){var u=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,g=void 0;switch(i[l++]){case o.M:n=i[l++],r=i[l++];break;case o.L:if(u=i[l++],c=i[l++],(g=a?(e-n)/(u-n):(e-r)/(c-r))<=1&&g>=0){var m=a?(c-r)*g+r:(u-n)*g+n;return a?[e,m]:[m,e]}n=u,r=c;break;case o.C:u=i[l++],c=i[l++],h=i[l++],d=i[l++],p=i[l++],f=i[l++];var v=a?Ea(n,u,h,p,e,s):Ea(r,c,d,f,e,s);if(v>0)for(var y=0;y<v;y++){var _=s[y];if(_<=1&&_>=0){m=a?Ca(r,c,d,f,_):Ca(n,u,h,p,_);return a?[e,m]:[m,e]}}n=p,r=f}}},t}(ed),XD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t}(UD),jD=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return g(t,e),t.prototype.getDefaultShape=function(){return new XD},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&GD(n[2*o-2],n[2*o-1]);o--);for(;i<o&&GD(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=HD(e,n,i,o,o,1,t.smooth,a,t.connectNulls);HD(e,r,i+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),i+=s+1,e.closePath()}},t}(ed);function YD(e,t,n,r,i){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||2;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new fd({shape:{x:a,y:s,width:l,height:u}});if(t){var d=e.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=u),h.shape.height=0);var g=qr(i)?function(e){i(e,h)}:null;cg(h,{shape:{width:l,height:u,x:a,y:s}},n,null,r,g)}return h}function ZD(e,t,n){var r=e.getArea(),i=cu(r.r0,1),o=cu(r.r,1),a=new bf({shape:{cx:cu(e.cx,1),cy:cu(e.cy,1),r0:i,r:o,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=r.startAngle:a.shape.r=i,cg(a,{shape:{endAngle:r.endAngle,r:o}},n));return a}function qD(e,t,n,r,i){return e?"polar"===e.type?ZD(e,t,n):"cartesian2d"===e.type?YD(e,t,n,r,i):null:null}function KD(e,t){return e.type===t}function $D(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function JD(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),r=Math.max(a,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function QD(e,t){var n=JD(e),r=n[0],i=n[1],o=JD(t),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function eE(e){return Jr(e)?e:e?.5:0}function tE(e,t,n,r){var i=t.getBaseAxis(),o="x"===i.dim||"radius"===i.dim?0:1,a=[],s=0,l=[],u=[],c=[],h=[];if(r){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||h.push(e[s],e[s+1]);e=h}for(s=0;s<e.length-2;s+=2)switch(c[0]=e[s+2],c[1]=e[s+3],u[0]=e[s],u[1]=e[s+1],a.push(u[0],u[1]),n){case"end":l[o]=c[o],l[1-o]=u[1-o],a.push(l[0],l[1]);break;case"middle":var d=(u[o]+c[o])/2,p=[];l[o]=p[o]=d,l[1-o]=u[1-o],p[1-o]=c[1-o],a.push(l[0],l[1]),a.push(p[0],p[1]);break;default:l[o]=u[o],l[1-o]=c[1-o],a.push(l[0],l[1])}return a.push(e[s++],e[s++]),a}function nE(e,t,n){var r=e.getVisual("visualMeta");if(r&&r.length&&e.count())if("cartesian2d"===t.type){for(var i,o,a=r.length-1;a>=0;a--){var s=e.getDimensionInfo(r[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){o=r[a];break}}if(o){var l=t.getAxis(i),u=Gr(o.stops,(function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}})),c=u.length,h=o.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=function(e,t){var n,r,i=[],o=e.length;function a(e,t,n){var r=e.coord;return{coord:n,color:us((n-r)/(t.coord-r),[e.color,t.color])}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else{if(u>t){r?i.push(a(r,l,t)):n&&i.push(a(n,l,0),a(n,l,t));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}(u,"x"===i?n.getWidth():n.getHeight()),p=d.length;if(!p&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";Fr(d,(function(e){e.offset=(e.coord-f)/m})),d.push({offset:p?d[p-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:h[0]||"transparent"});var v=new Zf(0,0,0,0,d,!0);return v[i]=f,v[i+"2"]=g,v}"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style only support x or y dimension.")}else"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style is only supported on cartesian2d.")}function rE(e,t,n){var r=e.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!function(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*LD.getSymbolSize(t,a)[e.isHorizontal()?1:0]>r)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return Fr(o.getViewLabels(),(function(e){var t=o.scale.getRawOrdinalNumber(e.tickValue);s[t]=1})),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}function iE(e,t){return isNaN(e)||isNaN(t)}function oE(e,t){return[e[2*t],e[2*t+1]]}function aE(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<Fd.length;t++)if(e.get([Fd[t],"endLabel","show"]))return!0;return!1}function sE(e,t,n,r){if(KD(t,"cartesian2d")){var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=aE(r)?function(n,r){e._endLabelOnDuring(n,r,a,s,o,i,t)}:null,u=t.getBaseAxis().isHorizontal(),c=YD(t,n,r,(function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})}),l);if(!r.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,c),c}return"production"!==process.env.NODE_ENV&&r.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),ZD(t,n,r)}var lE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.init=function(){var e=new Kl,t=new kD;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem,o=this.group,a=e.getData(),s=e.getModel("lineStyle"),l=e.getModel("areaStyle"),u=a.getLayout("points")||[],c="polar"===i.type,h=this._coordSys,d=this._symbolDraw,p=this._polyline,f=this._polygon,g=this._lineGroup,m=!t.ssr&&e.get("animation"),v=!l.isEmpty(),y=l.get("origin"),_=zD(i,a,y),x=v&&function(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=jT(2*r),o=0;o<r;o++){var a=BD(n,e,t,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(i,a,_),b=e.get("showSymbol"),w=e.get("connectNulls"),S=b&&!c&&rE(e,a,i),T=this._data;T&&T.eachItemGraphicEl((function(e,t){e.__temp&&(o.remove(e),T.setItemGraphicEl(t,null))})),b||d.remove(),o.add(g);var M,A=!c&&e.get("step");i&&i.getArea&&e.get("clip",!0)&&(null!=(M=i.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var C=nE(a,i,n)||a.getVisual("style")[a.getVisual("drawType")];if(p&&h.type===i.type&&A===this._step){v&&!f?f=this._newPolygon(u,x):f&&!v&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,i,vv(C));var D=g.getClipPath();if(D)cg(D,{shape:sE(this,i,!1,e).shape},e);else g.setClipPath(sE(this,i,!0,e));b&&d.updateData(a,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),$D(this._stackedOnPoints,x)&&$D(this._points,u)||(m?this._doUpdateAnimation(a,x,i,n,A,y,w):(A&&(u=tE(u,i,A,w),x&&(x=tE(x,i,A,w))),p.setShape({points:u}),f&&f.setShape({points:u,stackedOnPoints:x})))}else b&&d.updateData(a,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),m&&this._initSymbolLabelAnimation(a,i,M),A&&(u=tE(u,i,A,w),x&&(x=tE(x,i,A,w))),p=this._newPolyline(u),v?f=this._newPolygon(u,x):f&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,i,vv(C)),g.setClipPath(sE(this,i,!0,e));var E=e.getModel("emphasis"),I=E.get("focus"),L=E.get("blurScope"),N=E.get("disabled");(p.useStyle(Or(s.getLineStyle(),{fill:"none",stroke:C,lineJoin:"bevel"})),Dp(p,e,"lineStyle"),p.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(p.getState("emphasis").style.lineWidth=+p.style.lineWidth+1);Ld(p).seriesIndex=e.seriesIndex,Tp(p,I,L,N);var P=eE(e.get("smooth")),O=e.get("smoothMonotone");if(p.setShape({smooth:P,smoothMonotone:O,connectNulls:w}),f){var R=a.getCalculationInfo("stackedOnSeries"),k=0;f.useStyle(Or(l.getAreaStyle(),{fill:C,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),R&&(k=eE(R.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:k,smoothMonotone:O,connectNulls:w}),Dp(f,e,"areaStyle"),Ld(f).seriesIndex=e.seriesIndex,Tp(f,I,L,N)}var z=function(e){r._changePolyState(e)};a.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=z)})),this._polyline.onHoverStateChange=z,this._data=a,this._coordSys=i,this._stackedOnPoints=x,this._points=u,this._step=A,this._valueOrigin=y,e.get("triggerLineEvent")&&(this.packEventData(e,p),f&&this.packEventData(e,f))},t.prototype.packEventData=function(e,t){Ld(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),o=ic(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,h=e.get("z")||0;(s=new LD(i,o)).x=l,s.y=u,s.setZ(c,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else zx.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),o=ic(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else zx.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;op(this._polyline,e),t&&op(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new WD({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new jD({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(r=o.isHorizontal(),i=!1):"polar"===t.type&&(r="angle"===o.dim,i=!0);var s=e.hostModel,l=s.get("animationDuration");qr(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=qr(u)?u(null):u;e.eachItemGraphicEl((function(e,o){var s=e;if(s){var h=[e.x,e.y],d=void 0,p=void 0,f=void 0;if(n)if(i){var g=n,m=t.pointToCoord(h);r?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var v=n;r?(d=v.x,p=v.x+v.width,f=e.x):(d=v.y+v.height,p=v.y,f=e.y)}var y=p===d?0:(f-d)/(p-d);a&&(y=1-y);var _=qr(u)?u(o):l*y+c,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel("endLabel");if(aE(e)){var i=e.getData(),o=this._polyline,a=i.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Id({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(e){for(var t=e.length/2;t>0&&iE(e[2*t-2],e[2*t-1]);t--);return t-1}(a);l>=0&&(qg(o,Kg(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:l,defaultText:function(e,t,n){return null!=n?ID(i,n):ED(i,e)},enableTextSetter:!0},function(e,t){var n=t.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,o=r?i?"right":"left":"center",a=r?"middle":i?"top":"bottom";return{normal:{align:e.get("align")||o,verticalAlign:e.get("verticalAlign")||a}}}(r,t)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,_=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),b=g?"x":"y",w=function(e,t,n){for(var r,i,o=e.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<o;u++)if(i=e[2*u+a],!isNaN(i)&&!isNaN(e[2*u+1-a]))if(0!==u){if(r<=t&&i>=t||r>=t&&i<=t){l=u;break}s=u,r=i}else r=i;return{range:[s,l],t:(t-r)/(i-r)}}(u,y,b),S=w.range,T=S[1]-S[0],M=void 0;if(T>=1){if(T>1&&!h){var A=oE(u,S[0]);s.attr({x:A[0]+_,y:A[1]+x}),i&&(M=c.getRawValue(S[0]))}else{(A=l.getPointOn(y,b))&&s.attr({x:A[0]+_,y:A[1]+x});var C=c.getRawValue(S[0]),D=c.getRawValue(S[1]);i&&(M=fc(n,d,C,D,w.t))}r.lastFrameIndex=S[0]}else{var E=1===e||r.lastFrameIndex>0?S[0]:0;A=oE(u,E);i&&(M=c.getRawValue(E)),s.attr({x:A[0]+_,y:A[1]+x})}if(i){var I=im(s);"function"==typeof I.setLabelText&&I.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,r,i,o,a,s){for(var l=function(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}(e,t),u=[],c=[],h=[],d=[],p=[],f=[],g=[],m=zD(i,t,a),v=e.getLayout("points")||[],y=t.getLayout("points")||[],_=0;_<l.length;_++){var x=l[_],b=!0,w=void 0,S=void 0;switch(x.cmd){case"=":w=2*x.idx,S=2*x.idx1;var T=v[w],M=v[w+1],A=y[S],C=y[S+1];(isNaN(T)||isNaN(M))&&(T=A,M=C),u.push(T,M),c.push(A,C),h.push(n[w],n[w+1]),d.push(r[S],r[S+1]),g.push(t.getRawIndex(x.idx1));break;case"+":var D=x.idx,E=m.dataDimsForPoint,I=i.dataToPoint([t.get(E[0],D),t.get(E[1],D)]);S=2*D,u.push(I[0],I[1]),c.push(y[S],y[S+1]);var L=BD(m,i,t,D);h.push(L[0],L[1]),d.push(r[S],r[S+1]),g.push(t.getRawIndex(D));break;case"-":b=!1}b&&(p.push(x),f.push(f.length))}f.sort((function(e,t){return g[e]-g[t]}));var N=u.length,P=jT(N),O=jT(N),R=jT(N),k=jT(N),z=[];for(_=0;_<f.length;_++){var B=f[_],V=2*_,F=2*B;P[V]=u[F],P[V+1]=u[F+1],O[V]=c[F],O[V+1]=c[F+1],R[V]=h[F],R[V+1]=h[F+1],k[V]=d[F],k[V+1]=d[F+1],z[_]=p[B]}return{current:P,next:O,stackedOnCurrent:R,stackedOnNext:k,status:z}}(this._data,e,this._stackedOnPoints,t,this._coordSys,0,this._valueOrigin),h=c.current,d=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(i&&(h=tE(c.current,n,i,a),d=tE(c.stackedOnCurrent,n,i,a),p=tE(c.next,n,i,a),f=tE(c.stackedOnNext,n,i,a)),QD(h,p)>3e3||l&&QD(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=c.current,s.shape.points=h;var g={shape:{points:p}};c.current!==h&&(g.shape.__points=c.next),s.stopAnimation(),ug(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),ug(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++){if("="===v[y].cmd){var _=e.getItemGraphicEl(v[y].idx1);_&&m.push({el:_,ptIdx:y})}}s.animators&&s.animators.length&&s.animators[0].during((function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,r=2*m[t].ptIdx;n.x=e[r],n.y=e[r+1],n.markRedraw()}}))},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl((function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(zx);function uE(e,t){return{seriesType:e,plan:Dx(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,o=t||i.large;if(r){var a=Gr(r.dimensions,(function(e){return n.mapDimension(e)})).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");AT(n,a[0])&&(a[0]=l),AT(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=o&&jT(n*s),a=[],l=[],d=e.start,p=0;d<e.end;d++){var f=void 0;if(1===s){var g=u.get(c,d);f=r.dataToPoint(g,null,l)}else a[0]=u.get(c,d),a[1]=u.get(h,d),f=r.dataToPoint(a,null,l);o?(i[p++]=f[0],i[p++]=f[1]):t.setItemLayout(d,f.slice())}o&&t.setLayout("points",i)}}}}}}var cE={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)isNaN(e[r])||(t+=e[r],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},minmax:function(e){for(var t=-1/0,n=-1/0,r=0;r<e.length;r++){var i=e[r],o=Math.abs(i);o>t&&(t=o,n=i)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},hE=function(e){return Math.round(e.length/2)};function dE(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),d=Math.round(a/h);if(isFinite(d)&&d>1){"lttb"===i&&e.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d));var p=void 0;Kr(i)?p=cE[i]:qr(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(l.dim),1/d,p,hE))}}}}}var pE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.getInitialData=function(e,t){return DT(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)Fr(r.getAxes(),(function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),r.length<2)return;if(2===r.length)return void(o[n]=e.toGlobalCoord(e.getExtent()[l?1:0]));for(var u=void 0,c=void 0,h=1,d=0;d<r.length;d++){var p=r[d].coord,f=d===r.length-1?r[d-1].tickValue+h:r[d].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===d&&(h=f-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=r.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Mx);Mx.registerClass(pE);var fE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.getInitialData=function(){return DT(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Sm(pE.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(pE),gE=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},mE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return g(t,e),t.prototype.getDefaultShape=function(){return new gE},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=.5*(o-i),s=i+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(p*i+n,f*i+r),e.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(ed);function vE(e,t,n){return t*Math.sin(e)*(n?-1:1)}function yE(e,t,n){return t*Math.cos(e)*(n?1:-1)}function _E(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;Zr(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:Gr(r,(function(e){return zl(e,i)}))}}var xE=Math.max,bE=Math.min;var wE=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return g(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");"cartesian2d"===i||"polar"===i?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r)):"production"!==process.env.NODE_ENV&&ku("Only cartesian2d and polar supported for bar.")},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();"production"!==process.env.NODE_ENV&&n&&("category"!==r.type&&ku("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==t.type&&ku("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);h&&this._enableRealtimeSort(h,a,n);var d=e.get("clip",!0)||h,p=function(e,t){var n=e.getArea&&e.getArea();if(KD(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}(l,a);o.removeClipPath();var f=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],_=this._backgroundEls,x=r&&r.isInitSort,b=r&&"changeAxisOrder"===r.type;function w(e){var t=IE[l.type](a,e),n=function(e,t,n){var r="polar"===e.type?bf:fd;return new r({shape:zE(t,n,e),silent:!0,z2:0})}(l,i,t);return n.useStyle(m.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",v):n.setShape("cornerRadius",v),y[e]=n,n}a.diff(s).add((function(t){var n=a.getItemModel(t),r=IE[l.type](a,t,n);if(g&&w(t),a.hasValue(t)&&EE[l.type](r)){var s=!1;d&&(s=SE[l.type](p,r));var m=TE[l.type](e,a,t,r,i,c,u.model,!1,f);h&&(m.forceLabelAnimation=!0),NE(m,a,t,n,r,e,i,"polar"===l.type),x?m.attr({shape:r}):h?ME(h,c,m,r,t,i,!1,!1):cg(m,{shape:r},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}})).update((function(t,n){var r=a.getItemModel(t),S=IE[l.type](a,t,r);if(g){var T=void 0;0===_.length?T=w(n):((T=_[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?T.setShape("r",v):T.setShape("cornerRadius",v),y[t]=T);var M=IE[l.type](a,t);ug(T,{shape:zE(i,M,l)},c,t)}var A=s.getItemGraphicEl(n);if(a.hasValue(t)&&EE[l.type](S)){var C=!1;if(d&&(C=SE[l.type](p,S))&&o.remove(A),A?gg(A):A=TE[l.type](e,a,t,S,i,c,u.model,!!A,f),h&&(A.forceLabelAnimation=!0),b){var D=A.getTextContent();if(D){var E=im(D);null!=E.prevValue&&(E.prevValue=E.value)}}else NE(A,a,t,r,S,e,i,"polar"===l.type);x?A.attr({shape:S}):h?ME(h,c,A,S,t,i,!0,b):ug(A,{shape:S},e,t,null),a.setItemGraphicEl(t,A),A.ignore=C,o.add(A)}else o.remove(A)})).remove((function(t){var n=s.getItemGraphicEl(t);n&&fg(n,e,t)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Kl);S.removeAll();for(var T=0;T<y.length;++T)S.add(y[T]);o.add(S),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),RE(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),RE(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&qD(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),(function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})})),r.sort((function(e,t){return t.mappedValue-e.mappedValue})),{ordinalNumbers:Gr(r,(function(e){return e.ordinalNumber}))}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(i,r.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,(function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(t){fg(t,e,Ld(t).dataIndex)}))):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(zx),SE={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,a=xE(t.x,e.x),s=bE(t.x+t.width,i),l=xE(t.y,e.y),u=bE(t.y+t.height,o),c=s<a,h=u<l;return t.x=c&&a>i?s:a,t.y=h&&l>o?u:l,t.width=c?0:s-a,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=bE(t.r,e.r),o=xE(t.r0,e.r0);t.r=i,t.r0=o;var a=i-o<0;if(n<0){r=t.r;t.r=t.r0,t.r0=r}return a}},TE={cartesian2d:function(e,t,n,r,i,o,a,s,l){var u=new fd({shape:Pr({},r),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[i?"height":"width"]=0);return u},polar:function(e,t,n,r,i,o,a,s,l){var u=!i&&l?mE:bf,c=new u({shape:r,z2:1});c.name="item";var h,d,p=LE(i);if(c.calculateTextPosition=(h=p,d=({isRoundCap:u===mE}||{}).isRoundCap,function(e,t,n){var r=t.position;if(!r||r instanceof Array)return Bl(e,t,n);var i=h(r),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,c=a.r0,p=(u+c)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=d?Math.abs(u-c)/2:0,y=Math.cos,_=Math.sin,x=s+u*y(f),b=l+u*_(f),w="left",S="top";switch(i){case"startArc":x=s+(c-o)*y(m),b=l+(c-o)*_(m),w="center",S="top";break;case"insideStartArc":x=s+(c+o)*y(m),b=l+(c+o)*_(m),w="center",S="bottom";break;case"startAngle":x=s+p*y(f)+vE(f,o+v,!1),b=l+p*_(f)+yE(f,o+v,!1),w="right",S="middle";break;case"insideStartAngle":x=s+p*y(f)+vE(f,-o+v,!1),b=l+p*_(f)+yE(f,-o+v,!1),w="left",S="middle";break;case"middle":x=s+p*y(m),b=l+p*_(m),w="center",S="middle";break;case"endArc":x=s+(u+o)*y(m),b=l+(u+o)*_(m),w="center",S="bottom";break;case"insideEndArc":x=s+(u-o)*y(m),b=l+(u-o)*_(m),w="center",S="top";break;case"endAngle":x=s+p*y(g)+vE(g,o+v,!0),b=l+p*_(g)+yE(g,o+v,!0),w="left",S="middle";break;case"insideEndAngle":x=s+p*y(g)+vE(g,-o+v,!0),b=l+p*_(g)+yE(g,-o+v,!0),w="right",S="middle";break;default:return Bl(e,t,n)}return(e=e||{}).x=x,e.y=b,e.align=w,e.verticalAlign=S,e}),o){var f=i?"r":"endAngle",g={};c.shape[f]=i?r.r0:r.startAngle,g[f]=r[f],(s?ug:cg)(c,{shape:g},o)}return c}};function ME(e,t,n,r,i,o,a,s){var l,u;o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?ug:cg)(n,{shape:l},t,i,null),(a?ug:cg)(n,{shape:u},t?e.baseAxis.model:null,i)}function AE(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var CE=["x","y","width","height"],DE=["cx","cy","r","startAngle","endAngle"],EE={cartesian2d:function(e){return!AE(e,CE)},polar:function(e){return!AE(e,DE)}},IE={cartesian2d:function(e,t,n){var r=e.getItemLayout(t),i=n?function(e,t){var n=e.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),o=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,o)}(n,r):0,o=r.width>0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function LE(e){return function(e){var t=e?"Arc":"Angle";return function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}(e)}function NE(e,t,n,r,i,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape;Pr(u,_E(r.getModel("itemStyle"),u,!0)),e.setShape(u)}}else{var c=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",c)}e.useStyle(l);var h=r.getShallow("cursor");h&&e.attr("cursor",h);var d=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=Kg(r);qg(e,p,{labelFetcher:o,labelDataIndex:n,defaultText:ED(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=e.getTextContent();if(s&&f){var g=r.get(["label","position"]);e.textConfig.inside="middle"===g||null,function(e,t,n,r){if(Jr(r))e.setTextConfig({rotation:r});else if(Zr(t))e.setTextConfig({rotation:0});else{var i,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(t);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=l;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:return void e.setTextConfig({rotation:0})}var c=1.5*Math.PI-i;"middle"===u&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),e.setTextConfig({rotation:c})}}(e,"outside"===g?d:g,LE(a),r.get(["label","rotate"]))}om(f,p,o.getRawValue(n),(function(e){return ID(t,e)}));var m=r.getModel(["emphasis"]);Tp(e,m.get("focus"),m.get("blurScope"),m.get("disabled")),Dp(e,r),function(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}(i)&&(e.style.fill="none",e.style.stroke="none",Fr(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}var PE=function(){},OE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return g(t,e),t.prototype.getDefaultShape=function(){return new PE},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],a[0],a[1])},t}(ed);function RE(e,t,n,r){var i=e.getData(),o=i.getLayout("valueAxisHorizontal")?1:0,a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new OE({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new OE({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,t.add(h),h.useStyle(i.getVisual("style")),Ld(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",kE),h.on("mousemove",kE)),n&&n.push(h)}var kE=Gx((function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[r]=u,l[i]=o[d+2],s[r]=o[d+r],s[i]=o[d+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return-1}(this,e.offsetX,e.offsetY);Ld(this).dataIndex=t>=0?t:null}),30,!1);function zE(e,t,n){if(KD(n,"cartesian2d")){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var o=t;return{cx:(i=n.getArea()).cx,cy:i.cy,r0:e?i.r0:o.r0,r:e?i.r:o.r,startAngle:e?o.startAngle:0,endAngle:e?o.endAngle:2*Math.PI}}var BE=2*Math.PI,VE=Math.PI/180;function FE(e,t){return Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function GE(e,t){var n=FE(e,t),r=e.get("center"),i=e.get("radius");Zr(i)||(i=[0,i]);var o,a,s=uu(n.width,t.getWidth()),l=uu(n.height,t.getHeight()),u=Math.min(s,l),c=uu(i[0],u/2),h=uu(i[1],u/2),d=e.coordinateSystem;if(d){var p=d.dataToPoint(r);o=p[0]||0,a=p[1]||0}else Zr(r)||(r=[r,r]),o=uu(r[0],s)+n.x,a=uu(r[1],l)+n.y;return{cx:o,cy:a,r0:c,r:h}}function HE(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),r=t.mapDimension("value"),i=FE(e,n),o=GE(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*VE,h=e.get("endAngle"),d=e.get("padAngle")*VE;h="auto"===h?c-BE:-h*VE;var p=e.get("minAngle")*VE+d,f=0;t.each(r,(function(e){!isNaN(e)&&f++}));var g=t.getSum(r),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),_=e.get("stillShowZeroSum"),x=t.getDataExtent(r);x[0]=0;var b=v?1:-1,w=[c,h],S=b*d/2;Nh(w,!v),c=w[0],h=w[1];var T=Math.abs(h-c),M=T,A=0,C=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,(function(e,n){var r;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});else{(r="area"!==y?0===g&&_?m:e*m:T/f)<p?(r=p,M-=p):A+=e;var i=C+b*r,o=0,c=0;d>r?c=o=C+b*r/2:(o=C+S,c=i-S),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?lu(e,x,[u,l]):l}),C=i}})),M<BE&&f)if(M<=.001){var D=T/f;t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=D;var i=0,o=0;D<d?o=i=c+b*(n+.5)*D:(i=c+b*n*D+S,o=c+b*(n+1)*D-S),r.startAngle=i,r.endAngle=o}}))}else m=M/A,C=c,t.each(r,(function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*m,o=0,a=0;i<d?a=o=C+b*i/2:(o=C+S,a=C+b*i-S),r.startAngle=o,r.endAngle=a,C+=b*i}}))}))}function UE(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf((function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0}))}}}}var WE=Math.PI/180;function XE(e,t,n,r,i,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}XA(e,l,l+a)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*i,d=r+l.len,f=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d;u.rB=f,u.maxY=c}u.list.push(l)}p(o),p(a)}(e)}function p(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=r+l.len,h=c*c,d=Math.sqrt((1-Math.abs(u*u/a))*h),p=t+(d+l.len2)*i,f=p-l.label.x;jE(l,l.targetTextWidth-f*i,!0),l.label.x=p}}}function jE(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,c=o.width+(a?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var d=r.getBoundingRect();r.setStyle("width",Math.ceil(d.width)),r.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;r.setStyle("width",f)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function YE(e){return"center"===e.position}function ZE(e){var t,n,r=e.getData(),i=[],o=!1,a=(e.get("minShowLabelAngle")||0)*WE,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function p(e){e.ignore=!0}r.each((function(e){var s=r.getItemGraphicEl(e),h=s.shape,d=s.getTextContent(),f=s.getTextGuideLine(),g=r.getItemModel(e),m=g.getModel("label"),v=m.get("position")||g.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),_=m.get("alignTo"),x=uu(m.get("edgeDistance"),u),b=m.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=uu(S,u);var T=w.get("length2");if(T=uu(T,u),Math.abs(h.endAngle-h.startAngle)<a)return Fr(d.states,p),d.ignore=!0,void(f&&(Fr(f.states,p),f.ignore=!0));if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(d)){var M,A,C,D,E=(h.startAngle+h.endAngle)/2,I=Math.cos(E),L=Math.sin(E);t=h.cx,n=h.cy;var N="inside"===v||"inner"===v;if("center"===v)M=h.cx,A=h.cy,D="center";else{var P=(N?(h.r+h.r0)/2*I:h.r*I)+t,O=(N?(h.r+h.r0)/2*L:h.r*L)+n;if(M=P+3*I,A=O+3*L,!N){var R=P+I*(S+l-h.r),k=O+L*(S+l-h.r),z=R+(I<0?-1:1)*T;M="edge"===_?I<0?c+x:c+u-x:z+(I<0?-y:y),A=k,C=[[P,O],[R,k],[z,k]]}D=N?"center":"edge"===_?I>0?"right":"left":I>0?"left":"right"}var B=Math.PI,V=0,F=m.get("rotate");if(Jr(F))V=F*(B/180);else if("center"===v)V=0;else if("radial"===F||!0===F){V=I<0?-E+B:-E}else if("tangential"===F&&"outside"!==v&&"outer"!==v){var G=Math.atan2(I,L);G<0&&(G=2*B+G),L>0&&(G=B+G),V=G-B}if(o=!!V,d.x=M,d.y=A,d.rotation=V,d.setStyle({verticalAlign:"middle"}),N){d.setStyle({align:D});var H=d.states.select;H&&(H.x+=d.x,H.y+=d.y)}else{var U=d.getBoundingRect().clone();U.applyTransform(d.getComputedTransform());var W=(d.style.margin||0)+2.1;U.y-=W/2,U.height+=W,i.push({label:d,labelLine:f,position:v,len:S,len2:T,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new Po(I,L),linePoints:C,textAlign:D,labelDistance:y,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:U,unconstrainedWidth:U.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:N})}})),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var p=e[d].label;YE(e[d])||(p.x<t?(c=Math.min(c,p.x),l.push(e[d])):(h=Math.max(h,p.x),u.push(e[d])))}for(d=0;d<e.length;d++)if(!YE(m=e[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;p=m.label;var f=m.linePoints,g=void 0;g="edge"===m.labelAlignTo?p.x<t?f[2][0]-m.labelDistance-a-m.edgeDistance:a+i-m.edgeDistance-f[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?p.x<t?c-a-m.bleedMargin:a+i-h-m.bleedMargin:p.x<t?p.x-a-m.bleedMargin:a+i-p.x-m.bleedMargin,m.targetTextWidth=g,jE(m,g)}for(XE(u,t,n,r,1,0,o,0,s,h),XE(l,t,n,r,-1,0,o,0,s,c),d=0;d<e.length;d++){var m;if(!YE(m=e[d])&&m.linePoints){p=m.label,f=m.linePoints;var v="edge"===m.labelAlignTo,y=p.style.padding,_=y?y[1]+y[3]:0,x=p.style.backgroundColor?0:_,b=m.rect.width+x,w=f[1][0]-f[2][0];v?p.x<t?f[2][0]=a+m.edgeDistance+b+m.labelDistance:f[2][0]=a+i-m.edgeDistance-b-m.labelDistance:(p.x<t?f[2][0]=p.x+m.labelDistance:f[2][0]=p.x-m.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=p.y}}}(i,t,n,l,u,d,c,h);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(Fr(m.states,p),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(v){var x=g.linePoints;y||!x?(Fr(v.states,p),v.ignore=!0):(zA(x,g.minTurnAngle),BA(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new Po(x[0][0],x[0][1])})}}}var qE=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new Id;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return g(t,e),t.prototype.updateData=function(e,t,n,r){var i=this,o=e.hostModel,a=e.getItemModel(t),s=a.getModel("emphasis"),l=e.getItemLayout(t),u=Pr(_E(a.getModel("itemStyle"),l,!0),l);if(isNaN(u.startAngle))i.setShape(u);else{if(r){i.setShape(u);var c=o.getShallow("animationType");o.ecModel.ssr?(cg(i,{scaleX:0,scaleY:0},o,{dataIndex:t,isFrom:!0}),i.originX=u.cx,i.originY=u.cy):"scale"===c?(i.shape.r=l.r0,cg(i,{shape:{r:l.r}},o,t)):null!=n?(i.setShape({startAngle:n,endAngle:n}),cg(i,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,t)):(i.shape.endAngle=l.startAngle,ug(i,{shape:{endAngle:l.endAngle}},o,t))}else gg(i),ug(i,{shape:u},o,t);i.useStyle(e.getItemVisual(t,"style")),Dp(i,a);var h=(l.startAngle+l.endAngle)/2,d=o.get("selectedOffset"),p=Math.cos(h)*d,f=Math.sin(h)*d,g=a.getShallow("cursor");g&&i.attr("cursor",g),this._updateLabel(o,e,t),i.ensureState("emphasis").shape=Pr({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},_E(s.getModel("itemStyle"),l)),Pr(i.ensureState("select"),{x:p,y:f,shape:_E(a.getModel(["select","itemStyle"]),l)}),Pr(i.ensureState("blur"),{shape:_E(a.getModel(["blur","itemStyle"]),l)});var m=i.getTextGuideLine(),v=i.getTextContent();m&&Pr(m.ensureState("select"),{x:p,y:f}),Pr(v.ensureState("select"),{x:p,y:f}),Tp(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},t.prototype._updateLabel=function(e,t,n){var r=this,i=t.getItemModel(n),o=i.getModel("labelLine"),a=t.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;qg(r,Kg(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var u=r.getTextContent();r.setTextConfig({position:null,rotation:null}),u.attr({z2:10});var c=e.get(["label","position"]);if("outside"!==c&&"outer"!==c)r.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new Lf,this.setTextGuideLine(h)),GA(this,HA(i),{stroke:s,opacity:ui(o.get(["lineStyle","opacity"]),l,1)})}},t}(bf),KE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return g(t,e),t.prototype.render=function(e,t,n,r){var i,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new bf({shape:GE(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add((function(e){var t=new qE(o,e,i);o.setItemGraphicEl(e,t),s.add(t)})).update((function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)})).remove((function(t){fg(a.getItemGraphicEl(t),e,t)})).execute(),ZE(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(zx);function $E(e,t,n){t=Zr(t)&&{coordDimensions:t}||Pr({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=xT(r,t).dimensions,o=new yT(i,e);return o.initData(r,n),o}var JE=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),QE=oc(),eI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new JE(jr(this.getData,this),jr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return $E(this,{coordDimensions:["value"],encodeDefaulter:Yr(Zv,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=QE(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),(function(e){o.push(e)})),i=r.seats=gu(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=i[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){ju(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Mx);var tI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return g(t,e),t.prototype.getInitialData=function(e,t){return DT(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(Mx),nI=function(){},rI=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return g(t,e),t.prototype.getDefaultShape=function(){return new nI},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,r=t.points,i=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&i[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<r.length;){var c=r[n++],h=r[n++];isNaN(c)||isNaN(h)||(u&&!u.contain(c,h)||(a.x=c-i[0]/2,a.y=h-i[1]/2,a.width=i[0],a.height=i[1],o.buildPath(e,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,r=t.size,i=this._ctx,o=this.softClipShape;if(i){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];isNaN(a)||isNaN(s)||(o&&!o.contain(a,s)||i.fillRect(a-r[0]/2,s-r[1]/2,r[0],r[1]))}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),a=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var l=2*s,u=r[l]-o/2,c=r[l+1]-a/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+a)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],o=r[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),u=Math.max(d,u)}e=this._rect=new Uo(a-i/2,s-o/2,l-a+i,u-s+o)}return e},t}(ed),iI=function(){function e(){this.group=new Kl}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),r=4*e.startIndex*2;t=new Float32Array(t.buffer,r,n)}e.setShape("points",t),e.reset()}))},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout("points"),o=r&&r.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+i.length);s.set(o),s.set(i,a),r.endIndex=e.end,r.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new rI({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n=n||{};var i=t.getVisual("symbolSize");e.setShape("size",i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=Wb(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=Ld(e);l.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))}))},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),oI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=uE("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new iI:new kD,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(zx),aI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(Nv),sI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",uc).models[0]},t.type="cartesian2dAxis",t}(Nv);Br(sI,RM);var lI={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},uI=Lr({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},lI),cI=Lr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},lI),hI={category:uI,value:cI,time:Lr({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},cI),log:Or({logBase:10},cI)},dI={value:1,category:1,time:1,log:1};function pI(e,t,n,r){Fr(dI,(function(i,o){var a=Lr(Lr({},hI[o],!0),r,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return g(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=Av(this),r=n?Dv(e):{};Lr(e,t.getTheme().get(o+"Axis")),Lr(e,this.getDefaultOption()),e.type=fI(e),n&&Cv(e,r,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=LT.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+"Axis."+o,n.defaultOption=a,n}(n);e.registerComponentModel(s)})),e.registerSubTypeDefaulter(t+"Axis",fI)}function fI(e){return e.type||(e.data?"category":"value")}var gI=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return Gr(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Ur(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),mI=["x","y"];function vI(e){return"interval"===e.type||"time"===e.type}var yI=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=mI,t}return g(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(vI(e)&&vI(t)){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,c=i[0]-n[0]*l,h=i[1]-r[0]*u,d=this._transform=[l,0,0,u,c,h];this._invTransform=Io([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),o=new Uo(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var r=e[0],i=e[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return ji(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,t)),n[1]=a.toGlobalCoord(a.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(e[0]),s=r.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return ji(n,e,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-r+e,a=Math.max(n[0],n[1])-i+e;return new Uo(r,i,o,a)},t}(gI),_I=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return g(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(yA);function xI(e,t,n){n=n||{};var r=e.coordinateSystem,i=t.axis,o={},a=i.getAxesOnZeroOf()[0],s=i.position,l=a?"onZero":s,u=i.dim,c=r.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:h[0],"x"===u?f[d[l]]:h[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),si(n.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=t.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function bI(e){return"cartesian2d"===e.get("coordinateSystem")}function wI(e){var t={xAxisModel:null,yAxisModel:null};return Fr(t,(function(n,r){var i=r.replace(/Model$/,""),o=e.getReferringComponents(i,uc).models[0];if("production"!==process.env.NODE_ENV&&!o)throw new Error(i+' "'+ui(e.get(i+"Index"),e.get(i+"Id"),0)+'" not found');t[r]=o})),t}var SI=Math.log;function TI(e,t,n){var r=UT.prototype,i=r.getTicks.call(n),o=r.getTicks.call(n,!0),a=i.length-1,s=r.getInterval.call(n),l=AM(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=SI(e.base);u=[SI(u[0])/d,SI(u[1])/d]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:h});var p=r.getExtent.call(e);c&&(u[0]=p[0]),h&&(u[1]=p[1]);var f=r.getInterval.call(e),g=u[0],m=u[1];if(c&&h)f=(m-g)/a;else if(c)for(m=u[0]+f*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)f=RT(f),m=u[0]+f*a;else if(h)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=RT(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=RT(f));var v=f*a;(g=cu((m=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,m=cu(v)):m>0&&u[1]<=0&&(m=0,g=-cu(v))}var y=(i[0].value-o[0].value)/s,_=(i[a].value-o[a].value)/s;if(r.setExtent.call(e,g+f*y,m+f*_),r.setInterval.call(e,f),(y||_)&&r.setNiceExtent.call(e,g+f,m-f),"production"!==process.env.NODE_ENV){var x=r.getTicks.call(e);x[1]&&(!function(e){var t=Math.pow(10,Su(Math.abs(e))),n=Math.abs(e/t);return 0===n||1===n||2===n||3===n||5===n}(f)||pu(x[1].value)>pu(f))&&ku("The ticks may be not readable when set min: "+t.get("min")+", max: "+t.get("max")+" and alignTicks: true")}}var MI=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=mI,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function r(e){var t,n=Xr(e),r=n.length;if(r){for(var i=[],o=r-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;PT(l)&&s.get("alignTicks")&&null==s.get("interval")?i.push(a):(CM(l,s),PT(l)&&(t=a))}i.length&&(t||CM((t=i.pop()).scale,t.model),Fr(i,(function(e){TI(e.scale,e.model,t.scale)})))}}this._updateScale(e,this.model),r(n.x),r(n.y);var i={};Fr(n.x,(function(e){CI(n,"y",e,i)})),Fr(n.y,(function(e){CI(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Tv(r,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){Fr(a,(function(e){var t=e.isHorizontal(),n=t?[0,o.width]:[0,o.height],r=e.inverse?1:0;e.setExtent(n[r],n[1-r]),function(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return r-e+t}}(e,t?o.x:o.y)}))}s(),i&&(Fr(a,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var r,i,o=n.getExtent();i=n instanceof GT?n.count():(r=n.getTicks()).length;var a,s=e.getLabelModel(),l=EM(e),u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var h=l(r?r[c]:{value:o[0]+c},c),d=LM(s.getTextRect(h),s.get("rotate")||0);a?a.union(d):a=d}return a}}(e);if(t){var n=e.isHorizontal()?"height":"width",r=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+r,"top"===e.position?o.y+=t.height+r:"left"===e.position&&(o.x+=t.width+r)}}})),s()),Fr(this._coordsList,(function(e){e.calcAffineTransform()}))},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}Qr(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis("x").index===e||i[r].getAxis("y").index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",uc).models[0],o=e.yAxisModel||r&&r.getReferringComponents("yAxis",uc).models[0],a=e.gridModel,s=this._coordsList;if(r)kr(s,t=r.coordinateSystem)<0&&(t=null);else if(i&&o)t=this.getCartesian(i.componentIndex,o.componentIndex);else if(i)n=this.getAxis("x",i.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(a){a.coordinateSystem===this&&(t=this._coordsList[0])}return{cartesian:t,axis:n}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var r=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(t.eachComponent("xAxis",l("x"),this),t.eachComponent("yAxis",l("y"),this),!s.x||!s.y)return this._axesMap={},void(this._axesList=[]);function l(t){return function(n,r){if(AI(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=new _I(t,DM(n),[0,0],n.get("type"),l),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),n.axis=u,u.model=n,u.grid=i,u.index=r,i._axesList.push(u),a[t][r]=u,s[t]++}}}this._axesMap=a,Fr(a.x,(function(t,n){Fr(a.y,(function(i,o){var a="x"+n+"y"+o,s=new yI(a);s.master=r,s.model=e,r._coordsMap[a]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)}))}))},e.prototype._updateScale=function(e,t){function n(e,t){Fr(OM(e,t.dim),(function(n){t.scale.unionExtentFromData(e,n)}))}Fr(this._axesList,(function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setSortInfo(t)}})),e.eachSeries((function(e){if(bI(e)){var r=wI(e),i=r.xAxisModel,o=r.yAxisModel;if(!AI(i,t)||!AI(o,t))return;var a=this.getCartesian(i.componentIndex,o.componentIndex),s=e.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}),this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return Fr(this.getCartesians(),(function(r){var i=null!=e&&"auto"!==e?r.getAxis(e):r.getBaseAxis(),o=r.getOtherAxis(i);kr(t,i)<0&&t.push(i),kr(n,o)<0&&n.push(o)})),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent("grid",(function(i,o){var a=new e(i,t,n);a.name="grid_"+o,a.resize(i,n,!0),i.coordinateSystem=a,r.push(a)})),t.eachSeries((function(e){if(bI(e)){var t=wI(e),n=t.xAxisModel,r=t.yAxisModel,i=n.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!i)throw new Error('Grid "'+ui(n.get("gridIndex"),n.get("gridId"),0)+'" not found');if(n.getCoordSysModel()!==r.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var o=i.coordinateSystem;e.coordinateSystem=o.getCartesian(n.componentIndex,r.componentIndex)}})),r},e.dimensions=mI,e}();function AI(e,t){return e.getCoordSysModel()===t}function CI(e,t,n,r){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)DI(o[l])&&(i=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&DI(o[u])&&!r[c(o[u])]){i=o[u];break}i&&(r[c(i)]=!0)}function c(e){return e.dim+"_"+e.index}}function DI(e){return e&&"category"!==e.type&&"time"!==e.type&&function(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}(e)}var EI=Math.PI,II=function(){function e(e,t){this.group=new Kl,this.opt=t,this.axisModel=e,Or(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Kl({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!LI[e]},e.prototype.add=function(e){LI[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var r,i,o=yu(t-e);return _u(o)?(i=n>0?"top":"bottom",r="center"):_u(o-EI)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o<EI?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),LI={axisLine:function(e,t,n,r){var i=t.get(["axisLine","show"]);if("auto"===i&&e.handleAutoShown&&(i=e.handleAutoShown("axisLine")),i){var o=t.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(ji(s,s,a),ji(l,l,a));var c=Pr({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new Rf({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});Eg(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=t.get(["axisLine","symbol"]);if(null!=d){var p=t.get(["axisLine","symbolSize"]);Kr(d)&&(d=[d,d]),(Kr(p)||Jr(p))&&(p=[p,p]);var f=jb(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];Fr([{rotate:e.rotation+Math.PI/2,offset:f[0],r:0},{rotate:e.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,r){if("none"!==d[r]&&null!=d[r]){var i=Wb(d[r],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;i.attr({rotation:t.rotate,x:a[0]+o*Math.cos(e.rotation),y:a[1]-o*Math.sin(e.rotation),silent:!0,z2:11}),n.add(i)}}))}}},axisTickLabel:function(e,t,n,r){var i=function(e,t,n,r){var i=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&r.handleAutoShown&&(a=r.handleAutoShown("axisTick"));if(!a||i.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=r.tickDirection*o.get("length"),u=RI(i.getTicksCoords(),t.transform,l,Or(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}(n,r,t,e),o=function(e,t,n,r){var i=n.axis,o=si(r.axisLabelShow,n.get(["axisLabel","show"]));if(!o||i.scale.isBlank())return;var a=n.getModel("axisLabel"),s=a.get("margin"),l=i.getViewLabels(),u=(si(r.labelRotate,a.get("rotate"))||0)*EI/180,c=II.innerTextLayout(r.rotation,u,r.labelDirection),h=n.getCategories&&n.getCategories(!0),d=[],p=II.isLabelSilent(n),f=n.get("triggerEvent");return Fr(l,(function(o,u){var g="ordinal"===i.scale.type?i.scale.getRawOrdinalNumber(o.tickValue):o.tickValue,m=o.formattedLabel,v=o.rawLabel,y=a;if(h&&h[g]){var _=h[g];Qr(_)&&_.textStyle&&(y=new xm(_.textStyle,a,n.ecModel))}var x=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),b=i.dataToCoord(g),w=y.getShallow("align",!0)||c.textAlign,S=li(y.getShallow("alignMinLabel",!0),w),T=li(y.getShallow("alignMaxLabel",!0),w),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||c.textVerticalAlign,A=li(y.getShallow("verticalAlignMinLabel",!0),M),C=li(y.getShallow("verticalAlignMaxLabel",!0),M),D=new Id({x:b,y:r.labelOffset+r.labelDirection*s,rotation:c.rotation,silent:p,z2:10+(o.level||0),style:$g(y,{text:m,align:0===u?S:u===l.length-1?T:w,verticalAlign:0===u?A:u===l.length-1?C:M,fill:qr(x)?x("category"===i.type?v:"value"===i.type?g+"":g,u):x})});if(D.anid="label_"+g,f){var E=II.makeAxisEventDataBase(n);E.targetType="axisLabel",E.value=v,E.tickIndex=u,"category"===i.type&&(E.dataIndex=g),Ld(D).eventData=E}t.add(D),D.updateTransform(),d.push(D),e.add(D),D.decomposeTransform()})),d}(n,r,t,e);(function(e,t,n){if(PM(e.axis))return;var r=e.get(["axisLabel","showMinLabel"]),i=e.get(["axisLabel","showMaxLabel"]);t=t||[],n=n||[];var o=t[0],a=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===r?(NI(o),NI(u)):PI(o,a)&&(r?(NI(a),NI(c)):(NI(o),NI(u)));!1===i?(NI(s),NI(h)):PI(l,s)&&(i?(NI(l),NI(d)):(NI(s),NI(h)))}(t,o,i),function(e,t,n,r){var i=n.axis,o=n.getModel("minorTick");if(!o.get("show")||i.scale.isBlank())return;var a=i.getMinorTicksCoords();if(!a.length)return;for(var s=o.getModel("lineStyle"),l=r*o.get("length"),u=Or(s.getLineStyle(),Or(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=RI(a[c],t.transform,l,u,"minorticks_"+c),d=0;d<h.length;d++)e.add(h[d])}(n,r,t,e.tickDirection),t.get(["axisLabel","hideOverlap"]))&&jA(UA(Gr(o,(function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}}))))},axisName:function(e,t,n,r){var i=si(e.axisName,t.get("name"));if(i){var o,a,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),d=h[0]>h[1]?-1:1,p=["start"===s?h[0]-d*c:"end"===s?h[1]+d*c:(h[0]+h[1])/2,OI(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*EI/180),OI(s)?o=II.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(o=function(e,t,n,r){var i,o,a=yu(n-e),s=r[0]>r[1],l="start"===t&&!s||"start"!==t&&s;_u(a-EI/2)?(o=l?"bottom":"top",i="center"):_u(a-1.5*EI)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*EI&&a>EI/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:i,textVerticalAlign:o}}(e.rotation,s,f||0,h),null!=(a=e.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},v=m.ellipsis,y=si(e.nameTruncateMaxWidth,m.maxWidth,a),_=new Id({x:p[0],y:p[1],rotation:o.rotation,silent:II.isLabelSilent(t),style:$g(u,{text:i,font:g,overflow:"truncate",width:y,ellipsis:v,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(Hg({el:_,componentModel:t,itemName:i}),_.__fullText=i,_.anid="name",t.get("triggerEvent")){var x=II.makeAxisEventDataBase(t);x.targetType="axisName",x.name=i,Ld(_).eventData=x}r.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function NI(e){e&&(e.ignore=!0)}function PI(e,t){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var i=To([]);return Do(i,i,-e.rotation),n.applyTransform(Ao([],i,e.getLocalTransform())),r.applyTransform(Ao([],i,t.getLocalTransform())),n.intersect(r)}}function OI(e){return"middle"===e||"center"===e}function RI(e,t,n,r,i){for(var o=[],a=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,t&&(ji(a,a,t),ji(s,s,t));var c=new Rf({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});Eg(c.shape,c.style.lineWidth),c.anid=i+"_"+e[l].tickValue,o.push(c)}return o}function kI(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,n){var r=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),o=i.get("link",!0)||[],a=[];Fr(n.getCoordinateSystems(),(function(n){if(n.axisPointerEnabled){var s=FI(n.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var u=n.model.getModel("tooltip",r);if(Fr(n.getAxes(),Yr(p,!1,null)),n.getTooltipAxes&&r&&u.get("show")){var c="axis"===u.get("trigger"),h="cross"===u.get(["axisPointer","type"]),d=n.getTooltipAxes(u.get(["axisPointer","axis"]));(c||h)&&Fr(d.baseAxes,Yr(p,!h||"cross",c)),h&&Fr(d.otherAxes,Yr(p,"cross",!1))}}function p(r,s,c){var h=c.model.getModel("axisPointer",i),d=h.get("show");if(d&&("auto"!==d||r||VI(h))){null==s&&(s=h.get("triggerTooltip")),h=r?function(e,t,n,r,i,o){var a=t.getModel("axisPointer"),s={};Fr(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=Ir(a.get(e))})),s.snap="category"!==e.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===i){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&Or(l,c.textStyle)}}return e.model.getModel("axisPointer",new xm(s,n,r))}(c,u,i,t,r,s):h;var p=h.get("snap"),f=h.get("triggerEmphasis"),g=FI(c.model),m=s||p||"category"===c.type,v=e.axesInfo[g]={key:g,axis:c,coordSys:n,axisPointerModel:h,triggerTooltip:s,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:VI(h),seriesModels:[],linkGroup:null};l[g]=v,e.seriesInvolved=e.seriesInvolved||m;var y=function(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var o=e[i]||{};if(zI(o[r+"AxisId"],n.id)||zI(o[r+"AxisIndex"],n.componentIndex)||zI(o[r+"AxisName"],n.name))return i}}(o,c);if(null!=y){var _=a[y]||(a[y]={axesInfo:{}});_.axesInfo[g]=v,_.mapper=o[y].mapper,v.linkGroup=_}}}}))}(n,e,t),n.seriesInvolved&&function(e,t){t.eachSeries((function(t){var n=t.coordinateSystem,r=t.get(["tooltip","trigger"],!0),i=t.get(["tooltip","show"],!0);n&&"none"!==r&&!1!==r&&"item"!==r&&!1!==i&&!1!==t.get(["axisPointer","show"],!0)&&Fr(e.coordSysAxesInfo[FI(n.model)],(function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}))}(n,e),n}function zI(e,t){return"all"===e||Zr(e)&&kr(e,t)>=0||e===t}function BI(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[FI(e)]}function VI(e){return!!e.get(["handle","show"])}function FI(e){return e.type+"||"+e.id}var GI={},HI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(t,n,r,i){this.axisPointerClass&&function(e){var t=BI(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=VI(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),i.value=a,s&&(i.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var o=function(e){var t=BI(e);return t&&t.axisPointerModel}(e);o?(this._axisPointer||(this._axisPointer=new i)).render(e,o,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){if("production"!==process.env.NODE_ENV&&GI[e])throw new Error("axisPointer "+e+" exists");GI[e]=t},t.getAxisPointerClass=function(e){return e&&GI[e]},t.type="axis",t}(Cx),UI=oc();function WI(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,h=UI(e).splitAreaColors,d=xi(),p=0;if(h)for(var f=0;f<u.length;f++){var g=h.get(u[f].tickValue);if(null!=g){p=(g+(c-1)*f)%c;break}}var m=i.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=Zr(s)?s:[s];for(f=1;f<u.length;f++){var y=i.toGlobalCoord(u[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;i.isHorizontal()?(_=m,x=l.y,b=y-_,w=l.height,m=_+b):(_=l.x,x=m,b=l.width,m=x+(w=y-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),t.add(new fd({anid:null!=S?"area_"+S:null,shape:{x:_,y:x,width:b,height:w},style:Or({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}UI(e).splitAreaColors=d}}}function XI(e){UI(e).splitAreaColors=null}var jI=["axisLine","axisTickLabel","axisName"],YI=["splitArea","splitLine","minorSplitLine"],ZI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return g(t,e),t.prototype.render=function(t,n,r,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Kl,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=xI(a,t),l=new II(t,Pr({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),r=0;r<n.length;r++)if(PT(n[r].getOtherAxis(t.axis).scale))return!0;return!1}},s));Fr(jI,l.add,l),this._axisGroup.add(l.getGroup()),Fr(YI,(function(e){t.get([e,"show"])&&qI[e](this,this._axisGroup,t,a)}),this),i&&"changeAxisOrder"===i.type&&i.isInitSort||Rg(o,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)}},t.prototype.remove=function(){XI(this)},t.type="cartesianAxis",t}(HI),qI={splitLine:function(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=Zr(s)?s:[s];for(var l=r.coordinateSystem.getRect(),u=i.isHorizontal(),c=0,h=i.getTicksCoords({tickModel:o}),d=[],p=[],f=a.getLineStyle(),g=0;g<h.length;g++){var m=i.toGlobalCoord(h[g].coord);u?(d[0]=m,d[1]=l.y,p[0]=m,p[1]=l.y+l.height):(d[0]=l.x,d[1]=m,p[0]=l.x+l.width,p[1]=m);var v=c++%s.length,y=h[g].tickValue,_=new Rf({anid:null!=y?"line_"+h[g].tickValue:null,autoBatch:!0,shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]},style:Or({stroke:s[v]},f),silent:!0});Eg(_.shape,f.lineWidth),t.add(_)}}},minorSplitLine:function(e,t,n,r){var i=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=r.coordinateSystem.getRect(),s=i.isHorizontal(),l=i.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var p=0;p<l[d].length;p++){var f=i.toGlobalCoord(l[d][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new Rf({anid:"minor_line_"+l[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0});Eg(g.shape,h.lineWidth),t.add(g)}},splitArea:function(e,t,n,r){WI(e,t,n,r)}},KI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="xAxis",t}(ZI),$I=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=KI.type,t}return g(t,e),t.type="yAxis",t}(ZI),JI=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return g(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new fd({shape:e.coordinateSystem.getRect(),style:Or({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(Cx),QI={offset:0};function eL(e){e.registerComponentView(JI),e.registerComponentModel(aI),e.registerCoordinateSystem("cartesian2d",MI),pI(e,"x",sI,QI),pI(e,"y",sI,QI),e.registerComponentView(KI),e.registerComponentView($I),e.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})}))}function tL(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),n=[],r=e.coordinateSystem;if(r){var i=r.getIndicatorAxes();Fr(i,(function(e,o){t.each(t.mapDimension(i[o].dim),(function(e,t){n[t]=n[t]||[];var i=r.dataToPoint(e,o);n[t][o]=nL(i)?i:rL(r)}))})),t.each((function(e){var i=Wr(n[e],(function(e){return nL(e)}))||rL(r);n[e].push(i.slice()),t.setItemLayout(e,n[e])}))}}))}function nL(e){return!isNaN(e[0])&&!isNaN(e[1])}function rL(e){return[e.cx,e.cy]}function iL(e){var t=e.polar;if(t){Zr(t)||(t=[t]);var n=[];Fr(t,(function(t,r){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],Zr(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)})),e.polar=n}Fr(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))}var oL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,o=e.getData(),a=this._data;function s(e,t){var n=e.getItemVisual(t,"symbol")||"circle";if("none"!==n){var r=Xb(e.getItemVisual(t,"symbolSize")),i=Wb(n,-1,-1,2,2),o=e.getItemVisual(t,"symbolRotate")||0;return i.attr({style:{strokeNoScale:!0},z2:100,scaleX:r[0]/2,scaleY:r[1]/2,rotation:o*Math.PI/180||0}),i}}function l(t,n,r,i,o,a){r.removeAll();for(var l=0;l<n.length-1;l++){var u=s(i,o);u&&(u.__dimIdx=l,t[l]?(u.setPosition(t[l]),Xg[a?"initProps":"updateProps"](u,{x:n[l][0],y:n[l][1]},e,o)):u.setPosition(n[l]),r.add(u))}}function u(e){return Gr(e,(function(e){return[r.cx,r.cy]}))}o.diff(a).add((function(t){var n=o.getItemLayout(t);if(n){var r=new Df,i=new Lf,a={shape:{points:n}};r.shape.points=u(n),i.shape.points=u(n),cg(r,a,e,t),cg(i,a,e,t);var s=new Kl,c=new Kl;s.add(i),s.add(r),s.add(c),l(i.shape.points,n,c,o,t,!0),o.setItemGraphicEl(t,s)}})).update((function(t,n){var r=a.getItemGraphicEl(n),i=r.childAt(0),s=r.childAt(1),u=r.childAt(2),c={shape:{points:o.getItemLayout(t)}};c.shape.points&&(l(i.shape.points,c.shape.points,u,o,t,!1),gg(s),gg(i),ug(i,c,e),ug(s,c,e),o.setItemGraphicEl(t,r))})).remove((function(e){i.remove(a.getItemGraphicEl(e))})).execute(),o.eachItemGraphicEl((function(e,t){var n=o.getItemModel(t),r=e.childAt(0),a=e.childAt(1),s=e.childAt(2),l=o.getItemVisual(t,"style"),u=l.fill;i.add(e),r.useStyle(Or(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:u})),Dp(r,n,"lineStyle"),Dp(a,n,"areaStyle");var c=n.getModel("areaStyle"),h=c.isEmpty()&&c.parentModel.isEmpty();a.ignore=h,Fr(["emphasis","select","blur"],(function(e){var t=n.getModel([e,"areaStyle"]),r=t.isEmpty()&&t.parentModel.isEmpty();a.ensureState(e).ignore=r&&h})),a.useStyle(Or(c.getAreaStyle(),{fill:u,opacity:.7,decal:l.decal}));var d=n.getModel("emphasis"),p=d.getModel("itemStyle").getItemStyle();s.eachChild((function(e){if(e instanceof ad){var r=e.style;e.useStyle(Pr({image:r.image,x:r.x,y:r.y,width:r.width,height:r.height},l))}else e.useStyle(l),e.setColor(u),e.style.strokeNoScale=!0;e.ensureState("emphasis").style=Ir(p);var i=o.getStore().get(o.getDimensionIndex(e.__dimIdx),t);(null==i||isNaN(i))&&(i=""),qg(e,Kg(n),{labelFetcher:o.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,inheritColor:u,defaultOpacity:l.opacity})})),Tp(e,d.get("focus"),d.get("blurScope"),d.get("disabled"))})),this._data=o},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t}(zx),aL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return g(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new JE(jr(this.getData,this),jr(this.getRawData,this))},t.prototype.getInitialData=function(e,t){return $E(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(e),a=""===o?this.name:o,s=ux(this,e);return ex("section",{header:a,sortBlocks:!0,blocks:Gr(i,(function(t){var n=r.get(r.mapDimension(t.dim),e);return ex("nameValue",{markerType:"subItem",markerColor:s,name:t.name,value:n,sortParam:n})}))})},t.prototype.getTooltipPosition=function(e){if(null!=e)for(var t=this.getData(),n=this.coordinateSystem,r=t.getValues(Gr(n.dimensions,(function(e){return t.mapDimension(e)})),e),i=0,o=r.length;i<o;i++)if(!isNaN(r[i])){var a=n.getIndicatorAxes();return n.coordToPoint(a[i].dataToCoord(r[i]),i)}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},t}(Mx),sL=hI.value;function lL(e,t){return Or({show:t},e)}var uL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),r=this.get("axisLine"),i=this.get("axisTick"),o=this.get("axisLabel"),a=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=Gr(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var d=a;null!=h.color&&(d=Or({color:h.color},a));var p=Lr(Ir(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:r,axisTick:i,axisLabel:o,name:h.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:d,triggerEvent:c},!1);if(Kr(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else qr(l)&&(p.name=l(p.name,p));var g=new xm(p,null,this.ecModel);return Br(g,RM.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Lr({lineStyle:{color:"#bbb"}},sL.axisLine),axisLabel:lL(sL.axisLabel,!1),axisTick:lL(sL.axisTick,!1),splitLine:lL(sL.splitLine,!0),splitArea:lL(sL.splitArea,!0),indicator:[]},t}(Nv),cL=["axisLine","axisTickLabel","axisName"],hL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;Fr(Gr(t.getIndicatorAxes(),(function(e){var n=e.model.get("showName")?e.name:"";return new II(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){Fr(cL,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var r=e.get("shape"),i=e.getModel("splitLine"),o=e.getModel("splitArea"),a=i.getModel("lineStyle"),s=o.getModel("areaStyle"),l=i.get("show"),u=o.get("show"),c=a.get("color"),h=s.get("color"),d=Zr(c)?c:[c],p=Zr(h)?h:[h],f=[],g=[];if("circle"===r)for(var m=n[0].getTicksCoords(),v=t.cx,y=t.cy,_=0;_<m.length;_++){if(l)f[C(f,d,_)].push(new tf({shape:{cx:v,cy:y,r:m[_].coord}}));if(u&&_<m.length-1)g[C(g,p,_)].push(new Tf({shape:{cx:v,cy:y,r0:m[_].coord,r:m[_+1].coord}}))}else{var x,b=Gr(n,(function(e,n){var r=e.getTicksCoords();return x=null==x?r.length-1:Math.min(r.length-1,x),Gr(r,(function(e){return t.coordToPoint(e.coord,n)}))})),w=[];for(_=0;_<=x;_++){for(var S=[],T=0;T<n.length;T++)S.push(b[T][_]);if(S[0]?S.push(S[0].slice()):"production"!==process.env.NODE_ENV&&console.error("Can't draw value axis "+_),l)f[C(f,d,_)].push(new Lf({shape:{points:S}}));if(u&&w)g[C(g,p,_-1)].push(new Df({shape:{points:S.concat(w)}}));w=S.slice().reverse()}}var M=a.getLineStyle(),A=s.getAreaStyle();Fr(g,(function(e,t){this.group.add(Cg(e,{style:Or({stroke:"none",fill:p[t%p.length]},A),silent:!0}))}),this),Fr(f,(function(e,t){this.group.add(Cg(e,{style:Or({fill:"none",stroke:d[t%d.length]},M),silent:!0}))}),this)}function C(e,t,n){var r=n%t.length;return e[r]=e[r]||[],r}},t.type="radar",t}(Cx),dL=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="value",i.angle=0,i.name="",i}return g(t,e),t}(yA),pL=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=Gr(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,r=new dL(n,new UT);return r.name=e.get("name"),r.model=e,e.axis=r,this.dimensions.push(n),r}),this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=Math.sqrt(t*t+n*n);t/=r,n/=r;for(var i,o=Math.atan2(-n,t),a=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(o-u.angle);c<a&&(i=u,s=l,a=c)}return[s,+(i&&i.coordToData(r))]},e.prototype.resize=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i)/2;this.cx=uu(n[0],r),this.cy=uu(n[1],i),this.startAngle=e.get("startAngle")*Math.PI/180;var a=e.get("radius");(Kr(a)||Jr(a))&&(a=[0,a]),this.r0=uu(a[0],o),this.r=uu(a[1],o),Fr(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var n=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),e.angle=n}),this)},e.prototype.update=function(e,t){var n=this._indicatorAxes,r=this._model;Fr(n,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,i){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===r){var o=t.getData();Fr(n,(function(e){e.scale.unionExtentFromData(o,o.mapDimension(e.dim))}))}}),this);var i=r.get("splitNumber"),o=new UT;o.setExtent(0,i),o.setInterval(1),Fr(n,(function(e,t){TI(e.scale,e.model,o)}))},e.prototype.convertToPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.create=function(t,n){var r=[];return t.eachComponent("radar",(function(i){var o=new e(i,t,n);r.push(o),i.coordinateSystem=o})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("radarIndex")||0])})),r},e.dimensions=[],e}();function fL(e){e.registerCoordinateSystem("radar",pL),e.registerComponentModel(uL),e.registerComponentView(hL),e.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each((function(e){t.setItemVisual(e,"legendIcon","roundRect")})),t.setVisual("legendIcon","roundRect")}})}var gL="\0_ec_interaction_mutex";function mL(e,t){return!!vL(e)[t]}function vL(e){return e[gL]||(e[gL]={})}LS({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Mi);var yL=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var r=jr(n._mousedownHandler,n),i=jr(n._mousemoveHandler,n),o=jr(n._mouseupHandler,n),a=jr(n._mousewheelHandler,n),s=jr(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=Or(Ir(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",r),t.on("mousemove",i),t.on("mouseup",o)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",r),t.off("mousemove",i),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return g(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!_o(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(this._dragging&&bL("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!mL(this._zr,"globalPan")){var t=e.offsetX,n=e.offsetY,r=this._x,i=this._y,o=t-r,a=n-i;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&yo(e.event),xL(this,"pan","moveOnMouseMove",e,{dx:o,dy:a,oldX:r,oldY:i,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){_o(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=bL("zoomOnMouseWheel",e,this._opt),n=bL("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,i=Math.abs(r),o=e.offsetX,a=e.offsetY;if(0!==r&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1;_L(this,"zoom","zoomOnMouseWheel",e,{scale:r>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(r);_L(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(r>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){mL(this._zr,"globalPan")||_L(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Ji);function _L(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(yo(r.event),xL(e,t,n,r,i))}function xL(e,t,n,r,i){i.isAvailableBehavior=jr(bL,null,n,r),e.trigger(t,i)}function bL(e,t,n){var r=n[e];return!e||r&&(!Kr(r)||t.event[r+"Key"])}function wL(e,t,n){var r=e.target;r.x+=t,r.y+=n,r.dirty()}function SL(e,t,n,r){var i=e.target,o=e.zoomLimit,a=e.zoom=e.zoom||1;if(a*=t,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/e.zoom;e.zoom=a,i.x-=(n-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var TL,ML={axisPointer:1,tooltip:1,brush:1};function AL(e,t,n){var r=t.getComponentByElement(e.topTarget),i=r&&r.coordinateSystem;return r&&r!==n&&!ML.hasOwnProperty(r.mainType)&&i&&i.model!==n}function CL(e){Kr(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var DL={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},EL=Xr(DL),IL={"alignment-baseline":"textBaseline","stop-color":"stopColor"},LL=Xr(IL),NL=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t=t||{};var n=CL(e);if("production"!==process.env.NODE_ENV&&!n)throw new Error("Illegal svg");this._defsUsePending=[];var r=new Kl;this._root=r;var i=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),s=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),BL(n,r,null,!0,!1);for(var l,u,c=n.firstChild;c;)this._parseNode(c,r,i,null,!1,!1),c=c.nextSibling;if(function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r[0].style[r[1]]=e[r[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var h=HL(o);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=s&&(u=YL(l,{x:0,y:0,width:a,height:s}),!t.ignoreViewBox)){var d=r;(r=new Kl).add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return t.ignoreRootClip||null==a||null==s||r.setClipPath(new fd({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},e.prototype._parseNode=function(e,t,n,r,i,o){var a,s=e.nodeName.toLowerCase(),l=r;if("defs"===s&&(i=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=t;else{if(!i){var u=TL[s];if(u&&Ti(TL,s)){a=u.call(this,e,t);var c=e.getAttribute("name");if(c){var h={name:c,namedFrom:null,svgNodeTagLower:s,el:a};n.push(h),"g"===s&&(l=h)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:s,el:a});t.add(a)}}var d=PL[s];if(d&&Ti(PL,s)){var p=d.call(this,e),f=e.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup)for(var g=e.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,i,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},e.prototype._parseText=function(e,t){var n=new nd({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});kL(t,n),BL(e,n,this._defsUsePending,!1,!1),function(e,t){var n=t.__selfStyle;if(n){var r=n.textBaseline,i=r;r&&"auto"!==r?"baseline"===r?i="alphabetic":"before-edge"===r||"text-before-edge"===r?i="top":"after-edge"===r||"text-after-edge"===r?i="bottom":"central"!==r&&"mathematical"!==r||(i="middle"):i="alphabetic",e.style.textBaseline=i}var o=t.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),e.style.textAlign=s)}}(n,t);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9);var o=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+"px",r.fontFamily||"sans-serif"].join(" ");r.font=o;var a=n.getBoundingRect();return this._textX+=a.width,t.add(n),n},e.internalField=void(TL={g:function(e,t){var n=new Kl;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new fd;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new tf;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new Rf;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new of;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n,r=e.getAttribute("points");r&&(n=zL(r));var i=new Df({shape:{points:n||[]},silent:!0});return kL(t,i),BL(e,i,this._defsUsePending,!1,!1),i},polyline:function(e,t){var n,r=e.getAttribute("points");r&&(n=zL(r));var i=new Lf({shape:{points:n||[]},silent:!0});return kL(t,i),BL(e,i,this._defsUsePending,!1,!1),i},image:function(e,t){var n=new ad;return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",r=e.getAttribute("y")||"0",i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(o);var a=new Kl;return kL(t,a),BL(e,a,this._defsUsePending,!1,!0),a},tspan:function(e,t){var n=e.getAttribute("x"),r=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var i=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",a=new Kl;return kL(t,a),BL(e,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(o),a},path:function(e,t){var n=$p(e.getAttribute("d")||"");return kL(t,n),BL(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),e}(),PL={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),r=parseInt(e.getAttribute("x2")||"10",10),i=parseInt(e.getAttribute("y2")||"0",10),o=new Zf(t,n,r,i);return OL(e,o),RL(e,o),o},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),n=parseInt(e.getAttribute("cy")||"0",10),r=parseInt(e.getAttribute("r")||"0",10),i=new Kf(t,n,r);return OL(e,i),RL(e,i),i}};function OL(e,t){"userSpaceOnUse"===e.getAttribute("gradientUnits")&&(t.global=!0)}function RL(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var r=n.getAttribute("offset"),i=void 0;i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};jL(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function kL(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Or(t.__inheritedStyle,e.__inheritedStyle))}function zL(e){for(var t=HL(e),n=[],r=0;r<t.length;r+=2){var i=parseFloat(t[r]),o=parseFloat(t[r+1]);n.push([i,o])}return n}function BL(e,t,n,r,i){var o=t,a=o.__inheritedStyle=o.__inheritedStyle||{},s={};1===e.nodeType&&(function(e,t){var n=e.getAttribute("transform");if(n){n=n.replace(/,/g," ");var r=[],i=null;n.replace(UL,(function(e,t,n){return r.push(t,n),""}));for(var o=r.length-1;o>0;o-=2){var a=r[o],s=r[o-1],l=HL(a);switch(i=i||[1,0,0,1,0,0],s){case"translate":Co(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Eo(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Do(i,i,-parseFloat(l[0])*WL,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":Ao(i,[1,0,Math.tan(parseFloat(l[0])*WL),1,0,0],i);break;case"skewY":Ao(i,[1,Math.tan(parseFloat(l[0])*WL),0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5])}}t.setLocalTransform(i)}}(e,t),jL(e,a,s),r||function(e,t,n){for(var r=0;r<EL.length;r++){var i=EL[r];null!=(o=e.getAttribute(i))&&(t[DL[i]]=o)}for(r=0;r<LL.length;r++){var o;i=LL[r];null!=(o=e.getAttribute(i))&&(n[IL[i]]=o)}}(e,a,s)),o.style=o.style||{},null!=a.fill&&(o.style.fill=FL(o,"fill",a.fill,n)),null!=a.stroke&&(o.style.stroke=FL(o,"stroke",a.stroke,n)),Fr(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){null!=a[e]&&(o.style[e]=parseFloat(a[e]))})),Fr(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],(function(e){null!=a[e]&&(o.style[e]=a[e])})),i&&(o.__selfStyle=s),a.lineDash&&(o.style.lineDash=Gr(HL(a.lineDash),(function(e){return parseFloat(e)}))),"hidden"!==a.visibility&&"collapse"!==a.visibility||(o.invisible=!0),"none"===a.display&&(o.ignore=!0)}var VL=/^url\(\s*#(.*?)\)/;function FL(e,t,n,r){var i=n&&n.match(VL);if(!i)return"none"===n&&(n=null),n;var o=pi(i[1]);r.push([e,t,o])}var GL=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function HL(e){return e.match(GL)||[]}var UL=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,WL=Math.PI/180;var XL=/([^\s:;]+)\s*:\s*([^:;]+)/g;function jL(e,t,n){var r,i=e.getAttribute("style");if(i)for(XL.lastIndex=0;null!=(r=XL.exec(i));){var o=r[1],a=Ti(DL,o)?DL[o]:null;a&&(t[a]=r[2]);var s=Ti(IL,o)?IL[o]:null;s&&(n[s]=r[2])}}function YL(e,t){var n=t.width/e.width,r=t.height/e.height,i=Math.min(n,r);return{scale:i,x:-(e.x+e.width/2)*i+(t.x+t.width/2),y:-(e.y+e.height/2)*i+(t.y+t.height/2)}}var ZL=xi(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),qL=function(){function e(e,t){this.type="geoSVG",this._usedGraphicMap=xi(),this._freedGraphics=[],this._mapName=e,this._parsedXML=CL(t)}return e.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=function(e){var t=[],n=xi();return Fr(e,(function(e){if(null==e.namedFrom){var r=new $M(e.name,e.el);t.push(r),n.set(e.name,r)}})),{regions:t,regionsMap:n}}(e.named),n=t.regions,r=t.regionsMap;this._regions=n,this._regionsMap=r}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},e.prototype._buildGraphic=function(e){var t,n,r,i;try{di(null!=(n=(t=e&&(r=e,i={ignoreViewBox:!0,ignoreRootClip:!0},(new NL).parse(r,i))||{}).root))}catch(e){throw new Error("Invalid svg format\n"+e.message)}var o=new Kl;o.add(n),o.isGeoSVGGraphicRoot=!0;var a=t.width,s=t.height,l=t.viewBoxRect,u=this._boundingRect;if(!u){var c=void 0,h=void 0,d=void 0,p=void 0;if(null!=a?(c=0,d=a):l&&(c=l.x,d=l.width),null!=s?(h=0,p=s):l&&(h=l.y,p=l.height),null==c||null==h){var f=n.getBoundingRect();null==c&&(c=f.x,d=f.width),null==h&&(h=f.y,p=f.height)}u=this._boundingRect=new Uo(c,h,d,p)}if(l){var g=YL(l,u);n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}o.setClipPath(new fd({shape:u.plain()}));var m=[];return Fr(t.named,(function(e){var t;null!=ZL.get(e.svgNodeTagLower)&&(m.push(e),(t=e.el).silent=!1,t.isGroup&&t.traverse((function(e){e.silent=!1})))})),{root:o,boundingRect:u,named:m}},e.prototype.useGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,n),n)},e.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);n&&(t.removeKey(e),this._freedGraphics.push(n))},e}();for(var KL=[126,25],$L="南海诸岛",JL=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],QL=0;QL<JL.length;QL++)for(var eN=0;eN<JL[QL].length;eN++)JL[QL][eN][0]/=10.5,JL[QL][eN][1]/=-14,JL[QL][eN][0]+=KL[0],JL[QL][eN][1]+=KL[1];var tN={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};function nN(e,t){if("china"===e){var n=tN[t.name];if(n){var r=t.getCenter();r[0]+=n[0]/10.5,r[1]+=-n[1]/14,t.setCenter(r)}}}var rN=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var iN=function(){function e(e,t,n){var r;this.type="geoJSON",this._parsedMap=xi(),this._mapName=e,this._specialAreas=n,this._geoJSON=Kr(r=t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}return e.prototype.load=function(e,t){t=t||"name";var n=this._parsedMap.get(t);if(!n){var r=this._parseToRegions(t);n=this._parsedMap.set(t,{regions:r,boundingRect:oN(r)})}var i=xi(),o=[];return Fr(n.regions,(function(t){var n=t.name;e&&Ti(e,n)&&(t=t.cloneShallow(n=e[n])),o.push(t),i.set(n,t)})),{regions:o,boundingRect:n.boundingRect||new Uo(0,0,0,0),regionsMap:i}},e.prototype._parseToRegions=function(e){var t,n=this._mapName,r=this._geoJSON;try{t=r?eA(r,e):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return function(e,t){if("china"===e){for(var n=0;n<t.length;n++)if(t[n].name===$L)return;t.push(new KM($L,Gr(JL,(function(e){return{type:"polygon",exterior:e}})),KL))}}(n,t),Fr(t,(function(e){var t=e.name;nN(n,e),function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:rN[0]})}(n,e);var r=this._specialAreas&&this._specialAreas[t];r&&e.transformTo(r.left,r.top,r.width,r.height)}),this),t},e.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function oN(e){for(var t,n=0;n<e.length;n++){var r=e[n].getBoundingRect();(t=t||r.clone()).union(r)}return t}var aN=xi(),sN={registerMap:function(e,t,n){if(t.svg){var r=new qL(e,t.svg);aN.set(e,r)}else{var i=t.geoJson||t.geoJSON;i&&!t.features?n=t.specialAreas:i=t;r=new iN(e,i,n);aN.set(e,r)}},getGeoResource:function(e){return aN.get(e)},getMapForUser:function(e){var t=aN.get(e);return t&&"geoJSON"===t.type&&t.getMapForUser()},load:function(e,t,n){var r=aN.get(e);if(r)return r.load(t,n);"production"!==process.env.NODE_ENV&&console.error("Map "+e+" not exists. The GeoJSON of the map must be provided.")}},lN=["rect","circle","line","ellipse","polygon","polyline","path"],uN=xi(lN),cN=xi(lN.concat(["g"])),hN=xi(lN.concat(["g"])),dN=oc();function pN(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}function fN(e){var t=e.style;t&&(t.stroke=t.stroke||t.fill,t.fill=null)}var gN=function(){function e(e){var t=new Kl;this.uid=wm("ec_map_draw"),this._controller=new yL(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Kl),t.add(this._svgGroup=new Kl)}return e.prototype.draw=function(e,t,n,r,i){var o="geo"===e.mainType,a=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},(function(t){a||t.getHostGeoModel()!==e||(a=t.getData())}));var s=e.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),h=c.raw,d=c.roam;!l.childAt(0)||i?(u.x=d.x,u.y=d.y,u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.dirty()):ug(u,d,e);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:e,data:a,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:h};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(e,t,n),this._updateMapSelectHandler(e,l,n,r)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=xi(),n=xi(),r=this._regionsGroup,i=e.transformInfoRaw,o=e.mapOrGeoModel,a=e.data,s=e.geo.projection,l=s&&s.stream;function u(e,t){return t&&(e=t(e)),e&&[e[0]*i.scaleX+i.x,e[1]*i.scaleY+i.y]}function c(e){for(var t=[],n=!l&&s&&s.project,r=0;r<e.length;++r){var i=u(e[r],n);i&&t.push(i)}return t}function h(e){return{shape:{points:c(e)}}}r.removeAll(),Fr(e.geo.regions,(function(i){var c=i.name,d=t.get(c),p=n.get(c)||{},f=p.dataIdx,g=p.regionModel;d||(d=t.set(c,new Kl),r.add(d),f=a?a.indexOfName(c):null,g=e.isGeo?o.getRegionModel(c):a?a.getItemModel(f):null,n.set(c,{dataIdx:f,regionModel:g}));var m=[],v=[];Fr(i.geometries,(function(e){if("polygon"===e.type){var t=[e.exterior].concat(e.interiors||[]);l&&(t=bN(t,l)),Fr(t,(function(e){m.push(new Df(h(e)))}))}else{var n=e.points;l&&(n=bN(n,l,!0)),Fr(n,(function(e){v.push(new Lf(h(e)))}))}}));var y=u(i.getCenter(),s&&s.project);function _(t,n){if(t.length){var r=new Xf({culling:!0,segmentIgnoreThreshold:1,shape:{paths:t}});d.add(r),mN(e,r,f,g),vN(e,r,c,g,o,f,y),n&&(fN(r),Fr(r.states,fN))}}_(m),_(v,!0)})),t.each((function(t,r){var i=n.get(r),a=i.dataIdx,s=i.regionModel;yN(e,t,r,s,o,a),_N(e,t,r,s,o),xN(e,t,r,s,o)}),this)},e.prototype._buildSVG=function(e){var t=e.geo.map,n=e.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var r=this._svgDispatcherMap=xi(),i=!1;Fr(this._svgGraphicRecord.named,(function(t){var n=t.name,o=e.mapOrGeoModel,a=e.data,s=t.svgNodeTagLower,l=t.el,u=a?a.indexOfName(n):null,c=o.getRegionModel(n);(null!=uN.get(s)&&l instanceof Qc&&mN(e,l,u,c),l instanceof Qc&&(l.culling=!0),l.z2EmphasisLift=0,t.namedFrom)||(null!=hN.get(s)&&vN(e,l,n,c,o,u,null),yN(e,l,n,c,o,u),_N(e,l,n,c,o),null!=cN.get(s)&&("self"===xN(e,l,n,c,o)&&(i=!0),(r.get(n)||r.set(n,[])).push(l)))}),this),this._enableBlurEntireSVG(i,e)},e.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var n=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse((function(e){if(!e.isGroup){sp(e);var t=e.ensureState("blur").style||{};null==t.opacity&&null!=n&&(t.opacity=n),e.ensureState("emphasis")}}))}},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},e.prototype.findHighDownDispatchers=function(e,t){if(null==e)return[];var n=t.coordinateSystem;if("geoJSON"===n.resourceType){var r=this._regionsGroupByName;if(r){var i=r.get(e);return i?[i]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},e.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},e.prototype._useSVG=function(e){var t=sN.getGeoResource(e);if(t&&"geoSVG"===t.type){var n=t.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=e}},e.prototype._freeSVG=function(){var e=this._svgMapName;if(null!=e){var t=sN.getGeoResource(e);t&&"geoSVG"===t.type&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},e.prototype._updateController=function(e,t,n){var r=e.coordinateSystem,i=this._controller,o=this._controllerHost;o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.enable(e.get("roam")||!1);var a=e.mainType;function s(){var t={type:"geoRoam",componentType:a};return t[a+"Id"]=e.id,t}i.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,wL(o,e.dx,e.dy),n.dispatchAction(Pr(s(),{dx:e.dx,dy:e.dy,animation:{duration:0}}))}),this),i.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,SL(o,e.scale,e.originX,e.originY),n.dispatchAction(Pr(s(),{zoom:e.scale,originX:e.originX,originY:e.originY,animation:{duration:0}}))}),this),i.setPointerChecker((function(t,i,o){return r.containPoint([i,o])&&!AL(t,n,e)}))},e.prototype.resetForLabelLayout=function(){this.group.traverse((function(e){var t=e.getTextContent();t&&(t.ignore=dN(t).ignore)}))},e.prototype._updateMapSelectHandler=function(e,t,n,r){var i=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",(function(){i._mouseDownFlag=!0})),t.on("click",(function(e){i._mouseDownFlag&&(i._mouseDownFlag=!1)})))},e}();function mN(e,t,n,r){var i=r.getModel("itemStyle"),o=r.getModel(["emphasis","itemStyle"]),a=r.getModel(["blur","itemStyle"]),s=r.getModel(["select","itemStyle"]),l=pN(i),u=pN(o),c=pN(s),h=pN(a),d=e.data;if(d){var p=d.getItemVisual(n,"style"),f=d.getItemVisual(n,"decal");e.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=bw(f,e.api))}t.setStyle(l),t.style.strokeNoScale=!0,t.ensureState("emphasis").style=u,t.ensureState("select").style=c,t.ensureState("blur").style=h,sp(t)}function vN(e,t,n,r,i,o,a){var s=e.data,l=e.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),o)),c=s&&s.getItemLayout(o);if(l||u||c&&c.showLabel){var h=l?n:o,d=void 0;(!s||o>=0)&&(d=i);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;qg(t,Kg(r),{labelFetcher:d,labelDataIndex:h,defaultText:n},p);var f=t.getTextContent();if(f&&(dN(f).ignore=f.ignore,t.textConfig&&a)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function yN(e,t,n,r,i,o){e.data?e.data.setItemGraphicEl(o,t):Ld(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function _N(e,t,n,r,i){e.data||Hg({el:t,componentModel:i,itemName:n,itemTooltipOption:r.get("tooltip")})}function xN(e,t,n,r,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var o=r.getModel("emphasis"),a=o.get("focus");return Tp(t,a,o.get("blurScope"),o.get("disabled")),e.isGeo&&function(e,t,n){var r=Ld(e);r.componentMainType=t.mainType,r.componentIndex=t.componentIndex,r.componentHighDownName=n}(t,i,n),a}function bN(e,t,n){var r,i=[];function o(){r=[]}function a(){r.length&&(i.push(r),r=[])}var s=t({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(e,t){isFinite(e)&&isFinite(t)&&r.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),Fr(e,(function(e){s.lineStart();for(var t=0;t<e.length;t++)s.point(e[t][0],e[t][1]);s.lineEnd()})),!n&&s.polygonEnd(),i}var wN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n,r){if(!r||"mapToggleSelect"!==r.type||r.from!==this.uid){var i=this.group;if(i.removeAll(),!e.getHostGeoModel()){if(this._mapDraw&&r&&"geoRoam"===r.type&&this._mapDraw.resetForLabelLayout(),r&&"geoRoam"===r.type&&"series"===r.componentType&&r.seriesId===e.id)(o=this._mapDraw)&&i.add(o.group);else if(e.needsDrawMap){var o=this._mapDraw||new gN(n);i.add(o.group),o.draw(e,t,n,this,r),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var r=e.originalData,i=this.group;r.each(r.mapDimension("value"),(function(t,n){if(!isNaN(t)){var o=r.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new tf({style:{fill:e.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:Hd+1)});if(!s){var u=e.mainSeries.getData(),c=r.getName(n),h=u.indexOfName(c),d=r.getItemModel(n),p=d.getModel("label"),f=u.getItemGraphicEl(h);qg(l,Kg(d),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}},defaultText:c}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){op(l,e)}}i.add(l)}}}))},t.type="map",t}(zx),SN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(e){if(null!=e){var t=this.getData().getName(e),n=this.coordinateSystem,r=n.getRegion(t);return r&&n.dataToPoint(r.getCenter())}},n}return g(t,e),t.prototype.getInitialData=function(e){for(var t=$E(this,{coordDimensions:["value"],encodeDefaulter:Yr(Zv,this)}),n=xi(),r=[],i=0,o=t.count();i<o;i++){var a=t.getName(i);n.set(a,!0)}return Fr(sN.load(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,(function(e){var t=e.name;n.get(t)||r.push(t)})),t.appendValues([],r),t},t.prototype.getHostGeoModel=function(){var e=this.option.geoIndex;return null!=e?this.ecModel.getComponent("geo",e):null},t.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},t.prototype.getRawValue=function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},t.prototype.getRegionModel=function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData(),i=this.getRawValue(e),o=r.getName(e),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var u=a[l].originalData.indexOfName(o),c=r.mapDimension("value");isNaN(a[l].originalData.get(c,u))||s.push(a[l].name)}return ex("section",{header:s.join(", "),noHeader:!s.length,blocks:[ex("nameValue",{name:o,value:i})]})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.getLegendIcon=function(e){var t=e.icon||"roundRect",n=Wb(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill);return n.setStyle(e.itemStyle),n.style.stroke="none",t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},t}(Mx);function TN(e){var t={};e.eachSeriesByType("map",(function(e){var n=e.getHostGeoModel(),r=n?"o"+n.id:"i"+e.getMapType();(t[r]=t[r]||[]).push(e)})),Fr(t,(function(e,t){for(var n,r,i,o=(n=Gr(e,(function(e){return e.getData()})),r=e[0].get("mapValueCalculation"),i={},Fr(n,(function(e){e.each(e.mapDimension("value"),(function(t,n){var r="ec-"+e.getName(n);i[r]=i[r]||[],isNaN(t)||i[r].push(t)}))})),n[0].map(n[0].mapDimension("value"),(function(e,t){for(var o="ec-"+n[0].getName(t),a=0,s=1/0,l=-1/0,u=i[o].length,c=0;c<u;c++)s=Math.min(s,i[o][c]),l=Math.max(l,i[o][c]),a+=i[o][c];return 0===u?NaN:"min"===r?s:"max"===r?l:"average"===r?a/u:a}))),a=0;a<e.length;a++)e[a].originalData=e[a].getData();for(a=0;a<e.length;a++)e[a].seriesGroup=e,e[a].needsDrawMap=0===a&&!e[a].getHostGeoModel(),e[a].setData(o.cloneShallow()),e[a].mainSeries=e[0]}))}function MN(e){var t={};e.eachSeriesByType("map",(function(n){var r=n.getMapType();if(!n.getHostGeoModel()&&!t[r]){var i={};Fr(n.seriesGroup,(function(t){var n=t.coordinateSystem,r=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&r.each(r.mapDimension("value"),(function(e,t){var o=r.getName(t),a=n.getRegion(o);if(a&&!isNaN(e)){var s=i[o]||0,l=n.dataToPoint(a.getCenter());i[o]=s+1,r.setItemLayout(t,{point:l,offset:s})}}))}));var o=n.getData();o.each((function(e){var t=o.getName(e),n=o.getItemLayout(e)||{};n.showLabel=!i[t],o.setItemLayout(e,n)})),t[r]=!0}}))}var AN=ji,CN=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new El,n._rawTransformable=new El,n.name=t,n}return g(t,e),t.prototype.setBoundingRect=function(e,t,n,r){return this._rect=new Uo(e,t,n,r),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,r){this._transformTo(e,t,n,r),this._viewRect=new Uo(e,t,n,r)},t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._rawTransformable;o.transform=i.calculateTransform(new Uo(e,t,n,r));var a=o.parent;o.parent=null,o.decomposeTransform(),o.parent=a,this._updateTransform()},t.prototype.setCenter=function(e,t){e&&(this._center=[uu(e[0],t.getWidth()),uu(e[1],t.getHeight())],this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),r=this.getCenter(),i=this.getZoom();r=ji([],r,e),n=ji([],n,e),t.originX=r[0],t.originY=r[1],t.x=n[0]-r[0],t.y=n[1]-r[1],t.scaleX=t.scaleY=i,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),Mo(this.transform||(this.transform=[]),t.transform||[1,0,0,1,0,0]),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],Io(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new El;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var r=t?this._rawTransform:this.transform;return n=n||[],r?AN(n,e,r):Ei(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?AN([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var r=DN(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=DN(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(El);function DN(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var EN={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},IN=["lng","lat"],LN=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.dimensions=IN,i.type="geo",i._nameCoordMap=xi(),i.map=n;var o,a=r.projection,s=sN.load(n,r.nameMap,r.nameProperty),l=sN.getGeoResource(n),u=i.resourceType=l?l.type:null,c=i.regions=s.regions,h=EN[l.type];if(i._regionsMap=s.regionsMap,i.regions=s.regions,"production"!==process.env.NODE_ENV&&a&&("geoSVG"===u&&("production"!==process.env.NODE_ENV&&ku("Map "+n+" with SVG source can't use projection. Only GeoJSON source supports projection."),a=null),a.project&&a.unproject||("production"!==process.env.NODE_ENV&&ku("project and unproject must be both provided in the projeciton."),a=null)),i.projection=a,a)for(var d=0;d<c.length;d++){var p=c[d].getBoundingRect(a);(o=o||p.clone()).union(p)}else o=s.boundingRect;return i.setBoundingRect(o.x,o.y,o.width,o.height),i.aspectScale=a?1:li(r.aspectScale,h.aspectScale),i._invertLongitute=!a&&h.invertLongitute,i}return g(t,e),t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),o=this._invertLongitute;i=i.clone(),o&&(i.y=-i.y-i.height);var a=this._rawTransformable;a.transform=i.calculateTransform(new Uo(e,t,n,r));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,o&&(a.scaleY=-a.scaleY),this._updateTransform()},t.prototype.getRegion=function(e){return this._regionsMap.get(e)},t.prototype.getRegionByCoord=function(e){for(var t=this.regions,n=0;n<t.length;n++){var r=t[n];if("geoJSON"===r.type&&r.contain(e))return t[n]}},t.prototype.addGeoCoord=function(e,t){this._nameCoordMap.set(e,t)},t.prototype.getGeoCoord=function(e){var t=this._regionsMap.get(e);return this._nameCoordMap.get(e)||t&&t.getCenter()},t.prototype.dataToPoint=function(e,t,n){if(Kr(e)&&(e=this.getGeoCoord(e)),e){var r=this.projection;return r&&(e=r.project(e)),e&&this.projectedToPoint(e,t,n)}},t.prototype.pointToData=function(e){var t=this.projection;return t&&(e=t.unproject(e)),e&&this.pointToProjected(e)},t.prototype.pointToProjected=function(t){return e.prototype.pointToData.call(this,t)},t.prototype.projectedToPoint=function(t,n,r){return e.prototype.dataToPoint.call(this,t,n,r)},t.prototype.convertToPixel=function(e,t,n){var r=NN(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=NN(t);return r===this?r.pointToData(n):null},t}(CN);function NN(e){var t=e.geoModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",uc).models[0]||{}).coordinateSystem:null}Br(LN,CN);var PN=LN;function ON(e,t){var n=e.get("boundingCoords");if(null!=n){var r=n[0],i=n[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var o=this.projection;if(o){var a=r[0],s=r[1],l=i[0],u=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var c=function(e,t,n,a){for(var s=n-e,l=a-t,u=0;u<=100;u++){var c=u/100,h=o.project([e+s*c,t+l*c]);Yi(r,r,h),Zi(i,i,h)}};c(a,s,l,s),c(l,s,l,u),c(l,u,a,u),c(a,u,l,s)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}else"production"!==process.env.NODE_ENV&&console.error("Invalid boundingCoords")}var h,d,p,f=this.getBoundingRect(),g=e.get("layoutCenter"),m=e.get("layoutSize"),v=t.getWidth(),y=t.getHeight(),_=f.width/f.height*this.aspectScale,x=!1;if(g&&m&&(h=[uu(g[0],v),uu(g[1],y)],d=uu(m,Math.min(v,y)),isNaN(h[0])||isNaN(h[1])||isNaN(d)?"production"!==process.env.NODE_ENV&&console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):x=!0),x)p={},_>1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=h[1]-p.height/2,p.x=h[0]-p.width/2;else{var b=e.getBoxLayoutParams();b.aspect=_,p=Tv(b,{width:v,height:y})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(e.get("center"),t),this.setZoom(e.get("zoom"))}var RN=function(){function e(){this.dimensions=IN}return e.prototype.create=function(e,t){var n=[];function r(e){return{nameProperty:e.get("nameProperty"),aspectScale:e.get("aspectScale"),projection:e.get("projection")}}e.eachComponent("geo",(function(e,i){var o=e.get("map"),a=new PN(o+i,o,Pr({nameMap:e.get("nameMap")},r(e)));a.zoomLimit=e.get("scaleLimit"),n.push(a),e.coordinateSystem=a,a.model=e,a.resize=ON,a.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var i={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}})),Fr(i,(function(e,i){var o=Gr(e,(function(e){return e.get("nameMap")})),a=new PN(i,i,Pr({nameMap:Nr(o)},r(e[0])));a.zoomLimit=si.apply(null,Gr(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=ON,a.resize(e[0],t),Fr(e,(function(e){e.coordinateSystem=a,function(e,t){Fr(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n,r){for(var i=(e||[]).slice(),o=xi(),a=0;a<i.length;a++)o.set(i[a].name,i[a]);return Fr(sN.load(t,n,r).regions,(function(e){var t=e.name;!o.get(t)&&i.push({name:t})})),i},e}(),kN=new RN,zN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t,n){var r=sN.getGeoResource(e.map);if(r&&"geoJSON"===r.type){var i=e.itemStyle=e.itemStyle||{};"color"in i||(i.color="#eee")}this.mergeDefaultAndTheme(e,n),ju(e,"label",["show"])},t.prototype.optionUpdated=function(){var e=this,t=this.option;t.regions=kN.getFilledRegions(t.regions,t.map,t.nameMap,t.nameProperty);var n={};this._optionModelMap=Hr(t.regions||[],(function(t,r){var i=r.name;return i&&(t.set(i,new xm(r,e,e.ecModel)),r.selected&&(n[i]=!0)),t}),xi()),t.selectedMap||(t.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new xm(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),r="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),i={name:e};return qr(r)?(i.status=t,r(i)):Kr(r)?r.replace("{a}",null!=e?e:""):void 0},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;n&&("multiple"!==n&&(t.selectedMap=null),(t.selectedMap||(t.selectedMap={}))[e]=!0)},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?"unSelect":"select"](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!(!t||!t[e])},t.type="geo",t.layoutMode="box",t.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},t}(Nv);function BN(e,t){return e.pointToProjected?e.pointToProjected(t):e.pointToData(t)}function VN(e,t,n,r){var i=e.getZoom(),o=e.getCenter(),a=t.zoom,s=e.projectedToPoint?e.projectedToPoint(o):e.dataToPoint(o);if(null!=t.dx&&null!=t.dy&&(s[0]-=t.dx,s[1]-=t.dy,e.setCenter(BN(e,s),r)),null!=a){if(n){var l=n.min||0,u=n.max||1/0;a=Math.max(Math.min(i*a,u),l)/i}e.scaleX*=a,e.scaleY*=a;var c=(t.originX-e.x)*(a-1),h=(t.originY-e.y)*(a-1);e.x-=c,e.y-=h,e.updateTransform(),e.setCenter(BN(e,s),r),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}var FN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.focusBlurEnabled=!0,n}return g(t,e),t.prototype.init=function(e,t){this._api=t},t.prototype.render=function(e,t,n,r){if(this._model=e,!e.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new gN(n));var i=this._mapDraw;i.draw(e,t,n,this,r),i.group.on("click",this._handleRegionClick,this),i.group.silent=e.get("silent"),this.group.add(i.group),this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){var t;Nb(e.target,(function(e){return null!=(t=Ld(e).eventData)}),!0),t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var r=this;this._mapDraw.group.traverse((function(e){var t=Ld(e).eventData;if(t)return r._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.findHighDownDispatchers=function(e){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(e,this._model)},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(Cx);function GN(e,t,n){sN.registerMap(e,t,n)}function HN(e){function t(t,n){n.update="geo:updateSelectStatus",e.registerAction(n,(function(e,n){var r={},i=[];return n.eachComponent({mainType:"geo",query:e},(function(n){n[t](e.name),Fr(n.coordinateSystem.regions,(function(e){r[e.name]=n.isSelected(e.name)||!1}));var o=[];Fr(r,(function(e,t){r[t]&&o.push(t)})),i.push({geoIndex:n.componentIndex,name:o})})),{selected:r,allSelected:i,name:e.name}}))}e.registerCoordinateSystem("geo",kN),e.registerComponentModel(zN),e.registerComponentView(FN),e.registerImpl("registerMap",GN),e.registerImpl("getMap",(function(e){return sN.getMapForUser(e)})),t("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),t("select",{type:"geoSelect",event:"geoselected"}),t("unSelect",{type:"geoUnSelect",event:"geounselected"}),e.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t,n){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var o=VN(i,e,t.get("scaleLimit"),n);t.setCenter&&t.setCenter(o.center),t.setZoom&&t.setZoom(o.zoom),"series"===r&&Fr(t.seriesGroup,(function(e){e.setCenter(o.center),e.setZoom(o.zoom)}))}}))}))}function UN(e,t){var n=e.isExpand?e.children:[],r=e.parentNode.children,i=e.hierNode.i?r[e.hierNode.i-1]:null;if(n.length){!function(e){var t=e.children,n=t.length,r=0,i=0;for(;--n>=0;){var o=t[n];o.hierNode.prelim+=r,o.hierNode.modifier+=r,i+=o.hierNode.change,r+=o.hierNode.shift+i}}(e);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-o):e.hierNode.prelim=o}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=function(e,t,n,r){if(t){for(var i=e,o=e,a=o.parentNode.children[0],s=t,l=i.hierNode.modifier,u=o.hierNode.modifier,c=a.hierNode.modifier,h=s.hierNode.modifier;s=YN(s),o=ZN(o),s&&o;){i=YN(i),a=ZN(a),i.hierNode.ancestor=e;var d=s.hierNode.prelim+h-o.hierNode.prelim-u+r(s,o);d>0&&(KN(qN(s,e,n),e,d),u+=d,l+=d),h+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=i.hierNode.modifier,c+=a.hierNode.modifier}s&&!YN(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),o&&!ZN(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-c,n=e)}return n}(e,i,e.parentNode.hierNode.defaultAncestor||r[0],t)}function WN(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function XN(e){return arguments.length?e:$N}function jN(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function YN(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function ZN(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function qN(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function KN(e,t,n){var r=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=r,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=r}function $N(e,t){return e.parentNode===t.parentNode?1:2}var JN=function(){this.parentPoint=[],this.childPoints=[]},QN=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new JN},t.prototype.buildPath=function(e,t){var n=t.childPoints,r=n.length,i=t.parentPoint,o=n[0],a=n[r-1];if(1===r)return e.moveTo(i[0],i[1]),void e.lineTo(o[0],o[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=uu(t.forkPosition,1),h=[];h[l]=i[l],h[u]=i[u]+(a[u]-i[u])*c,e.moveTo(i[0],i[1]),e.lineTo(h[0],h[1]),e.moveTo(o[0],o[1]),h[l]=o[l],e.lineTo(h[0],h[1]),h[l]=a[l],e.lineTo(h[0],h[1]),e.lineTo(a[0],a[1]);for(var d=1;d<r-1;d++){var p=n[d];e.moveTo(p[0],p[1]),h[l]=p[l],e.lineTo(h[0],h[1])}},t}(ed),eP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Kl,n}return g(t,e),t.prototype.init=function(e,t){this._controller=new yL(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var r=e.getData(),i=e.layoutInfo,o=this._mainGroup;"radial"===e.get("layout")?(o.x=i.x+i.width/2,o.y=i.y+i.height/2):(o.x=i.x,o.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,t,n);var a=this._data;r.diff(a).add((function(t){tP(r,t)&&nP(r,t,null,o,e)})).update((function(t,n){var i=a.getItemGraphicEl(n);tP(r,t)?nP(r,t,i,o,e):i&&oP(a,n,i,o,e)})).remove((function(t){var n=a.getItemGraphicEl(t);n&&oP(a,t,n,o,e)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===e.get("expandAndCollapse")&&r.eachItemGraphicEl((function(t,r){t.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:r})}))})),this._data=r},t.prototype._updateViewCoordSys=function(e,t){var n=e.getData(),r=[];n.each((function(e){var t=n.getItemLayout(e);!t||isNaN(t.x)||isNaN(t.y)||r.push([+t.x,+t.y])}));var i=[],o=[];lh(r,i,o);var a=this._min,s=this._max;o[0]-i[0]==0&&(i[0]=a?a[0]:i[0]-1,o[0]=s?s[0]:o[0]+1),o[1]-i[1]==0&&(i[1]=a?a[1]:i[1]-1,o[1]=s?s[1]:o[1]+1);var l=e.coordinateSystem=new CN;l.zoomLimit=e.get("scaleLimit"),l.setBoundingRect(i[0],i[1],o[0]-i[0],o[1]-i[1]),l.setCenter(e.get("center"),t),l.setZoom(e.get("zoom")),this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=i,this._max=o},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!AL(t,n,e)})),i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){wL(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){SL(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(e),n.updateLabelLayout()}))},t.prototype._updateNodeAndLinkScale=function(e){var t=e.getData(),n=this._getNodeGlobalScale(e);t.eachItemGraphicEl((function(e,t){e.setSymbolScale(n)}))},t.prototype._getNodeGlobalScale=function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=this._nodeScaleRatio,r=t.scaleX||1;return((t.getZoom()-1)*n+1)/r},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type="tree",t}(zx);function tP(e,t){var n=e.getItemLayout(t);return n&&!isNaN(n.x)&&!isNaN(n.y)}function nP(e,t,n,r,i){var o=!n,a=e.tree.getNodeByDataIndex(t),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:"#fff",c=e.tree.root,h=a.parentNode===c?a:a.parentNode||a,d=e.getItemGraphicEl(h.dataIndex),p=h.getLayout(),f=d?{x:d.__oldX,y:d.__oldY,rawX:d.__radialOldRawX,rawY:d.__radialOldRawY}:p,g=a.getLayout();o?((n=new LD(e,t,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(e,t,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,r.add(n),e.setItemGraphicEl(t,n),n.__oldX=n.x,n.__oldY=n.y,ug(n,{x:g.x,y:g.y},i);var m=n.getSymbolPath();if("radial"===i.get("layout")){var v=c.children[0],y=v.getLayout(),_=v.children.length,x=void 0,b=void 0;if(g.x===y.x&&!0===a.isExpand&&v.children.length){var w={x:(v.children[0].getLayout().x+v.children[_-1].getLayout().x)/2,y:(v.children[0].getLayout().y+v.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-y.y,w.x-y.x))<0&&(x=2*Math.PI+x),(b=w.x<y.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-y.y,g.x-y.x))<0&&(x=2*Math.PI+x),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<y.x)&&(x-=Math.PI):(b=g.x>y.x)||(x-=Math.PI);var S=b?"left":"right",T=s.getModel("label"),M=T.get("rotate"),A=M*(Math.PI/180),C=m.getTextContent();C&&(m.setTextConfig({position:T.get("position")||S,rotation:null==M?-x:A,origin:"center"}),C.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),E="relative"===D?bi(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===D?a.getAncestorsIndices():"descendant"===D?a.getDescendantIndices():null;E&&(Ld(n).focus=E),function(e,t,n,r,i,o,a,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),d=e.get(["lineStyle","curveness"]),p=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=r.__edge=new Ff({shape:aP(c,h,d,i,i)})),ug(g,{shape:aP(c,h,d,o,a)},e));else if("polyline"===u)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var m=t.children,v=[],y=0;y<m.length;y++){var _=m[y].getLayout();v.push([_.x,_.y])}g||(g=r.__edge=new QN({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:h,forkPosition:p}})),ug(g,{shape:{parentPoint:[a.x,a.y],childPoints:v}},e)}}else if("production"!==process.env.NODE_ENV)throw new Error("The polyline edgeShape can only be used in orthogonal layout");g&&("polyline"!==u||t.isExpand)&&(g.useStyle(Or({strokeNoScale:!0,fill:null},f)),Dp(g,l,"lineStyle"),sp(g),s.add(g))}(i,a,c,n,f,p,g,r),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var r=a.parentNode&&e.getItemGraphicEl(a.parentNode.dataIndex);r&&r.hoverState===Bd||op(n.__edge,t)}})}function rP(e,t,n,r,i){var o=iP(t.tree.root,e),a=o.source,s=o.sourceLayout,l=t.getItemGraphicEl(e.dataIndex);if(l){var u=t.getItemGraphicEl(a.dataIndex).__edge,c=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),h=r.get("edgeShape"),d=r.get("layout"),p=r.get("orient"),f=r.get(["lineStyle","curveness"]);c&&("curve"===h?dg(c,{shape:aP(d,p,f,s,s),style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}):"polyline"===h&&"orthogonal"===r.get("layout")&&dg(c,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},r,{cb:function(){n.remove(c)},removeOpt:i}))}}function iP(e,t){for(var n,r=t.parentNode===e?t:t.parentNode||t;null==(n=r.getLayout());)r=r.parentNode===e?r:r.parentNode||r;return{source:r,sourceLayout:n}}function oP(e,t,n,r,i){var o=e.tree.getNodeByDataIndex(t),a=iP(e.tree.root,o).sourceLayout,s={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};dg(n,{x:a.x+1,y:a.y+1},i,{cb:function(){r.remove(n),e.setItemGraphicEl(t,null)},removeOpt:s}),n.fadeOut(null,e.hostModel,{fadeLabel:!0,animation:s}),o.children.forEach((function(t){rP(t,e,r,i,s)})),rP(o,e,r,i,s)}function aP(e,t,n,r,i){var o,a,s,l,u,c,h,d;if("radial"===e){u=r.rawX,h=r.rawY,c=i.rawX,d=i.rawY;var p=jN(u,h),f=jN(u,h+(d-h)*n),g=jN(c,d+(h-d)*n),m=jN(c,d);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=r.x,h=r.y,c=i.x,d=i.y,"LR"!==t&&"RL"!==t||(o=u+(c-u)*n,a=h,s=c+(u-c)*n,l=d),"TB"!==t&&"BT"!==t||(o=u,a=h+(d-h)*n,s=c,l=d+(h-d)*n),{x1:u,y1:h,x2:c,y2:d,cpx1:o,cpy1:a,cpx2:s,cpy2:l}}var sP=oc();function lP(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,fP(t,n,e),Fr(n,(function(n){Fr(t.TRANSFERABLE_METHODS,(function(t){n.wrapMethod(t,Yr(uP,e))}))})),t.wrapMethod("cloneShallow",Yr(hP,e)),Fr(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,Yr(cP,e))})),di(n[t.dataType]===t)}function uP(e,t){if(sP(r=this).mainData===r){var n=Pr({},sP(this).datas);n[this.dataType]=t,fP(t,n,e)}else gP(t,this.dataType,sP(this).mainData,e);var r;return t}function cP(e,t){return e.struct&&e.struct.update(),t}function hP(e,t){return Fr(sP(t).datas,(function(n,r){n!==t&&gP(n.cloneShallow(),r,t,e)})),t}function dP(e){var t=sP(this).mainData;return null==e||null==t?t:sP(t).datas[e]}function pP(){var e=sP(this).mainData;return null==e?[{data:e}]:Gr(Xr(sP(e).datas),(function(t){return{type:t,data:sP(e).datas[t]}}))}function fP(e,t,n){sP(e).datas={},Fr(t,(function(t,r){gP(t,r,e,n)}))}function gP(e,t,n,r){sP(n).datas[t]=e,sP(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=dP,e.getLinkedDataAll=pP}var mP=function(){function e(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,t,n){qr(e)&&(n=t,t=e,e=null),Kr(e=e||{})&&(e={order:e});var r,i=e.order||"preorder",o=this[e.attr||"children"];"preorder"===i&&(r=t.call(n,this));for(var a=0;!r&&a<o.length;a++)o[a].eachNode(e,t,n);"postorder"===i&&t.call(n,this)},e.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(e+1),r.height>t&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].getNodeById(e);if(i)return i}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].contains(e);if(i)return i}},e.prototype.getAncestors=function(e){for(var t=[],n=e?this:this.parentNode;n;)t.push(n),n=n.parentNode;return t.reverse(),t},e.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},e.prototype.getDescendantIndices=function(){var e=[];return this.eachNode((function(t){e.push(t.dataIndex)})),e},e.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},e.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),vP=function(){function e(e){this.type="tree",this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,r=t.length;n<r;n++)t[n].dataIndex=-1;for(n=0,r=e.count();n<r;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,r){var i=new e(n),o=[],a=1;!function e(t,n){var r=t.value;a=Math.max(a,Zr(r)?r.length:1),o.push(t);var s=new mP(Qu(t.name,""),i);n?function(e,t){var n=t.children;if(e.parentNode===t)return;n.push(e),e.parentNode=t}(s,n):i.root=s,i._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(t),i.root.updateDepthAndHeight(0);var s=xT(o,{coordDimensions:["value"],dimensionsCount:a}).dimensions,l=new yT(s,n);return l.initData(o),r&&r(l),lP({mainData:l,struct:i,structAttr:"tree"}),i.update(),i},e}();function yP(e,t,n){if(e&&kr(t,e.type)>=0){var r=n.getData().tree.root,i=e.targetNode;if(Kr(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var o=e.targetNodeId;if(null!=o&&(i=r.getNodeById(o)))return{node:i}}}function _P(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function xP(e,t){return kr(_P(e),t)>=0}function bP(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}var wP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return g(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},r=new xm(n,this,this.ecModel),i=vP.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t);return n&&n.children.length&&n.isExpand||(e.parentModel=r),e}))}));var o=0;i.eachNode("preorder",(function(e){e.depth>o&&(o=e.depth)}));var a=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:o;return i.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=a})),i.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData().tree,i=r.root.children[0],o=r.getNodeByDataIndex(e),a=o.getValue(),s=o.name;o&&o!==i;)s=o.parentNode.name+"."+s,o=o.parentNode;return ex("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=bP(r,this),n.collapsed=!r.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Mx);function SP(e,t){for(var n,r=[e];n=r.pop();)if(t(n),n.isExpand){var i=n.children;if(i.length)for(var o=i.length-1;o>=0;o--)r.push(i[o])}}function TP(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var n=function(e,t){return Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=n;var r=e.get("layout"),i=0,o=0,a=null;"radial"===r?(i=2*Math.PI,o=Math.min(n.height,n.width)/2,a=XN((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(i=n.width,o=n.height,a=XN());var s=e.getData().tree.root,l=s.children[0];if(l){!function(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,r,i=[t];n=i.pop();)if(r=n.children,n.isExpand&&r.length)for(var o=r.length-1;o>=0;o--){var a=r[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},i.push(a)}}(s),function(e,t,n){for(var r,i=[e],o=[];r=i.pop();)if(o.push(r),r.isExpand){var a=r.children;if(a.length)for(var s=0;s<a.length;s++)i.push(a[s])}for(;r=o.pop();)t(r,n)}(l,UN,a),s.hierNode.modifier=-l.hierNode.prelim,SP(l,WN);var u=l,c=l,h=l;SP(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>c.getLayout().x&&(c=e),e.depth>h.depth&&(h=e)}));var d=u===c?1:a(u,c)/2,p=d-u.getLayout().x,f=0,g=0,m=0,v=0;if("radial"===r)f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),SP(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=jN(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=o/(c.getLayout().x+d+p),f=i/(h.depth-1||1),SP(l,(function(e){v=(e.getLayout().x+p)*g,m="LR"===y?(e.depth-1)*f:i-(e.depth-1)*f,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(f=i/(c.getLayout().x+d+p),g=o/(h.depth-1||1),SP(l,(function(e){m=(e.getLayout().x+p)*f,v="TB"===y?(e.depth-1)*g:o-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))}function MP(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();Pr(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}var AP=["treemapZoomToNode","treemapRender","treemapMove"];function CP(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var r=t;r&&r.depth>1;)r=r.parentNode;var i=oy(e.ecModel,r.name||r.dataIndex+"",n);t.setVisual("decal",i)}))}var DP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return g(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};EP(n);var r=e.levels||[],i=this.designatedVisualItemStyle={},o=new xm({itemStyle:i},this,t);r=e.levels=function(e,t){var n,r,i=Xu(t.get("color")),o=Xu(t.get(["aria","decal","decals"]));if(!i)return;e=e||[],Fr(e,(function(e){var t=new xm(e),i=t.get("color"),o=t.get("decal");(t.get(["itemStyle","color"])||i&&"none"!==i)&&(n=!0),(t.get(["itemStyle","decal"])||o&&"none"!==o)&&(r=!0)}));var a=e[0]||(e[0]={});n||(a.color=i.slice());!r&&o&&(a.decal=o.slice());return e}(r,t);var a=Gr(r||[],(function(e){return new xm(e,o,t)}),this),s=vP.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),r=n?a[n.depth]:null;return e.parentModel=r||o,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return ex("nameValue",{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=bP(r,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},Pr(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=xi(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){CP(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(Mx);function EP(e){var t=0;Fr(e.children,(function(e){EP(e);var n=e.value;Zr(n)&&(n=n[0]),t+=n}));var n=e.value;Zr(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Zr(e.value)?e.value[0]=n:e.value=n}var IP=function(){function e(e){this.group=new Kl,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),i.get("show")&&n){var a=i.getModel("itemStyle"),s=i.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),c={pos:{left:i.get("left"),right:i.get("right"),top:i.get("top"),bottom:i.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:i.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,a,s,l,u,r),Mv(o,c.pos,c.box)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=Qu(r.getModel().get("name"),""),o=n.getTextRect(i),a=Math.max(o.width+16,t.emptyItemWidth);t.totalWidth+=a+8,t.renderList.push({node:r,text:i,width:a})}},e.prototype._renderContent=function(e,t,n,r,i,o,a){for(var s=0,l=t.emptyItemWidth,u=e.get(["breadcrumb","height"]),c=function(e,t,n){var r=t.width,i=t.height,o=uu(e.left,r),a=uu(e.top,i),s=uu(e.right,r),l=uu(e.bottom,i);return(isNaN(o)||isNaN(parseFloat(e.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=r),(isNaN(a)||isNaN(parseFloat(e.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=i),n=cv(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}(t.pos,t.box),h=t.totalWidth,d=t.renderList,p=r.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],m=g.node,v=g.width,y=g.text;h>c.width&&(h-=v-l,v=l,y=null);var _=new Df({shape:{points:LP(s,0,v,u,f===d.length-1,0===f)},style:Or(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Id({style:$g(i,{text:y})}),textConfig:{position:"inside"},z2:1e4*Hd,onclick:Yr(a,m)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=$g(o,{text:y}),_.ensureState("emphasis").style=p,Tp(_,r.get("focus"),r.get("blurScope"),r.get("disabled")),this.group.add(_),NP(_,e,m),s+=v+8}},e.prototype.remove=function(){this.group.removeAll()},e}();function LP(e,t,n,r,i,o){var a=[[i?e:e-5,t],[e+n,t],[e+n,t+r],[i?e:e-5,t+r]];return!o&&a.splice(2,0,[e+n+5,t+r/2]),!i&&a.push([e,t+r/2]),a}function NP(e,t,n){Ld(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&bP(n,t)}}var PP=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var o=this._storage[r];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:n,aborted:n})}return this},e}();var OP=Kl,RP=fd,kP="label",zP="upperLabel",BP=10*Hd,VP=2*Hd,FP=3*Hd,GP=Mc([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),HP=function(e){var t=GP(e);return t.stroke=t.fill=t.lineWidth=null,t},UP=oc(),WP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}return g(t,e),t.prototype.render=function(e,t,n,r){if(!(kr(t.findComponents({mainType:"series",subType:"treemap",query:r}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var i=yP(r,["treemapZoomToNode","treemapRootToNode"],e),o=r&&r.type,a=e.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&i&&l?{rootNodeGroup:l.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,c=this._giveContainerGroup(a),h=e.get("animation"),d=this._doRender(c,e,u);!h||s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,u),this._resetController(n),this._renderBreadcrumb(e,n,i)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new OP,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var r=t.getData().tree,i=this._oldTree,o={nodeGroup:[],background:[],content:[]},a={nodeGroup:[],background:[],content:[]},s=this._storage,l=[];function u(e,r,i,u){return function(e,t,n,r,i,o,a,s,l,u){if(!a)return;var c=a.getLayout(),h=e.getData(),d=a.getModel();if(h.setItemGraphicEl(a.dataIndex,null),!c||!c.isInView)return;var p=c.width,f=c.height,g=c.borderWidth,m=c.invisible,v=a.getRawIndex(),y=s&&s.getRawIndex(),_=a.viewChildren,x=c.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),T=d.getModel(["blur","itemStyle"]),M=d.getModel(["select","itemStyle"]),A=w.get("borderRadius")||0,C=F("nodeGroup",OP);if(!C)return;if(l.add(C),C.x=c.x||0,C.y=c.y||0,C.markRedraw(),UP(C).nodeWidth=p,UP(C).nodeHeight=f,c.isAboveViewRoot)return C;var D=F("background",RP,u,VP);D&&R(C,D,b&&c.upperLabelHeight);var E=d.getModel("emphasis"),I=E.get("focus"),L=E.get("blurScope"),N=E.get("disabled"),P="ancestor"===I?a.getAncestorsIndices():"descendant"===I?a.getDescendantIndices():I;if(b)Ip(C)&&Ep(C,!1),D&&(Ep(D,!N),h.setItemGraphicEl(a.dataIndex,D),Mp(D,P,L));else{var O=F("content",RP,u,FP);O&&k(C,O),D.disableMorphing=!0,D&&Ip(D)&&Ep(D,!1),Ep(C,!N),h.setItemGraphicEl(a.dataIndex,C),Mp(C,P,L)}return C;function R(t,n,r){var i=Ld(n);if(i.dataIndex=a.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:A}),m)z(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=HP(w);l.fill=s;var u=GP(S);u.fill=S.get("borderColor");var c=GP(T);c.fill=T.get("borderColor");var h=GP(M);if(h.fill=M.get("borderColor"),r){var d=p-2*g;B(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,sp(n)}t.add(n)}function k(t,n){var r=Ld(n);r.dataIndex=a.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:i,height:o,r:A}),m)z(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=HP(w);u.fill=l,u.decal=s.decal;var c=GP(S),h=GP(T),d=GP(M);B(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=d,sp(n)}t.add(n)}function z(e){!e.invisible&&o.push(e)}function B(t,n,r,i){var o=d.getModel(i?zP:kP),s=Qu(d.get("name"),null),l=o.getShallow("show");qg(t,Kg(d,i?zP:kP),{defaultText:l?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:a.dataIndex});var u=t.getTextContent();if(u){var h=u.style,p=hi(h.padding||0);i&&(t.setTextConfig({layoutRect:i}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);h.width===e&&h.height===n||u.setStyle({width:e,height:n})},h.truncateMinChar=2,h.lineOverflow="truncate",V(h,i,c);var f=u.getState("emphasis");V(f?f.style:null,i,c)}}function V(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&null!=i){var o=e.get("drillDownIcon",!0);t.text=o?o+" "+i:i}}function F(e,r,o,a){var s=null!=y&&n[e][y],l=i[e];return s?(n[e][y]=null,G(l,s)):m||((s=new r)instanceof Qc&&(s.z2=function(e,t){return e*BP+t}(o,a)),H(l,s)),t[e][v]=s}function G(e,t){var n=e[v]={};t instanceof OP?(n.oldX=t.x,n.oldY=t.y):n.oldShape=Pr({},t.shape)}function H(e,t){var n=e[v]={},o=a.parentNode,s=t instanceof Kl;if(o&&(!r||"drillDown"===r.direction)){var l=0,u=0,c=i.background[o.getRawIndex()];!r&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}(t,a,s,n,o,l,e,r,i,u)}!function e(t,n,r,i,o){i?(n=t,Fr(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new YS(n,t,a,a).add(s).update(s).remove(Yr(s,null)).execute();function a(e){return e.getId()}function s(a,s){var l=null!=a?t[a]:null,c=null!=s?n[s]:null,h=u(l,c,r,o);h&&e(l&&l.viewChildren||[],c&&c.viewChildren||[],h,i,o+1)}}(r.root?[r.root]:[],i&&i.root?[i.root]:[],e,r===i||!i,0);var c=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&Fr(e,(function(e,n){var r=t[n];Fr(e,(function(e){e&&(r.push(e),UP(e).willDelete=!0)}))})),t}(s);return this._oldTree=r,this._storage=a,{lastsForAnimation:o,willDeleteEls:c,renderFinally:function(){Fr(c,(function(e){Fr(e,(function(e){e.parent&&e.parent.remove(e)}))})),Fr(l,(function(e){e.invisible=!0,e.dirty()}))}}},t.prototype._doAnimation=function(e,t,n,r){var i=n.get("animationDurationUpdate"),o=n.get("animationEasing"),a=(qr(i)?0:i)||0,s=(qr(o)?null:o)||"cubicOut",l=new PP;Fr(t.willDeleteEls,(function(e,t){Fr(e,(function(e,n){if(!e.invisible){var i,o=e.parent,u=UP(o);if(r&&"drillDown"===r.direction)i=o===r.rootNodeGroup?{shape:{x:0,y:0,width:u.nodeWidth,height:u.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var c=0,h=0;u.willDelete||(c=u.nodeWidth/2,h=u.nodeHeight/2),i="nodeGroup"===t?{x:c,y:h,style:{opacity:0}}:{shape:{x:c,y:h,width:0,height:0},style:{opacity:0}}}i&&l.add(e,i,a,0,s)}}))})),Fr(this._storage,(function(e,n){Fr(e,(function(e,r){var i=t.lastsForAnimation[n][r],o={};i&&(e instanceof Kl?null!=i.oldX&&(o.x=e.x,o.y=e.y,e.x=i.oldX,e.y=i.oldY):(i.oldShape&&(o.shape=Pr({},e.shape),e.setShape(i.oldShape)),i.fadein?(e.setStyle("opacity",0),o.style={opacity:1}):1!==e.style.opacity&&(o.style={opacity:1})),l.add(e,o,a,0,s))}))}),this),this._state="animating",l.finished(jr((function(){this._state="ready",t.renderFinally()}),this)).start()},t.prototype._resetController=function(e){var t=this._controller;t||((t=this._controller=new yL(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",jr(this._onPan,this)),t.on("zoom",jr(this._onZoom,this)));var n=new Uo(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,r){return n.contain(t,r)}))},t.prototype._clearController=function(){var e=this._controller;e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY;if("animating"!==this._state){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.getLayout();if(!i)return;var o=new Uo(i.x,i.y,i.width,i.height),a=this.seriesModel.layoutInfo,s=[1,0,0,1,0,0];Co(s,s,[-(t-=a.x),-(n-=a.y)]),Eo(s,s,[e.scale,e.scale]),Co(s,s,[t,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if("zoomToNode"===n)t._zoomToNode(r);else if("link"===n){var o=i.hostTree.data.getItemModel(i.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&yv(a,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new IP(this.group))).render(e,t,n.node,(function(t){"animating"!==r._state&&(xP(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(r){var i=this._storage.background[r.getRawIndex()];if(i){var o=i.transformCoordToLocal(e,t),a=i.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:r,offsetX:o[0],offsetY:o[1]}}}),this),n},t.type="treemap",t}(zx);var XP=Fr,jP=Qr,YP=-1,ZP=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=Ir(t);this.type=r,this.mappingMethod=n,this._normalizeData=iO[n];var o=e.visualHandlers[r];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(qP(i),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,Fr(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(i)):"category"===n?i.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(XP(t,(function(e,t){n[e]=t})),!Zr(r)){var i=[];Qr(r)?XP(r,(function(e,t){var r=n[t];i[null!=r?r:YP]=e})):i[YP]=r,r=rO(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(i):qP(i,!0):(di("linear"!==n||i.dataExtent),qP(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return jr(this._normalizeData,this)},e.listVisualTypes=function(){return Xr(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){Qr(e)?Fr(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=Zr(t)?[]:Qr(t)?{}:(i=!0,null);return e.eachVisual(t,(function(e,t){var a=n.call(r,e,t);i?o=a:o[t]=a})),o},e.retrieveVisuals=function(t){var n,r={};return t&&XP(e.visualHandlers,(function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)})),n?r:null},e.prepareVisualTypes=function(e){if(Zr(e))e=e.slice();else{if(!jP(e))return[];var t=[];XP(e,(function(e,n){t.push(n)})),e=t}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},e.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||Kr(s)&&s===e+"")return o;n&&h(s,o)}}for(o=0,a=t.length;o<a;o++){var l=t[o],u=l.interval,c=l.close;if(u){if(u[0]===-1/0){if(oO(c[1],e,u[1]))return o}else if(u[1]===1/0){if(oO(c[0],u[0],e))return o}else if(oO(c[0],u[0],e)&&oO(c[1],e,u[1]))return o;n&&h(u[0],o),n&&h(u[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function h(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:JP("color"),getColorMapper:function(){var e=this.option;return jr("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),QP.call(this,e)}:function(t,n,r){var i=!!r;return!n&&(t=this._normalizeData(t)),r=ss(t,e.parsedVisual,r),i?r:ps(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return ps(ss(e,this.option.parsedVisual),"rgba")},category:QP,piecewise:function(e,t){var n=nO.call(this,t);return null==n&&(n=ps(ss(e,this.option.parsedVisual),"rgba")),n},fixed:eO}},colorHue:KP((function(e,t){return hs(e,t)})),colorSaturation:KP((function(e,t){return hs(e,null,t)})),colorLightness:KP((function(e,t){return hs(e,null,null,t)})),colorAlpha:KP((function(e,t){return ds(e,t)})),decal:{applyVisual:JP("decal"),_normalizedToVisual:{linear:null,category:QP,piecewise:null,fixed:null}},opacity:{applyVisual:JP("opacity"),_normalizedToVisual:tO([0,1])},liftZ:{applyVisual:JP("liftZ"),_normalizedToVisual:{linear:eO,category:eO,piecewise:eO,fixed:eO}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:$P,category:QP,piecewise:function(e,t){var n=nO.call(this,t);return null==n&&(n=$P.call(this,e)),n},fixed:eO}},symbolSize:{applyVisual:JP("symbolSize"),_normalizedToVisual:tO([0,1])}},e}();function qP(e,t){var n=e.visual,r=[];Qr(n)?XP(n,(function(e){r.push(e)})):null!=n&&r.push(n);t||1!==r.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(r[1]=r[0]),rO(e,r)}function KP(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:tO([0,1])}}function $P(e){var t=this.option.visual;return t[Math.round(lu(e,[0,1],[0,t.length-1],!0))]||{}}function JP(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function QP(e){var t=this.option.visual;return t[this.option.loop&&e!==YP?e%t.length:e]}function eO(){return this.option.visual[0]}function tO(e){return{linear:function(t){return lu(t,e,this.option.visual,!0)},category:QP,piecewise:function(t,n){var r=nO.call(this,n);return null==r&&(r=lu(t,e,this.option.visual,!0)),r},fixed:eO}}function nO(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[ZP.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function rO(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=Gr(t,(function(e){var t=is(e);return t||"production"===process.env.NODE_ENV||ku("'"+e+"' is an illegal color, fallback to '#000000'",!0),t||[0,0,0,1]}))),t}var iO={linear:function(e){return lu(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=ZP.findPieceIndex(e,t,!0);if(null!=n)return lu(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?YP:t},fixed:Mi};function oO(e,t,n){return e?t<=n:t<n}var aO=oc(),sO={seriesType:"treemap",reset:function(e){var t=e.getData().tree.root;t.isRemoved()||lO(t,{},e.getViewRoot().getAncestors(),e)}};function lO(e,t,n,r){var i=e.getModel(),o=e.getLayout(),a=e.hostTree.data;if(o&&!o.invisible&&o.isInView){var s,l=i.getModel("itemStyle"),u=function(e,t,n){var r=Pr({},t),i=n.designatedVisualItemStyle;return Fr(["color","colorAlpha","colorSaturation"],(function(n){i[n]=t[n];var o=e.get(n);i[n]=null,null!=o&&(r[n]=o)})),r}(l,t,r),c=a.ensureUniqueItemVisual(e.dataIndex,"style"),h=l.get("borderColor"),d=l.get("borderColorSaturation");null!=d&&(h=function(e,t){return null!=t?hs(t,null,null,e):null}(d,s=uO(u))),c.stroke=h;var p=e.viewChildren;if(p&&p.length){var f=function(e,t,n,r,i,o){if(!o||!o.length)return;var a=hO(t,"color")||null!=i.color&&"none"!==i.color&&(hO(t,"colorAlpha")||hO(t,"colorSaturation"));if(!a)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:a.name,dataExtent:u,visual:a.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var d=new ZP(h);return aO(d).drColorMappingBy=c,d}(0,i,o,0,u,p);Fr(p,(function(e,t){if(e.depth>=n.length||e===n[e.depth]){var o=function(e,t,n,r,i,o){var a=Pr({},t);if(i){var s=i.type,l="color"===s&&aO(i).drColorMappingBy,u="index"===l?r:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));a[s]=i.mapValueToVisual(u)}return a}(i,u,e,t,f,r);lO(e,o,n,r)}}))}else s=uO(u),c.fill=s}}function uO(e){var t=cO(e,"color");if(t){var n=cO(e,"colorAlpha"),r=cO(e,"colorSaturation");return r&&(t=hs(t,null,null,r)),n&&(t=ds(t,n)),t}}function cO(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function hO(e,t){var n=e.get(t);return Zr(n)&&n.length?{name:t,range:n}:null}var dO=Math.max,pO=Math.min,fO=si,gO=Fr,mO=["itemStyle","borderWidth"],vO=["itemStyle","gapWidth"],yO=["upperLabel","show"],_O=["upperLabel","height"],xO={seriesType:"treemap",reset:function(e,t,n,r){var i=n.getWidth(),o=n.getHeight(),a=e.option,s=Tv(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=uu(fO(s.width,l[0]),i),c=uu(fO(s.height,l[1]),o),h=r&&r.type,d=yP(r,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===h||"treemapMove"===h?r.rootRect:null,f=e.getViewRoot(),g=_P(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?function(e,t,n,r,i){var o,a=(t||{}).node,s=[r,i];if(!a||a===n)return s;var l=r*i,u=l*e.option.zoomToNodeRatio;for(;o=a.parentNode;){for(var c=0,h=o.children,d=0,p=h.length;d<p;d++)c+=h[d].getValue();var f=a.getValue();if(0===f)return s;u*=c/f;var g=o.getModel(),m=g.get(mO);(u+=4*m*m+(3*m+Math.max(m,MO(g)))*Math.pow(u,.5))>vu&&(u=vu),a=o}u<l&&(u=l);var v=Math.pow(u/l,.5);return[r*v,i*v]}(e,d,f,u,c):p?[p.width,p.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),bO(f,y,!1,0),_=f.getLayout(),gO(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(Pr({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(function(e,t,n){if(t)return{x:t.x,y:t.y};var r={x:0,y:0};if(!n)return r;var i=n.node,o=i.getLayout();if(!o)return r;var a=[o.width/2,o.height/2],s=i;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:e.width/2-a[0],y:e.height/2-a[1]}}(s,p,d),!0),e.setLayoutInfo(s),TO(x,new Uo(-s.x,-s.y,i,o),g,f,0)}};function bO(e,t,n,r){var i,o;if(!e.isRemoved()){var a=e.getLayout();i=a.width,o=a.height;var s=e.getModel(),l=s.get(mO),u=s.get(vO)/2,c=MO(s),h=Math.max(l,c),d=l-u,p=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(i=dO(i-2*d,0))*(o=dO(o-d-p,0)),g=function(e,t,n,r,i,o){var a=e.children||[],s=r.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=r.leafDepth&&r.leafDepth<=o;if(i&&!l)return e.viewChildren=[];a=Ur(a,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,n){var r="asc"===t?e.getValue()-n.getValue():n.getValue()-e.getValue();return 0===r?"asc"===t?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:r}))}(a,s);var u=function(e,t,n){for(var r=0,i=0,o=t.length;i<o;i++)r+=t[i].getValue();var a,s=e.get("visualDimension");t&&t.length?"value"===s&&n?(a=[t[t.length-1].getValue(),t[0].getValue()],"asc"===n&&a.reverse()):(a=[1/0,-1/0],gO(t,(function(e){var t=e.getValue(s);t<a[0]&&(a[0]=t),t>a[1]&&(a[1]=t)}))):a=[NaN,NaN];return{sum:r,dataExtent:a}}(t,a,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,n,r,i){if(!r)return n;for(var o=e.get("visibleMin"),a=i.length,s=a,l=a-1;l>=0;l--){var u=i["asc"===r?a-l-1:l].getValue();u/n*t<o&&(s=l,n-=u)}return"asc"===r?i.splice(0,a-s):i.splice(s,a-s),n}(t,n,u.sum,s,a),0===u.sum)return e.viewChildren=[];for(var c=0,h=a.length;c<h;c++){var d=a[c].getValue()/u.sum*n;a[c].setLayout({area:d})}l&&(a.length&&e.setLayout({isLeafRoot:!0},!0),a.length=0);return e.viewChildren=a,e.setLayout({dataExtent:u.dataExtent},!0),a}(e,s,f,t,n,r);if(g.length){var m={x:d,y:p,width:i,height:o},v=pO(i,o),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var S=wO(_,v,t.squareRatio);S<=y?(x++,y=S):(_.area-=_.pop().getLayout().area,SO(_,v,m,u,!1),v=pO(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&SO(_,v,m,u,!0),!n){var T=s.get("childrenVisibleMin");null!=T&&f<T&&(n=!0)}for(x=0,b=g.length;x<b;x++)bO(g[x],t,n,r+1)}}}function wO(e,t,n){for(var r=0,i=1/0,o=0,a=void 0,s=e.length;o<s;o++)(a=e[o].getLayout().area)&&(a<i&&(i=a),a>r&&(r=a));var l=e.area*e.area,u=t*t*n;return l?dO(u*r/l,l/(u*i)):1/0}function SO(e,t,n,r,i){var o=t===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=t?e.area/t:0;(i||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,d=e.length;h<d;h++){var p=e[h],f={},g=c?p.getLayout().area/c:0,m=f[l[a]]=dO(c-2*r,0),v=n[s[o]]+n[l[o]]-u,y=h===d-1||v<g?v:g,_=f[l[o]]=dO(y-2*r,0);f[s[a]]=n[s[a]]+pO(r,m/2),f[s[o]]=u+pO(r,_/2),u+=y,p.setLayout(f,!0)}n[s[a]]+=c,n[l[a]]-=c}function TO(e,t,n,r,i){var o=e.getLayout(),a=n[i],s=a&&a===e;if(!(a&&!s||i===n.length&&e!==r)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(o),isAboveViewRoot:s},!0);var l=new Uo(t.x-o.x,t.y-o.y,t.width,t.height);gO(e.viewChildren||[],(function(e){TO(e,l,n,r,i+1)}))}}function MO(e){return e.get(yO)?e.get(_O):0}function AO(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getGraph().data,i=n.mapArray(n.getName);r.filterSelf((function(e){var n=r.getItemModel(e).getShallow("category");if(null!=n){Jr(n)&&(n=i[n]);for(var o=0;o<t.length;o++)if(!t[o].isSelected(n))return!1}return!0}))}))}function CO(e){var t={};e.eachSeriesByType("graph",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=a.getShallow(l[u],!0);null!=c&&n.setItemVisual(r,l[u],c)}})),n.count()&&r.each((function(e){var t=r.getItemModel(e).getShallow("category");if(null!=t){Kr(t)&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");Pr(r.ensureUniqueItemVisual(e,"style"),o);for(var a=["symbol","symbolSize","symbolKeepAspect"],s=0;s<a.length;s++)r.setItemVisual(e,a[s],n.getItemVisual(t,a[s]))}}))}))}function DO(e){return e instanceof Array||(e=[e,e]),e}function EO(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=DO(e.get("edgeSymbol")),i=DO(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=DO(r.getShallow("symbol",!0)),a=DO(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(Pr(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))}var IO="--\x3e",LO=function(e){return e.get("autoCurveness")||null},NO=function(e,t){var n=LO(e),r=20,i=[];if(Jr(n))r=n;else if(Zr(n))return void(e.__curvenessList=n);t>r&&(r=t);var o=r%2?r+2:r+3;i=[];for(var a=0;a<o;a++)i.push((a%2?a+1:a)/10*(a%2?-1:1));e.__curvenessList=i},PO=function(e,t,n){var r=[e.id,e.dataIndex].join("."),i=[t.id,t.dataIndex].join(".");return[n.uid,r,i].join(IO)},OO=function(e){var t=e.split(IO);return[t[0],t[2],t[1]].join(IO)},RO=function(e,t){var n=PO(e.node1,e.node2,t);return t.__edgeMap[n]},kO=function(e,t){return zO(PO(e.node1,e.node2,t),t)+zO(PO(e.node2,e.node1,t),t)},zO=function(e,t){var n=t.__edgeMap;return n[e]?n[e].length:0};function BO(e,t,n,r){var i=LO(t),o=Zr(i);if(!i)return null;var a=RO(e,t);if(!a)return null;for(var s=-1,l=0;l<a.length;l++)if(a[l]===n){s=l;break}var u=kO(e,t);NO(t,u),e.lineStyle=e.lineStyle||{};var c=PO(e.node1,e.node2,t),h=t.__curvenessList,d=o||u%2?0:1;if(a.isForward)return h[d+s];var p=OO(c),f=zO(p,t),g=h[s+f+d];return r?o?i&&0===i[0]?(f+d)%2?g:-g:((f%2?0:1)+d)%2?g:-g:(f+d)%2?g:-g:h[s+f+d]}function VO(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var n=e.getGraph();n.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),FO(n,e)}}function FO(e,t){e.eachEdge((function(e,n){var r=ui(e.getModel().get(["lineStyle","curveness"]),-BO(e,t,n,!0),0),i=Ii(e.node1.getLayout()),o=Ii(e.node2.getLayout()),a=[i,o];+r&&a.push([(i[0]+o[0])/2-(i[1]-o[1])*r,(i[1]+o[1])/2-(o[0]-i[0])*r]),e.setLayout(a)}))}function GO(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),n=e.coordinateSystem;if(n&&"view"!==n.type){var r=e.getData(),i=[];Fr(n.dimensions,(function(e){i=i.concat(r.mapDimensionsAll(e))}));for(var o=0;o<r.count();o++){for(var a=[],s=!1,l=0;l<i.length;l++){var u=r.get(i[l],o);isNaN(u)||(s=!0),a.push(u)}s?r.setItemLayout(o,n.dataToPoint(a)):r.setItemLayout(o,[NaN,NaN])}FO(r.graph,e)}else t&&"none"!==t||VO(e)}))}function HO(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,r=t.scaleX;return((t.getZoom()-1)*n+1)/r}function UO(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var WO=Math.PI,XO=[];function jO(e,t,n,r){var i=e.coordinateSystem;if(!i||"view"===i.type){var o=i.getBoundingRect(),a=e.getData(),s=a.graph,l=o.width/2+o.x,u=o.height/2+o.y,c=Math.min(o.width,o.height)/2,h=a.count();if(a.setLayout({cx:l,cy:u}),h){if(n){var d=i.pointToData(r),p=d[0],f=d[1],g=[p-l,f-u];Fi(g,g),Vi(g,g,c),n.setLayout([l+g[0],u+g[1]],!0),ZO(n,e.get(["circular","rotateLabel"]),l,u)}YO[t](e,s,a,c,l,u,h),s.eachEdge((function(t,n){var r,i=ui(t.getModel().get(["lineStyle","curveness"]),BO(t,e,n),0),o=Ii(t.node1.getLayout()),a=Ii(t.node2.getLayout()),s=(o[0]+a[0])/2,c=(o[1]+a[1])/2;+i&&(r=[l*(i*=3)+s*(1-i),u*i+c*(1-i)]),t.setLayout([o,a,r])}))}}}var YO={value:function(e,t,n,r,i,o,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);t.eachNode((function(e){var t=e.getValue("value"),n=u*(l?t:1)/2;s+=n,e.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+o]),s+=n}))},symbolSize:function(e,t,n,r,i,o,a){var s=0;XO.length=a;var l=HO(e);t.eachNode((function(e){var t=UO(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var n=Math.asin(t/2/r);isNaN(n)&&(n=WO/2),XO[e.dataIndex]=n,s+=2*n}));var u=(2*WO-s)/a/2,c=0;t.eachNode((function(e){var t=u+XO[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([r*Math.cos(c)+i,r*Math.sin(c)+o]),c+=t}))}};function ZO(e,t,n,r){var i=e.getGraphicEl();if(i){var o=e.getModel().get(["label","rotate"])||0,a=i.getSymbolPath();if(t){var s=e.getLayout(),l=Math.atan2(s[1]-r,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var c=u?"left":"right";a.setTextConfig({rotation:-l,position:c,origin:"center"});var h=a.ensureState("emphasis");Pr(h.textConfig||(h.textConfig={}),{position:c})}else a.setTextConfig({rotation:o*=Math.PI/180})}}function qO(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&jO(e,"symbolSize")}))}var KO=Pi;function $O(e){e.eachSeriesByType("graph",(function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var n=e.preservedPoints||{},r=e.getGraph(),i=r.data,o=r.edgeData,a=e.getModel("force"),s=a.get("initLayout");e.preservedPoints?i.each((function(e){var t=i.getId(e);i.setItemLayout(e,n[t]||[NaN,NaN])})):s&&"none"!==s?"circular"===s&&jO(e,"value"):VO(e);var l=i.getDataExtent("value"),u=o.getDataExtent("value"),c=a.get("repulsion"),h=a.get("edgeLength"),d=Zr(c)?c:[c,c],p=Zr(h)?h:[h,h];p=[p[1],p[0]];var f=i.mapArray("value",(function(e,t){var n=i.getItemLayout(t),r=lu(e,l,d);return isNaN(r)&&(r=(d[0]+d[1])/2),{w:r,rep:r,fixed:i.getItemModel(t).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),g=o.mapArray("value",(function(t,n){var i=r.getEdgeByIndex(n),o=lu(t,u,p);isNaN(o)&&(o=(p[0]+p[1])/2);var a=i.getModel(),s=ui(i.getModel().get(["lineStyle","curveness"]),-BO(i,e,n,!0),0);return{n1:f[i.node1.dataIndex],n2:f[i.node2.dataIndex],d:o,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}})),m=t.getBoundingRect(),v=function(e,t,n){for(var r=e,i=t,o=n.rect,a=o.width,s=o.height,l=[o.x+a/2,o.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<r.length;c++){var h=r[c];h.p||(h.p=Di(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=Ii(h.p),h.edges=null}var d,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(e){r[e].fixed=!0},setUnfixed:function(e){r[e].fixed=!1},beforeStep:function(e){d=e},afterStep:function(e){p=e},step:function(e){d&&d(r,i);for(var t=[],n=r.length,o=0;o<i.length;o++){var a=i[o];if(!a.ignoreForceLayout){var s=a.n1;Oi(t,(m=a.n2).p,s.p);var c=Ri(t)-a.d,h=m.w/(s.w+m.w);isNaN(h)&&(h=0),Fi(t,t),!s.fixed&&KO(s.p,s.p,t,h*c*g),!m.fixed&&KO(m.p,m.p,t,-(1-h)*c*g)}}for(o=0;o<n;o++)(_=r[o]).fixed||(Oi(t,l,_.p),KO(_.p,_.p,t,u*g));for(o=0;o<n;o++){s=r[o];for(var f=o+1;f<n;f++){var m;Oi(t,(m=r[f]).p,s.p),0===(c=Ri(t))&&(Li(t,Math.random()-.5,Math.random()-.5),c=1);var v=(s.rep+m.rep)/c/c;!s.fixed&&KO(s.pp,s.pp,t,v),!m.fixed&&KO(m.pp,m.pp,t,-v)}}var y=[];for(o=0;o<n;o++){var _;(_=r[o]).fixed||(Oi(y,_.p,_.pp),KO(_.p,_.p,y,g),Ei(_.pp,_.p))}var x=(g*=.992)<.01;p&&p(r,i,x),e&&e(x)}}}(f,g,{rect:m,gravity:a.get("gravity"),friction:a.get("friction")});v.beforeStep((function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].fixed&&Ei(e[n].p,r.getNodeByIndex(n).getLayout())})),v.afterStep((function(e,t,o){for(var a=0,s=e.length;a<s;a++)e[a].fixed||r.getNodeByIndex(a).setLayout(e[a].p),n[i.getId(a)]=e[a].p;for(a=0,s=t.length;a<s;a++){var l=t[a],u=r.getEdgeByIndex(a),c=l.n1.p,h=l.n2.p,d=u.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],Ei(d[0],c),Ei(d[1],h),+l.curveness&&(d[2]=[(c[0]+h[0])/2-(c[1]-h[1])*l.curveness,(c[1]+h[1])/2-(h[0]-c[0])*l.curveness]),u.setLayout(d)}})),e.forceLayout=v,e.preservedPoints=n,v.step()}else e.forceLayout=null}))}function JO(e,t){var n=[];return e.eachSeriesByType("graph",(function(e){var r=e.get("coordinateSystem");if(!r||"view"===r){var i=e.getData(),o=[],a=[];lh(i.mapArray((function(e){var t=i.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o,a),a[0]-o[0]==0&&(a[0]+=1,o[0]-=1),a[1]-o[1]==0&&(a[1]+=1,o[1]-=1);var s=(a[0]-o[0])/(a[1]-o[1]),l=function(e,t,n){return Tv(Pr(e.getBoxLayoutParams(),{aspect:n}),{width:t.getWidth(),height:t.getHeight()})}(e,t,s);isNaN(s)&&(o=[l.x,l.y],a=[l.x+l.width,l.y+l.height]);var u=a[0]-o[0],c=a[1]-o[1],h=l.width,d=l.height,p=e.coordinateSystem=new CN;p.zoomLimit=e.get("scaleLimit"),p.setBoundingRect(o[0],o[1],u,c),p.setViewRect(l.x,l.y,h,d),p.setCenter(e.get("center"),t),p.setZoom(e.get("zoom")),n.push(p)}})),n}var QO=Rf.prototype,eR=Ff.prototype,tR=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function nR(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}g(t,e)}(tR);var rR=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return g(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new tR},t.prototype.buildPath=function(e,t){nR(t)?QO.buildPath.call(this,e,t):eR.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return nR(this.shape)?QO.pointAt.call(this,e):eR.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=nR(t)?[t.x2-t.x1,t.y2-t.y1]:eR.tangentAt.call(this,e);return Fi(n,n)},t}(ed),iR=["fromSymbol","toSymbol"];function oR(e){return"_"+e+"Type"}function aR(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=Xb(i);return r+l+jb(a||0,l)+(o||"")+(s||"")}function sR(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=Xb(i),u=jb(a||0,l),c=Wb(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=e,c}}function lR(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var uR=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return g(t,e),t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=function(e){var t=new rR({name:"line",subPixelOptimize:!0});return lR(t.shape,e),t}(e.getItemLayout(t));i.shape.percent=0,cg(i,{shape:{percent:1}},r,t),this.add(i),Fr(iR,(function(n){var r=sR(n,e,t);this.add(r),this[oR(n)]=aR(n,e,t)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};lR(a.shape,o),ug(i,a,r,t),Fr(iR,(function(n){var r=aR(n,e,t),i=oR(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=sR(n,e,t);this.add(o)}this[i]=r}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),h=p.get("blurScope"),l=Kg(d)}var f=e.getItemVisual(t,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,Fr(iR,(function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<Fd.length;n++){var r=Fd[n],o=i.getState(r);if(o){var a=o.style||{},s=t.ensureState(r),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}}),this);var m=r.getRawValue(t);qg(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?cu(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var _=y.get("distance");Zr(_)||(_=[_,_]),v.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),Tp(this,c,h,u)},t.prototype.highlight=function(){cp(this)},t.prototype.downplay=function(){hp(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");lR(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),n=e.childOfName("toSymbol"),r=e.getTextContent();if(t||n||r&&!r.ignore){for(var i=1,o=this.parent;o;)o.scaleX&&(i/=o.scaleX),o=o.parent;var a=e.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=Oi([],u,l);if(Fi(c,c),t&&(t.setPosition(l),S(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(u),S(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var h=void 0,d=void 0,p=r.__labelDistance,f=p[0]*i,g=p[1]*i,m=s/2,v=a.tangentAt(m),y=[v[1],-v[0]],_=a.pointAt(m);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if("start"!==r.__position&&"end"!==r.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),r.rotation=b}var w=void 0;switch(r.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-g,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=g,d="top";break;default:w=0,d="middle"}switch(r.__position){case"end":r.x=c[0]*f+u[0],r.y=c[1]*g+u[1],h=c[0]>.8?"left":c[0]<-.8?"right":"center",d=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":r.x=-c[0]*f+l[0],r.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",d=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":r.x=f*x+l[0],r.y=l[1]+w,h=v[0]<0?"right":"left",r.originX=-f*x,r.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":r.x=_[0],r.y=_[1]+w,h="center",r.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":r.x=-f*x+u[0],r.y=u[1]+w,h=v[0]>=0?"right":"left",r.originX=f*x,r.originY=-w}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||d,align:r.__align||h})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=a.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(Kl),cR=function(){function e(e){this.group=new Kl,this._LineCtor=e||uR}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var o=hR(e);e.diff(i).add((function(n){t._doAdd(e,n,o)})).update((function(n,r){t._doUpdate(i,e,r,n,o)})).remove((function(e){r.remove(i.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=hR(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var r=e.start;r<e.end;r++){if(pR(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(pR(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);pR(t.getItemLayout(r))?(o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},e}();function hR(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:Kg(t)}}function dR(e){return isNaN(e[0])||isNaN(e[1])}function pR(e){return e&&!dR(e[0])&&!dR(e[1])}var fR=[],gR=[],mR=[],vR=Oa,yR=Wi,_R=Math.abs;function xR(e,t,n){for(var r,i=e[0],o=e[1],a=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){fR[0]=vR(i[0],o[0],a[0],c),fR[1]=vR(i[1],o[1],a[1],c),(p=_R(yR(fR,t)-l))<s&&(s=p,r=c)}for(var h=0;h<32;h++){var d=r+u;gR[0]=vR(i[0],o[0],a[0],r),gR[1]=vR(i[1],o[1],a[1],r),mR[0]=vR(i[0],o[0],a[0],d),mR[1]=vR(i[1],o[1],a[1],d);var p=yR(gR,t)-l;if(_R(p)<.01)break;var f=yR(mR,t)-l;u/=2,p<0?f>=0?r+=u:r-=u:f>=0?r-=u:r+=u}return r}function bR(e,t){var n=[],r=za,i=[[],[],[]],o=[[],[]],a=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[Ii(l[0]),Ii(l[1])],l[2]&&l.__original.push(Ii(l[2])));var h=l.__original;if(null!=l[2]){if(Ei(i[0],h[0]),Ei(i[1],h[2]),Ei(i[2],h[1]),u&&"none"!==u){var d=UO(e.node1),p=xR(i,h[0],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(c&&"none"!==c){d=UO(e.node2),p=xR(i,h[1],d*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}Ei(l[0],i[0]),Ei(l[1],i[2]),Ei(l[2],i[1])}else{if(Ei(o[0],h[0]),Ei(o[1],h[1]),Oi(a,o[1],o[0]),Fi(a,a),u&&"none"!==u){d=UO(e.node1);Pi(o[0],o[0],a,d*t)}if(c&&"none"!==c){d=UO(e.node2);Pi(o[1],o[1],a,-d*t)}Ei(l[0],o[0]),Ei(l[1],o[1])}}))}function wR(e){return"view"===e.type}var SR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t){var n=new kD,r=new cR,i=this.group;this._controller=new yL(t.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(r.group),this._symbolDraw=n,this._lineDraw=r,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem;this._model=e;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(wR(i)){var l={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(l):ug(s,l,e)}bR(e.getGraph(),HO(e));var u=e.getData();o.updateData(u);var c=e.getEdgeData();a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,d=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,d);var p=e.get("layout");u.graph.eachNode((function(t){var n=t.dataIndex,i=t.getGraphicEl(),o=t.getModel();if(i){i.off("drag").off("dragend");var a=o.get("draggable");a&&i.on("drag",(function(o){switch(p){case"force":h.warmUp(),!r._layouting&&r._startForceLayoutIteration(h,d),h.setFixed(n),u.setItemLayout(n,[i.x,i.y]);break;case"circular":u.setItemLayout(n,[i.x,i.y]),t.setLayout({fixed:!0},!0),jO(e,"symbolSize",t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(n,[i.x,i.y]),FO(e.getGraph(),e),r.updateLayout(e)}})).on("dragend",(function(){h&&h.setUnfixed(n)})),i.setDraggable(a,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(Ld(i).focus=t.getAdjacentDataIndices())}})),u.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(Ld(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var f="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),g=u.getLayout("cx"),m=u.getLayout("cy");u.graph.eachNode((function(e){ZO(e,f,g,m)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function r(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(r,16):r())}))}()},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,o=this._controllerHost,a=this.group;i.setPointerChecker((function(t,r,i){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(r,i)&&!AL(t,n,e)})),wR(e.coordinateSystem)?(i.enable(e.get("roam")),o.zoomLimit=e.get("scaleLimit"),o.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",(function(t){wL(o,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){SL(o,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(),bR(e.getGraph(),HO(e)),r._lineDraw.updateLayout(),n.updateLabelLayout()}))):i.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=HO(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){bR(e.getGraph(),HO(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(zx);function TR(e){return"_EC_"+e}var MR=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[TR(e)]){var r=new AR(e,t);return r.hostGraph=this,this.nodes.push(r),n[TR(e)]=r,r}"production"!==process.env.NODE_ENV&&console.error("Graph nodes have duplicate name or id")},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[TR(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(Jr(e)&&(e=this.nodes[e]),Jr(t)&&(t=this.nodes[t]),e instanceof AR||(e=r[TR(e)]),t instanceof AR||(t=r[TR(t)]),e&&t){var o=e.id+"-"+t.id,a=new CR(e,t,n);return a.hostGraph=this,this._directed&&(e.outEdges.push(a),t.inEdges.push(a)),e.edges.push(a),e!==t&&t.edges.push(a),this.edges.push(a),i[o]=a,a}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof AR&&(e=e.id),t instanceof AR&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof AR||(t=this._nodesMap[TR(t)]),t){for(var i="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(r,t,null))for(var a=[t];a.length;){var s=a.shift(),l=s[i];for(o=0;o<l.length;o++){var u=l[o],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(e.call(r,c,s))return;a.push(c),c.__visited=!0}}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,r=this.edges,i=0,o=n.length;i<o;i++)n[i].dataIndex=-1;for(i=0,o=e.count();i<o;i++)n[e.getRawIndex(i)].dataIndex=i;t.filterSelf((function(e){var n=r[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));for(i=0,o=r.length;i<o;i++)r[i].dataIndex=-1;for(i=0,o=t.count();i<o;i++)r[t.getRawIndex(i)].dataIndex=i},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)t.addNode(n[i].id,n[i].dataIndex);for(i=0;i<r.length;i++){var o=r[i];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},e}(),AR=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==e?"":e,this.dataIndex=null==t?-1:t}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var n=this.edges[t];n.dataIndex<0||(e.edge.push(n.dataIndex),e.node.push(n.node1.dataIndex,n.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=xi(),t=xi(),n=0;n<this.edges.length;n++){var r=this.edges[n];if(!(r.dataIndex<0)){e.set(r.dataIndex,!0);for(var i=[r.node1],o=[r.node2],a=0;a<i.length;){var s=i[a];a++,t.set(s.dataIndex,!0);for(var l=0;l<s.inEdges.length;l++)e.set(s.inEdges[l].dataIndex,!0),i.push(s.inEdges[l].node1)}for(a=0;a<o.length;){var u=o[a];a++,t.set(u.dataIndex,!0);for(l=0;l<u.outEdges.length;l++)e.set(u.outEdges[l].dataIndex,!0),o.push(u.outEdges[l].node2)}}}return{edge:e.keys(),node:t.keys()}},e}(),CR=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=null==n?-1:n}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=xi(),t=xi();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var o=n[i];i++,t.set(o.dataIndex,!0);for(var a=0;a<o.inEdges.length;a++)e.set(o.inEdges[a].dataIndex,!0),n.push(o.inEdges[a].node1)}for(i=0;i<r.length;){var s=r[i];i++,t.set(s.dataIndex,!0);for(a=0;a<s.outEdges.length;a++)e.set(s.outEdges[a].dataIndex,!0),r.push(s.outEdges[a].node2)}return{edge:e.keys(),node:t.keys()}},e}();function DR(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function ER(e,t,n,r,i){for(var o=new MR(r),a=0;a<e.length;a++)o.addNode(si(e[a].id,e[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<t.length;a++){var c=t[a],h=c.source,d=c.target;o.addEdge(h,d,u)&&(l.push(c),s.push(si(Qu(c.id,null),h+" > "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=DT(e,n);else{var g=yy.get(f),m=g&&g.dimensions||[];kr(m,"value")<0&&m.concat(["value"]);var v=xT(e,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(p=new yT(v,n)).initData(e)}var y=new yT(["value"],n);return y.initData(l,s),i&&i(p,y),lP({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}Br(AR,DR("hostGraph","data")),Br(CR,DR("hostGraph","edgeData"));var IR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return g(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new JE(r,r),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),ju(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n,r=e.edges||e.links||[],i=e.data||e.nodes||[],o=this;if(i&&r){LO(n=this)&&(n.__curvenessList=[],n.__edgeMap={},NO(n));var a=ER(i,r,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=xm.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=i,r}function i(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=i,e.getModel=r,e}))}));return Fr(a.edges,(function(e){!function(e,t,n,r){if(LO(n)){var i=PO(e,t,n),o=n.__edgeMap,a=o[OO(i)];o[i]&&!a?o[i].isForward=!0:a&&o[i]&&(a.isForward=!0,o[i].isForward=!1),o[i]=o[i]||[],o[i].push(r)}}(e.node1,e.node2,this,e.dataIndex)}),this),a.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),ex("nameValue",{name:l.join(" > "),value:i.value,noValue:null==i.value})}return dx({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=Gr(this.option.categories||[],(function(e){return null!=e.value?e:Pr({value:0},e)})),t=new yT(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Mx),LR={type:"graphRoam",event:"graphRoam",update:"none"};var NR=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},PR=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return g(t,e),t.prototype.getDefaultShape=function(){return new NR},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=i/3?1:2),l=t.y-r(a)*o*(o>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+r(a)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(a)*o,t.y-r(a)*o),e.lineTo(s,l)},t}(ed);function OR(e,t){var n=null==e?"":e+"";return t&&(Kr(t)?n=t.replace("{value}",n):qr(t)&&(n=t(e))),n}var RR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get(["axisLine","lineStyle","color"]),i=function(e,t){var n=e.get("center"),r=t.getWidth(),i=t.getHeight(),o=Math.min(r,i);return{cx:uu(n[0],t.getWidth()),cy:uu(n[1],t.getHeight()),r:uu(e.get("radius"),o/2)}}(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?mE:bf,h=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];Nh(f,!a);for(var g=(l=f[1])-(s=f[0]),m=s,v=[],y=0;h&&y<r.length;y++){var _=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});_.setStyle({fill:r[y][1]}),_.setStyle(d.getLineStyle(["color","width"])),v.push(_),m=l}v.reverse(),Fr(v,(function(e){return o.add(e)}));var x=function(e){if(e<=0)return r[0][1];var t;for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,l,a,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,r,i,o,a,s,l){for(var u,c,h=this.group,d=i.cx,p=i.cy,f=i.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),_=e.getModel("axisLabel"),x=e.get("splitNumber"),b=y.get("splitNumber"),w=uu(v.get("length"),f),S=uu(y.get("length"),f),T=o,M=(a-o)/x,A=M/b,C=v.getModel("lineStyle").getLineStyle(),D=y.getModel("lineStyle").getLineStyle(),E=v.get("distance"),I=0;I<=x;I++){if(u=Math.cos(T),c=Math.sin(T),v.get("show")){var L=new Rf({shape:{x1:u*(f-(N=E?E+l:l))+d,y1:c*(f-N)+p,x2:u*(f-w-N)+d,y2:c*(f-w-N)+p},style:C,silent:!0});"auto"===C.stroke&&L.setStyle({stroke:r(I/x)}),h.add(L)}if(_.get("show")){var N=_.get("distance")+E,P=OR(cu(I/x*(m-g)+g),_.get("formatter")),O=r(I/x),R=u*(f-w-N)+d,k=c*(f-w-N)+p,z=_.get("rotate"),B=0;"radial"===z?(B=-T+2*Math.PI)>Math.PI/2&&(B+=Math.PI):"tangential"===z?B=-T-Math.PI/2:Jr(z)&&(B=z*Math.PI/180),0===B?h.add(new Id({style:$g(_,{text:P,x:R,y:k,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new Id({style:$g(_,{text:P,x:R,y:k,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:R,originY:k,rotation:B}))}if(y.get("show")&&I!==x){N=(N=y.get("distance"))?N+l:l;for(var V=0;V<=b;V++){u=Math.cos(T),c=Math.sin(T);var F=new Rf({shape:{x1:u*(f-N)+d,y1:c*(f-N)+p,x2:u*(f-S-N)+d,y2:c*(f-S-N)+p},silent:!0,style:D});"auto"===D.stroke&&F.setStyle({stroke:r((I+V/b)/x)}),h.add(F),T+=A}T-=A}else T+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,d=[],p=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),_=+e.get("max"),x=[y,_],b=[o,a];function w(t,n){var r,o=m.getItemModel(t).getModel("pointer"),a=uu(o.get("width"),i.r),s=uu(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=uu(u[0],i.r),h=uu(u[1],i.r),d=o.get("keepAspect");return(r=l?Wb(l,c-a/2,h-s,a,s,null,d):new PR({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:h}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function S(e,t){var n=f.get("roundCap")?mE:bf,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(e+1)*a,c=r?i.r:i.r-e*a,h=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:c}});return r&&(h.z2=_-m.get(v,e)%_),h}(g||p)&&(m.diff(c).add((function(t){var n=m.get(v,t);if(p){var r=w(t,o);cg(r,{rotation:-((isNaN(+n)?b[0]:lu(n,x,b,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=S(t,o),a=f.get("clip");cg(i,{shape:{endAngle:lu(n,x,b,a)}},e),u.add(i),Nd(e.seriesIndex,m.dataType,t,i),d[t]=i}})).update((function(t,n){var r=m.get(v,t);if(p){var i=c.getItemGraphicEl(n),a=i?i.rotation:o,s=w(t,a);s.rotation=a,ug(s,{rotation:-((isNaN(+r)?b[0]:lu(r,x,b,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=h[n],y=S(t,l?l.shape.endAngle:o),_=f.get("clip");ug(y,{shape:{endAngle:lu(r,x,b,_)}},e),u.add(y),Nd(e.seriesIndex,m.dataType,t,y),d[t]=y}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof ad){var c=s.style;s.useStyle(Pr({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",r(lu(m.get(v,e),x,[0,1],!0))),s.z2EmphasisLift=0,Dp(s,t),Tp(s,i,o,a)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,Dp(h,t),Tp(h,i,o,a)}})),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=Wb(i,t.cx-r/2+uu(o[0],t.r),t.cy-r/2+uu(o[1],t.r),r,r,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Kl,h=[],d=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add((function(e){h[e]=new Id({silent:!0}),d[e]=new Id({silent:!0})})).update((function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]})).execute(),a.each((function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new Kl,m=r(lu(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),_=i.cx+uu(y[0],i.r),x=i.cy+uu(y[1],i.r);(D=h[t]).attr({z2:f?0:2,style:$g(v,{x:_,y:x,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(D)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=i.cx+uu(w[0],i.r),T=i.cy+uu(w[1],i.r),M=uu(b.get("width"),i.r),A=uu(b.get("height"),i.r),C=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,D=d[t],E=b.get("formatter");D.attr({z2:f?0:2,style:$g(b,{x:S,y:T,text:OR(o,E),width:isNaN(M)?null:M,height:isNaN(A)?null:A,align:"center",verticalAlign:"middle"},{inheritColor:C})}),om(D,{normal:b},o,(function(e){return OR(e,E)})),p&&am(D,t,a,e,{getFormattedLabel:function(e,t,n,r,i,a){return OR(a?a.interpolatedValue:o,E)}}),g.add(D)}c.add(g)})),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(zx),kR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return g(t,e),t.prototype.getInitialData=function(e,t){return $E(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Mx);var zR=["itemStyle","opacity"],BR=function(e){function t(t,n){var r=e.call(this)||this,i=r,o=new Lf,a=new Id;return i.setTextContent(a),r.setTextGuideLine(o),r.updateData(t,n,!0),r}return g(t,e),t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,o=e.getItemModel(t),a=e.getItemLayout(t),s=o.getModel("emphasis"),l=o.get(zR);l=null==l?1:l,n||gg(r),r.useStyle(e.getItemVisual(t,"style")),r.style.lineJoin="round",n?(r.setShape({points:a.points}),r.style.opacity=0,cg(r,{style:{opacity:l}},i,t)):ug(r,{style:{opacity:l},shape:{points:a.points}},i,t),Dp(r,o),this._updateLabel(e,t),Tp(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),o=e.hostModel,a=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;qg(i,Kg(a),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var c=s.linePoints;r.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Po(c[0][0],c[0][1]):null},ug(i,{style:{x:s.x,y:s.y}},o,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),GA(n,HA(a),{stroke:u})},t}(Df),VR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,o=this.group;r.diff(i).add((function(e){var t=new BR(r,e);r.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),o.add(n),r.setItemGraphicEl(e,n)})).remove((function(t){fg(i.getItemGraphicEl(t),e,t)})).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(zx),FR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new JE(jr(this.getData,this),jr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return $E(this,{coordDimensions:["value"],encodeDefaulter:Yr(Zv,this)})},t.prototype._defaultLabelLine=function(e){ju(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension("value"),o=n.getSum(i);return r.percent=o?+(n.get(i,t)/o*100).toFixed(2):0,r.$vars.push("percent"),r},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(Mx);function GR(e,t){e.eachSeriesByType("funnel",(function(e){var n=e.getData(),r=n.mapDimension("value"),i=e.get("sort"),o=function(e,t){return Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),a=e.get("orient"),s=o.width,l=o.height,u=function(e,t){for(var n=e.mapDimension("value"),r=e.mapArray(n,(function(e){return e})),i=[],o="ascending"===t,a=0,s=e.count();a<s;a++)i[a]=a;return qr(t)?i.sort(t):"none"!==t&&i.sort((function(e,t){return o?r[e]-r[t]:r[t]-r[e]})),i}(n,i),c=o.x,h=o.y,d="horizontal"===a?[uu(e.get("minSize"),l),uu(e.get("maxSize"),l)]:[uu(e.get("minSize"),s),uu(e.get("maxSize"),s)],p=n.getDataExtent(r),f=e.get("min"),g=e.get("max");null==f&&(f=Math.min(p[0],0)),null==g&&(g=p[1]);var m=e.get("funnelAlign"),v=e.get("gap"),y=(("horizontal"===a?s:l)-v*(n.count()-1))/n.count(),_=function(e,t){if("horizontal"===a){var i=lu(n.get(r,e)||0,[f,g],d,!0),o=void 0;switch(m){case"top":o=h;break;case"center":o=h+(l-i)/2;break;case"bottom":o=h+(l-i)}return[[t,o],[t,o+i]]}var u,p=lu(n.get(r,e)||0,[f,g],d,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-p)/2;break;case"right":u=c+s-p}return[[u,t],[u+p,t]]};"ascending"===i&&(y=-y,v=-v,"horizontal"===a?c+=s:h+=l,u=u.reverse());for(var x=0;x<u.length;x++){var b=u[x],w=u[x+1],S=n.getItemModel(b);if("horizontal"===a){var T=S.get(["itemStyle","width"]);null==T?T=y:(T=uu(T,s),"ascending"===i&&(T=-T));var M=_(b,c),A=_(w,c+T);c+=T+v,n.setItemLayout(b,{points:M.concat(A.slice().reverse())})}else{var C=S.get(["itemStyle","height"]);null==C?C=y:(C=uu(C,l),"ascending"===i&&(C=-C));M=_(b,h),A=_(w,h+C);h+=C+v,n.setItemLayout(b,{points:M.concat(A.slice().reverse())})}}!function(e){var t=e.hostModel.get("orient");e.each((function(n){var r,i,o,a,s=e.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=e.getItemLayout(n),h=c.points,d="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(d)"insideLeft"===l?(i=(h[0][0]+h[3][0])/2+5,o=(h[0][1]+h[3][1])/2,r="left"):"insideRight"===l?(i=(h[1][0]+h[2][0])/2-5,o=(h[1][1]+h[2][1])/2,r="right"):(i=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,r="center"),a=[[i,o],[i,o]];else{var p=void 0,f=void 0,g=void 0,m=void 0,v=u.get("length");"production"!==process.env.NODE_ENV&&("vertical"===t&&["top","bottom"].indexOf(l)>-1&&(l="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),"horizontal"===t&&["left","right"].indexOf(l)>-1&&(l="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),"left"===l?(p=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,i=(g=p-v)-5,r="right"):"right"===l?(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,i=(g=p+v)+5,r="left"):"top"===l?(p=(h[3][0]+h[0][0])/2,o=(m=(f=(h[3][1]+h[0][1])/2)-v)-5,r="center"):"bottom"===l?(p=(h[1][0]+h[2][0])/2,o=(m=(f=(h[1][1]+h[2][1])/2)+v)+5,r="center"):"rightTop"===l?(p="horizontal"===t?h[3][0]:h[1][0],f="horizontal"===t?h[3][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p+v)+5,r="top")):"rightBottom"===l?(p=h[2][0],f=h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="bottom")):"leftTop"===l?(p=h[0][0],f="horizontal"===t?h[0][1]:h[1][1],"horizontal"===t?(o=(m=f-v)-5,r="center"):(i=(g=p-v)-5,r="right")):"leftBottom"===l?(p="horizontal"===t?h[1][0]:h[3][0],f="horizontal"===t?h[1][1]:h[2][1],"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p-v)-5,r="right")):(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===t?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="left")),"horizontal"===t?i=g=p:o=m=f,a=[[p,f],[g,m]]}c.label={linePoints:a,x:i,y:o,verticalAlign:"middle",textAlign:r,inside:d}}))}(n)}))}var HR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Kl,n._initialized=!1,n}return g(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._dataGroup,o=e.getData(),a=this._data,s=e.coordinateSystem,l=s.dimensions,u=XR(e);if(o.diff(a).add((function(e){var t=WR(o,i,e,l,s);jR(t,o,e,u)})).update((function(t,n){var r=a.getItemGraphicEl(n),i=UR(o,t,l,s);o.setItemGraphicEl(t,r),ug(r,{shape:{points:i}},e,t),gg(r),jR(r,o,t,u)})).remove((function(e){var t=a.getItemGraphicEl(e);i.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=function(e,t,n){var r=e.model,i=e.getRect(),o=new fd({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),a="horizontal"===r.get("layout")?"width":"height";return o.setShape(a,0),cg(o,{shape:{width:i.width,height:i.height}},t,n),o}(s,e,(function(){setTimeout((function(){i.removeClipPath()}))}));i.setClipPath(c)}this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var r=t.getData(),i=t.coordinateSystem,o=i.dimensions,a=XR(t),s=this._progressiveEls=[],l=e.start;l<e.end;l++){var u=WR(r,this._dataGroup,l,o,i);u.incremental=!0,jR(u,r,l,a),s.push(u)}},t.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},t.type="parallel",t}(zx);function UR(e,t,n,r){for(var i,o=[],a=0;a<n.length;a++){var s=n[a],l=e.get(e.mapDimension(s),t);i=l,("category"===r.getAxis(s).type?null==i:null==i||isNaN(i))||o.push(r.dataToPoint(l,s))}return o}function WR(e,t,n,r,i){var o=UR(e,n,r,i),a=new Lf({shape:{points:o},z2:10});return t.add(a),e.setItemGraphicEl(n,a),a}function XR(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),ai(t=Cu(t))&&(t=0),{smooth:t}}function jR(e,t,n,r){e.useStyle(t.getItemVisual(n,"style")),e.style.fill=null,e.setShape("smooth",r.smooth);var i=t.getItemModel(n),o=i.getModel("emphasis");Dp(e,i,"lineStyle"),Tp(e,o.get("focus"),o.get("blurScope"),o.get("disabled"))}var YR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return g(t,e),t.prototype.getInitialData=function(e,t){return DT(null,this,{useEncodeDefaulter:jr(ZR,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),r=[];return t.eachActiveState(n,(function(t,i){e===t&&r.push(n.getRawIndex(i))})),r},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},t}(Mx);function ZR(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return Fr(t.dimensions,(function(e){var t=+e.replace("dim","");n[e]=t})),n}}var qR=["lineStyle","opacity"],KR={seriesType:"parallel",reset:function(e,t){var n=e.coordinateSystem,r={normal:e.get(["lineStyle","opacity"]),active:e.get("activeOpacity"),inactive:e.get("inactiveOpacity")};return{progress:function(e,t){n.eachActiveState(t,(function(e,n){var i=r[e];if("normal"===e&&t.hasItemOption){var o=t.getItemModel(n).get(qR,!0);null!=o&&(i=o)}t.ensureUniqueItemVisual(n,"style").opacity=i}),e.start,e.end)}}}};function $R(e){!function(e){if(e.parallel)return;var t=!1;Fr(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=Xu(e.parallelAxis);Fr(t,(function(t){if(Qr(t)){var n=t.parallelIndex||0,r=Xu(e.parallel)[n];r&&r.parallelAxisDefault&&Lr(t,r.parallelAxisDefault,!1)}}))}(e)}var JR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},Fr(QR,(function(e,t){n.getZr().on(t,this._handlers[t]=jr(e,this))}),this)),Hx(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){Ux(this,"_throttledDispatchExpand"),Fr(this._handlers,(function(e,n){t.getZr().off(n,e)})),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(Pr({type:"parallelAxisExpand"},e))},t.type="parallel",t}(Cx),QR={mousedown:function(e){ek(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(ek(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>5)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&ek(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),r=n.behavior;"jump"===r&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===r?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===r?null:{duration:0}})}}};function ek(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}var tk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&Lr(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){Fr(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];Fr(Ur(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(Nv),nk=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.axisIndex=o,a}return g(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(yA);function rk(e,t,n,r,i,o){e=e||0;var a=n[1]-n[0];if(null!=i&&(i=ok(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var s=Math.abs(t[1]-t[0]);s=ok(s,[0,a]),i=o=ok(s,[i,o]),r=0}t[0]=ok(t[0],n),t[1]=ok(t[1],n);var l=ik(t,r);t[r]+=e;var u,c=i||0,h=n.slice();return l.sign<0?h[0]+=c:h[1]-=c,t[r]=ok(t[r],h),u=ik(t,r),null!=i&&(u.sign!==l.sign||u.span<i)&&(t[1-r]=t[r]+l.sign*i),u=ik(t,r),null!=o&&u.span>o&&(t[1-r]=t[r]+u.sign*o),t}function ik(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function ok(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var ak=Fr,sk=Math.min,lk=Math.max,uk=Math.floor,ck=Math.ceil,hk=cu,dk=Math.PI,pk=function(){function e(e,t,n){this.type="parallel",this._axesMap=xi(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=e.dimensions,i=e.parallelAxisIndex;ak(r,(function(e,n){var r=i[n],o=t.getComponent("parallelAxis",r),a=this._axesMap.set(e,new nk(e,DM(o),[0,0],o.get("type"),r)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,r=t.layoutBase,i=t.pixelDimIndex,o=e[1-i],a=e[i];return o>=n&&o<=n+t.axisLength&&a>=r&&a<=r+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var r=n.getData();ak(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(r,r.mapDimension(e)),CM(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,r=["x","y"],i=["width","height"],o=t.get("layout"),a="horizontal"===o?0:1,s=n[i[a]],l=[0,s],u=this.dimensions.length,c=fk(t.get("axisExpandWidth"),l),h=fk(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,p=t.get("axisExpandWindow");p?(e=fk(p[1]-p[0],l),p[1]=p[0]+e):(e=fk(c*(h-1),l),(p=[c*(t.get("axisExpandCenter")||uk(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[uk(hk(p[0]/c,1))+1,ck(hk(p[1]/c,1))-1],m=f/c*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[r[a]],layoutLength:s,axisBase:n[r[1-a]],axisLength:n[i[1-a]],axisExpandable:d,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;t.each((function(e){var t=[0,r.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),ak(n,(function(t,n){var o=(r.axisExpandable?mk:gk)(n,r),a={horizontal:{x:o.position,y:r.axisLength},vertical:{x:0,y:o.position}},s={horizontal:dk/2,vertical:0},l=[a[i].x+e.x,a[i].y+e.y],u=s[i],c=[1,0,0,1,0,0];Do(c,c,u),Co(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,r){null==n&&(n=0),null==r&&(r=e.count());var i=this._axesMap,o=this.dimensions,a=[],s=[];Fr(o,(function(t){a.push(e.mapDimension(t)),s.push(i.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;u<r;u++){var c=void 0;if(l){c="active";for(var h=e.getValues(a,u),d=0,p=o.length;d<p;d++){if("inactive"===s[d].getActiveState(h[d])){c="inactive";break}}}else c="normal";t(c,u)}},e.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,n=!1,r=0,i=e.length;r<i;r++)"normal"!==t.get(e[r]).model.getActiveState()&&(n=!0);return n},e.prototype.axisCoordToPoint=function(e,t){return Ng([e,0],this._axesLayout[t].transform)},e.prototype.getAxisLayout=function(e){return Ir(this._axesLayout[e])},e.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),n=t.pixelDimIndex,r=t.axisExpandWindow.slice(),i=r[1]-r[0],o=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:r};var a,s=e[n]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),h=null!=c[0];if(u)h&&u&&s<i*c[0]?(l="jump",a=s-i*c[2]):h&&u&&s>i*(1-c[0])?(l="jump",a=s-i*(1-c[2])):(a=s-i*c[1])>=0&&(a=s-i*(1-c[1]))<=0&&(a=0),(a*=t.axisExpandWidth/u)?rk(a,r,o,"all"):l="none";else{var d=r[1]-r[0];(r=[lk(0,o[1]*s/d-d/2)])[1]=sk(o[1],r[0]+d),r[0]=r[1]-d}return{axisExpandWindow:r,behavior:l}},e}();function fk(e,t){return sk(lk(e,t[0]),t[1])}function gk(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function mk(e,t){var n,r,i=t.layoutLength,o=t.axisExpandWidth,a=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e<l[0]?(n=e*s,r=s):e<=l[1]?(n=t.axisExpandWindow0Pos+e*o-t.axisExpandWindow[0],u=o,c=!0):(n=i-(a-1-e)*s,r=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:r}}var vk={create:function(e,t){var n=[];return e.eachComponent("parallel",(function(r,i){var o=new pk(r,e,t);o.name="parallel_"+i,o.resize(r,t),r.coordinateSystem=o,o.model=r,n.push(o)})),e.eachSeries((function(e){if("parallel"===e.get("coordinateSystem")){var t=e.getReferringComponents("parallel",uc).models[0];e.coordinateSystem=t.coordinateSystem}})),n}},yk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.activeIntervals=[],n}return g(t,e),t.prototype.getAreaSelectStyle=function(){return Mc([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},t.prototype.setActiveIntervals=function(e){var t=this.activeIntervals=Ir(e);if(t)for(var n=t.length-1;n>=0;n--)hu(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var r=0,i=t.length;r<i;r++)if(t[r][0]<=e&&e<=t[r][1])return"active";return"inactive"},t}(Nv);Br(yk,RM);var _k=!0,xk=Math.min,bk=Math.max,wk=Math.pow,Sk=1e4,Tk=6,Mk=6,Ak="globalPan",Ck={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Dk={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Ek={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},Ik=0,Lk=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},"production"!==process.env.NODE_ENV&&di(t),n._zr=t,n.group=new Kl,n._uid="brushController_"+Ik++,Fr(iz,(function(e,t){this._handlers[t]=jr(e,this)}),n),n}return g(t,e),t.prototype.enableBrush=function(e){return"production"!==process.env.NODE_ENV&&di(this._mounted),this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||function(e,t,n){vL(e)[t]=n}(t,Ak,this._uid),Fr(this._handlers,(function(e,n){t.on(n,e)})),this._brushType=e.brushType,this._brushOption=Lr(Ir(Ek),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;!function(e,t,n){var r=vL(e);r[t]===n&&(r[t]=null)}(e,Ak,this._uid),Fr(this._handlers,(function(t,n){e.off(n,t)})),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};Fr(e,(function(e){t[e.panelId]=Ir(e)}))}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},"production"!==process.env.NODE_ENV&&(this._mounted=!0),this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){"production"!==process.env.NODE_ENV&&di(this._mounted),e=Gr(e,(function(e){return Lr(Ir(Ek),e,!0)}));var t="\0-brush-index-",n=this._covers,r=this._covers=[],i=this,o=this._creatingCover;return new YS(n,e,(function(e,t){return a(e.__brushOption,t)}),a).add(s).update(s).remove((function(e){n[e]!==o&&i.group.remove(n[e])})).execute(),this;function a(e,n){return(null!=e.id?e.id:t+n)+"-"+e.brushType}function s(t,a){var s=e[t];if(null!=a&&n[a]===o)r[t]=n[a];else{var l=r[t]=null!=a?(n[a].__brushOption=s,n[a]):Pk(i,Nk(i,s));kk(i,l)}}},t.prototype.unmount=function(){if("production"===process.env.NODE_ENV||this._mounted)return this.enableBrush(!1),Fk(this),this._zr.remove(this.group),"production"!==process.env.NODE_ENV&&(this._mounted=!1),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(Ji);function Nk(e,t){var n=az[t.brushType].createCover(e,t);return n.__brushOption=t,Rk(n,t),e.group.add(n),n}function Pk(e,t){var n=zk(t);return n.endCreating&&(n.endCreating(e,t),Rk(t,t.__brushOption)),t}function Ok(e,t){var n=t.__brushOption;zk(t).updateCoverShape(e,t,n.range,n)}function Rk(e,t){var n=t.z;null==n&&(n=Sk),e.traverse((function(e){e.z=n,e.z2=n}))}function kk(e,t){zk(t).updateCommon(e,t),Ok(e,t)}function zk(e){return az[e.__brushOption.brushType]}function Bk(e,t,n){var r,i=e._panels;if(!i)return _k;var o=e._transform;return Fr(i,(function(e){e.isTargetByCursor(t,n,o)&&(r=e)})),r}function Vk(e,t){var n=e._panels;if(!n)return _k;var r=t.__brushOption.panelId;return null!=r?n[r]:_k}function Fk(e){var t=e._covers,n=t.length;return Fr(t,(function(t){e.group.remove(t)}),e),t.length=0,!!n}function Gk(e,t){var n=Gr(e._covers,(function(e){var t=e.__brushOption,n=Ir(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}}));e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function Hk(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function Uk(e,t,n,r){var i=new Kl;return i.add(new fd({name:"main",style:Yk(n),silent:!0,draggable:!0,cursor:"move",drift:Yr(Kk,e,t,i,["n","s","w","e"]),ondragend:Yr(Gk,t,{isEnd:!0})})),Fr(r,(function(n){i.add(new fd({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Yr(Kk,e,t,i,n),ondragend:Yr(Gk,t,{isEnd:!0})}))})),i}function Wk(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=bk(i,Mk),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],h=n[1][1],d=c-o+i/2,p=h-o+i/2,f=c-a,g=h-s,m=f+i,v=g+i;jk(e,t,"main",a,s,f,g),r.transformable&&(jk(e,t,"w",l,u,o,v),jk(e,t,"e",d,u,o,v),jk(e,t,"n",l,u,m,o),jk(e,t,"s",l,p,m,o),jk(e,t,"nw",l,u,o,o),jk(e,t,"ne",d,u,o,o),jk(e,t,"sw",l,p,o,o),jk(e,t,"se",d,p,o,o))}function Xk(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(Yk(n)),i.attr({silent:!r,cursor:r?"move":"default"}),Fr([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var i=t.childOfName(n.join("")),o=1===n.length?qk(e,n[0]):function(e,t){var n=[qk(e,t[0]),qk(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?Dk[o]+"-resize":null})}))}function jk(e,t,n,r,i,o,a){var s=t.childOfName(n);s&&s.setShape(function(e){var t=xk(e[0][0],e[1][0]),n=xk(e[0][1],e[1][1]),r=bk(e[0][0],e[1][0]),i=bk(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}(Qk(e,t,[[r,i],[r+o,i+a]])))}function Yk(e){return Or({strokeNoScale:!0},e.brushStyle)}function Zk(e,t,n,r){var i=[xk(e,n),xk(t,r)],o=[bk(e,n),bk(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function qk(e,t){var n=Pg({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return Lg(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function Kk(e,t,n,r,i,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=Jk(t,i,o);Fr(r,(function(e){var t=Ck[e];s[t[0]][t[1]]+=l[t[0]]})),a.range=e.fromRectRange(Zk(s[0][0],s[1][0],s[0][1],s[1][1])),kk(t,n),Gk(t,{isEnd:!1})}function $k(e,t,n,r){var i=t.__brushOption.range,o=Jk(e,n,r);Fr(i,(function(e){e[0]+=o[0],e[1]+=o[1]})),kk(e,t),Gk(e,{isEnd:!1})}function Jk(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function Qk(e,t,n){var r=Vk(e,t);return r&&r!==_k?r.clipPath(n,e._transform):Ir(n)}function ez(e){var t=e.event;t.preventDefault&&t.preventDefault()}function tz(e,t,n){return e.childOfName("main").contain(t,n)}function nz(e,t,n,r){var i,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return wk(i*i+o*o,.5)>Tk}(e)||o){if(a&&!o){"single"===s.brushMode&&Fk(e);var l=Ir(s);l.brushType=rz(l.brushType,a),l.panelId=a===_k?null:a.panelId,o=e._creatingCover=Nk(e,l),e._covers.push(o)}if(o){var u=az[rz(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(Qk(e,o,e._track)),r&&(Pk(e,o),u.updateCommon(e,o)),Ok(e,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&Bk(e,t,n)&&Fk(e)&&(i={isEnd:r,removeOnClick:!0});return i}function rz(e,t){return"auto"===e?("production"!==process.env.NODE_ENV&&di(t&&t.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),t.defaultBrushType):e}var iz={mousedown:function(e){if(this._dragging)oz(this,e);else if(!e.target||!e.target.draggable){ez(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=Bk(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(function(e,t,n){if(e._brushType&&!function(e,t,n){var r=e._zr;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}(e,t.offsetX,t.offsetY)){var r=e._zr,i=e._covers,o=Bk(e,t,n);if(!e._dragging)for(var a=0;a<i.length;a++){var s=i[a].__brushOption;if(o&&(o===_k||s.panelId===o.panelId)&&az[s.brushType].contain(i[a],n[0],n[1]))return}o&&r.setCursorStyle("crosshair")}}(this,e,r),this._dragging){ez(e);var i=nz(this,e,r,!1);i&&Gk(this,i)}},mouseup:function(e){oz(this,e)}};function oz(e,t){if(e._dragging){ez(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=nz(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&Gk(e,o)}}var az={lineX:sz(0),lineY:sz(1),rect:{createCover:function(e,t){function n(e){return e}return Uk({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=Hk(e);return Zk(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){Wk(e,t,n,r)},updateCommon:Xk,contain:tz},polygon:{createCover:function(e,t){var n=new Kl;return n.add(new Lf({name:"main",style:Yk(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Df({name:"main",draggable:!0,drift:Yr($k,e,t),ondragend:Yr(Gk,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:Qk(e,t,n)})},updateCommon:Xk,contain:tz}};function sz(e){return{createCover:function(t,n){return Uk({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=Hk(t);return[xk(n[0][e],n[1][e]),bk(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,a=Vk(t,n);if(a!==_k&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[r,o];e&&l.reverse(),Wk(t,n,l,i)},updateCommon:Xk,contain:tz}}function lz(e){return e=hz(e),function(t){return kg(t,e)}}function uz(e,t){return e=hz(e),function(n){var r=null!=t?t:n,i=r?e.width:e.height,o=r?e.x:e.y;return[o,o+(i||0)]}}function cz(e,t,n){var r=hz(e);return function(e,i){return r.contain(i[0],i[1])&&!AL(e,t,n)}}function hz(e){return Uo.create(e)}var dz=["axisLine","axisTickLabel","axisName"],pz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new Lk(n.getZr())).on("brush",jr(this._onBrush,this))},t.prototype.render=function(e,t,n,r){if(!function(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}(e,t,r)){this.axisModel=e,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Kl,this.group.add(this._axisGroup),e.get("show")){var o=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),a=o.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=Pr({strokeContainThreshold:l},a.getAxisLayout(u)),h=new II(e,c);Fr(dz,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,o,l,n),Rg(i,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,r,i,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=Uo.create({x:a[0],y:-i/2,width:s,height:i});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:lz(u),isTargetByCursor:cz(u,o,r),getLinearBrushOtherExtent:uz(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return Gr(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,r=n.axis,i=Gr(t,(function(e){return[r.coordToData(e.range[0],!0),r.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:i})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(Cx);var fz={type:"axisAreaSelect",event:"axisAreaSelected"};var gz={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function mz(e){e.registerComponentView(JR),e.registerComponentModel(tk),e.registerCoordinateSystem("parallel",vk),e.registerPreprocessor($R),e.registerComponentModel(yk),e.registerComponentView(pz),pI(e,"parallel",yk,gz),function(e){e.registerAction(fz,(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),e.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}))}(e)}var vz=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},yz=function(e){function t(t){return e.call(this,t)||this}return g(t,e),t.prototype.getDefaultShape=function(){return new vz},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){cp(this)},t.prototype.downplay=function(){hp(this)},t}(ed),_z=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return g(t,e),t.prototype.render=function(e,t,n){var r=this,i=e.getGraph(),o=this.group,a=e.layoutInfo,s=a.width,l=a.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,o.removeAll(),o.x=a.x,o.y=a.y,i.eachEdge((function(t){var n=new yz,r=Ld(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType="edge";var i,a,u,d,p,f,g,m,v=t.getModel(),y=v.getModel("lineStyle"),_=y.get("curveness"),x=t.node1.getLayout(),b=t.node1.getModel(),w=b.get("localX"),S=b.get("localY"),T=t.node2.getLayout(),M=t.node2.getModel(),A=M.get("localX"),C=M.get("localY"),D=t.getLayout();n.shape.extent=Math.max(1,D.dy),n.shape.orient=h,"vertical"===h?(i=(null!=w?w*s:x.x)+D.sy,a=(null!=S?S*l:x.y)+x.dy,u=(null!=A?A*s:T.x)+D.ty,p=i,f=a*(1-_)+(d=null!=C?C*l:T.y)*_,g=u,m=a*_+d*(1-_)):(i=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+D.sy,p=i*(1-_)+(u=null!=A?A*s:T.x)*_,f=a,g=i*_+u*(1-_),m=d=(null!=C?C*l:T.y)+D.ty),n.setShape({x1:i,y1:a,x2:u,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(y.getItemStyle()),xz(n.style,h,t);var E=""+v.get("value"),I=Kg(v,"edgeLabel");qg(n,I,{labelFetcher:{getFormattedLabel:function(t,n,r,i,o,a){return e.getFormattedLabel(t,n,"edge",i,ui(o,I.normal&&I.normal.get("formatter"),E),a)}},labelDataIndex:t.dataIndex,defaultText:E}),n.setTextConfig({position:"inside"});var L=v.getModel("emphasis");Dp(n,v,"lineStyle",(function(e){var n=e.getItemStyle();return xz(n,h,t),n})),o.add(n),c.setItemGraphicEl(t.dataIndex,n);var N=L.get("focus");Tp(n,"adjacency"===N?t.getAdjacentDataIndices():"trajectory"===N?t.getTrajectoryDataIndices():N,L.get("blurScope"),L.get("disabled"))})),i.eachNode((function(t){var n=t.getLayout(),r=t.getModel(),i=r.get("localX"),a=r.get("localY"),c=r.getModel("emphasis"),h=new fd({shape:{x:null!=i?i*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy},style:r.getModel("itemStyle").getItemStyle(),z2:10});qg(h,Kg(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,"node")}},labelDataIndex:t.dataIndex,defaultText:t.id}),h.disableLabelAnimation=!0,h.setStyle("fill",t.getVisual("color")),h.setStyle("decal",t.getVisual("style").decal),Dp(h,r),o.add(h),u.setItemGraphicEl(t.dataIndex,h),Ld(h).dataType="node";var d=c.get("focus");Tp(h,"adjacency"===d?t.getAdjacentDataIndices():"trajectory"===d?t.getTrajectoryDataIndices():d,c.get("blurScope"),c.get("disabled"))})),u.eachItemGraphicEl((function(t,i){u.getItemModel(i).get("draggable")&&(t.drift=function(t,o){r._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){r._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&o.setClipPath(function(e,t,n){var r=new fd({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return cg(r,{shape:{width:e.width+20}},t,n),r}(o.getBoundingRect(),e,(function(){o.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(zx);function xz(e,t,n){switch(e.fill){case"source":e.fill=n.node1.getVisual("color"),e.decal=n.node1.getVisual("style").decal;break;case"target":e.fill=n.node2.getVisual("color"),e.decal=n.node2.getVisual("style").decal;break;case"gradient":var r=n.node1.getVisual("color"),i=n.node2.getVisual("color");Kr(r)&&Kr(i)&&(e.fill=new Zf(0,0,+("horizontal"===t),+("vertical"===t),[{color:r,offset:0},{color:i,offset:1}]))}}var bz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.getInitialData=function(e,t){var n=e.edges||e.links,r=e.data||e.nodes,i=e.levels;this.levelModels=[];for(var o=this.levelModels,a=0;a<i.length;a++)if(null!=i[a].depth&&i[a].depth>=0)o[i[a].depth]=new xm(i[a],this,t);else if("production"!==process.env.NODE_ENV)throw new Error("levels[i].depth is mandatory and should be natural number");if(r&&n){var s=ER(r,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,o=n.levelModels[i];o&&(e.parentModel=o)}return e}))}));return s.data}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||null==e}if("edge"===n){var i=this.getDataParams(e,n),o=i.data,a=i.value;return ex("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:r(a)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,n).data.name;return ex("nameValue",{name:null!=l?l+"":null,value:s,noValue:r(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);if(null==r.value&&"node"===n){var i=this.getGraph().getNodeByIndex(t).getLayout().value;r.value=i}return r},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(Mx);function wz(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),r=e.get("nodeGap"),i=function(e,t){return Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=i;var o=i.width,a=i.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){Fr(e,(function(e){var t=Nz(e.outEdges,Lz),n=Nz(e.inEdges,Lz),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)}))}(l);var c=Ur(l,(function(e){return 0===e.getLayout().value}));!function(e,t,n,r,i,o,a,s,l){(function(e,t,n,r,i,o,a){for(var s=[],l=[],u=[],c=[],h=0,d=0;d<t.length;d++)s[d]=1;for(d=0;d<e.length;d++)l[d]=e[d].inEdges.length,0===l[d]&&u.push(e[d]);var p=-1;for(;u.length;){for(var f=0;f<u.length;f++){var g=u[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:h},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var y=0;y<g.outEdges.length;y++){var _=g.outEdges[y];s[t.indexOf(_)]=0;var x=_.node2;0==--l[e.indexOf(x)]&&c.indexOf(x)<0&&c.push(x)}}++h,u=c,c=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=p>h-1?p:h-1;a&&"left"!==a&&function(e,t,n,r){if("right"===t){for(var i=[],o=e,a=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:a},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];i.indexOf(c.node1)<0&&i.push(c.node1)}}o=i,i=[],++a}Fr(e,(function(e){Sz(e)||e.setLayout({depth:Math.max(0,r-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){Fr(e,(function(e){Sz(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,r)}(e,a,0,b);var w="vertical"===o?(i-n)/b:(r-n)/b;!function(e,t,n){Fr(e,(function(e){var r=e.getLayout().depth*t;"vertical"===n?e.setLayout({y:r},!0):e.setLayout({x:r},!0)}))}(e,w,o)})(e,t,n,i,o,s,l),function(e,t,n,r,i,o,a){var s=function(e,t){var n=[],r="vertical"===t?"y":"x",i=pc(e,(function(e){return e.getLayout()[r]}));return i.keys.sort((function(e,t){return e-t})),Fr(i.keys,(function(e){n.push(i.buckets.get(e))})),n}(e,a);(function(e,t,n,r,i,o){var a=1/0;Fr(e,(function(e){var t=e.length,s=0;Fr(e,(function(e){s+=e.getLayout().value}));var l="vertical"===o?(r-(t-1)*i)/s:(n-(t-1)*i)/s;l<a&&(a=l)})),Fr(e,(function(e){Fr(e,(function(e,t){var n=e.getLayout().value*a;"vertical"===o?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))}))})),Fr(t,(function(e){var t=+e.getValue()*a;e.setLayout({dy:t},!0)}))})(s,t,n,r,i,a),Tz(s,i,n,r,a);for(var l=1;o>0;o--)Mz(s,l*=.99,a),Tz(s,i,n,r,a),Pz(s,l,a),Tz(s,i,n,r,a)}(e,t,o,i,r,a,s),function(e,t){var n="vertical"===t?"x":"y";Fr(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[n]-t.node2.getLayout()[n]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[n]-t.node1.getLayout()[n]}))})),Fr(e,(function(e){var t=0,n=0;Fr(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),Fr(e.inEdges,(function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy}))}))}(e,s)}(l,u,n,r,o,a,0!==c.length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function Sz(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function Tz(e,t,n,r,i){var o="vertical"===i?"x":"y";Fr(e,(function(e){var a,s,l;e.sort((function(e,t){return e.getLayout()[o]-t.getLayout()[o]}));for(var u=0,c=e.length,h="vertical"===i?"dx":"dy",d=0;d<c;d++)(l=u-(s=e[d]).getLayout()[o])>0&&(a=s.getLayout()[o]+l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[h]+t;if((l=u-t-("vertical"===i?r:n))>0){a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=c-2;d>=0;--d)(l=(s=e[d]).getLayout()[o]+s.getLayout()[h]+t-u)>0&&(a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function Mz(e,t,n){Fr(e.slice().reverse(),(function(e){Fr(e,(function(e){if(e.outEdges.length){var r=Nz(e.outEdges,Az,n)/Nz(e.outEdges,Lz);if(isNaN(r)){var i=e.outEdges.length;r=i?Nz(e.outEdges,Cz,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-Iz(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-Iz(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function Az(e,t){return Iz(e.node2,t)*e.getValue()}function Cz(e,t){return Iz(e.node2,t)}function Dz(e,t){return Iz(e.node1,t)*e.getValue()}function Ez(e,t){return Iz(e.node1,t)}function Iz(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function Lz(e){return e.getValue()}function Nz(e,t,n){for(var r=0,i=e.length,o=-1;++o<i;){var a=+t(e[o],n);isNaN(a)||(r+=a)}return r}function Pz(e,t,n){Fr(e,(function(e){Fr(e,(function(e){if(e.inEdges.length){var r=Nz(e.inEdges,Dz,n)/Nz(e.inEdges,Lz);if(isNaN(r)){var i=e.inEdges.length;r=i?Nz(e.inEdges,Ez,n)/i:0}if("vertical"===n){var o=e.getLayout().x+(r-Iz(e,n))*t;e.setLayout({x:o},!0)}else{var a=e.getLayout().y+(r-Iz(e,n))*t;e.setLayout({y:a},!0)}}}))}))}function Oz(e){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph(),n=t.nodes,r=t.edges;if(n.length){var i=1/0,o=-1/0;Fr(n,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>o&&(o=t)})),Fr(n,(function(t){var n=new ZP({type:"color",mappingMethod:"linear",dataExtent:[i,o],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),r=t.getModel().get(["itemStyle","color"]);null!=r?(t.setVisual("color",r),t.setVisual("style",{fill:r})):(t.setVisual("color",n),t.setVisual("style",{fill:n}))}))}r.length&&Fr(r,(function(e){var t=e.getModel().get("lineStyle");e.setVisual("style",t)}))}))}var Rz=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,r,i=t.getComponent("xAxis",this.get("xAxisIndex")),o=t.getComponent("yAxis",this.get("yAxisIndex")),a=i.get("type"),s=o.get("type");"category"===a?(e.layout="horizontal",n=i.getOrdinalMeta(),r=!0):"category"===s?(e.layout="vertical",n=o.getOrdinalMeta(),r=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],d=[i,o],p=d[u].get("type"),f=d[1-u].get("type"),g=e.data;if(g&&r){var m=[];Fr(g,(function(e,t){var n;Zr(e)?(n=e.slice(),e.unshift(t)):Zr(e.value)?((n=Pr({},e)).value=n.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:c,type:KS(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:KS(f),dimsDef:v.slice()}];return $E(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:Yr(Yv,y,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),kz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return g(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(Mx);Br(kz,Rz,!0);var zz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this.group,o=this._data;this._data||i.removeAll();var a="horizontal"===e.get("layout")?1:0;r.diff(o).add((function(e){if(r.hasValue(e)){var t=Fz(r.getItemLayout(e),r,e,a,!0);r.setItemGraphicEl(e,t),i.add(t)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(r.hasValue(e)){var s=r.getItemLayout(e);n?(gg(n),Gz(s,n,r,e)):n=Fz(s,r,e,a),i.add(n),r.setItemGraphicEl(e,n)}else i.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=r},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot",t}(zx),Bz=function(){},Vz=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return g(t,e),t.prototype.getDefaultShape=function(){return new Bz},t.prototype.buildPath=function(e,t){var n=t.points,r=0;for(e.moveTo(n[r][0],n[r][1]),r++;r<4;r++)e.lineTo(n[r][0],n[r][1]);for(e.closePath();r<n.length;r++)e.moveTo(n[r][0],n[r][1]),r++,e.lineTo(n[r][0],n[r][1])},t}(ed);function Fz(e,t,n,r,i){var o=e.ends,a=new Vz({shape:{points:i?Hz(o,r,e):o}});return Gz(e,a,t,n,i),a}function Gz(e,t,n,r,i){var o=n.hostModel;(0,Xg[i?"initProps":"updateProps"])(t,{shape:{points:e.ends}},o,r),t.useStyle(n.getItemVisual(r,"style")),t.style.strokeNoScale=!0,t.z2=100;var a=n.getItemModel(r),s=a.getModel("emphasis");Dp(t,a),Tp(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function Hz(e,t,n){return Gr(e,(function(e){return(e=e.slice())[t]=n.initBaseline,e}))}var Uz=Fr;function Wz(e){var t=function(e){var t=[],n=[];return e.eachSeriesByType("boxplot",(function(e){var r=e.getBaseAxis(),i=kr(n,r);i<0&&(i=n.length,n[i]=r,t[i]={axis:r,seriesModels:[]}),t[i].seriesModels.push(e)})),t}(e);Uz(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,n=e.axis,r=e.seriesModels,i=r.length,o=e.boxWidthList=[],a=e.boxOffsetList=[],s=[];if("category"===n.type)t=n.getBandWidth();else{var l=0;Uz(r,(function(e){l=Math.max(l,e.getData().count())}));var u=n.getExtent();t=Math.abs(u[1]-u[0])/l}Uz(r,(function(e){var n=e.get("boxWidth");Zr(n)||(n=[n,n]),s.push([uu(n[0],t)||0,uu(n[1],t)||0])}));var c=.8*t-2,h=c/i*.3,d=(c-h*(i-1))/i,p=d/2-c/2;Uz(r,(function(e,t){a.push(p),p+=h+d,o.push(Math.min(Math.max(d,s[t][0]),s[t][1]))}))}(e),Uz(t,(function(t,n){!function(e,t,n){var r=e.coordinateSystem,i=e.getData(),o=n/2,a="horizontal"===e.get("layout")?0:1,s=1-a,l=["x","y"],u=i.mapDimension(l[a]),c=i.mapDimensionsAll(l[s]);if(null==u||c.length<5)return;for(var h=0;h<i.count();h++){var d=i.get(u,h),p=_(d,c[2],h),f=_(d,c[0],h),g=_(d,c[1],h),m=_(d,c[3],h),v=_(d,c[4],h),y=[];x(y,g,!1),x(y,m,!0),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),i.setItemLayout(h,{initBaseline:p[s],ends:y})}function _(e,n,o){var l,u=i.get(n,o),c=[];return c[a]=e,c[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=r.dataToPoint(c))[a]+=t,l}function x(e,t,n){var r=t.slice(),i=t.slice();r[a]+=o,i[a]-=o,n?e.push(r,i):e.push(i,r)}function b(e,t){var n=t.slice(),r=t.slice();n[a]-=o,r[a]+=o,e.push(n,r)}}(t,e.boxOffsetList[n],e.boxWidthList[n])})))}))}var Xz={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Bv){var n="";"production"!==process.env.NODE_ENV&&(n=Fu("source data is not applicable for this boxplot transform. Expect number[][].")),Gu(n)}var r=function(e,t){for(var n=[],r=[],i=(t=t||{}).boundIQR,o="none"===i||0===i,a=0;a<e.length;a++){var s=hu(e[a].slice()),l=Mu(s,.25),u=Mu(s,.5),c=Mu(s,.75),h=s[0],d=s[s.length-1],p=(null==i?1.5:i)*(c-l),f=o?h:Math.max(h,l-p),g=o?d:Math.min(d,c+p),m=t.itemNameFormatter,v=qr(m)?m({value:a}):Kr(m)?m.replace("{value}",a+""):a+"";n.push([v,f,l,u,c,g]);for(var y=0;y<s.length;y++){var _=s[y];if(_<f||_>g){var x=[v,_];r.push(x)}}}return{boxData:n,outliers:r}}(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:r.boxData},{data:r.outliers}]}};var jz=["color","borderColor"],Yz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,r=this.group,i=t.getLayout("isSimpleBox"),o=e.get("clip",!0),a=e.coordinateSystem,s=a.getArea&&a.getArea();this._data||r.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var a=t.getItemLayout(n);if(o&&$z(s,a))return;var l=Kz(a,n,!0);cg(l,{shape:{points:a.ends}},e,n),Jz(l,t,n,i),r.add(l),t.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(t.hasValue(a)){var c=t.getItemLayout(a);o&&$z(s,c)?r.remove(u):(u?(ug(u,{shape:{points:c.ends}},e,a),gg(u)):u=Kz(c),Jz(u,t,a,i),r.add(u),t.setItemGraphicEl(a,u))}else r.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),nB(e,this.group);var t=e.get("clip",!0)?qD(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,r=t.getData(),i=r.getLayout("isSimpleBox");null!=(n=e.next());){var o=Kz(r.getItemLayout(n));Jz(o,r,n,i),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},t.prototype._incrementalRenderLarge=function(e,t){nB(t,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(zx),Zz=function(){},qz=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return g(t,e),t.prototype.getDefaultShape=function(){return new Zz},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(ed);function Kz(e,t,n){var r=e.ends;return new qz({shape:{points:n?Qz(r,e):r},z2:100})}function $z(e,t){for(var n=!0,r=0;r<t.ends.length;r++)if(e.contain(t.ends[r][0],t.ends[r][1])){n=!1;break}return n}function Jz(e,t,n,r){var i=t.getItemModel(n);e.useStyle(t.getItemVisual(n,"style")),e.style.strokeNoScale=!0,e.__simpleBox=r,Dp(e,i)}function Qz(e,t){return Gr(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var eB=function(){},tB=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeCandlestickBox",n}return g(t,e),t.prototype.getDefaultShape=function(){return new eB},t.prototype.buildPath=function(e,t){for(var n=t.points,r=0;r<n.length;)if(this.__sign===n[r++]){var i=n[r++];e.moveTo(i,n[r++]),e.lineTo(i,n[r++])}else r+=3},t}(ed);function nB(e,t,n,r){var i=e.getData().getLayout("largePoints"),o=new tB({shape:{points:i},__sign:1,ignoreCoarsePointer:!0});t.add(o);var a=new tB({shape:{points:i},__sign:-1,ignoreCoarsePointer:!0});t.add(a);var s=new tB({shape:{points:i},__sign:0,ignoreCoarsePointer:!0});t.add(s),rB(1,o,e),rB(-1,a,e),rB(0,s,e),r&&(o.incremental=!0,a.incremental=!0),n&&n.push(o,a)}function rB(e,t,n,r){var i=n.get(["itemStyle",e>0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]);0===e&&(i=n.get(["itemStyle","borderColorDoji"]));var o=n.getModel("itemStyle").getItemStyle(jz);t.useStyle(o),t.style.fill=null,t.style.stroke=i}var iB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return g(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var r=t.getItemLayout(e);return r&&n.rect(r.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(Mx);function oB(e){e&&Zr(e.series)&&Fr(e.series,(function(e){Qr(e)&&"k"===e.type&&(e.type="candlestick")}))}Br(iB,Rz,!0);var aB=["itemStyle","borderColor"],sB=["itemStyle","borderColor0"],lB=["itemStyle","borderColorDoji"],uB=["itemStyle","color"],cB=["itemStyle","color0"],hB={seriesType:"candlestick",plan:Dx(),performRawSeries:!0,reset:function(e,t){function n(e,t){return t.get(e>0?uB:cB)}function r(e,t){return t.get(0===e?lB:e>0?aB:sB)}if(!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var i;null!=(i=e.next());){var o=t.getItemModel(i),a=t.getItemLayout(i).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=r(a,o)||s.fill,Pr(t.ensureUniqueItemVisual(i,"style"),s)}}}}},dB={seriesType:"candlestick",plan:Dx(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),r=function(e,t){var n,r=e.getBaseAxis(),i="category"===r.type?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/t.count()),o=uu(li(e.get("barMaxWidth"),i),i),a=uu(li(e.get("barMinWidth"),1),i),s=e.get("barWidth");return null!=s?uu(s,i):Math.max(Math.min(i/2,o),a)}(e,n),i=["x","y"],o=n.getDimensionIndex(n.mapDimension(i[0])),a=Gr(n.mapDimensionsAll(i[1]),n.getDimensionIndex,n),s=a[0],l=a[1],u=a[2],c=a[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),!(o<0||a.length<4))return{progress:e.pipelineContext.large?function(n,r){var i,a,h=jT(4*n.count),d=0,p=[],f=[],g=r.getStore(),m=!!e.get(["itemStyle","borderColorDoji"]);for(;null!=(a=n.next());){var v=g.get(o,a),y=g.get(s,a),_=g.get(l,a),x=g.get(u,a),b=g.get(c,a);isNaN(v)||isNaN(x)||isNaN(b)?(h[d++]=NaN,d+=3):(h[d++]=pB(g,a,y,_,l,m),p[0]=v,p[1]=x,i=t.dataToPoint(p,null,f),h[d++]=i?i[0]:NaN,h[d++]=i?i[1]:NaN,p[1]=b,i=t.dataToPoint(p,null,f),h[d++]=i?i[1]:NaN)}r.setLayout("largePoints",h)}:function(e,n){var i,a=n.getStore();for(;null!=(i=e.next());){var h=a.get(o,i),d=a.get(s,i),p=a.get(l,i),f=a.get(u,i),g=a.get(c,i),m=Math.min(d,p),v=Math.max(d,p),y=T(m,h),_=T(v,h),x=T(f,h),b=T(g,h),w=[];M(w,_,0),M(w,y,1),w.push(C(b),C(_),C(x),C(y));var S=!!n.getItemModel(i).get(["itemStyle","borderColorDoji"]);n.setItemLayout(i,{sign:pB(a,i,d,p,l,S),initBaseline:d>p?_[1]:y[1],ends:w,brushRect:A(f,g,h)})}function T(e,n){var r=[];return r[0]=n,r[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(r)}function M(e,t,n){var i=t.slice(),o=t.slice();i[0]=Ig(i[0]+r/2,1,!1),o[0]=Ig(o[0]-r/2,1,!0),n?e.push(i,o):e.push(o,i)}function A(e,t,n){var i=T(e,n),o=T(t,n);return i[0]-=r/2,o[0]-=r/2,{x:i[0],y:i[1],width:r,height:o[1]-i[1]}}function C(e){return e[0]=Ig(e[0],1),e}}}}};function pB(e,t,n,r,i,o){return n>r?-1:n<r?1:o?0:t>0?e.get(i,t-1)<=r?1:-1:1}function fB(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var gB=function(e){function t(t,n){var r=e.call(this)||this,i=new LD(t,n),o=new Kl;return r.add(i),r.add(o),r.updateData(t,n),r}return g(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,r=e.rippleNumber,i=this.childAt(1),o=0;o<r;o++){var a=Wb(t,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-o/r*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scaleX:e.rippleScale/2,scaleY:e.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(s).start(),i.add(a)}fB(i,e)},t.prototype.updateEffectAnimation=function(e){for(var t=this._effectCfg,n=this.childAt(1),r=["symbolType","period","rippleScale","rippleNumber"],i=0;i<r.length;i++){var o=r[i];if(t[o]!==e[o])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}fB(n,e)},t.prototype.highlight=function(){cp(this)},t.prototype.downplay=function(){hp(this)},t.prototype.getSymbolType=function(){var e=this.childAt(0);return e&&e.getSymbolType()},t.prototype.updateData=function(e,t){var n=this,r=e.hostModel;this.childAt(0).updateData(e,t);var i=this.childAt(1),o=e.getItemModel(t),a=e.getItemVisual(t,"symbol"),s=Xb(e.getItemVisual(t,"symbolSize")),l=e.getItemVisual(t,"style"),u=l&&l.fill,c=o.getModel("emphasis");i.setScale(s),i.traverse((function(e){e.setStyle("fill",u)}));var h=jb(e.getItemVisual(t,"symbolOffset"),s);h&&(i.x=h[0],i.y=h[1]);var d=e.getItemVisual(t,"symbolRotate");i.rotation=(d||0)*Math.PI/180||0;var p={};p.showEffectOn=r.get("showEffectOn"),p.rippleScale=o.get(["rippleEffect","scale"]),p.brushType=o.get(["rippleEffect","brushType"]),p.period=1e3*o.get(["rippleEffect","period"]),p.effectOffset=t/e.count(),p.z=r.getShallow("z")||0,p.zlevel=r.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=o.get(["rippleEffect","color"]),p.rippleNumber=o.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(e){"emphasis"===e?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===e&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,Tp(this,c.get("focus"),c.get("blurScope"),c.get("disabled"))},t.prototype.fadeOut=function(e){e&&e()},t}(Kl),mB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(){this._symbolDraw=new kD(gB)},t.prototype.render=function(e,t,n){var r=e.getData(),i=this._symbolDraw;i.updateData(r,{clipShape:this._getClipShape(e)}),this.group.add(i.group)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype.updateTransform=function(e,t,n){var r=e.getData();this.group.dirty();var i=uE("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout()},t.prototype._updateGroupTransform=function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=Lo(t.getRoamTransform()),this.group.decomposeTransform())},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0)},t.type="effectScatter",t}(zx),vB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return g(t,e),t.prototype.getInitialData=function(e,t){return DT(null,this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type="series.effectScatter",t.dependencies=["grid","polar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},t}(Mx);var yB=function(e){function t(t,n,r){var i=e.call(this)||this;return i.add(i.createLine(t,n,r)),i._updateEffectSymbol(t,n),i}return g(t,e),t.prototype.createLine=function(e,t,n){return new uR(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),r=n.get("symbolSize"),i=n.get("symbol");Zr(r)||(r=[r,r]);var o=e.getItemVisual(t,"style"),a=n.get("color")||o&&o.stroke,s=this.childAt(1);this._symbolType!==i&&(this.remove(s),(s=Wb(i,-.5,-.5,1,1,a)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",a),s.setStyle(n.getItemStyle(["color"])),s.scaleX=r[0],s.scaleY=r[1],s.setColor(a),this._symbolType=i,this._symbolScale=r,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var r=this.childAt(1);if(r){var i=e.getItemLayout(n),o=1e3*t.get("period"),a=t.get("loop"),s=t.get("roundTrip"),l=t.get("constantSpeed"),u=si(t.get("delay"),(function(t){return t/e.count()*o/3}));if(r.ignore=!0,this._updateAnimationPoints(r,i),l>0&&(o=this._getLineLength(r)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){r.stopAnimation();var c=void 0;c=qr(u)?u(n):u,r.__t>0&&(c=-o*r.__t),this._animateSymbol(r,o,c,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,r,i){if(t>0){e.__t=0;var o=this,a=e.animate("",r).when(i?2*t:t,{__t:i?2:1}).delay(n).during((function(){o._updateSymbolPosition(e)}));r||a.done((function(){o.remove(e)})),a.start()}},t.prototype._getLineLength=function(e){return Hi(e.__p1,e.__cp1)+Hi(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,r=e.__cp1,i=e.__t<1?e.__t:2-e.__t,o=[e.x,e.y],a=o.slice(),s=Oa,l=Ra;o[0]=s(t[0],r[0],n[0],i),o[1]=s(t[1],r[1],n[1],i);var u=e.__t<1?l(t[0],r[0],n[0],i):l(n[0],r[0],t[0],1-i),c=e.__t<1?l(t[1],r[1],n[1],i):l(n[1],r[1],t[1],1-i);e.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT<e.__t?(e.scaleY=1.05*Hi(a,o),1===i&&(o[0]=a[0]+(o[0]-a[0])/2,o[1]=a[1]+(o[1]-a[1])/2)):1===e.__lastT?e.scaleY=2*Hi(t,o):e.scaleY=this._symbolScale[1]),e.__lastT=e.__t,e.ignore=!1,e.x=o[0],e.y=o[1]},t.prototype.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var n=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,n,t)},t}(Kl),_B=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createPolyline(t,n,r),i}return g(t,e),t.prototype._createPolyline=function(e,t,n){var r=e.getItemLayout(t),i=new Lf({shape:{points:r}});this.add(i),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel;ug(this.childAt(0),{shape:{points:e.getItemLayout(t)}},r,t),this._updateCommonStl(e,t,n)},t.prototype._updateCommonStl=function(e,t,n){var r=this.childAt(0),i=e.getItemModel(t),o=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||e.hasItemOption){var u=i.getModel("emphasis");o=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}r.useStyle(e.getItemVisual(t,"style")),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,Tp(this,a,s,l)},t.prototype.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},t}(Kl),xB=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return g(t,e),t.prototype.createLine=function(e,t,n){return new _B(e,t,n)},t.prototype._updateAnimationPoints=function(e,t){this._points=t;for(var n=[0],r=0,i=1;i<t.length;i++){var o=t[i-1],a=t[i];r+=Hi(o,a),n.push(r)}if(0!==r){for(i=0;i<n.length;i++)n[i]/=r;this._offsets=n,this._length=r}else this._length=0},t.prototype._getLineLength=function(){return this._length},t.prototype._updateSymbolPosition=function(e){var t=e.__t<1?e.__t:2-e.__t,n=this._points,r=this._offsets,i=n.length;if(r){var o,a=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(a+1,i-1);o>=0&&!(r[o]<=t);o--);o=Math.min(o,i-2)}else{for(o=a;o<i&&!(r[o]>t);o++);o=Math.min(o-1,i-2)}var s=(t-r[o])/(r[o+1]-r[o]),l=n[o],u=n[o+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=e.__t<1?u[0]-l[0]:l[0]-u[0],h=e.__t<1?u[1]-l[1]:l[1]-u[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},t}(yB),bB=function(){this.polyline=!1,this.curveness=0,this.segs=[]},wB=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return g(t,e),t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new bB},t.prototype.buildPath=function(e,t){var n,r=t.segs,i=t.curveness;if(t.polyline)for(n=this._off;n<r.length;){var o=r[n++];if(o>0){e.moveTo(r[n++],r[n++]);for(var a=1;a<o;a++)e.lineTo(r[n++],r[n++])}}else for(n=this._off;n<r.length;){var s=r[n++],l=r[n++],u=r[n++],c=r[n++];if(e.moveTo(s,l),i>0){var h=(s+u)/2-(l-c)*i,d=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,d,u,c)}else e.lineTo(u,c)}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,r=n.segs,i=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<r.length;){var l=r[s++];if(l>0)for(var u=r[s++],c=r[s++],h=1;h<l;h++){if(Oh(u,c,d=r[s++],p=r[s++],o,e,t))return a}a++}else for(a=0,s=0;s<r.length;){u=r[s++],c=r[s++];var d=r[s++],p=r[s++];if(i>0){if(kh(u,c,(u+d)/2-(c-p)*i,(c+p)/2-(d-u)*i,d,p,o,e,t))return a}else if(Oh(u,c,d,p,o,e,t))return a;a++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<t.length;){var s=t[a++],l=t[a++];n=Math.min(s,n),i=Math.max(s,i),r=Math.min(l,r),o=Math.max(l,o)}e=this._rect=new Uo(n,r,i,o)}return e},t}(ed),SB=function(){function e(){this.group=new Kl}return e.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},e.prototype.incrementalUpdate=function(e,t){var n=this._newAdded[0],r=t.getLayout("linesPoints"),i=n&&n.shape.segs;if(i&&i.length<2e4){var o=i.length,a=new Float32Array(o+r.length);a.set(i),a.set(r,o),n.setShape({segs:a})}else{this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:r}),this._setCommon(s,t),s.__startIndex=e.start}},e.prototype.remove=function(){this._clear()},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new wB({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;e.setShape({polyline:r.get("polyline"),curveness:r.get(["lineStyle","curveness"])}),e.useStyle(r.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var i=t.getVisual("style");i&&i.stroke&&e.setStyle("stroke",i.stroke),e.setStyle("fill",null);var o=Ld(e);o.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){o.dataIndex=null;var n=e.hoverDataIdx;n>0&&(o.dataIndex=n+e.__startIndex)}))},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),TB={seriesType:"lines",plan:Dx(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get("polyline"),r=e.pipelineContext.large;return{progress:function(i,o){var a=[];if(r){var s=void 0,l=i.end-i.start;if(n){for(var u=0,c=i.start;c<i.end;c++)u+=e.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var h=0,d=[];for(c=i.start;c<i.end;c++){var p=e.getLineCoords(c,a);n&&(s[h++]=p);for(var f=0;f<p;f++)d=t.dataToPoint(a[f],!1,d),s[h++]=d[0],s[h++]=d[1]}o.setLayout("linesPoints",s)}else for(c=i.start;c<i.end;c++){var g=o.getItemModel(c),m=(p=e.getLineCoords(c,a),[]);if(n)for(var v=0;v<p;v++)m.push(t.dataToPoint(a[v]));else{m[0]=t.dataToPoint(a[0]),m[1]=t.dataToPoint(a[1]);var y=g.get(["lineStyle","curveness"]);+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}o.setItemLayout(c,m)}}}}"production"!==process.env.NODE_ENV&&zu("The lines series must have a coordinate system.")}},MB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this._updateLineDraw(r,e),o=e.get("zlevel"),a=e.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&a>0&&(l?"production"!==process.env.NODE_ENV&&console.warn("SVG render mode doesn't support lines with trail effect"):s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),i.updateData(r);var u=e.get("clip",!0)&&qD(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateLineDraw(r,e).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var r=e.getData(),i=e.pipelineContext;if(!this._finished||i.large||i.progressiveRender)return{update:!0};var o=TB.reset(e,t,n);o.progress&&o.progress({start:0,end:r.count(),count:r.count()},r),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,r=this._showEffect(t),i=!!t.get("polyline"),o=t.pipelineContext.large;return"production"!==process.env.NODE_ENV&&r&&o&&console.warn("Large lines not support effect"),n&&r===this._hasEffet&&i===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new SB:new cR(i?r?xB:_B:r?yB:uR),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=o),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type="lines",t}(zx),AB="undefined"==typeof Uint32Array?Array:Uint32Array,CB="undefined"==typeof Float64Array?Array:Float64Array;function DB(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&("production"!==process.env.NODE_ENV&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),e.data=Gr(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),Nr([t,e[0],e[1]])})))}var EB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return g(t,e),t.prototype.init=function(t){t.data=t.data||[],DB(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(DB(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=bi(this._flatCoords,t.flatCoords),this._flatCoordsOffset=bi(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},t.prototype._processFlatCoordsArray=function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),Jr(e[0])){for(var n=e.length,r=new AB(n),i=new CB(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},t.prototype.getInitialData=function(e,t){if("production"!==process.env.NODE_ENV&&!yy.get(e.coordinateSystem))throw new Error("Unknown coordinate system "+e.coordinateSystem);var n=new yT(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},t.prototype.formatTooltip=function(e,t,n){var r=this.getData().getItemModel(e),i=r.get("name");if(i)return i;var o=r.get("fromName"),a=r.get("toName"),s=[];return null!=o&&s.push(o),null!=a&&s.push(a),ex("nameValue",{name:s.join(" > ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),t=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&t>0?t+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(Mx);function IB(e){return e instanceof Array||(e=[e,e]),e}var LB={seriesType:"lines",reset:function(e){var t=IB(e.get("symbol")),n=IB(e.get("symbolSize")),r=e.getData();return r.setVisual("fromSymbol",t&&t[0]),r.setVisual("toSymbol",t&&t[1]),r.setVisual("fromSymbolSize",n&&n[0]),r.setVisual("toSymbolSize",n&&n[1]),{dataEach:r.hasItemOption?function(e,t){var n=e.getItemModel(t),r=IB(n.getShallow("symbol",!0)),i=IB(n.getShallow("symbolSize",!0));r[0]&&e.setItemVisual(t,"fromSymbol",r[0]),r[1]&&e.setItemVisual(t,"toSymbol",r[1]),i[0]&&e.setItemVisual(t,"fromSymbolSize",i[0]),i[1]&&e.setItemVisual(t,"toSymbolSize",i[1])}:null}}};var NB=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=fr.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=r(f[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),_=y.data,x=0,b=_.length,w=this.minOpacity,S=this.maxOpacity-w;x<b;){v=_[x+3]/256;var T=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*S+w),_[x++]=M[T],_[x++]=M[T+1],_[x++]=M[T+2],_[x++]=M[T+3]*v*256}else x+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=fr.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function PB(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var OB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r;if(t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(r=t)}))})),"production"!==process.env.NODE_ENV&&!r)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):PB(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(PB(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,a,s,l,u=e.coordinateSystem,c=KD(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");if("production"!==process.env.NODE_ENV){if("category"!==h.type||"category"!==d.type)throw new Error("Heatmap on cartesian must have two category axes");if(!h.onBand||!d.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),_=Kg(e),x=e.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),T=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<r;M++){var A=void 0,C=f.getItemVisual(M,"style");if(c){var D=f.get(T[0],M),E=f.get(T[1],M);if(isNaN(f.get(T[2],M))||isNaN(D)||isNaN(E)||D<s[0]||D>s[1]||E<l[0]||E>l[1])continue;var I=u.dataToPoint([D,E]);A=new fd({shape:{x:I[0]-o/2,y:I[1]-a/2,width:o,height:a},style:C})}else{if(isNaN(f.get(T[1],M)))continue;A=new fd({z2:1,shape:u.dataToRect([f.get(T[0],M)]).contentShape,style:C})}if(f.hasItemOption){var L=f.getItemModel(M),N=L.getModel("emphasis");g=N.getModel("itemStyle").getItemStyle(),m=L.getModel(["blur","itemStyle"]).getItemStyle(),v=L.getModel(["select","itemStyle"]).getItemStyle(),y=L.get(["itemStyle","borderRadius"]),b=N.get("focus"),w=N.get("blurScope"),S=N.get("disabled"),_=Kg(L)}A.shape.r=y;var P=e.getRawValue(M),O="-";P&&null!=P[2]&&(O=P[2]+""),qg(A,_,{labelFetcher:e,labelDataIndex:M,defaultOpacity:C.opacity,defaultText:O}),A.ensureState("emphasis").style=g,A.ensureState("blur").style=m,A.ensureState("select").style=v,Tp(A,b,w,S),A.incremental=i,i&&(A.states.emphasis.hoverLayer=!0),p.add(A),f.setItemGraphicEl(M,A),this._progressiveEls&&this._progressiveEls.push(A)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new NB;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),d=Math.min(l.width+l.x,r.getWidth()),p=Math.min(l.height+l.y,r.getHeight()),f=d-c,g=p-h,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(m,(function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=c,i[1]-=h,i.push(r),i})),y=n.getExtent(),_="visualMap.continuous"===n.type?function(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}(y,n.option.range):function(e,t,n){var r=e[1]-e[0],i=(t=Gr(t,(function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}}))).length,o=0;return function(e){var r;for(r=o;r<i;r++)if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}if(r===i)for(r=o-1;r>=0;r--){var a;if((a=t[r].interval)[0]<=e&&e<=a[1]){o=r;break}}return r>=0&&r<i&&n[r]}}(y,n.getPieceList(),n.option.selected);s.update(v,f,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new ad({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(zx),RB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.getInitialData=function(e,t){return DT(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=yy.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(Mx);var kB=["itemStyle","borderWidth"],zB=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],BB=new tf,VB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=this.group,i=e.getData(),o=this._data,a=e.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:zB[+s],categoryDim:zB[1-+s]};i.diff(o).add((function(e){if(i.hasValue(e)){var t=YB(i,e),n=FB(i,e,t,u),o=KB(i,u,n);i.setItemGraphicEl(e,o),r.add(o),tV(o,u,n)}})).update((function(e,t){var n=o.getItemGraphicEl(t);if(i.hasValue(e)){var a=YB(i,e),s=FB(i,e,a,u),l=JB(i,s);n&&l!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(e,null),n=null),n?function(e,t,n){var r=n.animationModel,i=n.dataIndex,o=e.__pictorialBundle;ug(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?UB(e,t,n,!0):WB(e,t,n,!0);XB(e,n,!0),jB(e,t,n,!0)}(n,u,s):n=KB(i,u,s,!0),i.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,r.add(n),tV(n,u,s)}else r.remove(n)})).remove((function(e){var t=o.getItemGraphicEl(e);t&&$B(o,e,t.__pictorialSymbolMeta.animationModel,t)})).execute();var c=e.get("clip",!0)?qD(e.coordinateSystem,!1,e):null;return c?r.setClipPath(c):r.removeClipPath(),this._data=i,this.group},t.prototype.remove=function(e,t){var n=this.group,r=this._data;e.get("animation")?r&&r.eachItemGraphicEl((function(t){$B(r,Ld(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(zx);function FB(e,t,n,r){var i=e.getItemLayout(t),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:t,layout:i,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!function(e,t,n,r,i){var o,a=r.valueDim,s=e.get("symbolBoundingData"),l=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[a.wh]<=0);if(Zr(s)){var h=[GB(l,s[0])-u,GB(l,s[1])-u];h[1]<h[0]&&h.reverse(),o=h[c]}else o=null!=s?GB(l,s)-u:t?r.coordSysExtent[a.index][c]-u:n[a.wh];i.boundingLength=o,t&&(i.repeatCutLength=n[a.wh]);i.pxSign=o>0?1:-1}(n,o,i,r,h),function(e,t,n,r,i,o,a,s,l,u){var c,h=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=e.getItemVisual(t,"symbolSize");c=Zr(f)?f.slice():null==f?["100%","100%"]:[f,f];c[d.index]=uu(c[d.index],p),c[h.index]=uu(c[h.index],r?p:Math.abs(o)),u.symbolSize=c;var g=u.symbolScale=[c[0]/s,c[1]/s];g[h.index]*=(l.isHorizontal?-1:1)*a}(e,t,i,o,0,h.boundingLength,h.pxSign,u,r,h),function(e,t,n,r,i){var o=e.get(kB)||0;o&&(BB.attr({scaleX:t[0],scaleY:t[1],rotation:n}),BB.updateTransform(),o/=BB.getLineScale(),o*=t[r.valueDim.index]);i.valueLineWidth=o||0}(n,h.symbolScale,l,r,h);var d=h.symbolSize,p=jb(n.get("symbolOffset"),d);return function(e,t,n,r,i,o,a,s,l,u,c,h){var d=c.categoryDim,p=c.valueDim,f=h.pxSign,g=Math.max(t[p.index]+s,0),m=g;if(r){var v=Math.abs(l),y=si(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=uu(y,t[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=Du(r),T=S?r:nV((v+w)/b);b=g+2*(x=(v-T*g)/2/(_?T:Math.max(T-1,1))),w=_?0:2*x,S||"fixed"===r||(T=u?nV((Math.abs(u)+w)/b):0),m=T*b-w,h.repeatTimes=T,h.symbolMargin=x}var M=f*(m/2),A=h.pathPosition=[];A[d.index]=n[d.wh]/2,A[p.index]="start"===a?M:"end"===a?l-M:l/2,o&&(A[0]+=o[0],A[1]+=o[1]);var C=h.bundlePosition=[];C[d.index]=n[d.xy],C[p.index]=n[p.xy];var D=h.barRectShape=Pr({},n);D[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(A[p.index]+M)),D[d.wh]=n[d.wh];var E=h.clipShape={};E[d.xy]=-n[d.xy],E[d.wh]=c.ecSize[d.wh],E[p.xy]=0,E[p.wh]=n[p.wh]}(n,d,i,o,0,p,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,r,h),h}function GB(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function HB(e){var t=e.symbolPatternSize,n=Wb(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function UB(e,t,n,r){var i=e.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=o[t.valueDim.index]+a+2*n.symbolMargin;for(QB(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c<u?eV(e,null,f(c),n,r):eV(e,null,{scaleX:0,scaleY:0},n,r,(function(){i.remove(e)})),c++}));c<u;c++){var d=HB(n);d.__pictorialAnimationIndex=c,d.__pictorialRepeatTimes=u,i.add(d);var p=f(c);eV(d,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,r)}function f(e){var t=s.slice(),r=n.pxSign,i=e;return("start"===n.symbolRepeatDirection?r>0:r<0)&&(i=u-1-e),t[l.index]=h*(i-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function WB(e,t,n,r){var i=e.__pictorialBundle,o=e.__pictorialMainPath;o?eV(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(o=e.__pictorialMainPath=HB(n),i.add(o),eV(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function XB(e,t,n){var r=Pr({},t.barRectShape),i=e.__pictorialBarRect;i?eV(i,null,{shape:r},t,n):((i=e.__pictorialBarRect=new fd({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,e.add(i))}function jB(e,t,n,r){if(n.symbolClip){var i=e.__pictorialClipPath,o=Pr({},n.clipShape),a=t.valueDim,s=n.animationModel,l=n.dataIndex;if(i)ug(i,{shape:o},s,l);else{o[a.wh]=0,i=new fd({shape:o}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[a.wh]=n.clipShape[a.wh],Xg[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function YB(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=ZB,n.isAnimationEnabled=qB,n}function ZB(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function qB(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function KB(e,t,n,r){var i=new Kl,o=new Kl;return i.add(o),i.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?UB(i,t,n):WB(i,0,n),XB(i,n,r),jB(i,t,n,r),i.__pictorialShapeStr=JB(e,n),i.__pictorialSymbolMeta=n,i}function $B(e,t,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var o=[];QB(r,(function(e){o.push(e)})),r.__pictorialMainPath&&o.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),Fr(o,(function(e){dg(e,{scaleX:0,scaleY:0},n,t,(function(){r.parent&&r.parent.remove(r)}))})),e.setItemGraphicEl(t,null)}function JB(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function QB(e,t,n){Fr(e.__pictorialBundle.children(),(function(r){r!==e.__pictorialBarRect&&t.call(n,r)}))}function eV(e,t,n,r,i,o){t&&e.attr(t),r.symbolClip&&!i?n&&e.attr(n):n&&Xg[i?"updateProps":"initProps"](e,n,r.animationModel,r.dataIndex,o)}function tV(e,t,n){var r=n.dataIndex,i=n.itemModel,o=i.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=o.get("focus"),h=o.get("blurScope"),d=o.get("scale");QB(e,(function(e){if(e instanceof ad){var t=e.style;e.useStyle(Pr({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var r=e.ensureState("emphasis");r.style=a,d&&(r.scaleX=1.1*e.scaleX,r.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var p=t.valueDim.posDesc[+(n.boundingLength>0)],f=e.__pictorialBarRect;f.ignoreClip=!0,qg(f,Kg(i),{labelFetcher:t.seriesModel,labelDataIndex:r,defaultText:ED(t.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),Tp(e,c,h,o.get("disabled"))}function nV(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var rV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return g(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Sm(pE.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(pE);var iV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return g(t,e),t.prototype.render=function(e,t,n){var r=e.getData(),i=this,o=this.group,a=e.getLayerSeries(),s=r.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(e){return e.name}o.x=0,o.y=l.y+u[0];var h=new YS(this._layersSeries||[],a,c,c),d=[];function p(t,n,s){var l=i._layers;if("remove"!==t){for(var u,c,h=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var m=r.getItemLayout(f[g]),v=m.x,y=m.y0,_=m.y;h.push(v,y),p.push(v,y+_),u=r.getItemVisual(f[g],"style")}var x=r.getItemLayout(f[0]),b=e.getModel("label").get("margin"),w=e.getModel("emphasis");if("add"===t){var S=d[n]=new Kl;c=new jD({shape:{points:h,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),S.add(c),o.add(S),e.isAnimationEnabled()&&c.setClipPath(function(e,t,n){var r=new fd({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return cg(r,{shape:{x:e.x-50,width:e.width+100,height:e.height+20}},t,n),r}(c.getBoundingRect(),e,(function(){c.removeClipPath()})))}else{S=l[s];c=S.childAt(0),o.add(S),d[n]=S,ug(c,{shape:{points:h,stackedOnPoints:p}},e),gg(c)}qg(c,Kg(e),{labelDataIndex:f[g-1],defaultText:r.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var T=c.getTextContent();T&&(T.x=x.x-b,T.y=x.y0+x.y/2),c.useStyle(u),r.setItemGraphicEl(n,c),Dp(c,e),Tp(c,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[n])}h.add(jr(p,this,"add")).update(jr(p,this,"update")).remove(jr(p,this,"remove")).execute(),this._layersSeries=a,this._layers=d},t.type="themeRiver",t}(zx);var oV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new JE(jr(this.getData,this),jr(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},r=pc(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),i=[];r.buckets.each((function(e,t){i.push({name:t,dataList:e})}));for(var o=i.length,a=0;a<o;++a){for(var s=i[a].name,l=0;l<i[a].dataList.length;++l){var u=i[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,e[t]=[u,0,s],t++)}return e},t.prototype.getInitialData=function(e,t){for(var n=this.getReferringComponents("singleAxis",uc).models[0].get("type"),r=Ur(e.data,(function(e){return void 0!==e[2]})),i=this.fixData(r||[]),o=[],a=this.nameMap=xi(),s=0,l=0;l<i.length;++l)o.push(i[l][2]),a.get(i[l][2])||(a.set(i[l][2],s),s++);var u=xT(i,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:KS(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,c=new yT(u,this);return c.initData(i),c},t.prototype.getLayerSeries=function(){for(var e=this.getData(),t=e.count(),n=[],r=0;r<t;++r)n[r]=r;var i=e.mapDimension("single"),o=pc(n,(function(t){return e.get("name",t)})),a=[];return o.buckets.each((function(t,n){t.sort((function(t,n){return e.get(i,t)-e.get(i,n)})),a.push({name:n,indices:t})})),a},t.prototype.getAxisTooltipData=function(e,t,n){Zr(e)||(e=e?[e]:[]);for(var r,i=this.getData(),o=this.getLayerSeries(),a=[],s=o.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,c=-1,h=o[l].indices.length,d=0;d<h;++d){var p=i.get(e[0],o[l].indices[d]),f=Math.abs(p-t);f<=u&&(r=p,u=f,c=o[l].indices[d])}a.push(c)}return{dataIndices:a,nestestValue:r}},t.prototype.formatTooltip=function(e,t,n){var r=this.getData();return ex("nameValue",{name:r.getName(e),value:r.get(r.mapDimension("value"),e)})},t.type="series.themeRiver",t.dependencies=["singleAxis"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},t}(Mx);function aV(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),n=e.coordinateSystem,r={},i=n.getRect();r.rect=i;var o=e.get("boundaryGap"),a=n.getAxis();(r.boundaryGap=o,"horizontal"===a.orient)?(o[0]=uu(o[0],i.height),o[1]=uu(o[1],i.height),sV(t,e,i.height-o[0]-o[1])):(o[0]=uu(o[0],i.width),o[1]=uu(o[1],i.width),sV(t,e,i.width-o[0]-o[1]));t.setLayout("layoutInfo",r)}))}function sV(e,t,n){if(e.count())for(var r,i=t.coordinateSystem,o=t.getLayerSeries(),a=e.mapDimension("single"),s=e.mapDimension("value"),l=Gr(o,(function(t){return Gr(t.indices,(function(t){var n=i.dataToPoint(e.get(a,t));return n[1]=e.get(s,t),n}))})),u=function(e){for(var t=e.length,n=e[0].length,r=[],i=[],o=0,a=0;a<n;++a){for(var s=0,l=0;l<t;++l)s+=e[l][a][1];s>o&&(o=s),r.push(s)}for(var u=0;u<n;++u)i[u]=(o-r[u])/2;o=0;for(var c=0;c<n;++c){var h=r[c]+i[c];h>o&&(o=h)}return{y0:i,max:o}}(l),c=u.y0,h=n/u.max,d=o.length,p=o[0].indices.length,f=0;f<p;++f){r=c[f]*h,e.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:r,y:l[0][f][1]*h});for(var g=1;g<d;++g)r+=l[g-1][f][1]*h,e.setItemLayout(o[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:r,y:l[g][f][1]*h})}}var lV=function(e){function t(t,n,r,i){var o=e.call(this)||this;o.z2=2,o.textConfig={inside:!0},Ld(o).seriesIndex=n.seriesIndex;var a=new Id({z2:4,silent:t.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,t,n,r,i),o}return g(t,e),t.prototype.updateData=function(e,t,n,r,i){this.node=t,t.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var o=this;Ld(o).dataIndex=t.dataIndex;var a=t.getModel(),s=a.getModel("emphasis"),l=t.getLayout(),u=Pr({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=bw(h,i));var d=_E(a.getModel("itemStyle"),u,!0);Pr(u,d),Fr(Fd,(function(e){var t=o.ensureState(e),n=a.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var r=_E(n,u);r&&(t.shape=r)})),e?(o.setShape(u),o.shape.r=l.r0,cg(o,{shape:{r:l.r}},n,t.dataIndex)):(ug(o,{shape:u},n),gg(o)),o.useStyle(c),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var f=s.get("focus");Tp(this,"ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():f,s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),r=n.getModel("label"),i=this.node.getLayout(),o=i.endAngle-i.startAngle,a=(i.startAngle+i.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,c=u.getTextContent(),h=this.node.dataIndex,d=r.get("minAngle")/180*Math.PI,p=r.get("show")&&!(null!=d&&Math.abs(o)<d);function f(e,t){var n=e.get(t);return null==n?r.get(t):n}c.ignore=!p,Fr(Gd,(function(r){var d="normal"===r?n.getModel("label"):n.getModel([r,"label"]),p="normal"===r,g=p?c:c.ensureState(r),m=e.getFormattedLabel(h,r);p&&(m=m||t.node.name),g.style=$g(d,{},null,"normal"!==r,!0),m&&(g.style.text=m);var v=d.get("show");null==v||p||(g.ignore=!v);var y,_=f(d,"position"),x=p?u:u.states[r],b=x.style.fill;x.textConfig={outsideFill:"inherit"===d.get("color")?b:null,inside:"outside"!==_};var w=f(d,"distance")||0,S=f(d,"align"),T=f(d,"rotate"),M=.5*Math.PI,A=1.5*Math.PI,C=Bh("tangential"===T?Math.PI/2-a:a),D=C>M&&!_u(C-M)&&C<A;"outside"===_?(y=i.r+w,S=D?"right":"left"):S&&"center"!==S?"left"===S?(y=i.r0+w,S=D?"right":"left"):"right"===S&&(y=i.r-w,S=D?"left":"right"):(y=o===2*Math.PI&&0===i.r0?0:(i.r+i.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=y*s+i.cx,g.y=y*l+i.cy;var E=0;"radial"===T?E=Bh(-a)+(D?Math.PI:0):"tangential"===T?E=Bh(Math.PI/2-a)+(D?Math.PI:0):Jr(T)&&(E=T*Math.PI/180),g.rotation=Bh(E)})),c.dirtyStyle()},t}(bf),uV="sunburstRootToNode",cV="sunburstHighlight",hV="sunburstUnhighlight";var dV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n,r){var i=this;this.seriesModel=e,this.api=n,this.ecModel=t;var o=e.getData(),a=o.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),c=[];s.eachNode((function(e){c.push(e)}));var h=this._oldChildren||[];!function(r,i){if(0===r.length&&0===i.length)return;function s(e){return e.getId()}function c(s,c){!function(r,i){u||!r||r.getValue()||(r=null);if(r!==a&&i!==a)if(i&&i.piece)r?(i.piece.updateData(!1,r,e,t,n),o.setItemGraphicEl(r.dataIndex,i.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(i);else if(r){var s=new lV(r,e,t,n);l.add(s),o.setItemGraphicEl(r.dataIndex,s)}}(null==s?null:r[s],null==c?null:i[c])}new YS(i,r,s,s).add(c).update(c).remove(Yr(c,null)).execute()}(c,h),function(r,o){o.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,e,t,n):(i.virtualPiece=new lV(r,e,t,n),l.add(i.virtualPiece)),o.piece.off("click"),i.virtualPiece.on("click",(function(e){i._rootToNode(o.parentNode)}))):i.virtualPiece&&(l.remove(i.virtualPiece),i.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(r){if(!n&&r.piece&&r.piece===t.target){var i=r.getModel().get("nodeClick");if("rootToNode"===i)e._rootToNode(r);else if("link"===i){var o=r.getModel(),a=o.get("link");if(a)yv(a,o.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:uV,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="sunburst",t}(zx),pV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return g(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};fV(n);var r=this._levelModels=Gr(e.levels||[],(function(e){return new xm(e,this,t)}),this),i=vP.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=i.getNodeByDataIndex(t),o=r[n.depth];return o&&(e.parentModel=o),e}))}));return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=bP(r,this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){CP(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(Mx);function fV(e){var t=0;Fr(e.children,(function(e){fV(e);var n=e.value;Zr(n)&&(n=n[0]),t+=n}));var n=e.value;Zr(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Zr(e.value)?e.value[0]=n:e.value=n}var gV=Math.PI/180;function mV(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),r=e.get("radius");Zr(r)||(r=[0,r]),Zr(t)||(t=[t,t]);var i=n.getWidth(),o=n.getHeight(),a=Math.min(i,o),s=uu(t[0],i),l=uu(t[1],o),u=uu(r[0],a/2),c=uu(r[1],a/2),h=-e.get("startAngle")*gV,d=e.get("minAngle")*gV,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&vV(f,m);var v=0;Fr(f.children,(function(e){!isNaN(e.getValue())&&v++}));var y=f.getValue(),_=Math.PI/(y||v)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(c-u)/(b||1),S=e.get("clockwise"),T=e.get("stillShowZeroSum"),M=S?1:-1,A=function(t,n){if(t){var r=n;if(t!==p){var i=t.getValue(),o=0===y&&T?_:i*_;o<d&&(o=d),r=n+M*o;var c=t.depth-g-(x?-1:1),h=u+w*c,f=u+w*(c+1),m=e.getLevelModel(t);if(m){var v=m.get("r0",!0),b=m.get("r",!0),C=m.get("radius",!0);null!=C&&(v=C[0],b=C[1]),null!=v&&(h=uu(v,a/2)),null!=b&&(f=uu(b,a/2))}t.setLayout({angle:o,startAngle:n,endAngle:r,clockwise:S,cx:s,cy:l,r0:h,r:f})}if(t.children&&t.children.length){var D=0;Fr(t.children,(function(e){D+=A(e,n+D)}))}return r-n}};if(x){var C=u,D=u+w,E=2*Math.PI;p.setLayout({angle:E,startAngle:h,endAngle:h+E,clockwise:S,cx:s,cy:l,r0:C,r:D})}A(f,h)}))}function vV(e,t){var n=e.children||[];e.children=function(e,t){if(qr(t)){var n=Gr(e,(function(e,t){var n=e.getValue();return{params:{depth:e.depth,height:e.height,dataIndex:e.dataIndex,getValue:function(){return n}},index:t}}));return n.sort((function(e,n){return t(e.params,n.params)})),Gr(n,(function(t){return e[t.index]}))}var r="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(r?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(r?-1:1):n}))}(n,t),n.length&&Fr(e.children,(function(e){vV(e,t)}))}function yV(e){var t={};e.eachSeriesByType("sunburst",(function(e){var n=e.getData(),r=n.tree;r.eachNode((function(i){var o=i.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(e,n,r){for(var i=e;i&&i.depth>1;)i=i.parentNode;var o=n.getColorFromPalette(i.name||i.dataIndex+"",t);return e.depth>1&&Kr(o)&&(o=as(o,(e.depth-1)/(r-1)*.5)),o}(i,e,r.root.height)),Pr(n.ensureUniqueItemVisual(i.dataIndex,"style"),o)}))}))}var _V={color:"fill",borderColor:"stroke"},xV={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},bV=oc(),wV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return DT(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=bV(r).info),i},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Mx);function SV(e,t){return t=t||[0,0],Gr(["x","y"],(function(n,r){var i=this.getAxis(n),o=t[r],a=e[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))}),this)}function TV(e,t){return t=t||[0,0],Gr([0,1],(function(n){var r=t[n],i=e[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function MV(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function AV(e,t){return t=t||[0,0],Gr(["Radius","Angle"],(function(n,r){var i=this["get"+n+"Axis"](),o=t[r],a=e[r]/2,s="category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}var CV={};function DV(e,t,n,r){return e&&(e.legacy||!1!==e.legacy&&!n&&!r&&"tspan"!==t&&("text"===t||Ti(e,"text")))}function EV(e,t,n){var r,i,o,a=e;if("text"===t)o=a;else{o={},Ti(a,"text")&&(o.text=a.text),Ti(a,"rich")&&(o.rich=a.rich),Ti(a,"textFill")&&(o.fill=a.textFill),Ti(a,"textStroke")&&(o.stroke=a.textStroke),Ti(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Ti(a,"fontSize")&&(o.fontSize=a.fontSize),Ti(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Ti(a,"fontWeight")&&(o.fontWeight=a.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=Ti(a,"textPosition");n?r.position=s?a.textPosition:"inside":s&&(r.position=a.textPosition),Ti(a,"textPosition")&&(r.position=a.textPosition),Ti(a,"textOffset")&&(r.offset=a.textOffset),Ti(a,"textRotation")&&(r.rotation=a.textRotation),Ti(a,"textDistance")&&(r.distance=a.textDistance)}return IV(o,e),Fr(o.rich,(function(e){IV(e,e)})),{textConfig:r,textContent:i}}function IV(e,t){t&&(t.font=t.textFont||t.font,Ti(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Ti(t,"textAlign")&&(e.align=t.textAlign),Ti(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Ti(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Ti(t,"textWidth")&&(e.width=t.textWidth),Ti(t,"textHeight")&&(e.height=t.textHeight),Ti(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Ti(t,"textPadding")&&(e.padding=t.textPadding),Ti(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Ti(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Ti(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Ti(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Ti(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Ti(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Ti(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function LV(e,t,n){var r=e;r.textPosition=r.textPosition||n.position||"inside",null!=n.offset&&(r.textOffset=n.offset),null!=n.rotation&&(r.textRotation=n.rotation),null!=n.distance&&(r.textDistance=n.distance);var i=r.textPosition.indexOf("inside")>=0,o=e.fill||"#000";NV(r,t);var a=null==r.textFill;return i?a&&(r.textFill=n.insideFill||"#fff",!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=o),null==r.textStrokeWidth&&(r.textStrokeWidth=2)):(a&&(r.textFill=e.fill||n.outsideFill||"#000"),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,Fr(t.rich,(function(e){NV(e,e)})),r}function NV(e,t){t&&(Ti(t,"fill")&&(e.textFill=t.fill),Ti(t,"stroke")&&(e.textStroke=t.fill),Ti(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Ti(t,"font")&&(e.font=t.font),Ti(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Ti(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Ti(t,"fontSize")&&(e.fontSize=t.fontSize),Ti(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Ti(t,"align")&&(e.textAlign=t.align),Ti(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Ti(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Ti(t,"width")&&(e.textWidth=t.width),Ti(t,"height")&&(e.textHeight=t.height),Ti(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Ti(t,"padding")&&(e.textPadding=t.padding),Ti(t,"borderColor")&&(e.textBorderColor=t.borderColor),Ti(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Ti(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Ti(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Ti(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Ti(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Ti(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Ti(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Ti(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Ti(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Ti(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function PV(e,t){if("production"!==process.env.NODE_ENV){var n=e+"^_^"+t;CV[n]||(console.warn('[ECharts] DEPRECATED: "'+e+'" has been deprecated. '+t),CV[n]=!0)}}var OV={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},RV=Xr(OV),kV=Hr(Cl,(function(e,t){return e[t]=1,e}),{}),zV=Cl.join(", "),BV=["","style","shape","extra"],VV=oc();function FV(e,t,n,r,i){var o=e+"Animation",a=sg(e,r,i)||{},s=VV(t).userDuring;return a.duration>0&&(a.during=s?jr(qV,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),Pr(a,n[o]),a}function GV(e,t,n,r){var i=(r=r||{}).dataIndex,o=r.isInit,a=r.clearStyle,s=n.isAnimationEnabled(),l=VV(e),u=t.style;l.userDuring=t.during;var c={},h={};if(function(e,t,n){for(var r=0;r<RV.length;r++){var i=RV[r],o=OV[i],a=t[i];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(r=0;r<Cl.length;r++){var s=Cl[r];null!=t[s]&&(n[s]=t[s])}}(0,t,h),$V("shape",t,h),$V("extra",t,h),!o&&s&&(function(e,t,n){for(var r=t.transition,i=WV(r)?Cl:Xu(r||[]),o=0;o<i.length;o++){var a=i[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];"production"!==process.env.NODE_ENV&&XV(a,"el.transition"),n[a]=s}}}(e,t,c),KV("shape",e,t,c),KV("extra",e,t,c),function(e,t,n,r){if(!n)return;var i,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!WV(a)){var l=Xu(a);!i&&(i=r.style={});for(var u=0;u<l.length;u++){var c=o[f=l[u]];i[f]=c}}else if(e.getAnimationStyleProps&&(WV(s)||WV(a)||kr(s,"style")>=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!i&&(i=r.style={});var p=Xr(n);for(u=0;u<p.length;u++){var f;if(d[f=p[u]]){c=o[f];i[f]=c}}}}}}(e,t,u,c)),h.style=u,function(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var a=i[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}(e,h,a),function(e,t){Ti(t,"silent")&&(e.silent=t.silent),Ti(t,"ignore")&&(e.ignore=t.ignore),e instanceof Qc&&Ti(t,"invisible")&&(e.invisible=t.invisible);e instanceof ed&&Ti(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}(e,t),s)if(o){var d={};Fr(BV,(function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(d[e]=d[e]||{}),Pr(e?d[e]:d,n.enterFrom))}));var p=FV("enter",e,t,n,i);p.duration>0&&e.animateFrom(d,p)}else!function(e,t,n,r,i){if(i){var o=FV("update",e,t,r,n);o.duration>0&&e.animateFrom(i,o)}}(e,t,i||0,n,c);HV(e,t),u?e.dirty():e.markRedraw()}function HV(e,t){for(var n=VV(e).leaveToProps,r=0;r<BV.length;r++){var i=BV[r],o=i?t[i]:t;o&&o.leaveTo&&(n||(n=VV(e).leaveToProps={}),i&&(n[i]=n[i]||{}),Pr(i?n[i]:n,o.leaveTo))}}function UV(e,t,n,r){if(e){var i=e.parent,o=VV(e).leaveToProps;if(o){var a=FV("update",e,t,n,0);a.done=function(){i.remove(e)},e.animateTo(o,a)}else i.remove(e)}}function WV(e){return"all"===e}var XV,jV={},YV={setTransform:function(e,t){return"production"!==process.env.NODE_ENV&&di(Ti(kV,e),"Only "+zV+" available in `setTransform`."),jV.el[e]=t,this},getTransform:function(e){return"production"!==process.env.NODE_ENV&&di(Ti(kV,e),"Only "+zV+" available in `getTransform`."),jV.el[e]},setShape:function(e,t){"production"!==process.env.NODE_ENV&&ZV(e);var n=jV.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){"production"!==process.env.NODE_ENV&&ZV(e);var t=jV.el.shape;if(t)return t[e]},setStyle:function(e,t){"production"!==process.env.NODE_ENV&&ZV(e);var n=jV.el,r=n.style;return r&&("production"!==process.env.NODE_ENV&&ai(t)&&ku("style."+e+" must not be assigned with NaN."),r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){"production"!==process.env.NODE_ENV&&ZV(e);var t=jV.el.style;if(t)return t[e]},setExtra:function(e,t){return"production"!==process.env.NODE_ENV&&ZV(e),(jV.el.extra||(jV.el.extra={}))[e]=t,this},getExtra:function(e){"production"!==process.env.NODE_ENV&&ZV(e);var t=jV.el.extra;if(t)return t[e]}};function ZV(e){if("production"!==process.env.NODE_ENV&&("transition"===e||"enterFrom"===e||"leaveTo"===e))throw new Error('key must not be "'+e+'"')}function qV(){var e=this,t=e.el;if(t){var n=VV(t).userDuring,r=e.userDuring;n===r?(jV.el=t,r(YV)):e.el=e.userDuring=null}}function KV(e,t,n,r){var i=n[e];if(i){var o,a=t[e];if(a){var s=n.transition,l=i.transition;if(l)if(!o&&(o=r[e]={}),WV(l))Pr(o,a);else for(var u=Xu(l),c=0;c<u.length;c++){var h=a[p=u[c]];o[p]=h}else if(WV(s)||kr(s,e)>=0){!o&&(o=r[e]={});var d=Xr(a);for(c=0;c<d.length;c++){var p;h=a[p=d[c]];JV(i[p],h)&&(o[p]=h)}}}}}function $V(e,t,n){var r=t[e];if(r)for(var i=n[e]={},o=Xr(r),a=0;a<o.length;a++){var s=o[a];i[s]=Gs(r[s])}}function JV(e,t){return Vr(e)?e!==t:null!=e&&isFinite(e)}"production"!==process.env.NODE_ENV&&(XV=function(e,t){Ti(kV,e)||ku("Prop `"+e+"` is not a permitted in `"+t+"`. Only `"+Xr(kV).join("`, `")+"` are permitted.")});var QV=oc(),eF=["percent","easing","shape","style","extra"];function tF(e){e.stopAnimation("keyframe"),e.attr(QV(e))}function nF(e,t,n){if(n.isAnimationEnabled()&&t)if(Zr(t))Fr(t,(function(t){nF(e,t,n)}));else{var r=t.keyframes,i=t.duration;if(n&&null==i){var o=sg("enter",n,0);i=o&&o.duration}if(r&&i){var a=QV(e);Fr(BV,(function(n){if(!n||e[n]){var o,s=!1;r.sort((function(e,t){return e.percent-t.percent})),Fr(r,(function(r){var l=e.animators,u=n?r[n]:r;if("production"!==process.env.NODE_ENV&&r.percent>=1&&(s=!0),u){var c=Xr(u);if(n||(c=Ur(c,(function(e){return kr(eF,e)<0}))),c.length){o||((o=e.animate(n,t.loop,!0)).scope="keyframe");for(var h=0;h<l.length;h++)l[h]!==o&&l[h].targetName===o.targetName&&l[h].stopTracks(c);n&&(a[n]=a[n]||{});var d=n?a[n]:a;Fr(c,(function(t){d[t]=((n?e[n]:e)||{})[t]})),o.whenWithKeys(i*r.percent,u,c,r.easing)}}})),o&&("production"!==process.env.NODE_ENV&&(s||ku("End frame with percent: 1 is missing in the keyframeAnimation.",!0)),o.delay(t.delay||0).duration(i).start(t.easing))}}))}}}var rF="emphasis",iF="normal",oF="blur",aF="select",sF=[iF,rF,oF,aF],lF={normal:["itemStyle"],emphasis:[rF,"itemStyle"],blur:[oF,"itemStyle"],select:[aF,"itemStyle"]},uF={normal:["label"],emphasis:[rF,"label"],blur:[oF,"label"],select:[aF,"label"]},cF=["x","y"],hF="e\0\0",dF={normal:{},emphasis:{},blur:{},select:{}},pF={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:jr(SV,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:jr(TV,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:jr(MV,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=e.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:jr(AV,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function fF(e){return e instanceof ed}function gF(e){return e instanceof Qc}var mF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,o=e.getData(),a=this.group,s=bF(e,o,t,n);i||a.removeAll(),o.diff(i).add((function(t){SF(n,null,t,s(t,r),e,a,o)})).remove((function(t){var n=i.getItemGraphicEl(t);n&&UV(n,bV(n).option,e)})).update((function(t,l){var u=i.getItemGraphicEl(l);SF(n,u,t,s(t,r),e,a,o)})).execute();var l=e.get("clip",!0)?qD(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var o=t.getData(),a=bF(t,o,n,r),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=SF(null,null,u,a(u,i),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){Wg(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type="custom",t}(zx);function vF(e){var t,n=e.type;if("path"===n){var r=e.shape,i=null!=r.width&&null!=r.height?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,o=PF(r);t=Tg(o,null,i,r.layout||"center"),bV(t).customPathData=o}else if("image"===n)t=new ad({}),bV(t).customImagePath=e.style.image;else if("text"===n)t=new Id({});else if("group"===n)t=new Kl;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=Sg(n);if(!a){var s="";"production"!==process.env.NODE_ENV&&(s='graphic type "'+n+'" can not be found.'),Gu(s)}t=new a}return bV(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function yF(e,t,n,r,i,o,a){tF(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&null==r.transition&&(r.transition=cF);var l=r&&r.style;if(l){if("text"===t.type){var u=l;Ti(u,"textFill")&&(u.fill=u.textFill),Ti(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,h=fF(t)?l.decal:null;e&&h&&(h.dirty=!0,c=bw(h,e)),l.__decalPattern=c}gF(t)&&(l&&(c=l.__decalPattern)&&(l.decal=c));GV(t,r,o,{dataIndex:n,isInit:a,clearStyle:!0}),nF(t,r.keyframeAnimation,o)}function _F(e,t,n,r,i){var o=t.isGroup?null:t,a=i&&i[e].cfg;if(o){var s=o.ensureState(e);if(!1===r){var l=o.getState(e);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),sp(o)}}function xF(e,t,n){var r=n===iF,i=r?t:CF(t,n),o=i?i.z2:null;null!=o&&((r?e:e.ensureState(n)).z2=o||0)}function bF(e,t,n,r){var i=e.get("renderItem"),o=e.coordinateSystem,a={};o&&("production"!==process.env.NODE_ENV&&(di(i,"series.render is required."),di(o.prepareCustoms||pF[o.type],"This coordSys does not support custom series.")),a=o.prepareCustoms?o.prepareCustoms(o):pF[o.type](o));for(var s,l,u=Or({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(e,n){return null==n&&(n=s),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,r){"production"!==process.env.NODE_ENV&&PV("api.style","Please write literal style directly instead.");null==r&&(r=s);var i=t.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,l=y(r,iF).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:Kr(o)?o:"#000"},c=_(r,iF),h=$g(c,null,u,!1,!0);h.text=c.getShallow("show")?li(e.getFormattedLabel(r,iF),ED(t,r)):null;var d=Jg(c,u,!1);return b(n,l),l=LV(l,h,d),n&&x(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=s),e=e||0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var o=t.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,r){"production"!==process.env.NODE_ENV&&PV("api.styleEmphasis","Please write literal style directly instead.");null==r&&(r=s);var i=y(r,rF).getItemStyle(),o=_(r,rF),a=$g(o,null,null,!0,!0);a.text=o.getShallow("show")?ui(e.getFormattedLabel(r,rF),e.getFormattedLabel(r,iF),ED(t,r)):null;var l=Jg(o,null,!0);return b(n,i),i=LV(i,a,l),n&&x(i,n),i.legacy=!0,i},visual:function(e,n){if(null==n&&(n=s),Ti(_V,e)){var r=t.getItemVisual(n,"style");return r?r[_V[e]]:null}if(Ti(xV,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===o.type){return function(e){var t=[],n=e.axis,r="axis0";if("category"===n.type){for(var i=n.getBandWidth(),o=0;o<e.count;o++)t.push(Or({bandWidth:i,axisKey:r,stackId:YT+o},e));var a=JT(t),s=[];for(o=0;o<e.count;o++){var l=a[r][YT+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(Or({axis:o.getBaseAxis()},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return rm(e,n)}},a.api||{}),c={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:a.coordSys,dataInsideLength:t.count(),encode:wF(e.getData())},h={},d={},p={},f={},g=0;g<sF.length;g++){var m=sF[g];p[m]=e.getModel(lF[m]),f[m]=e.getModel(uF[m])}function v(e){return e===s?l||(l=t.getItemModel(e)):t.getItemModel(e)}function y(e,n){return t.hasItemOption?e===s?h[n]||(h[n]=v(e).getModel(lF[n])):v(e).getModel(lF[n]):p[n]}function _(e,n){return t.hasItemOption?e===s?d[n]||(d[n]=v(e).getModel(uF[n])):v(e).getModel(uF[n]):f[n]}return function(e,n){return s=e,l=null,h={},d={},i&&i(Or({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},c),u)};function x(e,t){for(var n in t)Ti(t,n)&&(e[n]=t[n])}function b(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function wF(e){var t={};return Fr(e.dimensions,(function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim;(t[i]=t[i]||[])[r.coordDimIndex]=e.getDimensionIndex(n)}})),t}function SF(e,t,n,r,i,o,a){if(r){var s=TF(e,t,n,r,i,o);return s&&a.setItemGraphicEl(n,s),s&&Tp(s,r.focus,r.blurScope,r.emphasisDisabled),s}o.remove(t)}function TF(e,t,n,r,i,o){"production"!==process.env.NODE_ENV&&di(r,"should not have an null/undefined element setting");var a=-1,s=t;t&&MF(t,r,i)&&(a=kr(o.childrenRef(),t),t=null);var l,u,c=!t,h=t;h?h.clearStates():(h=vF(r),s&&(l=s,(u=h).copyTransform(l),gF(u)&&gF(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,fF(u)&&fF(l)&&u.setShape(l.shape)))),!1===r.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),dF.normal.cfg=dF.normal.conOpt=dF.emphasis.cfg=dF.emphasis.conOpt=dF.blur.cfg=dF.blur.conOpt=dF.select.cfg=dF.select.conOpt=null,dF.isLegacy=!1,function(e,t,n,r,i,o){if(e.isGroup)return;AF(n,null,o),AF(n,rF,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=vF(a),e.setTextContent(c)),yF(null,c,t,a,null,r,i);for(var h=a&&a.style,d=0;d<sF.length;d++){var p=sF[d];if(p!==iF){var f=o[p].conOpt;_F(p,c,0,DF(a,f,p),null)}}h?c.dirty():c.markRedraw()}}}(h,n,r,i,c,dF),function(e,t,n,r,i){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&MF(a,o,r)&&(a=null),a||(a=vF(o),"production"!==process.env.NODE_ENV&&di(fF(a),"Only any type of `path` can be used in `clipPath`, rather than "+a.type+"."),e.setClipPath(a)),yF(null,a,t,o,null,r,i)}}(h,n,r,i,c),yF(e,h,n,r,dF,i,c),Ti(r,"info")&&(bV(h).info=r.info);for(var d=0;d<sF.length;d++){var p=sF[d];if(p!==iF){var f=CF(r,p);_F(p,h,0,DF(r,f,p),dF)}}return function(e,t,n){if(!e.isGroup){var r=e,i=n.currentZ,o=n.currentZLevel;r.z=i,r.zlevel=o;var a=t.z2;null!=a&&(r.z2=a||0);for(var s=0;s<sF.length;s++)xF(r,t,sF[s])}}(h,r,i),"group"===r.type&&function(e,t,n,r,i){var o=r.children,a=o?o.length:0,s=r.$mergeChildren,l="byName"===s||r.diffChildrenByName,u=!1===s;if(!a&&!l&&!u)return;if(l)return c={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:t},void new YS(c.oldChildren,c.newChildren,IF,IF,c).add(LF).update(LF).remove(NF).execute();var c;u&&t.removeAll();for(var h=0;h<a;h++){var d=o[h],p=t.childAt(h);d?(null==d.ignore&&(d.ignore=!1),TF(e,p,n,d,i,t)):("production"!==process.env.NODE_ENV&&di(p,"renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."),p.ignore=!0)}for(var f=t.childCount()-1;f>=h;f--){var g=t.childAt(f);EF(t,g,i)}}(e,h,n,r,i),a>=0?o.replaceAt(h,a):o.add(h),h}function MF(e,t,n){var r,i=bV(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&((r=a)&&(Ti(r,"pathData")||Ti(r,"d")))&&PF(a)!==i.customPathData||"image"===o&&Ti(s,"image")&&s.image!==i.customImagePath}function AF(e,t,n){var r=t?CF(e,t):e,i=t?DF(e,r,rF):e.style,o=e.type,a=r?r.textConfig:null,s=e.textContent,l=s?t?CF(s,t):s:null;if(i&&(n.isLegacy||DV(i,o,!!a,!!l))){n.isLegacy=!0;var u=EV(i,o,!t);!a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text"),"production"!==process.env.NODE_ENV&&di("text"===c.type,'textContent.type must be "text"')}var h=t?n[t]:n.normal;h.cfg=a,h.conOpt=l}function CF(e,t){return t?e?e[t]:null:e}function DF(e,t,n){var r=t&&t.style;return null==r&&n===rF&&e&&(r=e.styleEmphasis),r}function EF(e,t,n){t&&UV(t,bV(e).option,n)}function IF(e,t){var n=e&&e.name;return null!=n?n:hF+t}function LF(e,t){var n=this.context,r=null!=e?n.newChildren[e]:null,i=null!=t?n.oldChildren[t]:null;TF(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function NF(e){var t=this.context,n=t.oldChildren[e];n&&UV(n,bV(n).option,t.seriesModel)}function PF(e){return e&&(e.pathData||e.d)}var OF=oc(),RF=Ir,kF=jr,zF=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,i,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(a){var h=Yr(BF,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new Kl,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);HF(a,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),r=e.axis,i="category"===r.type,o=t.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&r.getBandWidth()>a)return!0;if(o){var s=BI(e).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var o=OF(e).pointerEl=new Xg[i.type](RF(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=OF(e).labelEl=new Id(RF(t.label));e.add(i),FF(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=OF(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=OF(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),FF(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(t=!0,i=this._handle=Bg(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){yo(e.event)},onmousedown:kF(this._onHandleDragMove,this,0,0),drift:kF(this._onHandleDragMove,this),ondragend:kF(this._onHandleDragEnd,this)}),r.add(i)),HF(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");Zr(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,Hx(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){BF(this._axisPointerModel,!t&&this._moveAnimation,this._handle,GF(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(GF(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(GF(r)),OF(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),Ux(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function BF(e,t,n,r){VF(OF(n).lastProp,r)||(OF(n).lastProp=r,t?ug(n,r,e):(n.stopAnimation(),n.attr(r)))}function VF(e,t){if(Qr(e)&&Qr(t)){var n=!0;return Fr(t,(function(t,r){n=n&&VF(e[r],t)})),!!n}return e===t}function FF(e,t){e[t.get(["label","show"])?"show":"hide"]()}function GF(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function HF(e,t,n){var r=t.get("z"),i=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=r&&(e.z=r),null!=i&&(e.zlevel=i),e.silent=n)}))}function UF(e){var t,n=e.get("type"),r=e.getModel(n+"Style");return"line"===n?(t=r.getLineStyle()).fill=null:"shadow"===n&&((t=r.getAreaStyle()).stroke=null),t}function WF(e,t,n,r,i){var o=XF(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=cv(a.get("padding")||0),l=a.getFont(),u=Pl(o,l),c=i.position,h=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=i.align;"right"===p&&(c[0]-=h),"center"===p&&(c[0]-=h/2);var f=i.verticalAlign;"bottom"===f&&(c[1]-=d),"middle"===f&&(c[1]-=d/2),function(e,t,n,r){var i=r.getWidth(),o=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,o)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(c,h,d,r);var g=a.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:$g(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function XF(e,t,n,r,i){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:i.precision}),a=i.formatter;if(a){var s={value:IM(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};Fr(r,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)})),Kr(a)?o=a.replace("{value}",o):qr(a)&&(o=a(s))}return o}function jF(e,t,n){var r=[1,0,0,1,0,0];return Do(r,r,n.rotation),Co(r,r,n.position),Ng([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function YF(e,t,n,r,i,o){var a=II.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get(["label","margin"]),WF(t,r,i,o,{position:jF(r.axis,e,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function ZF(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function qF(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function KF(e,t,n,r,i,o){return{cx:e,cy:t,r0:n,r:r,startAngle:i,endAngle:o,clockwise:!0}}var $F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.grid,s=r.get("type"),l=JF(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(t,!0));if(s&&"none"!==s){var c=UF(r),h=QF[s](o,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}YF(t,e,xI(a.model,n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=xI(t.axis.grid.model,t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=jF(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=JF(o,i).getOtherAxis(i).getGlobalExtent(),l="x"===i.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];return{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(zF);function JF(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var QF={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:ZF([t,n[0]],[t,n[1]],eG(e))}},shadow:function(e,t,n){var r=Math.max(1,e.getBandWidth()),i=n[1]-n[0];return{type:"Rect",shape:qF([t-r/2,n[0]],[r,i],eG(e))}}};function eG(e){return"x"===e.dim?0:1}var tG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,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",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(Nv),nG=oc(),rG=Fr;function iG(e,t,n){if(!sr.node){var r=t.getZr();nG(r).records||(nG(r).records={}),function(e,t){if(nG(e).initialized)return;function n(n,r){e.on(n,(function(n){var i=function(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}(t);rG(nG(e).records,(function(e){e&&r(e,n,i.dispatchAction)})),function(e,t){var n,r=e.showTip.length,i=e.hideTip.length;r?n=e.showTip[r-1]:i&&(n=e.hideTip[i-1]);n&&(n.dispatchAction=null,t.dispatchAction(n))}(i.pendings,t)}))}nG(e).initialized=!0,n("click",Yr(aG,"click")),n("mousemove",Yr(aG,"mousemove")),n("globalout",oG)}(r,t),(nG(r).records[e]||(nG(r).records[e]={})).handler=n}}function oG(e,t,n){e.handler("leave",null,n)}function aG(e,t,n,r){t.handler(e,n,r)}function sG(e,t){if(!sr.node){var n=t.getZr();(nG(n).records||{})[e]&&(nG(n).records[e]=null)}}var lG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=t.getComponent("tooltip"),i=e.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click";iG("axisPointer",n,(function(e,t,n){"none"!==i&&("leave"===e||i.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){sG("axisPointer",t)},t.prototype.dispose=function(e,t){sG("axisPointer",t)},t.type="axisPointer",t}(Cx);function uG(e,t){var n,r=[],i=e.seriesIndex;if(null==i||!(n=t.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=ic(o,e);if(null==a||a<0||Zr(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,d="x"===c||"radius"===c?1:0,p=o.mapDimension(h),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(f)||[]}else r=l.dataToPoint(o.getValues(Gr(l.dimensions,(function(e){return o.mapDimension(e)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var cG=oc();function hG(e,t,n){var r=e.currTrigger,i=[e.x,e.y],o=e,a=e.dispatchAction||jr(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){mG(i)&&(i=uG({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},t).point);var l=mG(i),u=o.axesInfo,c=s.axesInfo,h="leave"===r||mG(i),d={},p={},f={list:[],map:{}},g={showPointer:Yr(pG,p),showTooltip:Yr(fG,f)};Fr(s.coordSysMap,(function(e,t){var n=l||e.containPoint(i);Fr(s.coordSysAxesInfo[t],(function(e,t){var r=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}(u,e);if(!h&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&dG(e,a,g,!1,d)}}))}));var m={};return Fr(c,(function(e,t){var n=e.linkGroup;n&&!p[t]&&Fr(n.axesInfo,(function(t,r){var i=p[r];if(t!==e&&i){var o=i.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,gG(t),gG(e)))),m[e.key]=o}}))})),Fr(m,(function(e,t){dG(c[t],e,g,!0,d)})),function(e,t,n){var r=n.axesInfo=[];Fr(t,(function(t,n){var i=t.axisPointerModel.option,o=e[n];o?(!t.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!t.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})}))}(p,c,d),function(e,t,n,r){if(mG(t)||!e.list.length)return void r({type:"hideTip"});var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}(f,i,e,a),function(e,t,n){var r=n.getZr(),i="axisPointerLastHighlights",o=cG(r)[i]||{},a=cG(r)[i]={};Fr(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&Fr(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;a[t]=e}))}));var s=[],l=[];Fr(o,(function(e,t){!a[t]&&l.push(e)})),Fr(a,(function(e,t){!o[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(c,0,n),d}}function dG(e,t,n,r,i){var o=e.axis;if(!o.scale.isBlank()&&o.containData(t))if(e.involveSeries){var a=function(e,t){var n=t.axis,r=n.dim,i=e,o=[],a=Number.MAX_VALUE,s=-1;return Fr(t.seriesModels,(function(t,l){var u,c,h=t.getData().mapDimensionsAll(r);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(h,e,n);c=d.dataIndices,u=d.nestestValue}else{if(!(c=t.getData().indicesOfNearest(h[0],e,"category"===n.type?.5:null)).length)return;u=t.getData().get(h[0],c[0])}if(null!=u&&isFinite(u)){var p=e-u,f=Math.abs(p);f<=a&&((f<a||p>=0&&s<0)&&(a=f,s=p,i=u,o.length=0),Fr(c,(function(e){o.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:o,snapToValue:i}}(t,e),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&Pr(i,s[0]),!r&&e.snap&&o.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,a,l)}else n.showPointer(e,t)}function pG(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function fG(e,t,n,r){var i=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var l=t.coordSys.model,u=FI(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function gG(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=t.componentIndex,n.axisName=n[r+"AxisName"]=t.name,n.axisId=n[r+"AxisId"]=t.id,n}function mG(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function vG(e){HI.registerAxisPointerClass("CartesianAxisPointer",$F),e.registerComponentModel(tG),e.registerComponentView(lG),e.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Zr(t)&&(e.axisPointer.link=[t])}})),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=kI(e,t)})),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},hG)}var yG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o).getExtent(),l=o.dataToCoord(t),u=r.get("type");if(u&&"none"!==u){var c=UF(r),h=_G[u](o,a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}var d=function(e,t,n,r,i){var o=t.axis,a=o.dataToCoord(e),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=r.getRadiusAxis().getExtent();if("radius"===o.dim){var d=[1,0,0,1,0,0];Do(d,d,s),Co(d,d,[r.cx,r.cy]),l=Ng([a,-i],d);var p=t.getModel("axisLabel").get("rotate")||0,f=II.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,c=f.textVerticalAlign}else{var g=h[1];l=r.coordToPoint([g+i,a]);var m=r.cx,v=r.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",c=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(t,n,0,a,r.get(["label","margin"]));WF(e,n,r,i,d)},t}(zF);var _G={line:function(e,t,n,r){return"angle"===e.dim?{type:"Line",shape:ZF(t.coordToPoint([r[0],n]),t.coordToPoint([r[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,r){var i=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:KF(t.cx,t.cy,r[0],r[1],(-n-i/2)*o,(i/2-n)*o)}:{type:"Sector",shape:KF(t.cx,t.cy,n-i/2,n+i/2,0,2*Math.PI)}}},xG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(Nv),bG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",uc).models[0]},t.type="polarAxis",t}(Nv);Br(bG,RM);var wG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="angleAxis",t}(bG),SG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="radiusAxis",t}(bG),TG=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return g(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(yA);TG.prototype.dataToRadius=yA.prototype.dataToCoord,TG.prototype.radiusToData=yA.prototype.coordToData;var MG=oc(),AG=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return g(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var o=r[0],a=e.dataToCoord(o+1)-e.dataToCoord(o),s=Math.abs(a),l=Pl(null==o?"":o+"",t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var c=Math.max(0,Math.floor(u)),h=MG(e.model),d=h.lastAutoInterval,p=h.lastTickCount;return null!=d&&null!=p&&Math.abs(d-c)<=1&&Math.abs(p-i)<=1&&d>c?c=d:(h.lastTickCount=i,h.lastAutoInterval=c),c},t}(yA);AG.prototype.dataToAngle=yA.prototype.dataToCoord,AG.prototype.angleToData=yA.prototype.coordToData;var CG=["radius","angle"],DG=function(){function e(e){this.dimensions=CG,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new TG,this._angleAxis=new AG,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===e&&t.push(n),r.scale.type===e&&t.push(r),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),o=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);r.inverse?o=a-360:a=o+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,u=l<o?1:-1;l<o||l>a;)l+=360*u;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),r=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,r=t-this.cy,i=n*n+r*r-1e-4,o=this.r,a=this.r0;return i<=o*o&&i>=a*a}}},e.prototype.convertToPixel=function(e,t,n){return EG(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return EG(t)===this?this.pointToData(n):null},e}();function EG(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var IG=DG;function LG(e,t){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();Fr(OM(t,"radius"),(function(e){i.scale.unionExtentFromData(t,e)})),Fr(OM(t,"angle"),(function(e){r.scale.unionExtentFromData(t,e)}))}})),CM(r.scale,r.model),CM(i.scale,i.model),"category"===r.type&&!r.onBand){var o=r.getExtent(),a=360/r.scale.count();r.inverse?o[1]+=a:o[1]-=a,r.setExtent(o[0],o[1])}}function NG(e,t){var n;if(e.type=t.get("type"),e.scale=DM(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),function(e){return"angleAxis"===e.mainType}(t)){e.inverse=e.inverse!==t.get("clockwise");var r=t.get("startAngle"),i=null!==(n=t.get("endAngle"))&&void 0!==n?n:r+(e.inverse?-360:360);e.setExtent(r,i)}t.axis=e,e.model=t}var PG={dimensions:CG,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,r){var i=new IG(r+"");i.update=LG;var o=i.getRadiusAxis(),a=i.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");NG(o,s),NG(a,l),function(e,t,n){var r=t.get("center"),i=n.getWidth(),o=n.getHeight();e.cx=uu(r[0],i),e.cy=uu(r[1],o);var a=e.getRadiusAxis(),s=Math.min(i,o)/2,l=t.get("radius");null==l?l=[0,"100%"]:Zr(l)||(l=[0,l]);var u=[uu(l[0],s),uu(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}(i,e,t),n.push(i),e.coordinateSystem=i,i.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",uc).models[0];if("production"!==process.env.NODE_ENV&&!t)throw new Error('Polar "'+si(e.get("polarIndex"),e.get("polarId"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}})),n}},OG=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function RG(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],n]),i=e.coordToPoint([t[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function kG(e){return e.getRadiusAxis().inverse?0:1}function zG(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var BG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return g(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=Gr(n.getViewLabels(),(function(e){e=Ir(e);var t=n.scale,r="ordinal"===t.type?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(r),e}));zG(s),zG(o),Fr(OG,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||VG[t](this.group,e,r,o,a,i,s)}),this)}},t.type="angleAxis",t}(HI),VG={axisLine:function(e,t,n,r,i,o){var a,s=t.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,c=l.getExtent(),h=kG(n),d=h?0:1,p=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(a=0===o[d]?new Xg[p]({shape:{cx:n.cx,cy:n.cy,r:o[h],startAngle:-c[0]*u,endAngle:-c[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new Tf({shape:{cx:n.cx,cy:n.cy,r:o[h],r0:o[d]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(a)},axisTick:function(e,t,n,r,i,o){var a=t.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[kG(n)],u=Gr(r,(function(e){return new Rf({shape:RG(n,[l,l+s],e.coord)})}));e.add(Cg(u,{style:Or(a.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[kG(n)],c=[],h=0;h<i.length;h++)for(var d=0;d<i[h].length;d++)c.push(new Rf({shape:RG(n,[u,u+l],i[h][d].coord)}));e.add(Cg(c,{style:Or(s.getModel("lineStyle").getLineStyle(),Or(a.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(e,t,n,r,i,o,a){var s=t.getCategories(!0),l=t.getModel("axisLabel"),u=l.get("margin"),c=t.get("triggerEvent");Fr(a,(function(r,i){var a=l,h=r.tickValue,d=o[kG(n)],p=n.coordToPoint([d+u,r.coord]),f=n.cx,g=n.cy,m=Math.abs(p[0]-f)/d<.3?"center":p[0]>f?"left":"right",v=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[h]){var y=s[h];Qr(y)&&y.textStyle&&(a=new xm(y.textStyle,l,l.ecModel))}var _=new Id({silent:II.isLabelSilent(t),style:$g(a,{x:p[0],y:p[1],fill:a.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:r.formattedLabel,align:m,verticalAlign:v})});if(e.add(_),c){var x=II.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=r.rawLabel,Ld(_).eventData=x}}),this)},splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<r.length;c++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new Rf({shape:RG(n,o,r[c].coord)}))}for(c=0;c<u.length;c++)e.add(Cg(u[c],{style:Or({stroke:s[c%s.length]},a.getLineStyle()),silent:!0,z:t.get("z")}))},minorSplitLine:function(e,t,n,r,i,o){if(i.length){for(var a=t.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<i.length;l++)for(var u=0;u<i[l].length;u++)s.push(new Rf({shape:RG(n,o,i[l][u].coord)}));e.add(Cg(s,{style:a.getLineStyle(),silent:!0,z:t.get("z")}))}},splitArea:function(e,t,n,r,i,o){if(r.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,h=-r[0].coord*c,d=Math.min(o[0],o[1]),p=Math.max(o[0],o[1]),f=t.get("clockwise"),g=1,m=r.length;g<=m;g++){var v=g===m?r[0].coord:r[g].coord,y=l++%s.length;u[y]=u[y]||[],u[y].push(new bf({shape:{cx:n.cx,cy:n.cy,r0:d,r:p,startAngle:h,endAngle:-v*c,clockwise:f},silent:!0})),h=-v*c}for(g=0;g<u.length;g++)e.add(Cg(u[g],{style:Or({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}},FG=["axisLine","axisTickLabel","axisName"],GG=["splitLine","splitArea","minorSplitLine"],HG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return g(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=this._axisGroup,r=this._axisGroup=new Kl;this.group.add(r);var i=e.axis,o=i.polar,a=o.getAngleAxis(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=a.getExtent()[0],c=i.getExtent(),h=function(e,t,n){return{position:[e.cx,e.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(o,e,u),d=new II(e,h);Fr(FG,d.add,d),r.add(d.getGroup()),Rg(n,r,e),Fr(GG,(function(t){e.get([t,"show"])&&!i.scale.isBlank()&&UG[t](this.group,e,o,u,c,s,l)}),this)}},t.type="radiusAxis",t}(HI),UG={splitLine:function(e,t,n,r,i,o){var a=t.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),c=Math.PI/180,h=u.getExtent(),d=360===Math.abs(h[1]-h[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<o.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new Xg[d]({shape:{cx:n.cx,cy:n.cy,r:Math.max(o[f].coord,0),startAngle:-h[0]*c,endAngle:-h[1]*c,clockwise:u.inverse}}))}for(f=0;f<p.length;f++)e.add(Cg(p[f],{style:Or({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(e,t,n,r,i,o,a){if(a.length){for(var s=t.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var c=0;c<a[u].length;c++)l.push(new tf({shape:{cx:n.cx,cy:n.cy,r:a[u][c].coord}}));e.add(Cg(l,{style:Or({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(e,t,n,r,i,o){if(o.length){var a=t.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=o[0].coord,h=1;h<o.length;h++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new bf({shape:{cx:n.cx,cy:n.cy,r0:c,r:o[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=o[h].coord}for(h=0;h<u.length;h++)e.add(Cg(u[h],{style:Or({fill:s[h%s.length]},a.getAreaStyle()),silent:!0}))}}};function WG(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function XG(e,t){return t.dim+e.model.componentIndex}function jG(e,t,n){var r={},i=function(e){var t={};Fr(e,(function(e,n){var r=e.getData(),i=e.coordinateSystem,o=i.getBaseAxis(),a=XG(i,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/r.count(),u=t[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;t[a]=u;var h=WG(e);c[h]||u.autoWidthCount++,c[h]=c[h]||{width:0,maxWidth:0};var d=uu(e.get("barWidth"),l),p=uu(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");d&&!c[h].width&&(d=Math.min(u.remainedWidth,d),c[h].width=d,u.remainedWidth-=d),p&&(c[h].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return Fr(t,(function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,o=uu(e.categoryGap,i),a=uu(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),Fr(r,(function(e,t){var n=e.maxWidth;n&&n<u&&(n=Math.min(n,s),e.width&&(n=Math.min(n,e.width)),s-=n,e.width=n,l--)})),u=(s-o)/(l+(l-1)*a),u=Math.max(u,0);var c,h=0;Fr(r,(function(e,t){e.width||(e.width=u),c=e,h+=e.width*(1+a)})),c&&(h-=c.width*a);var d=-h/2;Fr(r,(function(e,r){n[t][r]=n[t][r]||{offset:d,width:e.width},d+=e.width*(1+a)}))})),n}(Ur(t.getSeriesByType(e),(function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type})));t.eachSeriesByType(e,(function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),n=e.coordinateSystem,o=n.getBaseAxis(),a=XG(n,o),s=WG(e),l=i[a][s],u=l.offset,c=l.width,h=n.getOtherAxis(o),d=e.coordinateSystem.cx,p=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;r[s]=r[s]||[];for(var m=t.mapDimension(h.dim),v=t.mapDimension(o.dim),y=AT(t,m),_="radius"!==o.dim||!e.get("roundCap",!0),x=h.dataToCoord(0),b=0,w=t.count();b<w;b++){var S=t.get(m,b),T=t.get(v,b),M=S>=0?"p":"n",A=x;y&&(r[s][T]||(r[s][T]={p:x,n:x}),A=r[s][T][M]);var C=void 0,D=void 0,E=void 0,I=void 0;if("radius"===h.dim){var L=h.dataToCoord(S)-x,N=o.dataToCoord(T);Math.abs(L)<f&&(L=(L<0?-1:1)*f),C=A,D=A+L,I=(E=N-u)-c,y&&(r[s][T][M]=D)}else{var P=h.dataToCoord(S,_)-x,O=o.dataToCoord(T);Math.abs(P)<g&&(P=(P<0?-1:1)*g),D=(C=O+u)+c,E=A,I=A+P,y&&(r[s][T][M]=I)}t.setItemLayout(b,{cx:d,cy:p,r0:C,r:D,startAngle:-E*Math.PI/180,endAngle:-I*Math.PI/180,clockwise:E>=I})}}}))}var YG={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},ZG={splitNumber:5},qG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="polar",t}(Cx);function KG(e,t){t=t||{};var n=e.coordinateSystem,r=e.axis,i={},o=r.position,a=r.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];i.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),si(t.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),i.labelRotation="top"===o?-c:c,i.z2=1,i}var $G=["axisLine","axisTickLabel","axisName"],JG=["splitArea","splitLine"],QG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return g(t,e),t.prototype.render=function(t,n,r,i){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Kl;var s=KG(t),l=new II(t,s);Fr($G,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),Fr(JG,(function(e){t.get([e,"show"])&&eH[e](this,this.group,this._axisGroup,t)}),this),Rg(a,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)},t.prototype.remove=function(){XI(this)},t.type="singleAxis",t}(HI),eH={splitLine:function(e,t,n,r){var i=r.axis;if(!i.scale.isBlank()){var o=r.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=r.coordinateSystem.getRect(),c=i.isHorizontal(),h=[],d=0,p=i.getTicksCoords({tickModel:o}),f=[],g=[],m=0;m<p.length;++m){var v=i.toGlobalCoord(p[m].coord);c?(f[0]=v,f[1]=u.y,g[0]=v,g[1]=u.y+u.height):(f[0]=u.x,f[1]=v,g[0]=u.x+u.width,g[1]=v);var y=new Rf({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});Eg(y.shape,l);var _=d++%s.length;h[_]=h[_]||[],h[_].push(y)}var x=a.getLineStyle(["color"]);for(m=0;m<h.length;++m)t.add(Cg(h[m],{style:Or({stroke:s[m%s.length]},x),silent:!0}))}},splitArea:function(e,t,n,r){WI(e,n,r,r)}},tH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.getCoordSysModel=function(){return this},t.type="singleAxis",t.layoutMode="box",t.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},t}(Nv);Br(tH,RM.prototype);var nH=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.type=i||"value",a.position=o||"bottom",a}return g(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(yA),rH=["single"],iH=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=rH,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=this.dimension,i=new nH(r,DM(e),[0,0],e.get("type"),e.get("position")),o="category"===i.type;i.onBand=o&&e.get("boundaryGap"),i.inverse=e.get("inverse"),i.orient=e.get("orient"),e.axis=i,i.model=e,i.coordinateSystem=this,this._axis=i},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();Fr(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),CM(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=Tv({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),r=n?[0,e.width]:[0,e.height],i=t.inverse?1:0;t.setExtent(r[i],r[1-i]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),r=n[0]+n[1],i=e.isHorizontal();e.toGlobalCoord=i?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=i?function(e){return e-t}:function(e){return r-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),r=[],i="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),r[i]=t.toGlobalCoord(t.dataToCoord(+e)),r[1-i]=0===i?n.y+n.height/2:n.x+n.width/2,r},e.prototype.convertToPixel=function(e,t,n){return oH(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return oH(t)===this?this.pointToData(n):null},e}();function oH(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var aH={create:function(e,t){var n=[];return e.eachComponent("singleAxis",(function(r,i){var o=new iH(r,e,t);o.name="single_"+i,o.resize(r,t),r.coordinateSystem=o,n.push(o)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",uc).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n},dimensions:rH},sH=["x","y"],lH=["width","height"],uH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o=n.axis,a=o.coordinateSystem,s=dH(a,1-hH(o)),l=a.dataToPoint(t)[0],u=r.get("type");if(u&&"none"!==u){var c=UF(r),h=cH[u](o,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}YF(t,e,KG(n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=KG(t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=jF(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.coordinateSystem,a=hH(i),s=dH(o,a),l=[e.x,e.y];l[a]+=t[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=dH(o,1-a),c=(u[1]+u[0])/2,h=[c,c];return h[a]=l[a],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(zF),cH={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:ZF([t,n[0]],[t,n[1]],hH(e))}},shadow:function(e,t,n){var r=e.getBandWidth(),i=n[1]-n[0];return{type:"Rect",shape:qF([t-r/2,n[0]],[r,i],hH(e))}}};function hH(e){return e.isHorizontal()?0:1}function dH(e,t){var n=e.getRect();return[n[sH[t]],n[sH[t]]+n[lH[t]]]}var pH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="single",t}(Cx);var fH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(t,n,r){var i=Dv(t);e.prototype.init.apply(this,arguments),gH(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),gH(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(Nv);function gH(e,t){var n,r=e.cellSize;1===(n=Zr(r)?r:e.cellSize=[r,r]).length&&(n[1]=n[0]);var i=Gr([0,1],(function(e){return function(e,t){return null!=e[bv[t][0]]||null!=e[bv[t][1]]&&null!=e[bv[t][2]]}(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));Cv(e,t,{type:"box",ignoreSize:i})}var mH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,o=i.getRangeInfo(),a=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,o,r),this._renderLines(e,o,a,r),this._renderYearText(e,o,a,r),this._renderMonthText(e,s,a,r),this._renderWeekText(e,s,o,a,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel("itemStyle").getItemStyle(),o=r.getCellWidth(),a=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToRect([s],!1).tl,u=new fd({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:i});n.add(u)}},t.prototype._renderLines=function(e,t,n,r){var i=this,o=e.coordinateSystem,a=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){d(u.formatedDate),0===c&&(u=o.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=o.getDateInfo(h)}function d(t){i._firstDayOfMonth.push(o.getDateInfo(t)),i._firstDayPoints.push(o.dataToRect([t],!1).tl);var l=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(l[0]),i._blpoints.push(l[l.length-1]),s&&i._drawSplitline(l,a,r)}d(o.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,l,n),a,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,l,n),a,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i="horizontal"===n?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new Lf({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),o=[],a=0;a<7;a++){var s=r.getNextNDay(i.time,a),l=r.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},t.prototype._formatterLabel=function(e,t){return Kr(e)&&e?(n=e,Fr(t,(function(e,t){n=n.replace("{"+t+"}",e)})),n):qr(e)?e(t):t.nameMap;var n},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var o=t[0],a=t[1],s=["center","bottom"];"bottom"===r?(a+=i,s=["center","top"]):"left"===r?o-=i:"right"===r?(o+=i,s=["center","top"]):a-=i;var l=0;return"left"!==r&&"right"!==r||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel("yearLabel");if(i.get("show")){var o=i.get("margin"),a=i.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var p=i.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new Id({z2:30,style:$g(i,{text:g})});m.attr(this._yearTextPositionControl(m,h[a],n,a,o)),r.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var o="left",a="top",s=e[0],l=e[1];return"horizontal"===n?(l+=i,t&&(o="center"),"start"===r&&(a="bottom")):(s+=i,t&&(a="middle"),"start"===r&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),a=i.get("margin"),s=i.get("position"),l=i.get("align"),u=[this._tlpoints,this._blpoints];o&&!Kr(o)||(o&&(t=Lm(o)||t),o=t.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,h="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=0;p<u[c].length-1;p++){var f=u[c][p].slice(),g=this._firstDayOfMonth[p];if(d){var m=this._firstDayPoints[p];f[h]=(m[h]+u[0][p+1][h])/2}var v=i.get("formatter"),y=o[+g.m-1],_={yyyy:g.y,yy:(g.y+"").slice(2),MM:g.m,M:+g.m,nameMap:y},x=this._formatterLabel(v,_),b=new Id({z2:30,style:Pr($g(i,{text:x}),this._monthTextPositionControl(f,d,n,s,a))});r.add(b)}}},t.prototype._weekTextPositionControl=function(e,t,n,r,i){var o="center",a="middle",s=e[0],l=e[1],u="start"===n;return"horizontal"===t?(s=s+r+(u?1:-1)*i[0]/2,o=u?"right":"left"):(l=l+r+(u?1:-1)*i[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:o,verticalAlign:a}},t.prototype._renderWeekText=function(e,t,n,r,i){var o=e.getModel("dayLabel");if(o.get("show")){var a=e.coordinateSystem,s=o.get("position"),l=o.get("nameMap"),u=o.get("margin"),c=a.getFirstDayOfWeek();if(!l||Kr(l))l&&(t=Lm(l)||t),l=t.get(["time","dayOfWeekShort"])||Gr(t.get(["time","dayOfWeekAbbr"]),(function(e){return e[0]}));var h=a.getNextNDay(n.end.time,7-n.lweek).time,d=[a.getCellWidth(),a.getCellHeight()];u=uu(u,Math.min(d[1],d[0])),"start"===s&&(h=a.getNextNDay(n.start.time,-(7+n.fweek)).time,u=-u);for(var p=0;p<7;p++){var f,g=a.getNextNDay(h,p),m=a.dataToRect([g.time],!1).center;f=Math.abs((p+c)%7);var v=new Id({z2:30,style:Pr($g(o,{text:l[f]}),this._weekTextPositionControl(m,r,s,u,d))});i.add(v)}}},t.type="calendar",t}(Cx),vH=864e5,yH=function(){function e(t,n,r){this.type="calendar",this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t}return e.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){var t=(e=bu(e)).getFullYear(),n=e.getMonth()+1,r=n<10?"0"+n:""+n,i=e.getDate(),o=i<10?"0"+i:""+i,a=e.getDay();return{y:t+"",m:r,d:o,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+r+"-"+o,date:e}},e.prototype.getNextNDay=function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},e.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=["width","height"],i=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),a="horizontal"===this._orient?[n,7]:[7,n];Fr([0,1],(function(e){u(i,e)&&(o[r[e]]=i[e]*a[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=Tv(o,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}Fr([0,1],(function(e){u(i,e)||(i[e]=l[r[e]]/a[e])})),this._sw=i[0],this._sh=i[1]},e.prototype.dataToPoint=function(e,t){Zr(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),r=this._rangeInfo,i=n.formatedDate;if(t&&!(n.time>=r.start.time&&n.time<r.end.time+vH))return[NaN,NaN];var o=n.day,a=this._getRangeInfo([r.start.time,i]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]:[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},e.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},e.prototype.dataToRect=function(e,t){var n=this.dataToPoint(e,t);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},e.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,n=Math.floor((e[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,t-1,r):this._getDateByWeeksAndDay(t,n-1,r)},e.prototype.convertToPixel=function(e,t,n){var r=_H(t);return r===this?r.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){var r=_H(t);return r===this?r.pointToData(n):null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.prototype._initRangeOption=function(){var e,t=this._model.get("range");if(Zr(t)&&1===t.length&&(t=t[0]),Zr(t))e=t;else{var n=t.toString();if(/^\d{4}$/.test(n)&&(e=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var o=this.getNextNDay(i,-1);e=[r.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(e=[n,n])}if(!e)return"production"!==process.env.NODE_ENV&&Er("Invalid date range."),t;var a=this._getRangeInfo(e);return a.start.time>a.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var r=Math.floor(n[1].time/vH)-Math.floor(n[0].time/vH)+1,i=new Date(n[0].time),o=i.getDate(),a=n[1].date.getDate();i.setDate(o+r-1);var s=i.getDate();if(s!==a)for(var l=i.getTime()-n[1].time>0?1:-1;(s=i.getDate())!==a&&(i.getTime()-n[1].time)*l>0;)r-=l,i.setDate(s-l);var u=Math.floor((r+n[0].day+6)/7),c=t?1-u:u-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:r,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||0===e&&t<r.fweek||e===r.weeks&&t>r.lweek)return null;var i=7*(e-1)-r.fweek+t,o=new Date(r.start.time);return o.setDate(+r.start.d+i),this.getDateInfo(o)},e.create=function(t,n){var r=[];return t.eachComponent("calendar",(function(t){var n=new e(t);r.push(n),t.coordinateSystem=n})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=r[e.get("calendarIndex")||0])})),r},e.dimensions=["time","value"],e}();function _H(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function xH(e,t){var n;return Fr(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}var bH=["transition","enterFrom","leaveTo"],wH=bH.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function SH(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?bH:wH,i=0;i<r.length;i++){var o=r[i];null==e[o]&&null!=t[o]&&(e[o]=t[o])}}var TH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return g(t,e),t.prototype.mergeOption=function(t,n){var r=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=r},t.prototype.optionUpdated=function(e,t){var n=this.option,r=(t?n:e).elements,i=n.elements=t?[]:n.elements,o=[];this._flatten(r,o,null);var a=Ku(i,o,"normalMerge"),s=this._elOptionsToUpdate=[];Fr(a,(function(e,t){var n=e.newOption;"production"!==process.env.NODE_ENV&&di(Qr(n)||e.existing,"Empty graphic option definition"),n&&(s.push(n),function(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}(e,n),function(e,t,n){var r=Pr({},n),i=e[t],o=n.$action||"merge";if("merge"===o)if(i){if("production"!==process.env.NODE_ENV){var a=n.type;di(!a||i.type===a,'Please set $action: "replace" to change `type`')}Lr(i,r,!0),Cv(i,r,{ignoreSize:!0}),Ev(n,i),SH(n,i),SH(n,i,"shape"),SH(n,i,"style"),SH(n,i,"extra"),n.clipPath=i.clipPath}else e[t]=r;else"replace"===o?e[t]=r:"remove"===o&&i&&(e[t]=null)}(i,t,n),function(e,t){if(e&&(e.hv=t.hv=[xH(t,["left","right"]),xH(t,["top","bottom"])],"group"===e.type)){var n=e,r=t;null==n.width&&(n.width=r.width=0),null==n.height&&(n.height=r.height=0)}}(i[t],n))}),this),n.elements=Ur(i,(function(e){return e&&delete e.$action,null!=e}))},t.prototype._flatten=function(e,t,n){Fr(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var r=e.children;r&&r.length&&this._flatten(r,t,e),delete e.children}}),this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type="graphic",t.defaultOption={elements:[]},t}(Nv),MH={path:null,compoundPath:null,group:Kl,image:ad,text:Id},AH=oc(),CH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(){this._elMap=xi()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,r=this.group,i=e.get("z"),o=e.get("zlevel");Fr(t,(function(t){var a=Qu(t.id,null),s=null!=a?n.get(a):null,l=Qu(t.parentId,null),u=null!=l?n.get(l):r,c=t.type,h=t.style;"text"===c&&h&&t.hv&&t.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var d=t.textContent,p=t.textConfig;if(h&&DV(h,c,!!p,!!d)){var f=EV(h,c,!0);!p&&f.textConfig&&(p=t.textConfig=f.textConfig),!d&&f.textContent&&(d=f.textContent)}var g=function(e){return e=Pr({},e),Fr(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(xv),(function(t){delete e[t]})),e}(t);"production"!==process.env.NODE_ENV&&s&&di(u===s.parent,"Changing parent is not supported.");var m=t.$action||"merge",v="merge"===m,y="replace"===m;if(v){var _=s;(A=!s)?_=EH(a,u,t.type,n):(_&&(AH(_).isNew=!1),tF(_)),_&&(GV(_,g,e,{isInit:A}),LH(_,t,i,o))}else if(y){IH(s,t,n,e);var x=EH(a,u,t.type,n);x&&(GV(x,g,e,{isInit:!0}),LH(x,t,i,o))}else"remove"===m&&(HV(s,t),IH(s,t,n,e));var b=n.get(a);if(b&&d)if(v){var w=b.getTextContent();w?w.attr(d):b.setTextContent(new Id(d))}else y&&b.setTextContent(new Id(d));if(b){var S=t.clipPath;if(S){var T=S.type,M=void 0,A=!1;if(v){var C=b.getClipPath();M=(A=!C||AH(C).type!==T)?DH(T):C}else y&&(A=!0,M=DH(T));b.setClipPath(M),GV(M,S,e,{isInit:A}),nF(M,S.keyframeAnimation,e)}var D=AH(b);b.setTextConfig(p),D.option=t,function(e,t,n){var r=Ld(e).eventData;e.silent||e.ignore||r||(r=Ld(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});r&&(r.info=n.info)}(b,e,t),Hg({el:b,componentModel:e,itemName:b.name,itemTooltipOption:t.tooltip}),nF(b,t.keyframeAnimation,e)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,r=this.group,i=this._elMap,o=t.getWidth(),a=t.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((f=null!=(p=Qu((d=n[l]).id,null))?i.get(p):null)&&f.isGroup){var u=(g=f.parent)===r,c=AH(f),h=AH(g);c.width=uu(c.option.width,u?o:h.width)||0,c.height=uu(c.option.height,u?a:h.height)||0}}for(l=n.length-1;l>=0;l--){var d,p,f;if(f=null!=(p=Qu((d=n[l]).id,null))?i.get(p):null){var g=f.parent,m=(h=AH(g),{}),v=Mv(f,d,g===r?{width:o,height:a}:{width:h.width,height:h.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!AH(f).isNew&&v){for(var y=d.transition,_={},x=0;x<s.length;x++){var b=s[x],w=m[b];y&&(WV(y)||kr(y,b)>=0)?_[b]=w:f[b]=w}ug(f,_,e,0)}else f.attr(m)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each((function(n){IH(n,AH(n).option,t,e._lastGraphicModel)})),this._elMap=xi()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Cx);function DH(e){"production"!==process.env.NODE_ENV&&di(e,"graphic type MUST be set");var t=Ti(MH,e)?MH[e]:Sg(e);"production"!==process.env.NODE_ENV&&di(t,"graphic type "+e+" can not be found");var n=new t({});return AH(n).type=e,n}function EH(e,t,n,r){var i=DH(n);return t.add(i),r.set(e,i),AH(i).id=e,AH(i).isNew=!0,i}function IH(e,t,n,r){e&&e.parent&&("group"===e.type&&e.traverse((function(e){IH(e,t,n,r)})),UV(e,t,r),n.removeKey(AH(e).id))}function LH(e,t,n,r){e.isGroup||Fr([["cursor",Qc.prototype.cursor],["zlevel",r||0],["z",n||0],["z2",0]],(function(n){var r=n[0];Ti(t,r)?e[r]=li(t[r],n[1]):null==e[r]&&(e[r]=n[1])})),Fr(Xr(t),(function(n){if(0===n.indexOf("on")){var r=t[n];e[n]=qr(r)?r:null}})),Ti(t,"draggable")&&(e.draggable=t.draggable),null!=t.name&&(e.name=t.name),null!=t.id&&(e.id=t.id)}var NH=["x","y","radius","angle","single"],PH=["cartesian2d","polar","singleAxis"];function OH(e){return"production"!==process.env.NODE_ENV&&di(e),e+"Axis"}function RH(e,t){var n,r=xi(),i=[],o=xi();e.eachComponent({mainType:"dataZoom",query:t},(function(e){o.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",a)}while(n);function a(e){!o.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var i=r.get(e);i&&i[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),i.push(e),e.eachTargetAxis((function(e,t){(r.get(e)||r.set(e,[]))[t]=!0}))}return i}function kH(e){var t=e.ecModel,n={infoList:[],infoMap:xi()};return e.eachTargetAxis((function(e,r){var i=t.getComponent(OH(e),r);if(i){var o=i.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(i)}}})),n}var zH=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),BH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return g(t,e),t.prototype.init=function(e,t,n){var r=VH(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=VH(e);Lr(this.option,e,!0),Lr(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;Fr([["start","startValue"],["end","endValue"]],(function(e,r){"value"===this._rangePropMode[r]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=xi();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return Fr(NH,(function(n){var r=this.getReferringComponents(OH(n),cc);if(r.specified){t=!0;var i=new zH;Fr(r.models,(function(e){i.add(e.componentIndex)})),e.set(n,i)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i="vertical"===t?"y":"x";o(n.findComponents({mainType:i+"Axis"}),i)}r&&o(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function o(t,n){var i=t[0];if(i){var o=new zH;if(o.add(i.componentIndex),e.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",uc).models[0];a&&Fr(t,(function(e){i.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",uc).models[0]&&o.add(e.componentIndex)}))}}}r&&Fr(NH,(function(t){if(r){var i=n.findComponents({mainType:OH(t),filter:function(e){return"category"===e.get("type",!0)}});if(i[0]){var o=new zH;o.add(i[0].componentIndex),e.set(t,o),r=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");Fr([["start","startValue"],["end","endValue"]],(function(r,i){var o=null!=e[r[0]],a=null!=e[r[1]];o&&!a?t[i]="percent":!o&&a?t[i]="value":n?t[i]=n[i]:o&&(t[i]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(OH(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,r){Fr(n.indexList,(function(n){e.call(t,r,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){"production"!==process.env.NODE_ENV&&di(e&&null!=t);var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(OH(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;Fr([["start","startValue"],["end","endValue"]],(function(r){null==e[r[0]]&&null==e[r[1]]||(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;Fr(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(i,o.indexList[a]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return"production"!==process.env.NODE_ENV&&di(this._orient),this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}(Nv);function VH(e){var t={};return Fr(["start","end","startValue","endValue","throttle"],(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}var FH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="dataZoom.select",t}(BH),GH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(Cx),HH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="dataZoom.select",t}(GH),UH=Fr,WH=hu,XH=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries((function(t){if(function(e){var t=e.get("coordinateSystem");return kr(PH,t)>=0}(t)){var n=OH(this._dimName),r=t.getReferringComponents(n,uc).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return Ir(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,r=this.getAxisModel().axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];UH(["start","end"],(function(l,u){var c=e[l],h=e[l+"Value"];"percent"===i[u]?(null==c&&(c=o[u]),h=r.parse(lu(c,o,n))):(t=!0,c=lu(h=null==h?n[u]:r.parse(h),n,o)),s[u]=null==h||isNaN(h)?n[u]:h,a[u]=null==c||isNaN(c)?o[u]:c})),WH(s),WH(a);var l=this._minMaxSpan;function u(e,t,n,i,o){var a=o?"Span":"ValueSpan";rk(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=lu(e[s],n,i,!0),o&&(t[s]=r.parse(t[s]))}return t?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,n){var r=[1/0,-1/0];UH(n,(function(e){!function(e,t,n){t&&Fr(OM(t,n),(function(n){var r=t.getApproximateExtent(n);r[0]<e[0]&&(e[0]=r[0]),r[1]>e[1]&&(e[1]=r[1])}))}(r,e.getData(),t)}));var i=e.getAxisModel(),o=TM(i.axis.scale,i,r).calculate();return[o.min,o.max]}(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;"none"!==i&&UH(r,(function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var a=t.getStore(),s=Gr(r,(function(e){return t.getDimensionIndex(e)}),t);t.filterSelf((function(e){for(var t,n,i,l=0;l<r.length;l++){var u=a.get(s[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(i=!0),h&&(t=!0),d&&(n=!0)}return i&&t&&n}))}else UH(r,(function(n){if("empty"===i)e.setData(t=t.map(n,(function(e){return function(e){return e>=o[0]&&e<=o[1]}(e)?e:NaN})));else{var r={};r[n]=o,t.selectRange(r)}}));UH(r,(function(e){t.setApproximateExtent(o,e)}))}}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;UH(["min","max"],(function(r){var i=t.get(r+"Span"),o=t.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=lu(n[0]+o,n,[0,100],!0):null!=i&&(o=lu(i,[0,100],n,!0)-n[0]),e[r+"Span"]=i,e[r+"ValueSpan"]=o}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=fu(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;0!==t[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==t[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},e}();var jH={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(r,i){var o=e.getComponent(OH(r),i);t(r,i,o,n)}))}))}t((function(e,t,n,r){n.__dzAxisProxy=null}));var n=[];t((function(t,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new XH(t,r,o,e),n.push(i.__dzAxisProxy))}));var r=xi();return Fr(n,(function(e){Fr(e.getTargetSeriesModels(),(function(e){r.set(e.uid,e)}))})),r},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,r){e.getAxisProxy(n,r).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}}))}};var YH=!1;function ZH(e){YH||(YH=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,jH),function(e){e.registerAction("dataZoom",(function(e,t){Fr(RH(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}))}(e),e.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function qH(e){e.registerComponentModel(FH),e.registerComponentView(HH),ZH(e)}var KH=function(){},$H={};function JH(e,t){$H[e]=t}function QH(e){return $H[e]}var eU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;Fr(this.option.feature,(function(e,n){var r=QH(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),Lr(e,r.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(Nv);function tU(e,t){var n=cv(t.get("padding")),r=t.getItemStyle(["color","opacity"]);return r.fill=t.get("backgroundColor"),e=new fd({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:r,silent:!0,z2:-1})}var nU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o=+e.get("itemSize"),a="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),u=[];Fr(s,(function(e,t){u.push(t)})),new YS(this._featureNames||[],u).add(c).update(c).remove(Yr(c,null)).execute(),this._featureNames=u,function(e,t,n){var r=t.getBoxLayoutParams(),i=t.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Tv(r,o,i);Sv(t.get("orient"),e,t.get("itemGap"),a.width,a.height),Mv(e,r,o,i)}(i,e,n),i.add(tU(i.getBoundingRect(),e)),a||i.eachChild((function(e){var t=e.__title,r=e.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!qr(l)&&t){var u=l.style||(l.style={}),c=Pl(t,Id.makeFont(u)),h=e.x+i.x,d=!1;e.y+i.y+o+c.height>n.getHeight()&&(a.position="top",d=!0);var p=d?-5-c.height:o+10;h+c.width/2>n.getWidth()?(a.position=["100%",p],u.align="right"):h-c.width/2<0&&(a.position=[0,p],u.align="left")}}))}function c(c,h){var d,p=u[c],f=u[h],g=s[p],m=new xm(g,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===p&&(g.title=r.newTitle),p&&!f){if(function(e){return 0===e.indexOf("my")}(p))d={onclick:m.option.onclick,featureName:p};else{var v=QH(p);if(!v)return;d=new v}l[p]=d}else if(!(d=l[f]))return;d.uid=wm("toolbox-feature"),d.model=m,d.ecModel=t,d.api=n;var y=d instanceof KH;p||!f?!m.get("show")||y&&d.unusable?y&&d.remove&&d.remove(t,n):(!function(r,s,l){var u,c,h=r.getModel("iconStyle"),d=r.getModel(["emphasis","iconStyle"]),p=s instanceof KH&&s.getIcons?s.getIcons():r.get("icon"),f=r.get("title")||{};Kr(p)?(u={})[l]=p:u=p;Kr(f)?(c={})[l]=f:c=f;var g=r.iconPaths={};Fr(u,(function(l,u){var p=Bg(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(h.getItemStyle()),p.ensureState("emphasis").style=d.getItemStyle();var f=new Id({style:{text:c[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:rm({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},t)},ignore:!0});p.setTextContent(f),Hg({el:p,componentModel:e,itemName:u,formatterParamsExtra:{title:c[u]}}),p.__title=c[u],p.on("mouseover",(function(){var t=d.getItemStyle(),r=a?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";f.setStyle({fill:d.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||r}),f.ignore=!e.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==r.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()})),("emphasis"===r.get(["iconStatus",u])?cp:hp)(p),i.add(p),p.on("click",jr(s.onclick,s,t,n,u)),g[u]=p}))}(m,d,p),m.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?cp:hp)(r[e])},d instanceof KH&&d.render&&d.render(m,t,n,r)):y&&d.dispose&&d.dispose(t,n)}},t.prototype.updateView=function(e,t,n,r){Fr(this._features,(function(e){e instanceof KH&&e.updateView&&e.updateView(e.model,t,n,r)}))},t.prototype.remove=function(e,t){Fr(this._features,(function(n){n instanceof KH&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){Fr(this._features,(function(n){n instanceof KH&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(Cx);var rU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=sr.browser;if(qr(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=r+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||i){var c=a.split(","),h=c[0].indexOf("base64")>-1,d=i?decodeURIComponent(c[1]):c[1];h&&(d=window.atob(d));var p=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var f=d.length,g=new Uint8Array(f);f--;)g[f]=d.charCodeAt(f);var m=new Blob([g]);window.navigator.msSaveOrOpenBlob(m,p)}else{var v=document.createElement("iframe");document.body.appendChild(v);var y=v.contentWindow,_=y.document;_.open("image/svg+xml","replace"),_.write(d),_.close(),y.focus(),_.execCommand("SaveAs",!0,p),document.body.removeChild(v)}}else{var x=n.get("lang"),b='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(x&&x[0]||"")+'" /></body>',w=window.open();w.document.write(b),w.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(KH),iU="__ec_magicType_stack__",oU=[["line","bar"],["stack"]],aU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return Fr(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get(["seriesIndex",n]);if(sU[n]){var o,a={series:[]};Fr(oU,(function(e){kr(e,n)>=0&&Fr(e,(function(e){r.setIconStatus(e,"normal")}))})),r.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},(function(e){var t=e.subType,i=e.id,o=sU[n](t,i,e,r);o&&(Or(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,uc).models[0].componentIndex;a[u]=a[u]||[];for(var h=0;h<=c;h++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=Lr({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},t}(KH),sU={line:function(e,t,n,r){if("bar"===e)return Lr({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return Lr({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===iU;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),Lr({id:t,stack:i?"":iU},r.get(["option","stack"])||{},!0)}};LS({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var lU=new Array(60).join("-"),uU="\t";function cU(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var hU=new RegExp("["+uU+"]+","g");function dU(e,t){var n=e.split(new RegExp("\n*"+lU+"\n*","g")),r={series:[]};return Fr(n,(function(e,n){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(uU)>=0)return!0}(e)){var i=function(e){for(var t=e.split(/\n+/g),n=[],r=Gr(cU(t.shift()).split(hU),(function(e){return{name:e,data:[]}})),i=0;i<t.length;i++){var o=cU(t[i]).split(hU);n.push(o.shift());for(var a=0;a<o.length;a++)r[a]&&(r[a].data[i]=o[a])}return{series:r,categories:n}}(e),o=t[n],a=o.axisDim+"Axis";o&&(r[a]=r[a]||[],r[a][o.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{i=function(e){for(var t=e.split(/\n+/g),n=cU(t.shift()),r=[],i=0;i<t.length;i++){var o=cU(t[i]);if(o){var a=o.split(hU),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);r.series.push(i)}})),r}var pU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.onclick=function(e,t){setTimeout((function(){t.dispatchAction({type:"hideTip"})}));var n=t.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement("div");i.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",i.style.backgroundColor=r.get("backgroundColor")||"#fff";var o=document.createElement("h4"),a=r.get("lang")||[];o.innerHTML=a[0]||r.get("title"),o.style.cssText="margin:10px 20px",o.style.color=r.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="overflow:auto";var u=r.get("optionToContent"),c=r.get("contentToOption"),h=function(e){var t,n,r,i=function(e){var t={},n=[],r=[];return e.eachRawSeries((function(e){var i=e.coordinateSystem;if(!i||"cartesian2d"!==i.type&&"polar"!==i.type)n.push(e);else{var o=i.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;t[a]||(t[a]={categoryAxis:o,valueAxis:i.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),t[a].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:r}}(e);return{value:Ur([(n=i.seriesGroupByCategoryAxis,r=[],Fr(n,(function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,o=[" "].concat(Gr(e.series,(function(e){return e.name}))),a=[n.model.getCategories()];Fr(e.series,(function(e){var t=e.getRawData();a.push(e.getRawData().mapArray(t.mapDimension(i),(function(e){return e})))}));for(var s=[o.join(uU)],l=0;l<a[0].length;l++){for(var u=[],c=0;c<a.length;c++)u.push(a[c][l]);s.push(u.join(uU))}r.push(s.join("\n"))})),r.join("\n\n"+lU+"\n\n")),(t=i.other,Gr(t,(function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),a=0;a<e-1;a++)r[a]=arguments[a];n.push((o?o+uU:"")+r.join(uU))})),n.join("\n")})).join("\n\n"+lU+"\n\n"))],(function(e){return!!e.replace(/[\n\t\s]/g,"")})).join("\n\n"+lU+"\n\n"),meta:i.meta}}(e);if(qr(u)){var d=u(t.getOption());Kr(d)?s.innerHTML=d:ni(d)&&s.appendChild(d)}else{l.readOnly=r.get("readOnly");var p=l.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=r.get("textColor"),p.borderColor=r.get("textareaBorderColor"),p.backgroundColor=r.get("textareaColor"),l.value=h.value,s.appendChild(l)}var f=h.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+r.get("buttonColor"),m+=";color:"+r.get("buttonTextColor");var _=this;function x(){n.removeChild(i),_._dom=null}vo(v,"click",x),vo(y,"click",(function(){if(null==c&&null!=u||null!=c&&null==u)return"production"!==process.env.NODE_ENV&&ku("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void x();var e;try{e=qr(c)?c(s,t.getOption()):dU(l.value,f)}catch(e){throw x(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),x()})),v.innerHTML=a[1],y.innerHTML=a[2],y.style.cssText=v.style.cssText=m,!r.get("readOnly")&&g.appendChild(y),g.appendChild(v),i.appendChild(o),i.appendChild(s),i.appendChild(g),s.style.height=n.clientHeight-80+"px",n.appendChild(i),this._dom=i},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(KH);function fU(e,t){return Gr(e,(function(e,n){var r=t&&t[n];if(Qr(r)&&!Zr(r)){Qr(e)&&!Zr(e)||(e={value:e});var i=null!=r.name&&null==e.name;return e=Or(e,r),i&&delete e.name,e}return e}))}LS({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var n=[];Fr(e.newOption.series,(function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i=r.get("data");n.push({name:e.name,data:fU(e.data,i)})}else n.push(Pr({type:"scatter"},e))})),t.mergeOption(Or({series:n},e.newOption))}));var gU=Fr,mU=oc();function vU(e){var t=mU(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var yU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.onclick=function(e,t){!function(e){mU(e).snapshots=null}(e),t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(KH);LS({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var _U=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],xU=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=wU(t,e);Fr(SU,(function(e,t){(!n||!n.include||kr(n.include,t)>=0)&&e(i,r._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=AU[e.brushType](0,n,t);e.__rangeOffset={offset:DU[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){Fr(e,(function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&Fr(r.coordSyses,(function(r){var i=AU[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)}))}),this)},e.prototype.setInputRanges=function(e,t){Fr(e,(function(e){var n,r,i,o,a,s=this.findTargetInfo(e,t);if("production"!==process.env.NODE_ENV&&(di(!s||!0===s||e.coordRange,"coordRange must be specified when coord index specified."),di(!s||!0!==s||e.range,"range must be specified in global brush.")),e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=AU[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?DU[e.brushType](l.values,u.offset,(n=l.xyMinMax,r=u.xyMinMax,i=IU(n),o=IU(r),a=[i[0]/o[0],i[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},e.prototype.makePanelOpts=function(e,t){return Gr(this._targetInfoList,(function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:lz(r),isTargetByCursor:cz(r,e,n.coordSysModel),getLinearBrushOtherExtent:uz(r)}}))},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return!0===r||r&&kr(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=wU(t,e),i=0;i<n.length;i++){var o=n[i],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<TU.length;s++)if(TU[s](r,o))return o}return!0},e}();function bU(e){return e[0]>e[1]&&e.reverse(),e}function wU(e,t){return sc(e,t,{includeMainTypes:_U})}var SU={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=xi(),a={},s={};(n||r||i)&&(Fr(n,(function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0})),Fr(r,(function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0})),Fr(i,(function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0})),o.each((function(e){var i=e.coordinateSystem,o=[];Fr(i.getCartesians(),(function(e,t){(kr(n,e.getAxis("x").model)>=0||kr(r,e.getAxis("y").model)>=0)&&o.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:MU.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){Fr(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:MU.geo})}))}},TU=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],MU={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Lg(e)),t}},AU={lineX:Yr(CU,0),lineY:Yr(CU,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),a=[bU([i[0],o[0]]),bU([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:Gr(n,(function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o})),xyMinMax:i}}};function CU(e,t,n,r){"production"!==process.env.NODE_ENV&&di("cartesian2d"===n.type,"lineX/lineY brush is available only in cartesian2d.");var i=n.getAxis(["x","y"][e]),o=bU(Gr([0,1],(function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))}))),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var DU={lineX:Yr(EU,0),lineY:Yr(EU,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return Gr(e,(function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]}))}};function EU(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function IU(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var LU,NU,PU=Fr,OU=Wu+"toolbox-dataZoom_",RU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new Lk(n.getZr()),this._brushController.on("brush",jr(this._onBrush,this)).mount()),function(e,t,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive);n._isZoomActive=o,e.setIconStatus("zoom",o?"emphasis":"normal");var a=new xU(zU(e),t,{include:["grid"]}),s=a.makePanelOpts(i,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,r,n),function(e,t){e.setIconStatus("back",function(e){return vU(e).length}(t)>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){kU[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},r=this.ecModel;this._brushController.updateCovers([]),new xU(zU(this.model),r,{include:["grid"]}).matchOutputRanges(t,r,(function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(i("x",n,t[0]),i("y",n,t[1])):i({lineX:"x",lineY:"y"}[r],n,t)}})),function(e,t){var n=vU(e);gU(t,(function(t,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var o=e.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(o){var a=o.getPercentRange();n[0][r]={dataZoomId:r,start:a[0],end:a[1]}}}})),n.push(t)}(r,n),this._dispatchZoomAction(n)}function i(e,t,i){var o=t.getAxis(e),a=o.model,s=function(e,t,n){var r;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)})),r}(e,a,r),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(i=rk(0,i.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:i[0],endValue:i[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];PU(e,(function(e,n){t.push(Ir(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(KH),kU={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(function(e){var t=vU(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return gU(n,(function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n]){r[n]=e;break}})),r}(this.ecModel))}};function zU(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}LU="dataZoom",NU=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=sc(e,zU(r));return PU(o.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),PU(o.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:OU+t+o};a[n]=o,i.push(a)}},di(null==Jv.get(LU)&&NU),Jv.set(LU,NU);var BU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(Nv);function VU(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function FU(e){if(sr.domSupported)for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}var GU=FU(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function HU(e,t){if(!e)return t;t=uv(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var UU=HU(FU(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),WU=HU(GU,"transform"),XU="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(sr.transform3dSupported?"will-change:transform;":"");function jU(e,t,n){var r=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!sr.transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=sr.transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+WU+":"+a+";":[["top",0],["left",0],[GU,a]]}function YU(e,t,n){var r=[],i=e.get("transitionDuration"),o=e.get("backgroundColor"),a=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=cx(e,"html"),d=l+"px "+u+"px "+a+"px "+s;return r.push("box-shadow:"+d),t&&i&&r.push(function(e,t){var n="cubic-bezier(0.23,1,0.32,1)",r=" "+e/2+"s "+n,i="opacity"+r+",visibility"+r;return t||(r=" "+e+"s "+n,i+=sr.transformSupported?","+WU+r:",left"+r+",top"+r),UU+":"+i}(i,n)),o&&r.push("background-color:"+o),Fr(["width","color","radius"],(function(t){var n="border-"+t,i=uv(n),o=e.get(i);null!=o&&r.push(n+":"+o+("color"===t?"":"px"))})),r.push(function(e){var t=[],n=e.get("fontSize"),r=e.getTextColor();r&&t.push("color:"+r),t.push("font:"+e.getFont()),n&&t.push("line-height:"+Math.round(3*n/2)+"px");var i=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,a=e.get("textShadowOffsetX")||0,s=e.get("textShadowOffsetY")||0;return i&&o&&t.push("text-shadow:"+a+"px "+s+"px "+o+"px "+i),Fr(["decoration","align"],(function(n){var r=e.get(n);r&&t.push("text-"+n+":"+r)})),t.join(";")}(c)),null!=h&&r.push("padding:"+cv(h).join("px ")+"px"),r.join(";")+";"}function ZU(e,t,n,r,i){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&function(e,t,n,r,i){io(ro,t,r,i,!0)&&io(e,n,ro[0],ro[1])}(e,a,n,r,i)}else{e[0]=r,e[1]=i;var s=o&&o.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var qU=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,sr.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,o=i&&(Kr(i)?document.querySelector(i):ni(i)?i:qr(i)&&i(e.getDom()));ZU(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!a._enterable){var t=r.handler;mo(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=(o="position",(a=(i=t).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?a[o]:null),r=t.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative")}var i,o,a,s=e.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=XU+YU(e,!this._firstShow,this._longHide)+jU(i[0],i[1],!0)+"border-color:"+vv(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var o=this.el;if(null!=e){var a="";if(Kr(i)&&"item"===n.get("trigger")&&!VU(n)&&(a=function(e,t,n){if(!Kr(n)||"inside"===n)return"";var r=e.get("backgroundColor"),i=e.get("borderWidth");t=vv(t);var o,a,s="left"===(o=n)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(i),6),u="",c=WU+":";kr(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var h=a*Math.PI/180,d=l+i,p=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),f=t+" solid "+i+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(u+=";"+s+":-"+Math.round(100*((p-Math.SQRT2*i)/2+Math.SQRT2*i-(p-d)/2))/100+"px")+";"+c+";","border-bottom:"+f,"border-right:"+f,"background-color:"+r+";"].join("")+'"></div>'}(n,r,i)),Kr(e))o.innerHTML=e+a;else if(e){o.innerHTML="",Zr(e)||(e=[e]);for(var s=0;s<e.length;s++)ni(e[s])&&e[s].parentNode!==o&&o.appendChild(e[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}}else o.innerHTML=""},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},e.prototype.moveTo=function(e,t){var n=this._styleCoord;if(ZU(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var r=this.el.style;Fr(jU(n[0],n[1]),(function(e){r[e[0]]=e[1]}))}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",sr.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return e._longHide=!0}),500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(jr(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},e}(),KU=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),QU(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,r,i){var o=this;Qr(e)&&Gu("production"!==process.env.NODE_ENV?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new Id({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:cx(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),Fr(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(e){o.el.style[e]=n.get(e)})),Fr(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(e){o.el.style[e]=a.get(e)||0})),this._zr.add(this.el);var s=this;this.el.on("mouseover",(function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0})),this.el.on("mouseout",(function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1}))},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=JU(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var r=this._styleCoord;QU(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,o=$U(i.borderWidth||0),a=JU(i);n.x=e+o+a.left,n.y=t+o+a.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(jr(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function $U(e){return Math.max(0,e)}function JU(e){var t=$U(e.shadowBlur||0),n=$U(e.shadowOffsetX||0),r=$U(e.shadowOffsetY||0);return{left:$U(t-n),right:$U(t+n),top:$U(t-r),bottom:$U(t+r)}}function QU(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var eW=new fd({shape:{x:-1,y:-1,width:2,height:2}}),tW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t){if(!sr.node&&t.getDom()){var n,r=e.getComponent("tooltip"),i=this._renderMode="auto"===(n=r.get("renderMode"))?sr.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===i?new KU(t):new qU(t,{appendTo:r.get("appendToBody",!0)?"body":r.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!sr.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?Hx(this,"_updatePosition",50,"fixRate"):Ux(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");iG("itemTooltip",this._api,jr((function(t,n,r){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,r):"leave"===t&&this._hide(r))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==r&&"click"!==r){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!sr.node&&n.getDom()){var i=rW(r,n);this._ticket="";var o=r.dataByCoordSys,a=function(e,t,n){var r=lc(e).queryOptionMap,i=r.keys()[0];if(!i||"series"===i)return;var o=hc(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(t){var n=Ld(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}(r,t,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y){var l=eW;l.x=r.x,l.y=r.y,l.update(),Ld(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,r))return;var u=uG(r,t),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(rW(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,o=r.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=t.getSeriesByIndex(i);if(s)if("axis"===nW([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){var i,o;if("legend"===Ld(n).ssrType)return;this._lastDataByCoordSys=null,Nb(n,(function(e){return null!=Ld(e).dataIndex?(i=e,!0):null!=Ld(e).tooltipConfig?(o=e,!0):void 0}),!0),i?this._showSeriesItemTooltip(e,i,t):o?this._showComponentItemTooltip(e,o,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=jr(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],o=nW([t.tooltipOption],r),a=this._renderMode,s=[],l=ex("section",{blocks:[],noHeader:!0}),u=[],c=new hx;Fr(e,(function(e){Fr(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var o=XF(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=ex("section",{header:o,noHeader:!pi(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),Fr(e.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=e.axisDim,f.axisIndex=e.axisIndex,f.axisType=e.axisType,f.axisId=e.axisId,f.axisValue=IM(t.axis,{value:i}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",vv(f.color),a);var g=m_(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=nW([d],r).get("valueFormatter");h.blocks.push(v?Pr({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,d=o.get("order"),p=ax(l,c,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,h,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=Ld(t),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,c=s.getData(u),h=this._renderMode,d=e.positionDefault,p=nW([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new hx;g.marker=m.makeTooltipMarker("item",vv(g.color),h);var v=m_(s.formatTooltip(l,!1,u)),y=p.get("order"),_=p.get("valueFormatter"),x=v.frag,b=x?ax(_?Pr({valueFormatter:_},x):x,m,h,y,r.get("useUTC"),p.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,b,g,w,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=Ld(t),i=r.tooltipConfig.option||{};if(Kr(i)){i={content:i,formatter:i}}var o=[i],a=this._ecModel.getComponent(r.componentMainType,r.componentIndex);a&&o.push(a),o.push({formatter:i.content});var s=e.positionDefault,l=nW(o,this._tooltipModel,s?{position:s}:null),u=l.get("content"),c=Math.random()+"",h=new hx;this._showOrMove(l,(function(){var n=Ir(l.get("formatterParams")||{});this._showTooltipContent(l,u,n,c,e.offsetX,e.offsetY,e.position,t,h)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,o,a,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var c=e.get("formatter");a=a||e.get("position");var h=t,d=this._getNearestPoint([i,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(Kr(c)){var p=e.ecModel.get("useUTC"),f=Zr(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=Xm(f.axisValue,h,p)),h=fv(h,n,!0)}else if(qr(c)){var g=jr((function(t,r){t===this._ticket&&(u.setContent(r,l,e,d,a),this._updatePosition(e,a,i,o,u,n,s))}),this);this._ticket=r,h=c(n,r,g)}else h=c;u.setContent(h,l,e,d,a),u.show(e,d),this._updatePosition(e,a,i,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r){return"axis"===n||Zr(t)?{color:r||("html"===this._renderMode?"#fff":"none")}:Zr(t)?void 0:{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=i.getSize(),c=e.get("align"),h=e.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),qr(t)&&(t=t([n,r],o,i.el,d,{viewSize:[s,l],contentSize:u.slice()})),Zr(t))n=uu(t[0],s),r=uu(t[1],l);else if(Qr(t)){var p=t;p.width=u[0],p.height=u[1];var f=Tv(p,{width:s,height:l});n=f.x,r=f.y,c=null,h=null}else if(Kr(t)&&a){var g=function(e,t,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-i/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+a;break;case"left":s=t.x-i-a,l=t.y+c/2-o/2;break;case"right":s=t.x+u+a,l=t.y+c/2-o/2}return[s,l]}(t,d,u,e.get("borderWidth"));n=g[0],r=g[1]}else{g=function(e,t,n,r,i,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(e+l+o+2>r?e-=l+o:e+=o);null!=a&&(t+u+a>i?t-=u+a:t+=a);return[e,t]}(n,r,i,s,l,c?null:20,h?null:20);n=g[0],r=g[1]}if(c&&(n-=iW(c)?u[0]/2:"right"===c?u[0]:0),h&&(r-=iW(h)?u[1]/2:"bottom"===h?u[1]:0),VU(e)){g=function(e,t,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return e=Math.min(e+a,r)-a,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&Fr(n,(function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(i=i&&a.length===s.length)&&Fr(a,(function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(i=i&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&Fr(a,(function(e,t){var n=l[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),r&&Fr(e.seriesDataIndices,(function(e){var n=e.seriesIndex,o=t[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!sr.node&&t.getDom()&&(Ux(this,"_updatePosition"),this._tooltipContent.dispose(),sG("itemTooltip",t))},t.type="tooltip",t}(Cx);function nW(e,t,n){var r,i=t.ecModel;n?(r=new xm(n,i,i),r=new xm(t.option,r,i)):r=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof xm&&(a=a.get("tooltip",!0)),Kr(a)&&(a={formatter:a}),a&&(r=new xm(a,r,i)))}return r}function rW(e,t){return e.dispatchAction||jr(t.dispatchAction,t)}function iW(e){return"center"===e||"middle"===e}var oW=["rect","polygon","keep","clear"];function aW(e,t){var n=Xu(e?e.brush:[]);if(n.length){var r=[];Fr(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(r=r.concat(t))}));var i=e&&e.toolbox;Zr(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var o=i.feature||(i.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,r),function(e){var t={};Fr(e,(function(e){t[e]=1})),e.length=0,Fr(t,(function(t,n){e.push(n)}))}(s),t&&!s.length&&s.push.apply(s,oW)}}var sW=Fr;function lW(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function uW(e,t,n){var r={};return sW(t,(function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);sW(e[t],(function(e,r){if(ZP.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new ZP(i),"opacity"===r&&((i=Ir(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new ZP(i))}}))})),r}function cW(e,t,n){var r;Fr(n,(function(e){t.hasOwnProperty(e)&&lW(t[e])&&(r=!0)})),r&&Fr(n,(function(n){t.hasOwnProperty(n)&&lW(t[n])?e[n]=Ir(t[n]):delete e[n]}))}var hW={lineX:dW(0),lineY:dW(1),rect:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])},rect:function(e,t,n){return e&&n.boundingRect.intersect(e)}},polygon:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])&&UM(n.range,e[0],e[1])},rect:function(e,t,n){var r=n.range;if(!e||r.length<=1)return!1;var i=e.x,o=e.y,a=e.width,s=e.height,l=r[0];return!!(UM(r,i,o)||UM(r,i+a,o)||UM(r,i,o+s)||UM(r,i+a,o+s)||Uo.create(e).contain(l[0],l[1])||Vg(i,o,i+a,o,r)||Vg(i,o,i,o+s,r)||Vg(i+a,o,i+a,o+s,r)||Vg(i,o+s,i+a,o+s,r))||void 0}}};function dW(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,r){if(t){var i=r.range;return pW(t[e],i)}},rect:function(r,i,o){if(r){var a=o.range,s=[r[t[e]],r[t[e]]+r[n[e]]];return s[1]<s[0]&&s.reverse(),pW(s[0],a)||pW(s[1],a)||pW(a[0],s)||pW(a[1],s)}}}}function pW(e,t){return t[0]<=e&&e<=t[1]}var fW=["inBrush","outOfBrush"],gW="__ecBrushSelect",mW="__ecInBrushSelectEvent";function vW(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new xU(t.option,e)).setInputRanges(t.areas,e)}))}function yW(e,t,n){var r,i,o=[];e.eachComponent({mainType:"brush"},(function(e){n&&"takeGlobalCursor"===n.type&&e.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})})),vW(e),e.eachComponent({mainType:"brush"},(function(t,n){var a={brushId:t.id,brushIndex:n,brushName:t.name,areas:Ir(t.areas),selected:[]};o.push(a);var s=t.option,l=s.brushLink,u=[],c=[],h=[],d=!1;n||(r=s.throttleType,i=s.throttleDelay);var p=Gr(t.areas,(function(e){var t=bW[e.brushType],n=Or({boundingRect:t?t(e):void 0},e);return n.selectors=function(e){var t=e.brushType,n={point:function(r){return hW[t].point(r,n,e)},rect:function(r){return hW[t].rect(r,n,e)}};return n}(n),n})),f=uW(t.option,fW,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||!!u[e]}function m(e){return!!e.length}Zr(l)&&Fr(l,(function(e){u[e]=1})),e.eachSeries((function(n,r){var i=h[r]=[];"parallel"===n.subType?function(e,t){var n=e.coordinateSystem;d=d||n.hasAxisBrushed(),g(t)&&n.eachActiveState(e.getData(),(function(e,t){"active"===e&&(c[t]=1)}))}(n,r):function(n,r,i){if(!n.brushSelector||function(e,t){var n=e.option.seriesIndex;return null!=n&&"all"!==n&&(Zr(n)?kr(n,t)<0:t!==n)}(t,r))return;if(Fr(p,(function(r){t.brushTargetManager.controlSeries(r,n,e)&&i.push(r),d=d||m(i)})),g(r)&&m(i)){var o=n.getData();o.each((function(e){xW(n,i,o,e)&&(c[e]=1)}))}}(n,r,i)})),e.eachSeries((function(e,t){var n={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};a.selected.push(n);var r=h[t],i=e.getData(),o=g(t)?function(e){return c[e]?(n.dataIndex.push(i.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(t){return xW(e,r,i,t)?(n.dataIndex.push(i.getRawIndex(t)),"inBrush"):"outOfBrush"};(g(t)?d:m(r))&&function(e,t,n,r,i,o){var a,s={};function l(e){return Cb(n,a,e)}function u(e,t){Eb(n,a,e,t)}Fr(e,(function(e){var n=ZP.prepareVisualTypes(t[e]);s[e]=n})),n.each((function(e,o){a=e;var c=n.getRawDataItem(a);if(!c||!1!==c.visualMap)for(var h=r.call(i,e),d=t[h],p=s[h],f=0,g=p.length;f<g;f++){var m=p[f];d[m]&&d[m].applyVisual(e,l,u)}}))}(fW,f,i,o)}))})),function(e,t,n,r,i){if(!i)return;var o=e.getZr();if(o[mW])return;o[gW]||(o[gW]=_W);var a=Hx(o,gW,n,t);a(e,r)}(t,r,i,o,n)}function _W(e,t){if(!e.isDisposed()){var n=e.getZr();n[mW]=!0,e.dispatchAction({type:"brushSelect",batch:t}),n[mW]=!1}}function xW(e,t,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i];if(e.brushSelector(r,n,a.selectors,a))return!0}}var bW={rect:function(e){return wW(e.range)},polygon:function(e){for(var t,n=e.range,r=0,i=n.length;r<i;r++){t=t||[[1/0,-1/0],[1/0,-1/0]];var o=n[r];o[0]<t[0][0]&&(t[0][0]=o[0]),o[0]>t[0][1]&&(t[0][1]=o[0]),o[1]<t[1][0]&&(t[1][0]=o[1]),o[1]>t[1][1]&&(t[1][1]=o[1])}return t&&wW(t)}};function wW(e){return new Uo(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var SW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new Lk(t.getZr())).on("brush",jr(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){vW(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:t,areas:Ir(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:Ir(n),$from:t})},t.type="brush",t}(Cx),TW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return g(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&cW(n,e,["inBrush","outOfBrush"]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},r.hasOwnProperty("liftZ")||(r.liftZ=5)},t.prototype.setAreas=function(e){"production"!==process.env.NODE_ENV&&(di(Zr(e)),Fr(e,(function(e){di(e.brushType,"Illegal areas")}))),e&&(this.areas=Gr(e,(function(e){return MW(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=MW(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}(Nv);function MW(e,t){return Lr({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new xm(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var AW=["rect","polygon","lineX","lineY","keep","clear"],CW=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.render=function(e,t,n){var r,i,o;t.eachComponent({mainType:"brush"},(function(e){r=e.brushType,i=e.brushOption.brushMode||"single",o=o||!!e.areas.length})),this._brushType=r,this._brushMode=i,Fr(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===i:"clear"===t?o:t===r)?"emphasis":"normal")}))},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get("icon",!0),n={};return Fr(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;"clear"===n?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?r:r!==n&&n,brushMode:"keep"===n?"multiple"===i?"single":"multiple":i}})},t.getDefaultOption=function(e){return{show:!0,type:AW.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocaleModel().get(["toolbox","brush","title"])}},t}(KH);var DW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return g(t,e),t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(Nv),EW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var r=this.group,i=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=li(e.get("textBaseline"),e.get("textVerticalAlign")),l=new Id({style:$g(i,{text:e.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new Id({style:$g(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,h.silent=!p&&!f,d&&l.on("click",(function(){yv(d,"_"+e.get("target"))})),p&&h.on("click",(function(){yv(p,"_"+e.get("subtarget"))})),Ld(l).eventData=Ld(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,r.add(l),c&&r.add(h);var g=r.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Tv(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));a||("middle"===(a=e.get("left")||e.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),r.x=v.x,r.y=v.y,r.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),h.setStyle(y),g=r.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new fd({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});r.add(b)}},t.type="title",t}(Cx);var IW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return g(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],r=t.axisType,i=this._names=[];"category"===r?(e=[],Fr(n,(function(t,n){var r,o=Qu(Zu(t),"");Qr(t)?(r=Ir(t)).value=n:r=n,e.push(r),i.push(o)}))):e=n;var o={category:"ordinal",time:"time",value:"number"}[r]||"number";(this._data=new yT([{name:"value",type:o}],this)).initData(e,i)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(Nv),LW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="timeline.slider",t.defaultOption=Sm(IW.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(IW);Br(LW,g_.prototype);var NW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="timeline",t}(Cx),PW=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r)||this;return o.type=i||"value",o}return g(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(yA),OW=Math.PI,RW=oc(),kW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,n),i=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return ex("nameValue",{noName:!0,value:a.scale.getLabel({value:e})})},Fr(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,i,a,e)}),this),this._renderAxisLabel(r,o,a,e),this._position(r,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,r,i,o,a=e.get(["label","position"]),s=e.get("orient"),l=function(e,t){return Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t),u={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2<t.getHeight()/2?"-":"+":l.x+l.width/2<t.getWidth()/2?"+":"-":Kr(a)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][a]:a)>=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:OW/2},d="vertical"===s?l.height:l.width,p=e.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=e.get(["label","rotate"])||0;y=y*OW/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,T=d;"left"===_||"bottom"===_?(x&&(r=[0,0],S+=v),b&&(i=[S,0],S+=v),w&&(o=[T-g,0],T-=v)):(x&&(r=[T-g,0],T-=v),b&&(i=[0,0],S+=v),w&&(o=[T-g,0],T-=v));var M=[S,T];return e.get("inverse")&&M.reverse(),{viewRect:l,mainLength:d,orient:s,rotation:h[s],labelRotation:y,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:r,prevBtnPosition:i,nextBtnPosition:o,axisExtent:M,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,r=this._labelGroup,i=e.viewRect;if("vertical"===e.orient){var o=[1,0,0,1,0,0],a=i.x,s=i.y+i.height;Co(o,o,[-a,-s]),Do(o,o,-OW/2),Co(o,o,[a,s]),(i=i.clone()).applyTransform(o)}var l=m(i),u=m(n.getBoundingRect()),c=m(r.getBoundingRect()),h=[n.x,n.y],d=[r.x,r.y];d[0]=h[0]=l[0][0];var p,f=e.labelPosOpt;null==f||Kr(f)?(v(h,u,l,1,p="+"===f?0:1),v(d,c,l,1,1-p)):(v(h,u,l,1,p=f>=0?0:1),d[1]=h[1]+f);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,n,r,i){e[r]+=n[r][i]-t[r][i]}n.setPosition(h),r.setPosition(d),n.rotation=r.rotation=e.rotation,g(n),g(r)},t.prototype._createAxis=function(e,t){var n=t.getData(),r=t.get("axisType"),i=function(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new GT({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new rM({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new UT}}(t,r);i.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var o=n.getDataExtent("value");i.setExtent(o[0],o[1]),i.calcNiceTicks();var a=new PW("value",i,e.axisExtent,r);return a.model=t,a},t.prototype._createGroup=function(e){var t=this[e]=new Kl;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,r){var i=n.getExtent();if(r.get(["lineStyle","show"])){var o=new Rf({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:Pr({lineCap:"round"},r.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(o);var a=this._progressLine=new Rf({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:Or({lineCap:"round",lineWidth:o.style.lineWidth},r.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(a)}},t.prototype._renderAxisTick=function(e,t,n,r){var i=this,o=r.getData(),a=n.scale.getTicks();this._tickSymbols=[],Fr(a,(function(e){var a=n.dataToCoord(e.value),s=o.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:a,y:0,onclick:jr(i._changeTimeline,i,e.value)},d=zW(s,l,t,h);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=c.getItemStyle(),Sp(d);var p=Ld(d);s.get("tooltip")?(p.dataIndex=e.value,p.dataModel=r):p.dataIndex=p.dataModel=null,i._tickSymbols.push(d)}))},t.prototype._renderAxisLabel=function(e,t,n,r){var i=this;if(n.getLabelModel().get("show")){var o=r.getData(),a=n.getViewLabels();this._tickLabels=[],Fr(a,(function(r){var a=r.tickValue,s=o.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(r.tickValue),d=new Id({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:jr(i._changeTimeline,i,a),silent:!1,style:$g(l,{text:r.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});d.ensureState("emphasis").style=$g(u),d.ensureState("progress").style=$g(c),t.add(d),Sp(d),RW(d).dataIndex=a,i._tickLabels.push(d)}))}},t.prototype._renderControl=function(e,t,n,r){var i=e.controlSize,o=e.rotation,a=r.getModel("controlStyle").getItemStyle(),s=r.getModel(["emphasis","controlStyle"]).getItemStyle(),l=r.getPlayState(),u=r.get("inverse",!0);function c(e,n,l,u){if(e){var c=zl(li(r.get(["controlStyle",n+"BtnSize"]),i),i),h=function(e,t,n,r){var i=r.style,o=Bg(e.get(["controlStyle",t]),r||{},new Uo(n[0],n[1],n[2],n[3]));i&&o.setStyle(i);return o}(r,n+"Icon",[0,-c/2,c,c],{x:e[0],y:e[1],originX:i/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});h.ensureState("emphasis").style=s,t.add(h),Sp(h)}}c(e.nextBtnPosition,"next",jr(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",jr(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",jr(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,r){var i=r.getData(),o=r.getCurrentIndex(),a=i.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=jr(s._handlePointerDrag,s),e.ondragend=jr(s._handlePointerDragend,s),BW(e,s._progressLine,o,n,r,!0)},onUpdate:function(e){BW(e,s._progressLine,o,n,r)}};this._currentPointer=zW(a,a,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],r=hu(this._axis.getExtent().slice());n>r[1]&&(n=r[1]),n<r[0]&&(n=r[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var i=this._progressLine;i&&(i.shape.x2=n,i.dirty());var o=this._findNearestTick(n),a=this.model;(t||o!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(o)},t.prototype._doPlayStop=function(){var e=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){var t=e.model;e._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},t.prototype._toAxisCoord=function(e){return Ng(e,this._mainGroup.getLocalTransform(),!0)},t.prototype._findNearestTick=function(e){var t,n=this.model.getData(),r=1/0,i=this._axis;return n.each(["value"],(function(n,o){var a=i.dataToCoord(n),s=Math.abs(a-e);s<r&&(r=s,t=o)})),t},t.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._changeTimeline=function(e){var t=this.model.getCurrentIndex();"+"===e?e=t+1:"-"===e&&(e=t-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})},t.prototype._updateTicksStatus=function(){var e=this.model.getCurrentIndex(),t=this._tickSymbols,n=this._tickLabels;if(t)for(var r=0;r<t.length;r++)t&&t[r]&&t[r].toggleState("progress",r<e);if(n)for(r=0;r<n.length;r++)n&&n[r]&&n[r].toggleState("progress",RW(n[r]).dataIndex<=e)},t.type="timeline.slider",t}(NW);function zW(e,t,n,r,i,o){var a=t.get("color");i?(i.setColor(a),n.add(i),o&&o.onUpdate(i)):((i=Wb(e.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(i),o&&o.onCreate(i));var s=t.getItemStyle(["color"]);i.setStyle(s),r=Lr({rectHover:!0,z2:100},r,!0);var l=Xb(e.get("symbolSize"));r.scaleX=l[0]/2,r.scaleY=l[1]/2;var u=jb(e.get("symbolOffset"),l);u&&(r.x=(r.x||0)+u[0],r.y=(r.y||0)+u[1]);var c=e.get("symbolRotate");return r.rotation=(c||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function BW(e,t,n,r,i,o){if(!e.dragging){var a=i.getModel("checkpointStyle"),s=r.dataToCoord(i.getData().get("value",n));if(o||!a.get("animation",!0))e.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};e.stopAnimation(null,!0),e.animateTo({x:s,y:0},l),t&&t.animateTo({shape:{x2:s}},l)}}}function VW(e){var t=e&&e.timeline;Zr(t)||(t=t?[t]:[]),Fr(t,(function(e){e&&function(e){var t=e.type,n={number:"value",time:"time"};n[t]&&(e.axisType=n[t],delete e.type);if(FW(e),GW(e,"controlPosition")){var r=e.controlStyle||(e.controlStyle={});GW(r,"position")||(r.position=e.controlPosition),"none"!==r.position||GW(r,"show")||(r.show=!1,delete r.position),delete e.controlPosition}Fr(e.data||[],(function(e){Qr(e)&&!Zr(e)&&(!GW(e,"value")&&GW(e,"name")&&(e.value=e.name),FW(e))}))}(e)}))}function FW(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),r=e.label||e.label||{},i=r.normal||(r.normal={}),o={normal:1,emphasis:1};Fr(r,(function(e,t){o[t]||GW(i,t)||(i[t]=e)})),n.label&&!GW(r,"emphasis")&&(r.emphasis=n.label,delete n.label)}function GW(e,t){return e.hasOwnProperty(t)}function HW(e,t){if(!e)return!1;for(var n=Zr(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function UW(e){ju(e,"label",["show"])}var WW=oc(),XW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return g(t,e),t.prototype.init=function(e,t,n){if("production"!==process.env.NODE_ENV&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(sr.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries((function(e){var n=e.get(this.mainType,!0),o=WW(e)[i];n&&n.data?(o?o._mergeOption(n,t,!0):(r&&UW(n),Fr(n.data,(function(e){e instanceof Array?(UW(e[0]),UW(e[1])):UW(e)})),Pr(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),WW(e)[i]=o):WW(e)[i]=null}),this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return ex("section",{header:this.name,blocks:[ex("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return WW(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(Nv);Br(XW,g_.prototype);var jW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(XW);function YW(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function ZW(e,t,n,r,i,o){var a=[],s=AT(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=eX(t,s,e),u=t.indicesOfNearest(s,l)[0];a[i]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(r,u),h=du(t.get(r,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var qW={min:Yr(ZW,"min"),max:Yr(ZW,"max"),average:Yr(ZW,"average"),median:Yr(ZW,"median")};function KW(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Zr(t.coord)&&Zr(i)){var o=$W(t,n,r,e);if((t=Ir(t)).type&&qW[t.type]&&o.baseAxis&&o.valueAxis){var a=kr(i,o.baseAxis.dim),s=kr(i,o.valueAxis.dim),l=qW[t.type](n,o.baseDataDim,o.valueDataDim,a,s);t.coord=l[0],t.value=l[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&Zr(i))for(var u=t.coord,c=0;c<2;c++)qW[u[c]]&&(u[c]=eX(n,n.mapDimension(i[c]),u[c]));else t.coord=[];return t}}function $W(e,t,n,r){var i={};return null!=e.valueIndex||null!=e.valueDim?(i.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,i.valueAxis=n.getAxis(function(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function JW(e,t){return!(e&&e.containData&&t.coord&&!YW(t))||e.containData(t.coord)}function QW(e,t){return e?function(e,n,r,i){return x_(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return x_(e.value,t[i])}}function eX(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,(function(e,t){isNaN(e)||(r+=e,i++)})),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var tX=oc(),nX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(){this.markerGroupMap=xi()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each((function(e){tX(e).keep=!1})),t.eachSeries((function(e){var i=XW.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)})),i.each((function(e){!tX(e).keep&&r.group.remove(e.group)}))},t.prototype.markKeep=function(e){tX(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;Fr(e,(function(e){var r=XW.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl((function(e){e&&(t?dp(e):pp(e))}))}))},t.type="marker",t}(Cx);function rX(e,t,n){var r=t.coordinateSystem;e.each((function(i){var o,a=e.getItemModel(i),s=uu(a.get("x"),n.getWidth()),l=uu(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)}))}var iX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=XW.getMarkerModelFromSeries(e,"markPoint");t&&(rX(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new kD),u=function(e,t,n){var r;r=e?Gr(e&&e.dimensions,(function(e){return Pr(Pr({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new yT(r,n),o=Gr(n.get("data"),Yr(KW,t));e&&(o=Ur(o,Yr(JW,e)));var a=QW(!!e,r);return i.initData(o,null,a),i}(i,e,t);t.setData(u),rX(t.getData(),e,r),u.each((function(e){var n=u.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(qr(r)||qr(i)||qr(o)||qr(s)){var c=t.getRawValue(e),h=t.getDataParams(e);qr(r)&&(r=r(c,h)),qr(i)&&(i=i(c,h)),qr(o)&&(o=o(c,h)),qr(s)&&(s=s(c,h))}var d=n.getModel("itemStyle").getItemStyle(),p=Db(a,"color");d.fill||(d.fill=p),u.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){Ld(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(nX);var oX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(XW),aX=oc(),sX=function(e,t,n,r){var i,o=e.getData();if(Zr(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=t.getAxis(null!=r.yAxis?"y":"x"),l=si(r.yAxis,r.xAxis);else{var u=$W(r,o,t,e);s=u.valueAxis,l=eX(o,CT(o,u.valueDataDim),a)}var c="x"===s.dim?0:1,h=1-c,d=Ir(r),p={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,p.coord[h]=1/0;var f=n.get("precision");f>=0&&Jr(l)&&(l=+l.toFixed(Math.min(f,20))),d.coord[c]=p.coord[c]=l,i=[d,p,{type:a,valueIndex:r.valueIndex,value:l}]}else"production"!==process.env.NODE_ENV&&Er("Invalid markLine data."),i=[]}var g=[KW(e,i[0]),KW(e,i[1]),Pr({},i[2])];return g[2].type=g[2].type||null,Lr(g[2],g[0]),Lr(g[2],g[1]),g};function lX(e){return!isNaN(e)&&!isFinite(e)}function uX(e,t,n,r){var i=1-e,o=r.dimensions[e];return lX(t[i])&&lX(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function cX(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(uX(1,n,r,e)||uX(0,n,r,e)))return!0}return JW(e,t[0])&&JW(e,t[1])}function hX(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=uu(s.get("x"),i.getWidth()),u=uu(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=a.dataToPoint([h,d])}if(KD(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");c=a.dimensions;lX(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):lX(e.get(c[1],t))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var dX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=XW.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=aX(t).from,o=aX(t).to;i.each((function(t){hX(i,t,!0,e,n),hX(o,t,!1,e,n)})),r.each((function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new cR);this.group.add(l.group);var u=function(e,t,n){var r;r=e?Gr(e&&e.dimensions,(function(e){return Pr(Pr({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new yT(r,n),o=new yT(r,n),a=new yT([],n),s=Gr(n.get("data"),Yr(sX,t,e,n));e&&(s=Ur(s,Yr(cX,e)));var l=QW(!!e,r);return i.initData(Gr(s,(function(e){return e[0]})),null,l),o.initData(Gr(s,(function(e){return e[1]})),null,l),a.initData(Gr(s,(function(e){return e[2]}))),a.hasItemOption=!0,{from:i,to:o,line:a}}(i,e,t),c=u.from,h=u.to,d=u.line;aX(t).from=c,aX(t).to=h,t.setData(d);var p=t.get("symbol"),f=t.get("symbolSize"),g=t.get("symbolRotate"),m=t.get("symbolOffset");function v(t,n,i){var o=t.getItemModel(n);hX(t,n,i,e,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=Db(a,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:li(o.get("symbolOffset",!0),m[i?0:1]),symbolRotate:li(o.get("symbolRotate",!0),g[i?0:1]),symbolSize:li(o.get("symbolSize"),f[i?0:1]),symbol:li(o.get("symbol",!0),p[i?0:1]),style:s})}Zr(p)||(p=[p,p]),Zr(f)||(f=[f,f]),Zr(g)||(g=[g,g]),Zr(m)||(m=[m,m]),u.from.each((function(e){v(c,e,!0),v(h,e,!1)})),d.each((function(e){var t=d.getItemModel(e).getModel("lineStyle").getLineStyle();d.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),d.setItemVisual(e,{fromSymbolKeepAspect:c.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(e,"symbolOffset"),fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolKeepAspect:h.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(e,"symbolOffset"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(d),u.line.eachItemGraphicEl((function(e){Ld(e).dataModel=t,e.traverse((function(e){Ld(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(nX);var pX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(XW),fX=oc(),gX=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var a=KW(e,i),s=KW(e,o),l=a.coord,u=s.coord;l[0]=si(l[0],-1/0),l[1]=si(l[1],-1/0),u[0]=si(u[0],1/0),u[1]=si(u[1],1/0);var c=Nr([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function mX(e){return!isNaN(e)&&!isFinite(e)}function vX(e,t,n,r){var i=1-e;return mX(t[i])&&mX(n[i])}function yX(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};return KD(e,"cartesian2d")?!(!n||!r||!vX(1,n,r)&&!vX(0,n,r))||function(e,t,n){return!(e&&e.containZone&&t.coord&&n.coord&&!YW(t)&&!YW(n))||e.containZone(t.coord,n.coord)}(e,i,o):JW(e,i)||JW(e,o)}function _X(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=uu(s.get(n[0]),i.getWidth()),u=uu(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=a.clampData(c),p=a.clampData(h),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?h[0]:c[0]:f[0]=d[0]>p[0]?c[0]:h[0],"y0"===n[1]?f[1]=d[1]>p[1]?h[1]:c[1]:f[1]=d[1]>p[1]?c[1]:h[1],o=r.getMarkerPosition(f,n,!0)}else{var g=[y=e.get(n[0],t),_=e.get(n[1],t)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(KD(a,"cartesian2d")){var m=a.getAxis("x"),v=a.getAxis("y"),y=e.get(n[0],t),_=e.get(n[1],t);mX(y)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):mX(_)&&(o[1]=v.toGlobalCoord(v.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var xX=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],bX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=XW.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each((function(t){var i=Gr(xX,(function(i){return _X(r,t,i,e,n)}));r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)}))}}),this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Kl});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){var r,i,o=["x0","y0","x1","y1"];if(e){var a=Gr(e&&e.dimensions,(function(e){var n=t.getData();return Pr(Pr({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}));i=Gr(o,(function(e,t){return{name:e,type:a[t%2].type}})),r=new yT(i,n)}else r=new yT(i=[{name:"value",type:"float"}],n);var s=Gr(n.get("data"),Yr(gX,t,e,n));e&&(s=Ur(s,Yr(yX,e)));var l=e?function(e,t,n,r){return x_(e.coord[Math.floor(r/2)][r%2],i[r])}:function(e,t,n,r){return x_(e.value,i[r])};return r.initData(s,null,l),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each((function(t){var n=Gr(xX,(function(n){return _X(u,t,n,e,r)})),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];hu(h),hu(d);var p=!!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=Db(a,"color");f.fill||(f.fill=g,Kr(f.fill)&&(f.fill=ds(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)})),u.diff(fX(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Df({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var r=fX(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?ug(r,{shape:{points:i.points}},t,e):r=new Df({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))})).remove((function(e){var t=fX(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),qg(e,Kg(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:Kr(i.fill)?ds(i.fill,1):"#000"}),Dp(e,r),Tp(e,null,null,r.get(["emphasis","disabled"])),Ld(e).dataModel=t})),fX(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(nX);var wX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return g(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),Zr(t)&&Fr(t,(function(e,r){Kr(e)&&(e={type:e}),t[r]=Lr(e,function(e,t){return"all"===t?{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,e.type))}))},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get("name");if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries((function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var a=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(a)),a.length?t=t.concat(a):i=!0}else i=!0;i&&nc(r)&&t.push(r.name)})),this._availableNames=n;var r=this.get("data")||t,i=xi(),o=Gr(r,(function(e){return(Kr(e)||Jr(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new xm(e,this,this.ecModel))}),this);this._data=Ur(o,(function(e){return!!e}))},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&Fr(this._data,(function(e){t[e.get("name")]=!1}));t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;Fr(e,(function(e){t[e.get("name",!0)]=!0}))},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;Fr(e,(function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]}))},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&kr(this._availableNames,e)>=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(Nv),SX=Yr,TX=Fr,MX=Kl,AX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return g(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new MX),this.group.add(this._selectorGroup=new MX),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var i=e.get("align"),o=e.get("orient");i&&"auto"!==i||(i="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),s=e.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=Tv(l,u,c),d=this.layoutInner(e,i,h,r,a,s),p=Tv(Or({width:d.width,height:d.height},l),u,c);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=tU(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,o,a){var s=this.getContentGroup(),l=xi(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),TX(t.getData(),(function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new MX;return h.newline=!0,void s.add(h)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(d,a,o,i,t,e,f,m,g,u,r);v.on("click",SX(CX,a,null,r,c)).on("mouseover",SX(EX,d.name,null,r,c)).on("mouseout",SX(IX,d.name,null,r,c)),n.ssr&&v.eachChild((function(e){var t=Ld(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}else n.eachRawSeries((function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(!h.containName(a))return;var d=h.indexOfName(a),p=h.getItemVisual(d,"style"),f=h.getItemVisual(d,"legendIcon"),g=is(p.fill);g&&0===g[3]&&(g[3]=.2,p=Pr(Pr({},p),{fill:ps(g,"rgba")}));var m=this._createItem(s,a,o,i,t,e,{},p,f,u,r);m.on("click",SX(CX,null,a,r,c)).on("mouseover",SX(EX,null,a,r,c)).on("mouseout",SX(IX,null,a,r,c)),n.ssr&&m.eachChild((function(e){var t=Ld(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"})),l.set(a,!0)}}),this);"production"!==process.env.NODE_ENV&&(l.get(a)||console.warn(a+" series not exists. Legend data should be same with series name or data name."))}}),this),i&&this._createSelector(i,t,r,o,a)},t.prototype._createSelector=function(e,t,n,r,i){var o=this.getSelectorGroup();TX(e,(function(e){var r=e.type,i=new Id({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i),qg(i,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),Sp(i)}))},t.prototype._createItem=function(e,t,n,r,i,o,a,s,l,u,c){var h=e.visualDrawType,d=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(t),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(e,t,n,r,i,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),TX(e,(function(n,r){"inherit"===e[r]&&(e[r]=t[r])}))}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?bw(h,a):r.decal,"inherit"===u.fill&&(u.fill=r[i]);"inherit"===u.stroke&&(u.stroke=r[c]);"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity);s(u,r);var d=t.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===p.stroke&&(p.stroke=r.fill),!o){var f=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===f?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",r,a,s,h,f,c),_=new MX,x=r.getModel("textStyle");if(!qr(e.getLegendIcon)||v&&"inherit"!==v){var b="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;_.add(function(e){var t=e.icon||"roundRect",n=Wb(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}))}else _.add(e.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));var w="left"===o?d+5:-5,S=o,T=i.get("formatter"),M=t;Kr(T)&&T?M=T.replace("{name}",null!=t?t:""):qr(T)&&(M=T(t));var A=f?x.getTextColor():r.get("inactiveColor");_.add(new Id({style:$g(x,{text:M,x:w,y:p/2,fill:A,align:S,verticalAlign:"middle"},{inheritColor:A})}));var C=new fd({shape:_.getBoundingRect(),style:{fill:"transparent"}}),D=r.getModel("tooltip");return D.get("show")&&Hg({el:C,componentModel:i,itemName:t,itemTooltipOption:D.option}),_.add(C),_.eachChild((function(e){e.silent=!0})),C.silent=!u,this.getContentGroup().add(_),Sp(_),_.__legendDataIndex=n,_},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Sv(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){Sv("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?h[p]+=l[f]+d:u[p]+=c[f]+d,h[1-p]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+d+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-p]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Cx);function CX(e,t,n,r){IX(e,t,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),EX(e,t,n,r)}function DX(e){for(var t,n=e.getZr().storage.getDisplayList(),r=0,i=n.length;r<i&&!(t=n[r].states.emphasis);)r++;return t&&t.hoverLayer}function EX(e,t,n,r){DX(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:r})}function IX(e,t,n,r){DX(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:r})}function LX(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0}))}function NX(e,t,n){var r,i={},o="toggleSelected"===e;return n.eachComponent("legend",(function(n){o&&null!=r?n[r?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),r=n.isSelected(t.name)),Fr(n.getData(),(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var r=n.isSelected(t);i.hasOwnProperty(t)?i[t]=i[t]&&r:i[t]=r}}))})),"allSelect"===e||"inverseSelect"===e?{selected:i}:{name:t.name,selected:i}}function PX(e){e.registerComponentModel(wX),e.registerComponentView(AX),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,LX),e.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(e){e.registerAction("legendToggleSelect","legendselectchanged",Yr(NX,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",Yr(NX,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",Yr(NX,"inverseSelect")),e.registerAction("legendSelect","legendselected",Yr(NX,"select")),e.registerAction("legendUnSelect","legendunselected",Yr(NX,"unSelect"))}(e)}var OX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Dv(t);e.prototype.init.call(this,t,n,r),RX(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),RX(this,this.option,t)},t.type="legend.scroll",t.defaultOption=Sm(wX.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(wX);function RX(e,t,n){var r=[1,1];r[e.getOrient().index]=0,Cv(t,n,{type:"box",ignoreSize:!!r})}var kX=Kl,zX=["width","height"],BX=["x","y"],VX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return g(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new kX),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new kX)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,r,i,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=Zr(c)?c:[c,c];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(e,t){var r=e+"DataIndex",o=Bg(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:jr(l._pageGo,l,r,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=e,u.add(o)}u.add(new Id({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=zX[s],u=BX[s],c=zX[1-s],h=BX[1-s];i&&Sv("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=Ir(n);i&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(e,r,g,s,l,c,h,u);if(i){if("end"===o)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[h]+m[c]/2-p[c]/2,m[c]=Math.max(m[c],p[c]),m[h]=Math.min(m[h],p[h]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,r,i,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;Sv(e.get("orient"),l,e.get("itemGap"),r?n.width:null,r?null:n.height),Sv("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),p=this._showController=h[i]>n[i],f=[-h.x,-h.y];t||(f[r]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=li(e.get("pageButtonGap",!0),e.get("itemGap",!0));p&&("end"===e.get("pageButtonPosition",!0)?m[r]+=n[i]-d[i]:g[r]+=d[i]+v);m[1-r]+=h[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[i]=p?n[i]:h[i],y[o]=Math.max(h[o],d[o]),y[a]=Math.min(0,d[a]+m[1-r]),u.__rectSize=n[i],p){var _={x:0,y:0};_[i]=Math.max(n[i]-d[i]-v,0),_[o]=y[o],u.setClipPath(new fd({shape:_})),u.__rectSize=_[i]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&ug(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?e:null),this._updatePageInfoView(e,x),y},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;Fr(["pagePrev","pageNext"],(function(r){var i=null!=t[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")}));var r=n.childOfName("pageText"),i=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;r&&i&&r.setStyle("text",Kr(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,o=zX[i],a=BX[i],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[i]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+r||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=s-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&_(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[a]+e[a];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===e&&(t=i)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(AX);function FX(e){WS(PX),e.registerComponentModel(OX),e.registerComponentView(VX),function(e){e.registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}))}(e)}var GX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="dataZoom.inside",t.defaultOption=Sm(BH.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(BH),HX=oc();function UX(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function WX(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function XX(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function jX(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=HX(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=xi());r.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){Fr(kH(e).infoList,(function(n){var i=n.model.uid,o=r.get(i)||r.set(i,function(e,t){var n={model:t,containsPoint:Yr(XX,t),dispatchAction:Yr(WX,e),dataZoomInfoMap:null,controller:null},r=n.controller=new yL(e.getZr());return Fr(["pan","zoom","scrollMove"],(function(e){r.on(e,(function(t){var r=[];n.dataZoomInfoMap.each((function(i){if(t.isAvailableBehavior(i.model.option)){var o=(i.getRange||{})[e],a=o&&o(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get("disabled",!0)&&a&&r.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}})),r.length&&n.dispatchAction(r)}))})),n}(t,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=xi())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),r.each((function(e){var t,n=e.controller,i=e.dataZoomInfoMap;if(i){var o=i.keys()[0];null!=o&&(t=i.get(o))}if(t){var a=function(e){var t,n="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},i=!0;return e.each((function(e){var o=e.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");r[n+a]>r[n+t]&&(t=a),i=i&&o.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}(i);n.enable(a.controlType,a.opt),n.setPointerChecker(e.containsPoint),Hx(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else UX(r,e)}))}))}var YX=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return g(t,e),t.prototype.render=function(t,n,r){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(e,t,n){HX(e).coordSysRecordMap.each((function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)}))}(r,t,{pan:jr(ZX.pan,this),zoom:jr(ZX.zoom,this),scrollMove:jr(ZX.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=HX(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||UX(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(GH),ZX={zoom:function(e,t,n,r){var i=this.range,o=i.slice(),a=e.axisModels[0];if(a){var s=KX[t](null,[r.originX,r.originY],a,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return rk(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1]?o:void 0}},pan:qX((function(e,t,n,r,i,o){var a=KX[r]([o.oldX,o.oldY],[o.newX,o.newY],t,i,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength})),scrollMove:qX((function(e,t,n,r,i,o){return KX[r]([0,0],[o.scrollDelta,o.scrollDelta],t,i,n).signal*(e[1]-e[0])*o.scrollDelta}))};function qX(e){return function(t,n,r,i){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s)return rk(e(a,s,t,n,r,i),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var KX={grid:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(e,t,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(a.pixel=t[0]-e[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(e,t,n,r,i){var o=n.axis,a=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===o.orient?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};function $X(e){ZH(e),e.registerComponentModel(GX),e.registerComponentView(YX),jX(e)}var JX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Sm(BH.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(BH),QX=fd,ej="horizontal",tj="vertical",nj=["line","bar","candlestick","scatter"],rj={easing:"cubicOut",duration:100,delay:0},ij=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return g(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=jr(this._onBrush,this),this._onBrushEnd=jr(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),Hx(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Ux(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Kl;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?7:0,r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},o=this._orient===ej?{right:i.width-r.x-r.width,top:i.height-30-7-n,width:r.width,height:30}:{right:7,top:r.y,width:30,height:r.height},a=Dv(e.option);Fr(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=o[e])}));var s=Tv(a,i);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===tj&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==ej||i?n===ej&&i?{scaleY:a?1:-1,scaleX:-1}:n!==tj||i?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=e.getBoundingRect([o]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get("brushSelect");n.add(new QX({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var i=new QX({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:jr(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),a=o&&i.getDimensionInfo(o)?r.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u=i.getDataExtent(a),c=.3*(u[1]-u[0]);u=[u[0]-c,u[1]+c];var h,d=[0,t[1]],p=[0,t[0]],f=[[t[0],0],[0,0]],g=[],m=p[1]/(i.count()-1),v=0,y=Math.round(i.count()/t[0]);i.each([a],(function(e,t){if(y>0&&t%y)v+=m;else{var n=null==e||isNaN(e)||""===e,r=n?0:lu(e,u,d,!0);n&&!h&&t?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&h&&(f.push([v,0]),g.push([v,0])),f.push([v,r]),g.push([v,r]),v+=m,h=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=i,this._shadowDim=a,this._shadowSize=[t[0],t[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(e){var t=_.getModel(e?"selectedDataBackground":"dataBackground"),n=new Kl,r=new Df({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new Lf({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,r=this.ecModel;return e.eachTargetAxis((function(i,o){Fr(e.getAxisProxy(i,o).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&kr(nj,e.get("type"))<0)){var a,s=r.getComponent(OH(i),o).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(i),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:i,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=t.filler=new QX({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new QX({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),Fr([0,1],(function(t){var o=a.get("handleIcon");!Gb[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o,"production"!==process.env.NODE_ENV&&Bu("handleIcon now needs 'path://' prefix when using a path string"));var s=Wb(o,-1,0,2,2,null,!0);s.attr({cursor:oj(this._orient),draggable:!0,drift:jr(this._onDragMove,this,t),ondragend:jr(this._onDragEnd,this),onmouseover:jr(this._showDataInfo,this,!0),onmouseout:jr(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=uu(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Sp(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),i.add(n[t]=s);var h=a.getModel("textStyle");e.add(r[t]=new Id({silent:!0,invisible:!0,style:$g(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))}),this);var h=c;if(u){var d=uu(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new fd({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=t.moveHandleIcon=Wb(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new fd({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",(function(){s.enterEmphasis(p)})).on("mouseout",(function(){s.leaveEmphasis(p)})),i.add(p),i.add(g),i.add(h)}h.attr({draggable:!0,cursor:oj(this._orient),drift:jr(this._onDragMove,this,"all"),ondragstart:jr(this._showDataInfo,this,!0),ondragend:jr(this._onDragEnd,this),onmouseover:jr(this._showDataInfo,this,!0),onmouseout:jr(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[lu(e[0],[0,100],t,!0),lu(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];rk(t,r,i,n.get("zoomLock")?"all":e,null!=o.minSpan?lu(o.minSpan,a,i,!0):null,null!=o.maxSpan?lu(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=hu([lu(r[0],i,a,!0),lu(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=hu(n.slice()),i=this._size;Fr([0,1],(function(e){var r=t.handles[e],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:i[1]/2-o/2})}),this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new fd,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,o=["",""];if(t.get("showDetail")){var a=t.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=e?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=hu(this._handleEnds.slice());function h(e){var t=Lg(n.handles[e].parent,this.group),a=Pg(0===e?"right":"left",t),s=this._handleWidth/2+5,l=Ng([c[e]+(0===e?-s:s),this._size[1]/2],t);r[e].setStyle({x:l[0],y:l[1],verticalAlign:i===ej?"middle":a,align:i===ej?a:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get("labelFormatter"),i=n.get("labelPrecision");null!=i&&"auto"!==i||(i=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return qr(r)?r(e,o):Kr(r)?r.replace("{value}",o):o},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,yo(r.event);var i=Ng([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(e,i[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Po(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100];this._range=hu([lu(n.x,r,i,!0),lu(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(yo(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new QX({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(e,t),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),i.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?rj:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=kH(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return e},t.type="dataZoom.slider",t}(GH);function oj(e){return"vertical"===e?"ns-resize":"ew-resize"}function aj(e){e.registerComponentModel(JX),e.registerComponentView(ij),ZH(e)}var sj=function(e,t,n){var r=Ir((lj[e]||{})[t]);return n&&Zr(r)?r[r.length-1]:r},lj={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},uj=ZP.mapVisual,cj=ZP.eachVisual,hj=Zr,dj=Fr,pj=hu,fj=lu,gj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return g(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&cW(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=jr(e,this),this.controllerVisuals=uW(this.option.controller,t,e),this.targetVisuals=uW(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,n){t.push(n)})):t=Xu(e),t},t.prototype.eachTargetSeries=function(e,t){Fr(this.getTargetSeriesIndices(),(function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)}),this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries((function(n){n===e&&(t=!0)})),t},t.prototype.formatValueText=function(e,t,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],Zr(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);return Kr(s)?s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l):qr(s)?r?s(e[0],e[1]):s(e):r?e[0]===a[0]?n[0]+" "+l[1]:e[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=pj([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),i=t.controller||(t.controller={});Lr(r,n),Lr(i,n);var o=this.isCategory();function a(n){hj(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,r),a.call(this,i),function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},dj(r,(function(e,t){if(ZP.isValidType(t)){var n=sj(t,"inactive",o);null!=n&&(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}})))}.call(this,r,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";dj(this.stateList,(function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&Ir(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&Ir(n)||(o?s[0]:[s[0],s[0]])),l.symbol=uj(l.symbol,(function(e){return"none"===e?i:e}));var u=l.symbolSize;if(null!=u){var c=-1/0;cj(u,(function(e){e>c&&(c=e)})),l.symbolSize=uj(u,(function(e){return fj(e,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,i)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(Nv),mj=[20,140],vj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=mj[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=mj[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):Zr(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),Fr(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=hu((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),(function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)}),this),t.push({seriesId:n.id,dataIndex:r})}),this),t},t.prototype.getVisualMeta=function(e){var t=yj(this,"outOfRange",this.getExtent()),n=yj(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&i(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=Sm(gj.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(gj);function yj(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var _j=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return g(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,!1!==e.get("show")?this.doRender(e,t,n,r):this.group.removeAll()},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=cv(t.get("padding")||0),r=e.getBoundingRect();e.add(new fd({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};if("color"===t){var a=i.get("contentColor");o.color=a}function s(e){return o[e]}function l(e,t){o[e]=t}var u=i.controllerVisuals[r||i.getValueState(e)];return Fr(ZP.prepareVisualTypes(u),(function(r){var i=u[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=u.__alphaForOpacity),ZP.dependsOn(r,t)&&i&&i.applyVisual(e,s,l)})),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;Mv(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(Cx),xj=[["left","right","width"],["top","bottom","height"]];function bj(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},a="horizontal"===r.orient?1:0,s=xj[a],l=[0,null,10],u={},c=0;c<3;c++)u[xj[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:r[s[c]];var h=[["x","width",3],["y","height",0]][a],d=Tv(u,o,r.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function wj(e,t){return Fr(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}var Sj=lu,Tj=Fr,Mj=Math.min,Aj=Math.max,Cj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return g(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=jr(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=jr(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new Id({style:$g(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,a=bj(t,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new Kl;s.add(l),l.add(n.outOfRange=Dj()),l.add(n.inRange=Dj(null,o?Ij(this._orient):null,jr(this._dragHandle,this,"all",!1),jr(this._dragHandle,this,"all",!0))),l.setClipPath(new fd({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=Aj(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,c,i),this._createHandle(t,s,1,r,c,i)),this._createIndicator(t,s,r,c,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,o){var a=jr(this._dragHandle,this,n,!1),s=jr(this._dragHandle,this,n,!0),l=zl(e.get("handleSize"),r[0]),u=Wb(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=Ij(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){yo(e.event)}}),u.x=r[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),Ep(u,!0),t.add(u);var h=this.visualMapModel.textStyleModel,d=new Id({cursor:c,draggable:!0,drift:a,onmousemove:function(e){yo(e.event)},ondragend:s,style:$g(h,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=d},t.prototype._createIndicator=function(e,t,n,r,i){var o=zl(e.get("indicatorSize"),n[0]),a=Wb(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof ad){var l=a.style;a.useStyle(Pr({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=this.visualMapModel.textStyleModel,c=new Id({silent:!0,invisible:!0,style:$g(u,{x:0,y:0,text:""})});this.group.add(c);var h=[("horizontal"===i?r/2:6)+n[0]/2,0],d=this._shapes;d.indicator=a,d.indicatorLabel=c,d.indicatorLabelPoint=h,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}t===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():Ej(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[Sj(t[0],n,r,!0),Sj(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];rk(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[Sj(r[0],i,o,!0),Sj(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),a=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new Zf(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Kl("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent();Tj([0,1],(function(l){var u=i[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=Sj(e[l],[0,a[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/a[0],u.x=a[0]-h/2;var d=Ng(n.handleLabelPoints[l],Lg(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=Sj(e,o,s,!0),p=a[0]-h/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=Ng(l.indicatorLabelPoint,Lg(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var _={x:p,y:d,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,b),m.animateTo(x,b)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;S<w.length;S++)this.api.enterBlur(w[S])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=Mj(Aj(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],o=n.getExtent();e=Mj(Aj(i[0],e),i[1]);var a=function(e,t,n){var r=6,i=e.get("hoverLinkDataSize");i&&(r=Sj(i,t,n,!0)/2);return r}(n,o,i),s=[e-a,e+a],l=Sj(e,i,o,!0),u=[Sj(s[0],i,o,!0),Sj(s[1],i,o,!0)];s[0]<i[0]&&(u[0]=-1/0),s[1]>i[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var c=this._hoverLinkDataIndices,h=[];(t||Ej(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=function(e,t){var n={},r={};return i(e||[],n),i(t||[],r,n),[o(n),o(r)];function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var o=Qu(e[r].seriesId,null);if(null==o)return;for(var a=Xu(e[r].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(t[o]||(t[o]={}))[c]=1}}}function o(e,t){var n=[];for(var r in e)if(e.hasOwnProperty(r)&&null!=e[r])if(t)n.push(+r);else{var i=o(e[r],!0);i.length&&n.push({seriesId:r,dataIndex:i})}return n}}(c,h);this._dispatchHighDown("downplay",wj(d[0],n)),this._dispatchHighDown("highlight",wj(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(Nb(e.target,(function(e){var n=Ld(e);if(null!=n.dataIndex)return t=n,!0}),!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",wj(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=Lg(t,r?null:this.group);return Zr(e)?Ng(e,i,n):Pg(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(_j);function Dj(e,t,n,r){return new Df({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){yo(e.event)},ondragend:r})}function Ej(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function Ij(e){return"vertical"===e?"ns-resize":"ew-resize"}var Lj={type:"selectDataRange",event:"dataRangeSelected",update:"update"},Nj=function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))},Pj=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",(function(t){var r,i,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((r=t.stateList,i=t.targetVisuals,o=jr(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},Fr(r,(function(e){var t=ZP.prepareVisualTypes(i[e]);s[e]=t})),{progress:function(e,t){var n,r;function l(e){return Cb(t,r,e)}function u(e,n){Eb(t,r,e,n)}null!=a&&(n=t.getDimensionIndex(a));for(var c=t.getStore();null!=(r=e.next());){var h=t.getRawDataItem(r);if(!h||!1!==h.visualMap)for(var d=null!=a?c.get(n,r):r,p=o(d),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(d,l,u)}}}}))})),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(jr(Oj,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}})),e.getData().setVisual("visualMeta",r)}}];function Oj(e,t,n,r){for(var i=t.targetVisuals[r],o=ZP.prepareVisualTypes(i),a={color:Db(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return a.color;function h(e){return a[e]}function d(e,t){a[e]=t}}var Rj=Fr;function kj(e){var t=e&&e.visualMap;Zr(t)||(t=t?[t]:[]),Rj(t,(function(e){if(e){zj(e,"splitList")&&!zj(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&Zr(t)&&Rj(t,(function(e){Qr(e)&&(zj(e,"start")&&!zj(e,"min")&&(e.min=e.start),zj(e,"end")&&!zj(e,"max")&&(e.max=e.end))}))}}))}function zj(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Bj=!1;function Vj(e){Bj||(Bj=!0,e.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"})),e.registerAction(Lj,Nj),Fr(Pj,(function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)})),e.registerPreprocessor(kj))}function Fj(e){e.registerComponentModel(vj),e.registerComponentView(Cj),Vj(e)}var Gj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return g(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],Hj[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual((function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=Ir(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=Gr(this._pieceList,(function(e){return e=Ir(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=ZP.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}Fr(t.pieces,(function(e){Fr(r,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),Fr(n,(function(e,n){var r=!1;Fr(this.stateList,(function(e){r=r||o(t,e,n)||o(t.target,e,n)}),this),!r&&Fr(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=sj(n,"inRange"===e?"active":"inactive",i)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,Fr(r,(function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)}),this),"single"===n.selectedMode){var o=!1;Fr(r,(function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[n]=!1:o=!0)}),this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=Ir(e)},t.prototype.getValueState=function(e){var t=ZP.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),(function(t,r){ZP.findPieceIndex(t,n)===e&&i.push(r)}),this),t.push({seriesId:r.id,dataIndex:i})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return Fr(i,(function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])}),this),{stops:t,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=e(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=Sm(gj.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(gj),Hj={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),Au(e),Fr(e,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(e){var t=this.option;Fr(t.categories,(function(t){e.push({text:this.formatValueText(t,!0),value:t})}),this),Uj(t,e)},pieces:function(e){var t=this.option;Fr(t.pieces,(function(t,n){Qr(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],a[c]=s[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),"production"!==process.env.NODE_ENV&&o[0]>o[1]&&console.warn("Piece "+n+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&a[0]&&a[1]&&(r.value=o[0])}r.visual=ZP.retrieveVisuals(t),e.push(r)}),this),Uj(t,e),Au(e),Fr(e,(function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function Uj(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var Wj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=si(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),Fr(l.viewPieceList,(function(r){var l=r.piece,u=new Kl;u.onclick=jr(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var d=this.visualMapModel.getValueState(h);u.add(new Id({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,a),Sv(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return r("highlight")})).on("mouseout",(function(){return r("downplay")}));var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:wj(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return bj(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new Kl,a=this.visualMapModel.textStyleModel;o.add(new Id({style:$g(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=Gr(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(Wb(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=Ir(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,Fr(i,(function(e,t){i[t]=t===o}))):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(_j);function Xj(e){e.registerComponentModel(Gj),e.registerComponentView(Wj),Vj(e)}var jj={label:{enabled:!0},decal:{show:!1}},Yj=oc(),Zj={};function qj(e,t){var n=e.getModel("aria");if(n.get("enabled")){var r=Ir(jj);Lr(r.label,e.getLocaleModel().get("aria"),!1),Lr(n.option,r,!1),function(){if(n.getModel("decal").get("show")){var t=xi();e.eachSeries((function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),Yj(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if(qr(t.enableAriaDecal))t.enableAriaDecal();else{var n=t.getData();if(t.isColorBySeries()){var r=oy(t.ecModel,t.name,Zj,e.getSeriesCount()),i=n.getVisual("decal");n.setVisual("decal",u(i,r))}else{var o=t.getRawData(),a={},s=Yj(t).scope;n.each((function(e){var t=n.getRawIndex(e);a[t]=e}));var l=o.count();o.each((function(e){var r=a[e],i=o.getName(e)||e+"",c=oy(t.ecModel,i,s,l),h=n.getItemVisual(r,"decal");n.setItemVisual(r,"decal",u(h,c))}))}}function u(e,t){var n=e?Pr(Pr({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var r=e.getLocaleModel().get("aria"),o=n.getModel("label");if(o.option=Or(o.option,r),!o.get("enabled"))return;var a=t.getZr().dom;if(o.get("description"))return void a.setAttribute("aria-label",o.get("description"));var s,l=e.getSeriesCount(),u=o.get(["data","maxCount"])||10,c=o.get(["series","maxCount"])||10,h=Math.min(l,c);if(l<1)return;var d=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();s=d?i(o.get(["general","withTitle"]),{title:d}):o.get(["general","withoutTitle"]);var p=[];s+=i(l>1?o.get(["series","multiple","prefix"]):o.get(["series","single","prefix"]),{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var r=void 0,a=t.get("name")?"withName":"withoutName";r=i(r=l>1?o.get(["series","multiple",a]):o.get(["series","single",a]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(_=t.subType,x=e.getLocaleModel().get(["series","typeNames"]),x[_]||x.chart)});var s=t.getData();if(s.count()>u)r+=i(o.get(["data","partialData"]),{displayCnt:u});else r+=o.get(["data","allData"]);for(var c=o.get(["data","separator","middle"]),d=o.get(["data","separator","end"]),f=[],g=0;g<s.count();g++)if(g<u){var m=s.getName(g),v=s.getValues(g),y=o.get(["data",m?"withName":"withoutName"]);f.push(i(y,{name:m,value:v.join(c)}))}r+=f.join(c)+d,p.push(r)}var _,x}));var f=o.getModel(["series","multiple","separator"]),g=f.get("middle"),m=f.get("end");s+=p.join(g)+m,a.setAttribute("aria-label",s)}()}function i(e,t){if(!Kr(e))return e;var n=e;return Fr(t,(function(e,t){n=n.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),n}}function Kj(e){if(e&&e.aria){var t=e.aria;null!=t.show&&(t.enabled=t.show),t.label=t.label||{},Fr(["description","general","series","data"],(function(e){null!=t[e]&&(t.label[e]=t[e])}))}}var $j={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Jj=function(){function e(e){if(null==(this._condVal=Kr(e)?new RegExp(e):oi(e)?e:null)){var t="";"production"!==process.env.NODE_ENV&&(t=Fu("Illegal regexp",e,"in")),Gu(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return Kr(t)?this._condVal.test(e):!!Jr(t)&&this._condVal.test(e+"")},e}(),Qj=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),eY=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},e}(),tY=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},e}(),nY=function(){function e(){}return e.prototype.evaluate=function(){return!this.child.evaluate()},e}(),rY=function(){function e(){}return e.prototype.evaluate=function(){for(var e=!!this.valueParser,t=(0,this.getValue)(this.valueGetterParam),n=e?this.valueParser(t):null,r=0;r<this.subCondList.length;r++)if(!this.subCondList[r].evaluate(e?n:t))return!1;return!0},e}();function iY(e,t){if(!0===e||!1===e){var n=new Qj;return n.value=e,n}var r="";return aY(e)||("production"!==process.env.NODE_ENV&&(r=Fu("Illegal config. Expect a plain object but actually",e)),Gu(r)),e.and?oY("and",e,t):e.or?oY("or",e,t):e.not?function(e,t){var n=e.not,r="";"production"!==process.env.NODE_ENV&&(r=Fu('"not" condition should only be `not: {}`.',"Illegal condition:",e));aY(n)||Gu(r);var i=new nY;i.child=iY(n,t),i.child||Gu(r);return i}(e,t):function(e,t){for(var n="",r=t.prepareGetValue(e),i=[],o=Xr(e),a=e.parser,s=a?w_(a):null,l=0;l<o.length;l++){var u=o[l];if("parser"!==u&&!t.valueGetterAttrMap.get(u)){var c=Ti($j,u)?$j[u]:u,h=e[u],d=s?s(h):h,p=C_(c,d)||"reg"===c&&new Jj(d);p||("production"!==process.env.NODE_ENV&&(n=Fu('Illegal relational operation: "'+u+'" in condition:',e)),Gu(n)),i.push(p)}}i.length||("production"!==process.env.NODE_ENV&&(n=Fu("Relational condition must have at least one operator.","Illegal condition:",e)),Gu(n));var f=new rY;return f.valueGetterParam=r,f.valueParser=s,f.getValue=t.getValue,f.subCondList=i,f}(e,t)}function oY(e,t,n){var r=t[e],i="";"production"!==process.env.NODE_ENV&&(i=Fu('"and"/"or" condition should only be `'+e+": [...]` and must not be empty array.","Illegal condition:",t)),Zr(r)||Gu(i),r.length||Gu(i);var o="and"===e?new eY:new tY;return o.children=Gr(r,(function(e){return iY(e,n)})),o.children.length||Gu(i),o}function aY(e){return Qr(e)&&!Vr(e)}var sY=function(){function e(e,t){this._cond=iY(e,t)}return e.prototype.evaluate=function(){return this._cond.evaluate()},e}();var lY={type:"echarts:filter",transform:function(e){for(var t,n,r,i=e.upstream,o=(n=e.config,r={valueGetterAttrMap:xi({dimension:!0}),prepareGetValue:function(e){var t="",n=e.dimension;Ti(e,"dimension")||("production"!==process.env.NODE_ENV&&(t=Fu('Relation condition must has prop "dimension" specified.',"Illegal condition:",e)),Gu(t));var r=i.getDimensionInfo(n);return r||("production"!==process.env.NODE_ENV&&(t=Fu("Can not find dimension info via: "+n+".\n","Existing dimensions: ",i.cloneAllDimensionInfo(),".\n","Illegal condition:",e,".\n")),Gu(t)),{dimIdx:r.index}},getValue:function(e){return i.retrieveValueFromItem(t,e.dimIdx)}},new sY(n,r)),a=[],s=0,l=i.count();s<l;s++)t=i.getRawDataItem(s),o.evaluate()&&a.push(t);return{data:a}}},uY="";"production"!==process.env.NODE_ENV&&(uY=["Valid config is like:",'{ dimension: "age", order: "asc" }','or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" "));var cY={type:"echarts:sort",transform:function(e){var t=e.upstream,n=e.config,r="",i=Xu(n);i.length||("production"!==process.env.NODE_ENV&&(r="Empty `config` in sort transform."),Gu(r));var o=[];Fr(i,(function(e){var n=e.dimension,i=e.order,a=e.parser,s=e.incomparable;if(null==n&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "dimension" specified.'+uY),Gu(r)),"asc"!==i&&"desc"!==i&&("production"!==process.env.NODE_ENV&&(r='Sort transform config must has "order" specified.'+uY),Gu(r)),s&&"min"!==s&&"max"!==s){var l="";"production"!==process.env.NODE_ENV&&(l='incomparable must be "min" or "max" rather than "'+s+'".'),Gu(l)}if("asc"!==i&&"desc"!==i){var u="";"production"!==process.env.NODE_ENV&&(u='order must be "asc" or "desc" rather than "'+i+'".'),Gu(u)}var c=t.getDimensionInfo(n);c||("production"!==process.env.NODE_ENV&&(r=Fu("Can not find dimension info via: "+n+".\n","Existing dimensions: ",t.cloneAllDimensionInfo(),".\n","Illegal config:",e,".\n")),Gu(r));var h=a?w_(a):null;a&&!h&&("production"!==process.env.NODE_ENV&&(r=Fu("Invalid parser name "+a+".\n","Illegal config:",e,".\n")),Gu(r)),o.push({dimIdx:c.index,parser:h,comparator:new M_(i,s)})}));var a=t.sourceFormat;a!==Bv&&a!==Vv&&("production"!==process.env.NODE_ENV&&(r='sourceFormat "'+a+'" is not supported yet'),Gu(r));for(var s=[],l=0,u=t.count();l<u;l++)s.push(t.getRawDataItem(l));return s.sort((function(e,n){for(var r=0;r<o.length;r++){var i=o[r],a=t.retrieveValueFromItem(e,i.dimIdx),s=t.retrieveValueFromItem(n,i.dimIdx);i.parser&&(a=i.parser(a),s=i.parser(s));var l=i.comparator.evaluate(a,s);if(0!==l)return l}return 0})),{data:s}}};var hY=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return g(t,e),t.prototype.init=function(t,n,r){e.prototype.init.call(this,t,n,r),this._sourceManager=new j_(this),Y_(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),Y_(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:Uv},t}(Nv),dY=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return g(t,e),t.type="dataset",t}(Cx);function pY(e){e.registerComponentModel(hY),e.registerComponentView(dY)}var fY=Ph.CMD;function gY(e,t){return Math.abs(e-t)<1e-5}function mY(e){var t,n,r,i,o,a=e.data,s=e.len(),l=[],u=0,c=0,h=0,d=0;function p(e,n){t&&t.length>2&&l.push(t),t=[e,n]}function f(e,n,r,i){gY(e,r)&&gY(n,i)||t.push(e,n,r,i,r,i)}function g(e,n,r,i,o,a){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=n<e?-1:1,c=Math.cos(e),h=Math.sin(e),d=Math.cos(n),p=Math.sin(n),f=c*o+r,g=h*a+i,m=d*o+r,v=p*a+i,y=o*l*u,_=a*l*u;t.push(f-y*h,g+_*c,m+y*p,v-_*d,m,v)}for(var m=0;m<s;){var v=a[m++],y=1===m;switch(y&&(h=u=a[m],d=c=a[m+1],v!==fY.L&&v!==fY.C&&v!==fY.Q||(t=[h,d])),v){case fY.M:u=h=a[m++],c=d=a[m++],p(h,d);break;case fY.L:f(u,c,n=a[m++],r=a[m++]),u=n,c=r;break;case fY.C:t.push(a[m++],a[m++],a[m++],a[m++],u=a[m++],c=a[m++]);break;case fY.Q:n=a[m++],r=a[m++],i=a[m++],o=a[m++],t.push(u+2/3*(n-u),c+2/3*(r-c),i+2/3*(n-i),o+2/3*(r-o),i,o),u=i,c=o;break;case fY.A:var _=a[m++],x=a[m++],b=a[m++],w=a[m++],S=a[m++],T=a[m++]+S;m+=1;var M=!a[m++];n=Math.cos(S)*b+_,r=Math.sin(S)*w+x,y?p(h=n,d=r):f(u,c,n,r),u=Math.cos(T)*b+_,c=Math.sin(T)*w+x;for(var A=(M?-1:1)*Math.PI/2,C=S;M?C>T:C<T;C+=A){g(C,M?Math.max(C+A,T):Math.min(C+A,T),_,x,b,w)}break;case fY.R:h=u=a[m++],d=c=a[m++],n=h+a[m++],r=d+a[m++],p(n,d),f(n,d,n,r),f(n,r,h,r),f(h,r,h,d),f(h,d,n,d);break;case fY.Z:t&&f(u,c,h,d),u=h,c=d}}return t&&t.length>2&&l.push(t),l}function vY(e,t,n,r,i,o,a,s,l,u){if(gY(e,n)&&gY(t,r)&&gY(i,a)&&gY(o,s))l.push(a,s);else{var c=2/u,h=c*c,d=a-e,p=s-t,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-e,m=r-t,v=i-a,y=o-s,_=g*g+m*m,x=v*v+y*y;if(_<h&&x<h)l.push(a,s);else{var b=d*g+p*m,w=-d*v-p*y;if(_-b*b<h&&b>=0&&x-w*w<h&&w>=0)l.push(a,s);else{var S=[],T=[];La(e,n,i,a,.5,S),La(t,r,o,s,.5,T),vY(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),vY(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}}}}function yY(e,t,n){var r=e[t],i=e[1-t],o=Math.abs(r/i),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],u=0;u<a;u++)l.push(s);var c=n-a*s;if(c>0)for(u=0;u<c;u++)l[u%a]+=1;return l}function _Y(e,t,n){for(var r=e.r0,i=e.r,o=e.startAngle,a=e.endAngle,s=Math.abs(a-o),l=s*i,u=i-r,c=l>Math.abs(u),h=yY([l,u],c?0:1,t),d=(c?s:u)/h.length,p=0;p<h.length;p++)for(var f=(c?u:s)/h[p],g=0;g<h[p];g++){var m={};c?(m.startAngle=o+d*p,m.endAngle=o+d*(p+1),m.r0=r+f*g,m.r=r+f*(g+1)):(m.startAngle=o+f*g,m.endAngle=o+f*(g+1),m.r0=r+d*p,m.r=r+d*(p+1)),m.clockwise=e.clockwise,m.cx=e.cx,m.cy=e.cy,n.push(m)}}function xY(e,t,n,r){return e*r-n*t}function bY(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=xY(c,h,l,u);if(Math.abs(d)<1e-6)return null;var p=xY(e-i,t-o,c,h)/d;return p<0||p>1?null:new Po(p*l+e,p*u+t)}function wY(e,t,n){var r=new Po;Po.sub(r,n,t),r.normalize();var i=new Po;return Po.sub(i,e,t),i.dot(r)}function SY(e,t){var n=e[e.length-1];n&&n[0]===t[0]&&n[1]===t[1]||e.push(t)}function TY(e){var t=e.points,n=[],r=[];lh(t,n,r);var i=new Uo(n[0],n[1],r[0]-n[0],r[1]-n[1]),o=i.width,a=i.height,s=i.x,l=i.y,u=new Po,c=new Po;return o>a?(u.x=c.x=s+o/2,u.y=l,c.y=l+a):(u.y=c.y=l+a/2,u.x=s,c.x=s+o),function(e,t,n){for(var r=e.length,i=[],o=0;o<r;o++){var a=e[o],s=e[(o+1)%r],l=bY(a[0],a[1],s[0],s[1],t.x,t.y,n.x,n.y);l&&i.push({projPt:wY(l,t,n),pt:l,idx:o})}if(i.length<2)return[{points:e},{points:e}];i.sort((function(e,t){return e.projPt-t.projPt}));var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}var d=[u.pt.x,u.pt.y],p=[c.pt.x,c.pt.y],f=[d],g=[p];for(o=u.idx+1;o<=c.idx;o++)SY(f,e[o].slice());for(SY(f,p),SY(f,d),o=c.idx+1;o<=u.idx+r;o++)SY(g,e[o%r].slice());return SY(g,d),SY(g,p),[{points:f},{points:g}]}(t,u,c)}function MY(e,t,n,r){if(1===n)r.push(t);else{var i=Math.floor(n/2),o=e(t);MY(e,o[0],i,r),MY(e,o[1],n-i,r)}return r}function AY(e,t){t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel}function CY(e,t){var n,r=[],i=e.shape;switch(e.type){case"rect":!function(e,t,n){for(var r=e.width,i=e.height,o=r>i,a=yY([r,i],o?0:1,t),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",c=o?"y":"x",h=e[s]/a.length,d=0;d<a.length;d++)for(var p=e[l]/a[d],f=0;f<a[d];f++){var g={};g[u]=d*h,g[c]=f*p,g[s]=h,g[l]=p,g.x+=e.x,g.y+=e.y,n.push(g)}}(i,t,r),n=fd;break;case"sector":_Y(i,t,r),n=bf;break;case"circle":_Y({r0:0,r:i.r,startAngle:0,endAngle:2*Math.PI,cx:i.cx,cy:i.cy},t,r),n=bf;break;default:var o=e.getComputedTransform(),a=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,s=Gr(function(e,t){var n=mY(e),r=[];t=t||1;for(var i=0;i<n.length;i++){var o=n[i],a=[],s=o[0],l=o[1];a.push(s,l);for(var u=2;u<o.length;){var c=o[u++],h=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++];vY(s,l,c,h,d,p,f,g,a,t),s=f,l=g}r.push(a)}return r}(e.getUpdatedPathProxy(),a),(function(e){return function(e){for(var t=[],n=0;n<e.length;)t.push([e[n++],e[n++]]);return t}(e)})),l=s.length;if(0===l)MY(TY,{points:s[0]},t,r);else if(l===t)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,h=Gr(s,(function(e){var t=[],n=[];lh(e,t,n);var r=(n[1]-t[1])*(n[0]-t[0]);return c+=r,{poly:e,area:r}}));h.sort((function(e,t){return t.area-e.area}));var d=t;for(u=0;u<l;u++){var p=h[u];if(d<=0)break;var f=u===l-1?d:Math.ceil(p.area/c*t);f<0||(MY(TY,{points:p.poly},f,r),d-=f)}}n=Df}if(!n)return function(e,t){for(var n=[],r=0;r<t;r++)n.push(Jp(e));return n}(e,t);var g=[];for(u=0;u<r.length;u++){var m=new n;m.setShape(r[u]),AY(e,m),g.push(m)}return g}function DY(e,t){var n=e.length,r=t.length;if(n===r)return[e,t];for(var i=[],o=[],a=n<r?e:t,s=Math.min(n,r),l=Math.abs(r-n)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,h=[a[0],a[1]],d=l,p=2;p<s;){var f=a[p-2],g=a[p-1],m=a[p++],v=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++];if(d<=0)h.push(m,v,y,_,x,b);else{for(var w=Math.min(d,c-1)+1,S=1;S<=w;S++){var T=S/w;La(f,m,y,x,T,i),La(g,v,_,b,T,o),f=i[3],g=o[3],h.push(i[1],o[1],i[2],o[2],f,g),m=i[5],v=o[5],y=i[6],_=o[6]}d-=w-1}}return a===e?[h,t]:[e,h]}function EY(e,t){for(var n=e.length,r=e[n-2],i=e[n-1],o=[],a=0;a<t.length;)o[a++]=r,o[a++]=i;return o}function IY(e){for(var t=0,n=0,r=0,i=e.length,o=0,a=i-2;o<i;a=o,o+=2){var s=e[a],l=e[a+1],u=e[o],c=e[o+1],h=s*c-u*l;t+=h,n+=(s+u)*h,r+=(l+c)*h}return 0===t?[e[0]||0,e[1]||0]:[n/t/3,r/t/3,t]}function LY(e,t,n,r){for(var i=(e.length-2)/6,o=1/0,a=0,s=e.length,l=s-2,u=0;u<i;u++){for(var c=6*u,h=0,d=0;d<s;d+=2){var p=0===d?c:(c+d-2)%l+2,f=e[p]-n[0],g=e[p+1]-n[1],m=t[d]-r[0]-f,v=t[d+1]-r[1]-g;h+=m*m+v*v}h<o&&(o=h,a=u)}return a}function NY(e){for(var t=[],n=e.length,r=0;r<n;r+=2)t[r]=e[n-r-2],t[r+1]=e[n-r-1];return t}function PY(e){return e.__isCombineMorphing}var OY="__mOriginal_";function RY(e,t,n){var r=OY+t,i=e[r]||e[t];e[r]||(e[r]=e[t]);var o=n.replace,a=n.after,s=n.before;e[t]=function(){var e,t=arguments;return s&&s.apply(this,t),e=o?o.apply(this,t):i.apply(this,t),a&&a.apply(this,t),e}}function kY(e,t){var n=OY+t;e[n]&&(e[t]=e[n],e[n]=null)}function zY(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;){var o=r[i],a=r[i+1];r[i++]=t[0]*o+t[2]*a+t[4],r[i++]=t[1]*o+t[3]*a+t[5]}}function BY(e,t){var n=e.getUpdatedPathProxy(),r=t.getUpdatedPathProxy(),i=function(e,t){for(var n,r,i,o=[],a=[],s=0;s<Math.max(e.length,t.length);s++){var l=e[s],u=t[s],c=void 0,h=void 0;l?u?(r=c=(n=DY(l,u))[0],i=h=n[1]):(h=EY(i||l,l),c=l):(c=EY(r||u,u),h=u),o.push(c),a.push(h)}return[o,a]}(mY(n),mY(r)),o=i[0],a=i[1],s=e.getComputedTransform(),l=t.getComputedTransform();s&&zY(o,s),l&&zY(a,l),RY(t,"updateTransform",{replace:function(){this.transform=null}}),t.transform=null;var u=function(e,t,n,r){for(var i,o=[],a=0;a<e.length;a++){var s=e[a],l=t[a],u=IY(s),c=IY(l);null==i&&(i=u[2]<0!=c[2]<0);var h=[],d=[],p=0,f=1/0,g=[],m=s.length;i&&(s=NY(s));for(var v=6*LY(s,l,u,c),y=m-2,_=0;_<y;_+=2){var x=(v+_)%y+2;h[_+2]=s[x]-u[0],h[_+3]=s[x+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=r/n,w=-r/2;w<=r/2;w+=b){var S=Math.sin(w),T=Math.cos(w),M=0;for(_=0;_<s.length;_+=2){var A=h[_],C=h[_+1],D=l[_]-c[0],E=l[_+1]-c[1],I=D*T-E*S,L=D*S+E*T;g[_]=I,g[_+1]=L;var N=I-A,P=L-C;M+=N*N+P*P}if(M<f){f=M,p=w;for(var O=0;O<g.length;O++)d[O]=g[O]}}o.push({from:h,to:d,fromCp:u,toCp:c,rotation:-p})}return o}(o,a,10,Math.PI),c=[];RY(t,"buildPath",{replace:function(e){for(var n=t.__morphT,r=1-n,i=[],o=0;o<u.length;o++){var a=u[o],s=a.from,l=a.to,h=a.rotation*n,d=a.fromCp,p=a.toCp,f=Math.sin(h),g=Math.cos(h);Xi(i,d,p,n);for(var m=0;m<s.length;m+=2){var v=s[m],y=s[m+1],_=v*r+(S=l[m])*n,x=y*r+(T=l[m+1])*n;c[m]=_*g-x*f+i[0],c[m+1]=_*f+x*g+i[1]}var b=c[0],w=c[1];e.moveTo(b,w);for(m=2;m<s.length;){var S=c[m++],T=c[m++],M=c[m++],A=c[m++],C=c[m++],D=c[m++];b===S&&w===T&&M===C&&A===D?e.lineTo(C,D):e.bezierCurveTo(S,T,M,A,C,D),b=C,w=D}}}})}function VY(e,t,n){if(!e||!t)return t;var r=n.done,i=n.during;return BY(e,t),t.__morphT=0,t.animateTo({__morphT:1},Or({during:function(e){t.dirtyShape(),i&&i(e)},done:function(){kY(t,"buildPath"),kY(t,"updateTransform"),t.__morphT=-1,t.createPathProxy(),t.dirtyShape(),r&&r()}},n)),t}function FY(e,t,n,r,i,o){e=i===n?0:Math.round(32767*(e-n)/(i-n)),t=o===r?0:Math.round(32767*(t-r)/(o-r));for(var a,s=0,l=32768;l>0;l/=2){var u=0,c=0;(e&l)>0&&(u=1),(t&l)>0&&(c=1),s+=l*l*(3*u^c),0===c&&(1===u&&(e=l-1-e,t=l-1-t),a=e,e=t,t=a)}return s}function GY(e){var t=1/0,n=1/0,r=-1/0,i=-1/0,o=Gr(e,(function(e){var o=e.getBoundingRect(),a=e.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return t=Math.min(s,t),n=Math.min(l,n),r=Math.max(s,r),i=Math.max(l,i),[s,l]}));return Gr(o,(function(o,a){return{cp:o,z:FY(o[0],o[1],t,n,r,i),path:e[a]}})).sort((function(e,t){return e.z-t.z})).map((function(e){return e.path}))}function HY(e){return CY(e.path,e.count)}function UY(e){return Zr(e[0])}function WY(e,t){for(var n=[],r=e.length,i=0;i<r;i++)n.push({one:e[i],many:[]});for(i=0;i<t.length;i++){var o=t[i].length,a=void 0;for(a=0;a<o;a++)n[a%r].many.push(t[i][a])}var s=0;for(i=r-1;i>=0;i--)if(!n[i].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[i].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var XY={clone:function(e){for(var t=[],n=1-Math.pow(1-e.path.style.opacity,1/e.count),r=0;r<e.count;r++){var i=Jp(e.path);i.setStyle("opacity",n),t.push(i)}return t},split:null};function jY(e,t,n,r,i,o){if(e.length&&t.length){var a=sg("update",r,i);if(a&&a.duration>0){var s,l,u=r.getModel("universalTransition").get("delay"),c=Object.assign({setToFinal:!0},a);UY(e)&&(s=e,l=t),UY(t)&&(s=t,l=e);for(var h=s?s===e:e.length>t.length,d=s?WY(l,s):WY(h?t:e,[h?e:t]),p=0,f=0;f<d.length;f++)p+=d[f].many.length;var g=0;for(f=0;f<d.length;f++)m(d[f],h,g,p),g+=d[f].many.length}}function m(e,t,r,i,a){var s=e.many,l=e.one;if(1!==s.length||a)for(var h=Or({dividePath:XY[n],individualDelay:u&&function(e,t,n,o){return u(e+r,i)}},c),d=t?function(e,t,n){var r=[];!function e(t){for(var n=0;n<t.length;n++){var i=t[n];PY(i)?e(i.childrenRef()):i instanceof ed&&r.push(i)}}(e);var i=r.length;if(!i)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(n.dividePath||HY)({path:t,count:i});if(o.length!==i)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};r=GY(r),o=GY(o);for(var a=n.done,s=n.during,l=n.individualDelay,u=new El,c=0;c<i;c++){var h=r[c],d=o[c];d.parent=t,d.copyTransform(u),l||BY(h,d)}function p(e){for(var t=0;t<o.length;t++)o[t].addSelfToZr(e)}function f(){t.__isCombineMorphing=!1,t.__morphT=-1,t.childrenRef=null,kY(t,"addSelfToZr"),kY(t,"removeSelfFromZr")}t.__isCombineMorphing=!0,t.childrenRef=function(){return o},RY(t,"addSelfToZr",{after:function(e){p(e)}}),RY(t,"removeSelfFromZr",{after:function(e){for(var t=0;t<o.length;t++)o[t].removeSelfFromZr(e)}});var g=o.length;if(l){var m=g,v=function(){0==--m&&(f(),a&&a())};for(c=0;c<g;c++){var y=l?Or({delay:(n.delay||0)+l(c,g,r[c],o[c]),done:v},n):n;VY(r[c],o[c],y)}}else t.__morphT=0,t.animateTo({__morphT:1},Or({during:function(e){for(var n=0;n<g;n++){var r=o[n];r.__morphT=t.__morphT,r.dirtyShape()}s&&s(e)},done:function(){f();for(var t=0;t<e.length;t++)kY(e[t],"updateTransform");a&&a()}},n));return t.__zr&&p(t.__zr),{fromIndividuals:r,toIndividuals:o,count:g}}(s,l,h):function(e,t,n){var r=t.length,i=[],o=n.dividePath||HY;if(PY(e)){!function e(t){for(var n=0;n<t.length;n++){var r=t[n];PY(r)?e(r.childrenRef()):r instanceof ed&&i.push(r)}}(e.childrenRef());var a=i.length;if(a<r)for(var s=0,l=a;l<r;l++)i.push(Jp(i[s++%a]));i.length=r}else{i=o({path:e,count:r});var u=e.getComputedTransform();for(l=0;l<i.length;l++)i[l].setLocalTransform(u);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}i=GY(i),t=GY(t);var c=n.individualDelay;for(l=0;l<r;l++){var h=c?Or({delay:(n.delay||0)+c(l,r,i[l],t[l])},n):n;VY(i[l],t[l],h)}return{fromIndividuals:i,toIndividuals:t,count:t.length}}(l,s,h),p=d.fromIndividuals,f=d.toIndividuals,g=p.length,v=0;v<g;v++){y=u?Or({delay:u(v,g)},c):c;o(p[v],f[v],t?s[v]:e.one,t?e.one:s[v],y)}else{var y,_=t?s[0]:l,x=t?l:s[0];if(PY(_))m({many:[_],one:x},!0,r,i,!0);else VY(_,x,y=u?Or({delay:u(r,i)},c):c),o(_,x,_,x,y)}}}function YY(e){if(!e)return[];if(Zr(e)){for(var t=[],n=0;n<e.length;n++)t.push(YY(e[n]));return t}var r=[];return e.traverse((function(e){e instanceof ed&&!e.disableMorphing&&!e.invisible&&!e.ignore&&r.push(e)})),r}var ZY=1e4,qY=0,KY=1,$Y=2,JY=oc();function QY(e,t,n,r){var i=function(e,t){for(var n=e.dimensions,r=0;r<n.length;r++){var i=e.getDimensionInfo(n[r]);if(i&&0===i.otherDims[t])return n[r]}}(e,r?"itemChildGroupId":"itemGroupId");if(i){var o=function(e,t,n){var r=e.getDimensionInfo(n),i=r&&r.ordinalMeta;if(r){var o=e.get(r.name,t);return i&&i.categories[o]||o+""}}(e,t,i);return o}var a=e.getRawDataItem(t),s=r?"childGroupId":"groupId";return a&&a[s]?a[s]+"":r?void 0:n||e.getId(t)}function eZ(e){var t=[];return Fr(e,(function(e){var n=e.data,r=e.dataGroupId;if(n.count()>ZY)"production"!==process.env.NODE_ENV&&ku("Universal transition is disabled on large data > 10k.");else for(var i=n.getIndices(),o=0;o<i.length;o++)t.push({data:n,groupId:QY(n,o,r,!1),childGroupId:QY(n,o,r,!0),divide:e.divide,dataIndex:o})})),t}function tZ(e,t,n){e.traverse((function(e){e instanceof ed&&cg(e,{style:{opacity:0}},t,{dataIndex:n,isFrom:!0})}))}function nZ(e){if(e.parent){var t=e.getComputedTransform();e.setLocalTransform(t),e.parent.remove(e)}}function rZ(e){e.stopAnimation(),e.isGroup&&e.traverse((function(e){e.stopAnimation()}))}function iZ(e,t,n){var r=sg("update",n,t);r&&e.traverse((function(e){if(e instanceof Qc){var t=function(e){return ag(e).oldStyle}(e);t&&e.animateFrom({style:t},r)}}))}function oZ(e,t,n){var r=eZ(e),i=eZ(t);function o(e,t,n,r,i){(n||e)&&t.animateFrom({style:n&&n!==e?Pr(Pr({},n.style),e.style):e.style},i)}var a=!1,s=qY,l=xi(),u=xi();r.forEach((function(e){e.groupId&&l.set(e.groupId,!0),e.childGroupId&&u.set(e.childGroupId,!0)}));for(var c=0;c<i.length;c++){var h=i[c].groupId;if(u.get(h)){s=KY;break}var d=i[c].childGroupId;if(d&&l.get(d)){s=$Y;break}}function p(e,t){return function(n){var r=n.data,i=n.dataIndex;return t?r.getId(i):e?s===KY?n.childGroupId:n.groupId:s===$Y?n.childGroupId:n.groupId}}var f=function(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++){var i=e[r],o=t[r];if(i.data.getId(i.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(r,i),g={};if(!f)for(c=0;c<i.length;c++){var m=i[c],v=m.data.getItemGraphicEl(m.dataIndex);v&&(g[v.id]=!0)}function y(e,t){var n=r[t],s=i[e],l=s.data.hostModel,u=n.data.getItemGraphicEl(n.dataIndex),c=s.data.getItemGraphicEl(s.dataIndex);u!==c?u&&g[u.id]||c&&(rZ(c),u?(rZ(u),nZ(u),a=!0,jY(YY(u),YY(c),s.divide,l,e,o)):tZ(c,l,e)):c&&iZ(c,s.dataIndex,l)}new YS(r,i,p(!0,f),p(!1,f),null,"multiple").update(y).updateManyToOne((function(e,t){var n=i[e],s=n.data,l=s.hostModel,u=s.getItemGraphicEl(n.dataIndex),c=Ur(Gr(t,(function(e){return r[e].data.getItemGraphicEl(r[e].dataIndex)})),(function(e){return e&&e!==u&&!g[e.id]}));u&&(rZ(u),c.length?(Fr(c,(function(e){rZ(e),nZ(e)})),a=!0,jY(YY(c),YY(u),n.divide,l,e,o)):tZ(u,l,n.dataIndex))})).updateOneToMany((function(e,t){var n=r[t],s=n.data.getItemGraphicEl(n.dataIndex);if(!s||!g[s.id]){var l=Ur(Gr(e,(function(e){return i[e].data.getItemGraphicEl(i[e].dataIndex)})),(function(e){return e&&e!==s})),u=i[e[0]].data.hostModel;l.length&&(Fr(l,(function(e){return rZ(e)})),s?(rZ(s),nZ(s),a=!0,jY(YY(s),YY(l),n.divide,u,e[0],o)):Fr(l,(function(t){return tZ(t,u,e[0])})))}})).updateManyToMany((function(e,t){new YS(t,e,(function(e){return r[e].data.getId(r[e].dataIndex)}),(function(e){return i[e].data.getId(i[e].dataIndex)})).update((function(n,r){y(e[n],t[r])})).execute()})).execute(),a&&Fr(t,(function(e){var t=e.data.hostModel,r=t&&n.getViewOfSeriesModel(t),i=sg("update",t,0);r&&t.isAnimationEnabled()&&i&&i.duration>0&&r.group.traverse((function(e){e instanceof ed&&!e.animators.length&&e.animateFrom({style:{opacity:0}},i)}))}))}function aZ(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function sZ(e){return Zr(e)?e.sort().join(","):e}function lZ(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function uZ(e,t){for(var n=0;n<e.length;n++){if(null!=t.seriesIndex&&t.seriesIndex===e[n].seriesIndex||null!=t.seriesId&&t.seriesId===e[n].id)return n}}WS([CD]),WS([function(e){e.registerPainter("svg",_D)}]),WS([function(e){e.registerChartView(lE),e.registerSeriesModel(DD),e.registerLayout(uE("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,dE("line"))},function(e){e.registerChartView(wE),e.registerSeriesModel(fE),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Yr(QT,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,eM("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,dE("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))}))},function(e){e.registerChartView(KE),e.registerSeriesModel(eI),Ib("pie",e.registerAction),e.registerLayout(Yr(HE,"pie")),e.registerProcessor(UE("pie")),e.registerProcessor(function(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf((function(e){var t=n.mapDimension("value"),r=n.get(t,e);return!(Jr(r)&&!isNaN(r)&&r<0)}))}}}("pie"))},function(e){WS(eL),e.registerSeriesModel(tI),e.registerChartView(oI),e.registerLayout(uE("scatter"))},function(e){WS(fL),e.registerChartView(oL),e.registerSeriesModel(aL),e.registerLayout(tL),e.registerProcessor(UE("radar")),e.registerPreprocessor(iL)},function(e){WS(HN),e.registerChartView(wN),e.registerSeriesModel(SN),e.registerLayout(MN),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,TN),Ib("map",e.registerAction)},function(e){e.registerChartView(eP),e.registerSeriesModel(wP),e.registerLayout(TP),e.registerVisual(MP),function(e){e.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,r=t.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),e.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var r=VN(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))}(e)},function(e){e.registerSeriesModel(DP),e.registerChartView(WP),e.registerVisual(sO),e.registerLayout(xO),function(e){for(var t=0;t<AP.length;t++)e.registerAction({type:AP[t],update:"updateView"},Mi);e.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,n){var r=yP(e,["treemapZoomToNode","treemapRootToNode"],t);if(r){var i=t.getViewRoot();i&&(e.direction=xP(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))}))}(e)},function(e){e.registerChartView(SR),e.registerSeriesModel(IR),e.registerProcessor(AO),e.registerVisual(CO),e.registerVisual(EO),e.registerLayout(GO),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,qO),e.registerLayout($O),e.registerCoordinateSystem("graphView",{dimensions:CN.dimensions,create:JO}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Mi),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Mi),e.registerAction(LR,(function(e,t,n){t.eachComponent({mainType:"series",query:e},(function(t){var r=VN(t.coordinateSystem,e,void 0,n);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))},function(e){e.registerChartView(RR),e.registerSeriesModel(kR)},function(e){e.registerChartView(VR),e.registerSeriesModel(FR),e.registerLayout(GR),e.registerProcessor(UE("funnel"))},function(e){WS(mz),e.registerChartView(HR),e.registerSeriesModel(YR),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,KR)},function(e){e.registerChartView(_z),e.registerSeriesModel(bz),e.registerLayout(wz),e.registerVisual(Oz),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}))},function(e){e.registerSeriesModel(kz),e.registerChartView(zz),e.registerLayout(Wz),e.registerTransform(Xz)},function(e){e.registerChartView(Yz),e.registerSeriesModel(iB),e.registerPreprocessor(oB),e.registerVisual(hB),e.registerLayout(dB)},function(e){e.registerChartView(mB),e.registerSeriesModel(vB),e.registerLayout(uE("effectScatter"))},function(e){e.registerChartView(MB),e.registerSeriesModel(EB),e.registerLayout(TB),e.registerVisual(LB)},function(e){e.registerChartView(OB),e.registerSeriesModel(RB)},function(e){e.registerChartView(VB),e.registerSeriesModel(rV),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Yr(QT,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,eM("pictorialBar"))},function(e){e.registerChartView(iV),e.registerSeriesModel(oV),e.registerLayout(aV),e.registerProcessor(UE("themeRiver"))},function(e){e.registerChartView(dV),e.registerSeriesModel(pV),e.registerLayout(Yr(mV,"sunburst")),e.registerProcessor(Yr(UE,"sunburst")),e.registerVisual(yV),function(e){e.registerAction({type:uV,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var r=yP(e,[uV],t);if(r){var i=t.getViewRoot();i&&(e.direction=xP(i,r.node)?"rollUp":"drillDown"),t.resetViewRoot(r.node)}}))})),e.registerAction({type:cV,update:"none"},(function(e,t,n){e=Pr({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=yP(e,[cV],t);n&&(e.dataIndex=n.node.dataIndex)})),"production"!==process.env.NODE_ENV&&Vu("sunburstHighlight","highlight"),n.dispatchAction(Pr(e,{type:"highlight"}))})),e.registerAction({type:hV,update:"updateView"},(function(e,t,n){e=Pr({},e),"production"!==process.env.NODE_ENV&&Vu("sunburstUnhighlight","downplay"),n.dispatchAction(Pr(e,{type:"downplay"}))}))}(e)},function(e){e.registerChartView(mF),e.registerSeriesModel(wV)}]),WS((function(e){WS(eL),WS(vG)})),WS((function(e){WS(vG),HI.registerAxisPointerClass("PolarAxisPointer",yG),e.registerCoordinateSystem("polar",PG),e.registerComponentModel(xG),e.registerComponentView(qG),pI(e,"angle",wG,YG),pI(e,"radius",SG,ZG),e.registerComponentView(BG),e.registerComponentView(HG),e.registerLayout(Yr(jG,"bar"))})),WS(HN),WS((function(e){WS(vG),HI.registerAxisPointerClass("SingleAxisPointer",uH),e.registerComponentView(pH),e.registerComponentView(QG),e.registerComponentModel(tH),pI(e,"single",tH,tH.defaultOption),e.registerCoordinateSystem("single",aH)})),WS(mz),WS((function(e){e.registerComponentModel(fH),e.registerComponentView(mH),e.registerCoordinateSystem("calendar",yH)})),WS((function(e){e.registerComponentModel(TH),e.registerComponentView(CH),e.registerPreprocessor((function(e){var t=e.graphic;Zr(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}))})),WS((function(e){e.registerComponentModel(eU),e.registerComponentView(nU),JH("saveAsImage",rU),JH("magicType",aU),JH("dataView",pU),JH("dataZoom",RU),JH("restore",yU),WS(qH)})),WS((function(e){WS(vG),e.registerComponentModel(BU),e.registerComponentView(tW),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Mi),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Mi)})),WS(vG),WS((function(e){e.registerComponentView(SW),e.registerComponentModel(TW),e.registerPreprocessor(aW),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,yW),e.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),e.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Mi),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Mi),JH("brush",CW)})),WS((function(e){e.registerComponentModel(DW),e.registerComponentView(EW)})),WS((function(e){e.registerComponentModel(LW),e.registerComponentView(kW),e.registerSubTypeDefaulter("timeline",(function(){return"slider"})),function(e){e.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t,n){var r=t.getComponent("timeline");return r&&null!=e.currentIndex&&(r.setCurrentIndex(e.currentIndex),!r.get("loop",!0)&&r.isIndexMax()&&r.getPlayState()&&(r.setPlayState(!1),n.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:r.get("replaceMerge",!0)}),Or({currentIndex:r.option.currentIndex},e)})),e.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}))}(e),e.registerPreprocessor(VW)})),WS((function(e){e.registerComponentModel(jW),e.registerComponentView(iX),e.registerPreprocessor((function(e){HW(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})}))})),WS((function(e){e.registerComponentModel(oX),e.registerComponentView(dX),e.registerPreprocessor((function(e){HW(e.series,"markLine")&&(e.markLine=e.markLine||{})}))})),WS((function(e){e.registerComponentModel(pX),e.registerComponentView(bX),e.registerPreprocessor((function(e){HW(e.series,"markArea")&&(e.markArea=e.markArea||{})}))})),WS((function(e){WS(PX),WS(FX)})),WS((function(e){WS($X),WS(aj)})),WS($X),WS(aj),WS((function(e){WS(Fj),WS(Xj)})),WS(Fj),WS(Xj),WS((function(e){e.registerPreprocessor(Kj),e.registerVisual(e.PRIORITY.VISUAL.ARIA,qj)})),WS((function(e){e.registerTransform(lY),e.registerTransform(cY)})),WS(pY),WS((function(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){Fr(Xu(n.seriesTransition),(function(e){Fr(Xu(e.to),(function(e){for(var t=n.updatedSeries,r=0;r<t.length;r++)(null!=e.seriesIndex&&e.seriesIndex===t[r].seriesIndex||null!=e.seriesId&&e.seriesId===t[r].id)&&(t[r][gx]=!0)}))}))})),e.registerUpdateLifecycle("series:transition",(function(e,t,n){var r=JY(t);if(r.oldSeries&&n.updatedSeries&&n.optionChanged){var i=n.seriesTransition;if(i)Fr(Xu(i),(function(e){!function(e,t,n,r){var i=[],o=[];Fr(Xu(e.from),(function(e){var n=uZ(t.oldSeries,e);n>=0&&i.push({dataGroupId:t.oldDataGroupIds[n],data:t.oldData[n],divide:lZ(t.oldData[n]),groupIdDim:e.dimension})})),Fr(Xu(e.to),(function(e){var r=uZ(n.updatedSeries,e);if(r>=0){var i=n.updatedSeries[r].getData();o.push({dataGroupId:t.oldDataGroupIds[r],data:i,divide:lZ(i),groupIdDim:e.dimension})}})),i.length>0&&o.length>0&&oZ(i,o,r)}(e,r,n,t)}));else{var o=function(e,t){var n=xi(),r=xi(),i=xi();function o(e){n.get(e)&&ku("Duplicated seriesKey in universalTransition "+e)}return Fr(e.oldSeries,(function(t,n){var o=e.oldDataGroupIds[n],a=e.oldData[n],s=aZ(t),l=sZ(s);r.set(l,{dataGroupId:o,data:a}),Zr(s)&&Fr(s,(function(e){i.set(e,{key:l,dataGroupId:o,data:a})}))})),Fr(t.updatedSeries,(function(e){if(e.isUniversalTransitionEnabled()&&e.isAnimationEnabled()){var t=e.get("dataGroupId"),a=e.getData(),s=aZ(e),l=sZ(s),u=r.get(l);if(u)"production"!==process.env.NODE_ENV&&o(l),n.set(l,{oldSeries:[{dataGroupId:u.dataGroupId,divide:lZ(u.data),data:u.data}],newSeries:[{dataGroupId:t,divide:lZ(a),data:a}]});else if(Zr(s)){"production"!==process.env.NODE_ENV&&o(l);var c=[];Fr(s,(function(e){var t=r.get(e);t.data&&c.push({dataGroupId:t.dataGroupId,divide:lZ(t.data),data:t.data})})),c.length&&n.set(l,{oldSeries:c,newSeries:[{dataGroupId:t,data:a,divide:lZ(a)}]})}else{var h=i.get(s);if(h){var d=n.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:lZ(h.data)}],newSeries:[]},n.set(h.key,d)),d.newSeries.push({dataGroupId:t,data:a,divide:lZ(a)})}}}})),n}(r,n);Fr(o.keys(),(function(e){var n=o.get(e);oZ(n.oldSeries,n.newSeries,t)}))}Fr(n.updatedSeries,(function(e){e[gx]&&(e[gx]=!1)}))}for(var a=e.getSeries(),s=r.oldSeries=[],l=r.oldDataGroupIds=[],u=r.oldData=[],c=0;c<a.length;c++){var h=a[c].getData();h.count()<ZY&&(s.push(a[c]),l.push(a[c].get("dataGroupId")),u.push(h))}}))})),WS(rC);var cZ=Object.freeze({__proto__:null,Axis:yA,ChartView:zx,ComponentModel:Nv,ComponentView:Cx,List:yT,Model:xm,PRIORITY:Iw,SeriesModel:Mx,color:vs,connect:function(e){if(Zr(e)){var t=e;e=null,Fr(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+_S++,Fr(t,(function(t){t.group=e}))}return vS[e]=!0,e},dataTool:{},dependencies:{zrender:"5.5.0"},disConnect:SS,disconnect:wS,dispose:function(e){Kr(e)?e=mS[e]:e instanceof oS||(e=TS(e)),e instanceof oS&&!e.isDisposed()&&e.dispose()},env:sr,extendChartView:function(e){var t=zx.extend(e);return zx.registerClass(t),t},extendComponentModel:function(e){var t=Nv.extend(e);return Nv.registerClass(t),t},extendComponentView:function(e){var t=Cx.extend(e);return Cx.registerClass(t),t},extendSeriesModel:function(e){var t=Mx.extend(e);return Mx.registerClass(t),t},format:iA,getCoordinateSystemDimensions:PS,getInstanceByDom:TS,getInstanceById:function(e){return mS[e]},getMap:FS,graphic:rA,helper:FM,init:bS,innerDrawElementOnCanvas:mw,matrix:No,number:tA,parseGeoJSON:eA,parseGeoJson:eA,registerAction:LS,registerCoordinateSystem:NS,registerLayout:OS,registerLoading:BS,registerLocale:Im,registerMap:VS,registerPostInit:DS,registerPostUpdate:ES,registerPreprocessor:AS,registerProcessor:CS,registerTheme:MS,registerTransform:GS,registerUpdateLifecycle:IS,registerVisual:RS,setCanvasCreator:function(e){"production"!==process.env.NODE_ENV&&Bu("setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead."),gr({createCanvas:e})},setPlatformAPI:gr,throttle:Gx,time:nA,use:WS,util:oA,vector:qi,version:"5.5.0",zrUtil:Ci,zrender:ou});const hZ=e=>{const t=(e=>{const{data:t,extraData:n,sort:r}=e;if(t&&r){const a=(i=[...t],"asc"===(o=r)?i.sort(((e,t)=>e.value-t.value)):"desc"===o&&i.sort(((e,t)=>t.value-e.value)),i),s=Jn(a.map((e=>e.label))),l=nr(a,s),u=nr([...null!=n?n:[]],s);return Object.assign(Object.assign({},e),{data:l,extraData:u})}var i,o;return e})(e);switch(t.chartType){case ln.MINI_AREA:return(e=>{var t,n,r;const i=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),o=e.color;return{color:o,grid:{top:4,left:0,right:0,bottom:0,containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{show:!1},xAxis:{show:!1,boundaryGap:!1,data:Jn(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label)))},yAxis:{show:!1,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},series:[...i.map(((t,n)=>{var r,i;const a=null!==(r=null==o?void 0:o[n])&&void 0!==r?r:un[n];return{name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new Zf(0,0,0,1,[{offset:0,color:Vn(a,.5)},{offset:1,color:"dark"===e.theme?"#000":"#fff"}])},emphasis:{focus:"series"},data:null===(i=e.data)||void 0===i?void 0:i.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case ln.AREA:return(e=>{var t,n;const r=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:tr(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:[...r.map(((t,n)=>{var r;return{name:t,type:"line",smooth:!0,lineStyle:{width:2},showSymbol:!1,areaStyle:{opacity:.8,color:new Zf(0,0,0,1,[{offset:0,color:Vn(un[n],.5)},{offset:1,color:"dark"===e.theme?"#000":"#fff"}])},emphasis:{focus:"series"},data:null===(r=e.data)||void 0===r?void 0:r.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case ln.LINE:return(e=>{var t,n;const r=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:tr(e),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return{name:t,type:"line",smooth:!1,lineStyle:{width:2},showSymbol:!0,emphasis:{focus:"series"},data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))}}))}})(t);case ln.COLUMN:return(e=>{var t,n;const r=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},tr(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return{name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))}}))}})(t);case ln.STACK_COLUMN:return(e=>{var t,n;const r=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},tr(e)),{axisPointer:{type:"shadow"}}),yAxis:{min:null===(n=e.yStart)||void 0===n?void 0:n[0]},series:r.map((t=>{var n;return{name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))}}))}})(t);case ln.BAR:return(e=>{var t,n,r;const i=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:{},yAxis:{data:Jn(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:i.map((t=>{var n;return{name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:[0,500,500,0]}})))}}))}})(t);case ln.STACK_BAR:return(e=>{var t,n,r;const i=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:{},yAxis:{data:Jn(null===(n=e.data)||void 0===n?void 0:n.map((e=>e.label))),axisTick:{alignWithLabel:!0},axisPointer:{type:"shadow"},min:null===(r=e.yStart)||void 0===r?void 0:r[0],axisLabel:{rotate:e.xAxisLabelRotate,formatter:t=>{const n=e.xAxisLabelLength;return"number"==typeof n&&t.length>n?`${t.slice(0,n)}...`:t}}},series:i.map(((t,n)=>{var r;return{name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(r=e.data)||void 0===r?void 0:r.filter((e=>e.type===t)).map((e=>({value:e.value}))),label:{show:e.showStackTotal&&n===i.length-1,position:"right",formatter:t=>{var n;return String(Number(Qn(null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.label===t.name)).map((e=>e.value))).toFixed(2)))}}}}))}})(t);case ln.FUNNEL:return(e=>{var t,n;const r=null!==(n=null===(t=er(e.data))||void 0===t?void 0:t.map((e=>{var t;return{value:null!==(t=e.value)&&void 0!==t?t:0,name:e.type}})))&&void 0!==n?n:[],i={type:"funnel",minSize:"20%",left:10,top:24,width:"76%",sort:"descending",data:r};return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[Object.assign(Object.assign({},i),{label:{show:!0,position:"outer",formatter:"{c}"}}),Object.assign(Object.assign({},i),{emphasis:{label:{fontSize:20}},label:{show:!0,position:"inner",color:"#fff",formatter:e=>{const t=e.dataIndex;if(0===t)return"100%";const n=r[t-1].value;return $n(e.value/n)}}})]}})(t);case ln.DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=Jn(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},tr(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return{name:t,type:"bar",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value,itemStyle:{borderRadius:e.value>0?[500,500,0,0]:[0,0,500,500]}})))}})),...a.map((t=>{var n;return{name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1,data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case ln.STACK_DUAL_LINE_BAR:return(e=>{var t,n,r,i;const o=Jn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.type))),a=Jn(null===(n=e.extraData)||void 0===n?void 0:n.map((e=>e.type)));return{tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{bottom:0,type:"scroll"},xAxis:Object.assign(Object.assign({},tr(e)),{axisPointer:{type:"shadow"}}),yAxis:[{alignTicks:!0,min:null===(r=e.yStart)||void 0===r?void 0:r[0]},{alignTicks:!0,min:null===(i=e.yStart)||void 0===i?void 0:i[1]}],series:[...o.map((t=>{var n;return{name:t,type:"bar",stack:"total",barGap:"30%",barCategoryGap:"30%",barMaxWidth:8,data:null===(n=e.data)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>({value:e.value})))}})),...a.map((t=>{var n;return{name:t,type:"line",smooth:!0,yAxisIndex:1,showSymbol:!1,data:null===(n=e.extraData)||void 0===n?void 0:n.filter((e=>e.type===t)).map((e=>e.value))}}))]}})(t);case ln.PIE:return(e=>{var t,n;const r=Qn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:"50%",data:null===(n=er(e.data))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:ir(e),position:"outside",formatter:e=>$n(e.value/(r||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}})(t);case ln.CYCLE:return(e=>{var t,n,r,i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x;const b=Qn(null===(t=e.data)||void 0===t?void 0:t.map((e=>e.value)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},series:[{top:-30,type:"pie",radius:["60%","48%"],data:null===(n=er(e.data))||void 0===n?void 0:n.map((t=>({value:t.value,name:e.reserveValueWithLabelType?t.label:t.type}))),label:{show:!0,fontSize:12,color:ir(e),position:"outside",formatter:e=>$n(e.value/(b||1))},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],graphic:[{type:"text",left:"center",top:null!==(o=null===(i=null===(r=e.cycleCenterConfig)||void 0===r?void 0:r.content)||void 0===i?void 0:i.top)&&void 0!==o?o:76,style:{text:null!==(l=null===(s=null===(a=e.cycleCenterConfig)||void 0===a?void 0:a.content)||void 0===s?void 0:s.value)&&void 0!==l?l:Number(b.toFixed(2)).toString(),fill:"dark"===e.theme?"#fff":"#12161F",fontFamily:"roboto",fontSize:null!==(h=null===(c=null===(u=e.cycleCenterConfig)||void 0===u?void 0:u.content)||void 0===c?void 0:c.fontSize)&&void 0!==h?h:28,fontWeight:"bold"}},{type:"text",left:"center",top:null!==(f=null===(p=null===(d=e.cycleCenterConfig)||void 0===d?void 0:d.title)||void 0===p?void 0:p.top)&&void 0!==f?f:112,style:{text:null!==(v=null===(m=null===(g=e.cycleCenterConfig)||void 0===g?void 0:g.title)||void 0===m?void 0:m.value)&&void 0!==v?v:"总计",fill:"dark"===e.theme?"#fff":"#394252 ",fontSize:null!==(x=null===(_=null===(y=e.cycleCenterConfig)||void 0===y?void 0:y.title)||void 0===_?void 0:_.fontSize)&&void 0!==x?x:14}}]}})(t);case ln.RADAR:return(e=>{var t,n;const r=Jn(null===(t=e.data)||void 0===t?void 0:t.map((t=>e.reserveValueWithLabelType?t.label:t.type)));return{tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll"},radar:{shape:"circle",radius:"60%",indicator:Jn(null===(n=e.data)||void 0===n?void 0:n.map((t=>e.reserveValueWithLabelType?t.type:t.label))).map((e=>({name:e}))),axisName:{color:"#5d677a"},splitArea:{areaStyle:{color:["transparent"]}},axisLine:{lineStyle:{color:"rgba(226, 229, 235, .3)"}},splitLine:{lineStyle:{color:"#e2e5eb",type:"dashed",dashOffset:1.5}}},series:[{type:"radar",data:r.map(((t,n)=>{var r;return{name:t,value:null===(r=e.data)||void 0===r?void 0:r.filter((n=>e.reserveValueWithLabelType?n.label:n.type===t)).map((e=>e.value)),areaStyle:{color:Vn(un[n],.2)},label:{show:e.reserveValueWithLabelType,formatter:e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toString()}}}})),emphasis:{lineStyle:{width:4}}}]}})(t);default:return{}}};var dZ={color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"rgba(0,0,0,0)",textStyle:{},title:{textStyle:{color:"#272f3d"},subtextStyle:{color:"#394252"}},line:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},radar:{itemStyle:{borderWidth:1},lineStyle:{width:2},symbolSize:4,symbol:"emptyCircle",smooth:!1},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#dfe3eb"},symbolSize:4,symbol:"emptyCircle",smooth:!1,color:["#3379ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!0,lineStyle:{color:["#eef0f5"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"#eef0f5"}},axisTick:{show:!0,lineStyle:{color:"#eef0f5"}},axisLabel:{show:!0,color:"#828b9e"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#828c9e"},emphasis:{iconStyle:{borderColor:"#394252"}}},legend:{textStyle:{color:"#828b9e"}},tooltip:{axisPointer:{lineStyle:{color:"#ccd1db",width:"1"},crossStyle:{color:"#ccd1db",width:"1"}}},timeline:{lineStyle:{color:"#eef0f5",width:2},itemStyle:{color:"#eef0f5",borderWidth:"1"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},checkpointStyle:{color:"#3379ff",borderColor:"#ffffff"},label:{color:"#b1b9c7"},emphasis:{itemStyle:{color:"#3379ff"},controlStyle:{color:"#828c9e",borderColor:"#828c9e",borderWidth:1},label:{color:"#b1b9c7"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},pZ={color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],backgroundColor:"transparent",textStyle:{},title:{textStyle:{color:"#ffffff"},subtextStyle:{color:"#ffffff"}},line:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},radar:{itemStyle:{borderWidth:"1"},lineStyle:{width:"2"},symbolSize:"6",symbol:"emptyCircle",smooth:!0},bar:{itemStyle:{barBorderWidth:"0",barBorderColor:"#cccccc"}},pie:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},scatter:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},boxplot:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},parallel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},sankey:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},funnel:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},gauge:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"}},candlestick:{itemStyle:{color:"#f15451",color0:"#00c267",borderColor:"#f15451",borderColor0:"#00c267",borderWidth:1}},graph:{itemStyle:{borderWidth:"0",borderColor:"#cccccc"},lineStyle:{width:"1",color:"#ffffff"},symbolSize:"6",symbol:"emptyCircle",smooth:!0,color:["#5798ff","#00dcf0","#ffc94d","#00db75","#b8b3ff","#40b4ff","#ffa101","#90abe0","#6ee67a","#6b84ff","#fa6b69"],label:{color:"#ffffff"}},map:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},geo:{itemStyle:{areaColor:"#eee",borderColor:"#444",borderWidth:.5},label:{color:"#000"},emphasis:{itemStyle:{areaColor:"rgba(255,215,0,0.8)",borderColor:"#444",borderWidth:1},label:{color:"rgb(100,0,0)"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},valueAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},logAxis:{axisLine:{show:!1,lineStyle:{color:"#6E7079"}},axisTick:{show:!1,lineStyle:{color:"#6E7079"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!0,lineStyle:{color:["rgba(255,255,255,0.12)"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},timeAxis:{axisLine:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisTick:{show:!0,lineStyle:{color:"rgba(255,255,255,0.12)"}},axisLabel:{show:!0,color:"rgba(255,255,255,0.5)"},splitLine:{show:!1,lineStyle:{color:["#E0E6F1"]}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},toolbox:{iconStyle:{borderColor:"#ffffff"},emphasis:{iconStyle:{borderColor:"#ffffff"}}},legend:{textStyle:{color:"#ffffff"}},tooltip:{axisPointer:{lineStyle:{color:"#ffffff",width:"1"},crossStyle:{color:"#ffffff",width:"1"}}},timeline:{lineStyle:{color:"#ffffff",width:2},itemStyle:{color:"#ffffff",borderWidth:"1"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},checkpointStyle:{color:"#5798ff",borderColor:"#ffffff"},label:{color:"#ffffff"},emphasis:{itemStyle:{color:"#5798ff"},controlStyle:{color:"#ffffff",borderColor:"#ffffff",borderWidth:1},label:{color:"#ffffff"}}},visualMap:{color:["#062379","#2058d2","#3379ff","#a0cbff","#e8f4ff"]},dataZoom:{handleSize:"undefined%",textStyle:{}},markPoint:{label:{color:"#ffffff"},emphasis:{label:{color:"#ffffff"}}}},fZ=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===gZ}(e)}(e)};var gZ="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function mZ(e,t){return!1!==t.clone&&t.isMergeableObject(e)?bZ((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function vZ(e,t,n){return e.concat(t).map((function(e){return mZ(e,n)}))}function yZ(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function _Z(e,t){try{return t in e}catch(e){return!1}}function xZ(e,t,n){var r={};return n.isMergeableObject(e)&&yZ(e).forEach((function(t){r[t]=mZ(e[t],n)})),yZ(t).forEach((function(i){(function(e,t){return _Z(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(_Z(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return bZ;var n=t.customMerge(e);return"function"==typeof n?n:bZ}(i,n)(e[i],t[i],n):r[i]=mZ(t[i],n))})),r}function bZ(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||vZ,n.isMergeableObject=n.isMergeableObject||fZ,n.cloneUnlessOtherwiseSpecified=mZ;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):xZ(e,t,n):mZ(t,n)}bZ.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return bZ(e,n,t)}),{})};var wZ=s(bZ);MS("light",wZ(dZ,cn)),MS("dark",wZ(pZ,cn));const SZ={arrayMerge:(e,t)=>t},TZ=e=>{const n=t(null),[r,i]=o();return a((()=>{var t;const r=bS(n.current,null!==(t=e.theme)&&void 0!==t?t:"light");i(r);const o=rr(r.resize,500),a=()=>{o()};return globalThis.addEventListener("resize",a),()=>{globalThis.removeEventListener("resize",a)}}),[e.theme]),a((()=>{if(r){const{data:t,extraOption:n={},extraSeriesOption:i}=e;Kn(t)||r.clear();const o=wZ(((e,t)=>(Kn(e.series)&&Kn(t)&&t.forEach((t=>{e.series=e.series.map((e=>Object.assign(Object.assign({},e),e.name===t.name&&t)))})),e))(hZ(e),i),n,SZ);r.setOption(o);const a=setTimeout((()=>{r.resize()}),500);return()=>{clearTimeout(a)}}}),[r,e]),p.jsx(sn,{ref:n,className:e.className,style:e.style})};function MZ(e,t,n){"object"==typeof t&&(n=t,t=null);var r,i=this;if(!(e instanceof Function))for(var o in r=[],e)e.hasOwnProperty(o)&&r.push(o);var a=function(t){if(i.apply(this,arguments),e instanceof Function?AZ(this,e.call(this,t)):function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}}(this,e,r),this.constructor===a)for(var n=a.__initializers__,o=0;o<n.length;o++)n[o].apply(this,arguments)};a.__super__=i,i.__initializers__?a.__initializers__=i.__initializers__.slice():a.__initializers__=[],t&&a.__initializers__.push(t);var s=function(){};return s.prototype=i.prototype,a.prototype=new s,a.prototype.constructor=a,AZ(a.prototype,n),a.extend=i.extend,a.derive=i.extend,a}function AZ(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}WS([CD,pY]),WS(rC);var CZ={extend:MZ,derive:MZ};function DZ(e,t){this.action=e,this.context=t}var EZ={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],n=t.length,r=-1,i=arguments;switch(i.length){case 1:for(;++r<n;)t[r].action.call(t[r].context);return;case 2:for(;++r<n;)t[r].action.call(t[r].context,i[1]);return;case 3:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2]);return;case 4:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3]);return;case 5:for(;++r<n;)t[r].action.call(t[r].context,i[1],i[2],i[3],i[4]);return;default:for(;++r<n;)t[r].action.apply(t[r].context,Array.prototype.slice.call(i,1));return}}},on:function(e,t,n){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var i=new DZ(t,n||this);return r[e].push(i),this}},once:function(e,t,n){if(e&&t){var r=this;return this.on(e,(function n(){r.off(e,n),t.apply(this,arguments)}),n)}},before:function(e,t,n){if(e&&t)return e="before"+e,this.on(e,t,n)},after:function(e,t,n){if(e&&t)return e="after"+e,this.on(e,t,n)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var n=this.__handlers__||(this.__handlers__={});if(t){if(n[e]){for(var r=n[e],i=[],o=0;o<r.length;o++)t&&r[o].action!==t&&i.push(r[o]);n[e]=i}return this}n[e]=[]},has:function(e,t){var n=this.__handlers__;if(!n||!n[e])return!1;for(var r=n[e],i=0;i<r.length;i++)if(r[i].action===t)return!0}},IZ=0,LZ=Array.prototype.forEach,NZ={genGUID:function(){return++IZ},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var n=e.split("/"),r=t.split("/"),i=n[0];"."===i||".."===i;)".."===i&&r.pop(),n.shift(),i=n[0];return r.join("/")+"/"+n.join("/")},extend:function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},extendWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}return e},defaultsWithPropList:function(e,t,n){if(t)for(var r=0;r<n.length;r++){var i=n[r];null==e[i]&&(e[i]=t[i])}return e},each:function(e,t,n){if(e&&t)if(e.forEach&&e.forEach===LZ)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(NZ.isObject(e)){if(NZ.isArray(e))return e.slice();if(NZ.isArrayLike(e)){for(var t=new e.constructor(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}return NZ.extend({},e)}return e}},PZ=function(){this.__uid__=NZ.genGUID()};PZ.__initializers__=[function(e){NZ.extend(this,e)}],NZ.extend(PZ,CZ),NZ.extend(PZ.prototype,EZ);var OZ=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],RZ=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function kZ(e){for(var t={},n={},r=0;r<OZ.length;r++){o(OZ[r])}for(r=0;r<RZ.length;r++){var i=RZ[r];n[i]=e.getParameter(e[i])}function o(n){if(e.getExtension){var r=e.getExtension(n);r||(r=e.getExtension("MOZ_"+n)),r||(r=e.getExtension("WEBKIT_"+n)),t[n]=r}}this.getExtension=function(e){return e in t||o(e),t[e]},this.getParameter=function(e){return n[e]}}var zZ={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444};var BZ,VZ={get:function(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total;e.onprogress(n,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(n){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}},FZ={supportWebGL:function(){if(null==BZ)try{var e=document.createElement("canvas");if(!(e.getContext("webgl")||e.getContext("experimental-webgl")))throw new Error}catch(e){BZ=!1}return BZ}};FZ.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,FZ.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,FZ.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,FZ.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,FZ.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,FZ.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,FZ.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var GZ={};"undefined"!=typeof window?GZ=window:"undefined"!=typeof global&&(GZ=global),FZ.requestAnimationFrame=GZ.requestAnimationFrame||GZ.msRequestAnimationFrame||GZ.mozRequestAnimationFrame||GZ.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},FZ.createCanvas=function(){return document.createElement("canvas")},FZ.createImage=function(){return new GZ.Image},FZ.request={get:VZ.get},FZ.addEventListener=function(e,t,n,r){e.addEventListener(t,n,r)},FZ.removeEventListener=function(e,t,n){e.removeEventListener(t,n)};var HZ=function(){this.head=null,this.tail=null,this._length=0};HZ.prototype.insert=function(e){var t=new HZ.Entry(e);return this.insertEntry(t),t},HZ.prototype.insertAt=function(e,t){if(!(e<0)){for(var n=this.head,r=0;n&&r!=e;)n=n.next,r++;if(n){var i=new HZ.Entry(t),o=n.prev;o?(o.next=i,i.prev=o):this.head=i,i.next=n,n.prev=i}else this.insert(t)}},HZ.prototype.insertBeforeEntry=function(e,t){var n=new HZ.Entry(e),r=t.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=t,t.prev=n,this._length++},HZ.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},HZ.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._length--},HZ.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t?(this.remove(t),t.value):void 0}},HZ.prototype.getHead=function(){if(this.head)return this.head.value},HZ.prototype.getTail=function(){if(this.tail)return this.tail.value},HZ.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t.value}},HZ.prototype.indexOf=function(e){for(var t=this.head,n=0;t;){if(t.value===e)return n;t=t.next,n++}},HZ.prototype.length=function(){return this._length},HZ.prototype.isEmpty=function(){return 0===this._length},HZ.prototype.forEach=function(e,t){for(var n=this.head,r=0,i=void 0!==t;n;)i?e.call(t,n.value,r):e(n.value,r),n=n.next,r++},HZ.prototype.clear=function(){this.tail=this.head=null,this._length=0},HZ.Entry=function(e){this.value=e,this.next=null,this.prev=null};var UZ=function(e){this._list=new HZ,this._map={},this._maxSize=e||10};UZ.prototype.setMaxSize=function(e){this._maxSize=e},UZ.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var n=this._list.length();if(n>=this._maxSize&&n>0){var r=this._list.head;this._list.remove(r),delete this._map[r.key]}var i=this._list.insert(t);i.key=e,this._map[e]=i}},UZ.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},UZ.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},UZ.prototype.clear=function(){this._list.clear(),this._map={}};var WZ={},XZ={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function jZ(e){return(e=Math.round(e))<0?0:e>255?255:e}function YZ(e){return e<0?0:e>1?1:e}function ZZ(e){return e.length&&"%"===e.charAt(e.length-1)?jZ(parseFloat(e)/100*255):jZ(parseInt(e,10))}function qZ(e){return e.length&&"%"===e.charAt(e.length-1)?YZ(parseFloat(e)/100):YZ(parseFloat(e))}function KZ(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function $Z(e,t,n){return e+(t-e)*n}function JZ(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function QZ(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var eq=new UZ(20),tq=null;function nq(e,t){tq&&QZ(tq,t),tq=eq.put(e,tq||t.slice())}function rq(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=qZ(e[1]),i=qZ(e[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return JZ(t=t||[],jZ(255*KZ(a,o,n+1/3)),jZ(255*KZ(a,o,n)),jZ(255*KZ(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}WZ.parse=function(e,t){if(e){t=t||[];var n=eq.get(e);if(n)return QZ(t,n);var r,i=(e+="").replace(/ /g,"").toLowerCase();if(i in XZ)return QZ(t,XZ[i]),nq(e,t),t;if("#"===i.charAt(0))return 4===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=4095?(JZ(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),nq(e,t),t):void JZ(t,0,0,0,1):7===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=16777215?(JZ(t,(16711680&r)>>16,(65280&r)>>8,255&r,1),nq(e,t),t):void JZ(t,0,0,0,1):void 0;var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===i.length){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void JZ(t,0,0,0,1);u=qZ(l.pop());case"rgb":return 3!==l.length?void JZ(t,0,0,0,1):(JZ(t,ZZ(l[0]),ZZ(l[1]),ZZ(l[2]),u),nq(e,t),t);case"hsla":return 4!==l.length?void JZ(t,0,0,0,1):(l[3]=qZ(l[3]),rq(l,t),nq(e,t),t);case"hsl":return 3!==l.length?void JZ(t,0,0,0,1):(rq(l,t),nq(e,t),t);default:return}}JZ(t,0,0,0,1)}},WZ.parseToFloat=function(e,t){if(t=WZ.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},WZ.lift=function(e,t){var n=WZ.parse(e);if(n){for(var r=0;r<3;r++)n[r]=t<0?n[r]*(1-t)|0:(255-n[r])*t+n[r]|0;return WZ.stringify(n,4===n.length?"rgba":"rgb")}},WZ.toHex=function(e){var t=WZ.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},WZ.fastLerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=t[i],s=t[o],l=r-i;return n[0]=jZ($Z(a[0],s[0],l)),n[1]=jZ($Z(a[1],s[1],l)),n[2]=jZ($Z(a[2],s[2],l)),n[3]=YZ($Z(a[3],s[3],l)),n}},WZ.fastMapToColor=WZ.fastLerp,WZ.lerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),o=Math.ceil(r),a=WZ.parse(t[i]),s=WZ.parse(t[o]),l=r-i,u=WZ.stringify([jZ($Z(a[0],s[0],l)),jZ($Z(a[1],s[1],l)),jZ($Z(a[2],s[2],l)),YZ($Z(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}},WZ.mapToColor=WZ.lerp,WZ.modifyHSL=function(e,t,n,r){if(e=WZ.parse(e))return e=function(e){if(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?t=d-h:i===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(e[1]=qZ(n)),null!=r&&(e[2]=qZ(r)),WZ.stringify(rq(e),"rgba")},WZ.modifyAlpha=function(e,t){if((e=WZ.parse(e))&&null!=t)return e[3]=YZ(t),WZ.stringify(e,"rgba")},WZ.stringify=function(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}};var iq=WZ.parseToFloat,oq={};function aq(e){var t=Object.keys(e);t.sort();for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e[i];null===o?n.push(i):n.push(i+" "+o.toString())}return n.join("\n")}var sq,lq=PZ.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var n=this.uniforms[e];n&&("string"==typeof t&&(t=iq(t)||t),n.value=t,this.autoUpdateTextureStatus&&"t"===n.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var n=e[t];this.setUniform(t,n)}},isUniformEnabled:function(e){return this._enabledUniforms.indexOf(e)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var n in e){var r=e[n];this.setUniform(n,r)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var n=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var r=this.uniforms;this._enabledUniforms=Object.keys(r),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var i=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=NZ.clone(e.vertexDefines),this.fragmentDefines=NZ.clone(e.fragmentDefines),t){for(var a in n)r[a]&&(r[a].value=n[a].value);NZ.defaults(this.vertexDefines,i),NZ.defaults(this.fragmentDefines,o)}var s={};for(var l in e.textures)s[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:!(!t||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=NZ.clone(this.vertexDefines),e.fragmentDefines=NZ.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,n){var r=this.vertexDefines,i=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(n=t,t=e,e="both"),n=null!=n?n:null,"vertex"!==e&&"both"!==e||r[t]!==n&&(r[t]=n,this._programKey=""),"fragment"!==e&&"both"!==e||i[t]!==n&&(i[t]=n,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var n=this._textureStatus[e];if(n)n.enabled||(n.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var n=this._textureStatus[e];if(n)!n.enabled||(n.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e=[],t=this._textureStatus;for(var n in t)t[n].enabled&&e.push(n);return e},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,n){n.sort();for(var r=[],i=0;i<n.length;i++){var o=n[i];r.push(o)}var a=aq(e)+"\n"+aq(t)+"\n"+r.join("\n");if(oq[a])return oq[a];var s=NZ.genGUID();return oq[a]=s,s}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),uq=1e-6,cq=Array,hq=Math.random,dq={};dq.create=function(){var e=new cq(2);return e[0]=0,e[1]=0,e},dq.clone=function(e){var t=new cq(2);return t[0]=e[0],t[1]=e[1],t},dq.fromValues=function(e,t){var n=new cq(2);return n[0]=e,n[1]=t,n},dq.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},dq.set=function(e,t,n){return e[0]=t,e[1]=n,e},dq.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},dq.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},dq.sub=dq.subtract,dq.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dq.mul=dq.multiply,dq.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dq.div=dq.divide,dq.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},dq.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},dq.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},dq.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},dq.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},dq.dist=dq.distance,dq.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r},dq.sqrDist=dq.squaredDistance,dq.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},dq.len=dq.length,dq.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},dq.sqrLen=dq.squaredLength,dq.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},dq.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},dq.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},dq.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},dq.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},dq.lerp=function(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e},dq.random=function(e,t){t=t||1;var n=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},dq.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},dq.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},dq.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},dq.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},dq.forEach=(sq=dq.create(),function(e,t,n,r,i,o){var a,s;for(t||(t=2),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a<s;a+=t)sq[0]=e[a],sq[1]=e[a+1],i(sq,sq,o),e[a]=sq[0],e[a+1]=sq[1];return e});var pq=function(e,t){e=e||0,t=t||0,this.array=dq.fromValues(e,t),this._dirty=!0};if(pq.prototype={constructor:pq,add:function(e){return dq.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new pq(this.x,this.y)},copy:function(e){return dq.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return dq.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return dq.dist(this.array,e.array)},distance:function(e){return dq.distance(this.array,e.array)},div:function(e){return dq.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return dq.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return dq.dot(this.array,e.array)},len:function(){return dq.len(this.array)},length:function(){return dq.length(this.array)},lerp:function(e,t,n){return dq.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return dq.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return dq.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return dq.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return dq.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return dq.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return dq.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return dq.random(this.array,e),this._dirty=!0,this},scale:function(e){return dq.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return dq.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return dq.sqrDist(this.array,e.array)},squaredDistance:function(e){return dq.squaredDistance(this.array,e.array)},sqrLen:function(){return dq.sqrLen(this.array)},squaredLength:function(){return dq.squaredLength(this.array)},sub:function(e){return dq.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return dq.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return dq.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return dq.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return dq.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return dq.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var fq=pq.prototype;Object.defineProperty(fq,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(fq,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}pq.add=function(e,t,n){return dq.add(e.array,t.array,n.array),e._dirty=!0,e},pq.set=function(e,t,n){return dq.set(e.array,t,n),e._dirty=!0,e},pq.copy=function(e,t){return dq.copy(e.array,t.array),e._dirty=!0,e},pq.cross=function(e,t,n){return dq.cross(e.array,t.array,n.array),e._dirty=!0,e},pq.distance=pq.dist=function(e,t){return dq.distance(e.array,t.array)},pq.div=function(e,t,n){return dq.divide(e.array,t.array,n.array),e._dirty=!0,e},pq.divide=pq.div,pq.dot=function(e,t){return dq.dot(e.array,t.array)},pq.len=function(e){return dq.length(e.array)},pq.lerp=function(e,t,n,r){return dq.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},pq.min=function(e,t,n){return dq.min(e.array,t.array,n.array),e._dirty=!0,e},pq.max=function(e,t,n){return dq.max(e.array,t.array,n.array),e._dirty=!0,e},pq.mul=function(e,t,n){return dq.multiply(e.array,t.array,n.array),e._dirty=!0,e},pq.multiply=pq.mul,pq.negate=function(e,t){return dq.negate(e.array,t.array),e._dirty=!0,e},pq.normalize=function(e,t){return dq.normalize(e.array,t.array),e._dirty=!0,e},pq.random=function(e,t){return dq.random(e.array,t),e._dirty=!0,e},pq.scale=function(e,t,n){return dq.scale(e.array,t.array,n),e._dirty=!0,e},pq.scaleAndAdd=function(e,t,n,r){return dq.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},pq.squaredDistance=pq.sqrDist=function(e,t){return dq.sqrDist(e.array,t.array)},pq.squaredLength=pq.sqrLen=function(e){return dq.sqrLen(e.array)},pq.sub=function(e,t,n){return dq.subtract(e.array,t.array,n.array),e._dirty=!0,e},pq.subtract=pq.sub,pq.transformMat2=function(e,t,n){return dq.transformMat2(e.array,t.array,n.array),e._dirty=!0,e},pq.transformMat2d=function(e,t,n){return dq.transformMat2d(e.array,t.array,n.array),e._dirty=!0,e},pq.transformMat3=function(e,t,n){return dq.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},pq.transformMat4=function(e,t,n){return dq.transformMat4(e.array,t.array,n.array),e._dirty=!0,e};var gq={};function mq(e){for(var t=e.split("\n"),n=0,r=t.length;n<r;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function vq(e,t,n){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),mq(n)].join("\n")}var yq=new FZ.Float32Array(16),_q=PZ.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,n){t&&(e.gl.activeTexture(e.gl.TEXTURE0+n),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var n=this._textureSlot;return this.useTextureSlot(e,t,n),this._textureSlot++,n},setUniform:function(e,t,n,r){var i=this._locations[n];if(null==i)return!1;switch(t){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)yq[o]=r[o];r=yq}e.uniformMatrix4fv(i,!1,r);break;case"2i":e.uniform2i(i,r[0],r[1]);break;case"2f":e.uniform2f(i,r[0],r[1]);break;case"3i":e.uniform3i(i,r[0],r[1],r[2]);break;case"3f":e.uniform3f(i,r[0],r[1],r[2]);break;case"4i":e.uniform4i(i,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(i,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(i,r);break;case"1f":e.uniform1f(i,r);break;case"1fv":e.uniform1fv(i,r);break;case"1iv":e.uniform1iv(i,r);break;case"2iv":e.uniform2iv(i,r);break;case"2fv":e.uniform2fv(i,r);break;case"3iv":e.uniform3iv(i,r);break;case"3fv":e.uniform3fv(i,r);break;case"4iv":e.uniform4iv(i,r);break;case"4fv":e.uniform4fv(i,r);break;case"m2":case"m2v":e.uniformMatrix2fv(i,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(i,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var a=new FZ.Float32Array(16*r.length),s=0;for(o=0;o<r.length;o++)for(var l=r[o],u=0;u<16;u++)a[s++]=l[u];e.uniformMatrix4fv(i,!1,a)}else e.uniformMatrix4fv(i,!1,r)}return!0},setUniformOfSemantic:function(e,t,n){var r=this.uniformSemantics[t];return!!r&&this.setUniform(e,r.type,r.symbol,n)},enableAttributes:function(e,t,n){var r,i=e.gl,o=this._program,a=this._locations;(r=n?n.__enabledAttributeList:gq[e.__uid__])||(r=n?n.__enabledAttributeList=[]:gq[e.__uid__]=[]);for(var s=[],l=0;l<t.length;l++){var u=t[l];if(this.attributes[u]){var c=a[u];if(null==c){if(-1===(c=i.getAttribLocation(o,u))){s[l]=-1;continue}a[u]=c}s[l]=c,r[c]?r[c]=2:r[c]=1}else s[l]=-1}for(l=0;l<r.length;l++)switch(r[l]){case 1:i.enableVertexAttribArray(l),r[l]=3;break;case 2:r[l]=3;break;case 3:i.disableVertexAttribArray(l),r[l]=0}return s},getAttribLocation:function(e,t){var n=this._locations,r=n[t];return null==r&&(r=e.getAttribLocation(this._program,t),n[t]=r),r},buildProgram:function(e,t,n,r){var i=e.createShader(e.VERTEX_SHADER),o=e.createProgram();e.shaderSource(i,n),e.compileShader(i);var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=vq(e,i,n);if(s)return s;if(s=vq(e,a,r))return s;if(e.attachShader(o,i),e.attachShader(o,a),t.attributeSemantics.POSITION)e.bindAttribLocation(o,0,t.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);e.bindAttribLocation(o,0,l[0])}if(e.linkProgram(o),e.deleteShader(i),e.deleteShader(a),this._program=o,this.vertexCode=n,this.fragmentCode=r,!e.getProgramParameter(o,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(o);for(var u=0;u<t.uniforms.length;u++){var c=t.uniforms[u];this._locations[c]=e.getUniformLocation(o,c)}}}),xq=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function bq(e,t,n){var r={};for(var i in n)r[i+"_COUNT"]=n[i];return e.replace(xq,(function(e,n,i,o){var a="";isNaN(n)&&(n=n in t?t[n]:r[n]),isNaN(i)&&(i=i in t?t[i]:r[i]);for(var s=parseInt(n);s<parseInt(i);s++)a+="{"+o.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return a}))}function wq(e,t,n){var r=[];if(t)for(var i in t){var o=t[i];o>0&&r.push("#define "+i.toUpperCase()+"_COUNT "+o)}if(n)for(var a=0;a<n.length;a++){var s=n[a];r.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in e){var l=e[s];null===l?r.push("#define "+s):r.push("#define "+s+" "+l.toString())}return r.join("\n")}function Sq(e){this._renderer=e,this._cache={}}Sq.prototype.getProgram=function(e,t,n){var r=this._cache,i=e.isSkinnedMesh&&e.isSkinnedMesh(),o=e.isInstancedMesh&&e.isInstancedMesh(),a="s"+t.shader.shaderID+"m"+t.getProgramKey();if(n&&(a+="se"+n.getProgramKey(e.lightGroup)),i&&(a+=",sk"+e.joints.length),o&&(a+=",is"),y=r[a])return y;var s=n?n.getLightsNumbers(e.lightGroup):{},l=this._renderer,u=l.gl,c=t.getEnabledTextures(),h="";if(i){var d={SKINNING:null,JOINT_COUNT:e.joints.length};e.joints.length>l.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),h+="\n"+wq(d)+"\n"}o&&(h+="\n#define INSTANCING\n");var p=h+wq(t.vertexDefines,s,c),f=h+wq(t.fragmentDefines,s,c),g=p+"\n"+t.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=l.getGLExtension(e)}));m.indexOf("EXT_shader_texture_lod")>=0&&(f+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(f+="\n#define SUPPORT_STANDARD_DERIVATIVES");var v,y,_=function(e){for(var t=[],n=0;n<e.length;n++)t.push("#extension GL_"+e[n]+" : enable");return t.join("\n")}(m)+"\n"+(["precision",v=t.precision,"float"].join(" ")+";\n"+["precision",v,"int"].join(" ")+";\n"+["precision",v,"sampler2D"].join(" ")+";\n\n")+f+"\n"+t.shader.fragment,x=bq(g,t.vertexDefines,s),b=bq(_,t.fragmentDefines,s);(y=new _q).uniformSemantics=t.shader.uniformSemantics,y.attributes=t.shader.attributes;var w=y.buildProgram(u,t.shader,x,b);return y.__error=w,r[a]=y,y};var Tq=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,Mq=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,Aq=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,Cq={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function Dq(e){for(var t=[],n=0;n<e;n++)t[n]=0;return t}var Eq={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return Dq(2)},vec3:function(){return Dq(3)},vec4:function(){return Dq(4)},ivec2:function(){return Dq(2)},ivec3:function(){return Dq(3)},ivec4:function(){return Dq(4)},mat2:function(){return Dq(4)},mat3:function(){return Dq(9)},mat4:function(){return Dq(16)},array:function(){return[]}},Iq=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],Lq=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],Nq=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],Pq={vec4:4,vec3:3,vec2:2,float:1},Oq={},Rq={};function kq(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function zq(){console.error("Wrong uniform/attributes syntax")}function Bq(e,t){for(var n=/[,=\(\):]/,r=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),i=[],o=0;o<r.length;o++)r[o].match(n)?i.push(r[o].charAt(0),r[o].slice(1)):i.push(r[o]);var a,s=0,l={},u=null;function c(e){e||zq();var t=e.match(/\[(.*?)\]/);a=e.replace(/\[(.*?)\]/,""),l[a]={},t&&(l[a].isArray=!0,l[a].arraySize=t[1])}c((r=i)[0]);for(o=1;o<r.length;o++){var h=r[o];if(h)if("="!==h)if(":"!==h)if(","!==h)if(")"!==h)if("("!==h)if(h.indexOf("vec")>=0){if(1!==s&&4!==s){zq();break}s=2,u=[]}else if(1!==s)if(4!==s)c(h),s=0;else{var d=h;Iq.indexOf(d)>=0||Lq.indexOf(d)>=0||Nq.indexOf(d)>=0?l[a].semantic=d:"ignore"===d||"unconfigurable"===d?l[a].ignore=!0:l[a].value="bool"===e?"true"===d:parseFloat(d)}else l[a].value="bool"===e?"true"===h:parseFloat(h),u=null;else{if(2!==s){zq();break}if(!(u instanceof Array)){zq();break}u.push(+r[++o])}else l[a].value=new FZ.Float32Array(u),u=null,s=5;else if(2===s){if(!(u instanceof Array)){zq();break}u.push(+r[++o])}else s=5;else s=4;else{if(0!==s&&3!==s){zq();break}s=1}}return l}function Vq(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=kq(e),t=kq(t),this._shaderID=function(e,t){var n="vertex:"+e+"fragment:"+t;if(Oq[n])return Oq[n];var r=NZ.genGUID();return Oq[n]=r,Rq[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=Vq.parseImport(e),this._fragmentCode=Vq.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}Vq.prototype={constructor:Vq,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var n=this.uniformTemplates[t];e[t]={type:n.type,value:n.value()}}return e},_parseImport:function(){this._vertexCode=Vq.parseImport(this.vertex),this._fragmentCode=Vq.parseImport(this.fragment)},_addSemanticUniform:function(e,t,n){if(Iq.indexOf(n)>=0)this.attributeSemantics[n]={symbol:e,type:t};else if(Nq.indexOf(n)>=0){var r=!1,i=n;n.match(/TRANSPOSE$/)&&(r=!0,i=n.slice(0,-9)),this.matrixSemantics[n]={symbol:e,type:t,isTranspose:r,semanticNoTranspose:i}}else Lq.indexOf(n)>=0&&(this.uniformSemantics[n]={symbol:e,type:t})},_addMaterialUniform:function(e,t,n,r,i,o){o[e]={type:n,value:i?Eq.array:r||Eq[t],semantic:null}},_parseUniforms:function(){var e={},t=this;function n(e){return null!=e?function(){return e}:null}function r(r,i,o){var a=Bq(i,o),s=[];for(var l in a){var u=a[l],c=u.semantic,h=l,d=Cq[i],p=n(a[l].value);a[l].isArray&&(h+="["+a[l].arraySize+"]",d+="v"),s.push(h),t._uniformList.push(l),u.ignore||("sampler2D"!==i&&"samplerCube"!==i||(t.textures[l]={shaderType:"fragment",type:i}),c?t._addSemanticUniform(l,d,c):t._addMaterialUniform(l,i,d,p,a[l].isArray,e))}return s.length>0?"uniform "+i+" "+s.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(Tq,r),this._fragmentCode=this._fragmentCode.replace(Tq,r),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(Mq,(function(n,r,i){var o=Bq(r,i),a=Pq[r]||1,s=[];for(var l in o){var u=o[l].semantic;if(e[l]={type:"float",size:a,semantic:u||null},u){if(Iq.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:r}}s.push(l)}return"attribute "+r+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this;function t(t,n,r){var i=e.fragmentDefines;return i[n]||(i[n]="false"!==r&&("true"===r||(r?isNaN(parseFloat(r))?r.trim():parseFloat(r):null))),""}this._vertexCode=this._vertexCode.replace(Aq,t),this._fragmentCode=this._fragmentCode.replace(Aq,t)},clone:function(){var e=Rq[this._shaderID];return new Vq(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(Vq.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(Vq.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(Vq.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(Vq.prototype,"uniforms",{get:function(){return this._uniformList}}));var Fq=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;Vq.parseImport=function(e){return e=e.replace(Fq,(function(e,t,n){return(e=Vq.source(n))?Vq.parseImport(e):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var Gq=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;Vq.import=function(e){e.replace(Gq,(function(e,t,n,r){if(r=r.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var i,o=n.split("."),a=Vq.codes,s=0;s<o.length-1;)a[i=o[s++]]||(a[i]={}),a=a[i];a[i=o[s]]=r}return r}))},Vq.codes={},Vq.source=function(e){for(var t=e.split("."),n=Vq.codes,r=0;n&&r<t.length;){n=n[t[r++]]}return"string"!=typeof n?(console.error('Shader "'+e+'" not existed in library'),""):n};var Hq="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec4 P = vec4(pos, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = WVP * P;\n v_Texcoord = uv * uvRepeat + uvOffset;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end",Uq={create:function(){var e=new cq(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new cq(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,A=c*v-p*f,C=h*m-d*g,D=h*v-p*g,E=d*v-p*m,I=y*E-_*D+x*C+b*A-w*M+S*T;return I?(I=1/I,e[0]=(s*E-l*D+u*C)*I,e[1]=(i*D-r*E-o*C)*I,e[2]=(g*S-m*w+v*b)*I,e[3]=(d*w-h*S-p*b)*I,e[4]=(l*A-a*E-u*M)*I,e[5]=(n*E-i*A+o*M)*I,e[6]=(m*x-f*S-v*_)*I,e[7]=(c*S-d*x+p*_)*I,e[8]=(a*D-s*A+u*T)*I,e[9]=(r*A-n*D-o*T)*I,e[10]=(f*w-g*x+v*y)*I,e[11]=(h*x-c*w-p*y)*I,e[12]=(s*M-a*C-l*T)*I,e[13]=(n*C-r*M+i*T)*I,e[14]=(g*_-f*b-m*y)*I,e[15]=(c*b-h*_+d*y)*I,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15];return e[0]=s*(d*v-p*m)-h*(l*v-u*m)+g*(l*p-u*d),e[1]=-(r*(d*v-p*m)-h*(i*v-o*m)+g*(i*p-o*d)),e[2]=r*(l*v-u*m)-s*(i*v-o*m)+g*(i*u-o*l),e[3]=-(r*(l*p-u*d)-s*(i*p-o*d)+h*(i*u-o*l)),e[4]=-(a*(d*v-p*m)-c*(l*v-u*m)+f*(l*p-u*d)),e[5]=n*(d*v-p*m)-c*(i*v-o*m)+f*(i*p-o*d),e[6]=-(n*(l*v-u*m)-a*(i*v-o*m)+f*(i*u-o*l)),e[7]=n*(l*p-u*d)-a*(i*p-o*d)+c*(i*u-o*l),e[8]=a*(h*v-p*g)-c*(s*v-u*g)+f*(s*p-u*h),e[9]=-(n*(h*v-p*g)-c*(r*v-o*g)+f*(r*p-o*h)),e[10]=n*(s*v-u*g)-a*(r*v-o*g)+f*(r*u-o*s),e[11]=-(n*(s*p-u*h)-a*(r*p-o*h)+c*(r*u-o*s)),e[12]=-(a*(h*m-d*g)-c*(s*m-l*g)+f*(s*d-l*h)),e[13]=n*(h*m-d*g)-c*(r*m-i*g)+f*(r*d-i*h),e[14]=-(n*(s*m-l*g)-a*(r*m-i*g)+f*(r*l-i*s)),e[15]=n*(s*d-l*h)-a*(r*d-i*h)+c*(r*l-i*s),e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],g=e[14],m=e[15];return(t*a-n*o)*(h*m-d*g)-(t*s-r*o)*(c*m-d*f)+(t*l-i*o)*(c*g-h*f)+(n*s-r*a)*(u*m-d*p)-(n*l-i*a)*(u*g-h*p)+(r*l-i*s)*(u*f-c*p)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],g=t[12],m=t[13],v=t[14],y=t[15],_=n[0],x=n[1],b=n[2],w=n[3];return e[0]=_*r+x*s+b*h+w*g,e[1]=_*i+x*l+b*d+w*m,e[2]=_*o+x*u+b*p+w*v,e[3]=_*a+x*c+b*f+w*y,_=n[4],x=n[5],b=n[6],w=n[7],e[4]=_*r+x*s+b*h+w*g,e[5]=_*i+x*l+b*d+w*m,e[6]=_*o+x*u+b*p+w*v,e[7]=_*a+x*c+b*f+w*y,_=n[8],x=n[9],b=n[10],w=n[11],e[8]=_*r+x*s+b*h+w*g,e[9]=_*i+x*l+b*d+w*m,e[10]=_*o+x*u+b*p+w*v,e[11]=_*a+x*c+b*f+w*y,_=n[12],x=n[13],b=n[14],w=n[15],e[12]=_*r+x*s+b*h+w*g,e[13]=_*i+x*l+b*d+w*m,e[14]=_*o+x*u+b*p+w*v,e[15]=_*a+x*c+b*f+w*y,e},multiplyAffine:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[4],s=t[5],l=t[6],u=t[8],c=t[9],h=t[10],d=t[12],p=t[13],f=t[14],g=n[0],m=n[1],v=n[2];return e[0]=g*r+m*a+v*u,e[1]=g*i+m*s+v*c,e[2]=g*o+m*l+v*h,g=n[4],m=n[5],v=n[6],e[4]=g*r+m*a+v*u,e[5]=g*i+m*s+v*c,e[6]=g*o+m*l+v*h,g=n[8],m=n[9],v=n[10],e[8]=g*r+m*a+v*u,e[9]=g*i+m*s+v*c,e[10]=g*o+m*l+v*h,g=n[12],m=n[13],v=n[14],e[12]=g*r+m*a+v*u+d,e[13]=g*i+m*s+v*c+p,e[14]=g*o+m*l+v*h+f,e}};Uq.mul=Uq.multiply,Uq.mulAffine=Uq.multiplyAffine,Uq.translate=function(e,t,n){var r,i,o,a,s,l,u,c,h,d,p,f,g=n[0],m=n[1],v=n[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*v+t[12],e[13]=t[1]*g+t[5]*m+t[9]*v+t[13],e[14]=t[2]*g+t[6]*m+t[10]*v+t[14],e[15]=t[3]*g+t[7]*m+t[11]*v+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=r*g+s*m+h*v+t[12],e[13]=i*g+l*m+d*v+t[13],e[14]=o*g+u*m+p*v+t[14],e[15]=a*g+c*m+f*v+t[15]),e},Uq.scale=function(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},Uq.rotate=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,_,x,b,w,S,T,M,A,C,D=r[0],E=r[1],I=r[2],L=Math.sqrt(D*D+E*E+I*I);return Math.abs(L)<uq?null:(D*=L=1/L,E*=L,I*=L,i=Math.sin(n),a=1-(o=Math.cos(n)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],p=t[6],f=t[7],g=t[8],m=t[9],v=t[10],y=t[11],_=D*D*a+o,x=E*D*a+I*i,b=I*D*a-E*i,w=D*E*a-I*i,S=E*E*a+o,T=I*E*a+D*i,M=D*I*a+E*i,A=E*I*a-D*i,C=I*I*a+o,e[0]=s*_+h*x+g*b,e[1]=l*_+d*x+m*b,e[2]=u*_+p*x+v*b,e[3]=c*_+f*x+y*b,e[4]=s*w+h*S+g*T,e[5]=l*w+d*S+m*T,e[6]=u*w+p*S+v*T,e[7]=c*w+f*S+y*T,e[8]=s*M+h*A+g*C,e[9]=l*M+d*A+m*C,e[10]=u*M+p*A+v*C,e[11]=c*M+f*A+y*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},Uq.rotateX=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+u*r,e[5]=a*i+c*r,e[6]=s*i+h*r,e[7]=l*i+d*r,e[8]=u*i-o*r,e[9]=c*i-a*r,e[10]=h*i-s*r,e[11]=d*i-l*r,e},Uq.rotateY=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-u*r,e[1]=a*i-c*r,e[2]=s*i-h*r,e[3]=l*i-d*r,e[8]=o*r+u*i,e[9]=a*r+c*i,e[10]=s*r+h*i,e[11]=l*r+d*i,e},Uq.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+u*r,e[1]=a*i+c*r,e[2]=s*i+h*r,e[3]=l*i+d*r,e[4]=u*i-o*r,e[5]=c*i-a*r,e[6]=h*i-s*r,e[7]=d*i-l*r,e},Uq.fromRotationTranslation=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,u=o+o,c=r*s,h=r*l,d=r*u,p=i*l,f=i*u,g=o*u,m=a*s,v=a*l,y=a*u;return e[0]=1-(p+g),e[1]=h+y,e[2]=d-v,e[3]=0,e[4]=h-y,e[5]=1-(c+g),e[6]=f+m,e[7]=0,e[8]=d+v,e[9]=f-m,e[10]=1-(c+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},Uq.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[1]=c+v,e[2]=d-m,e[3]=0,e[4]=c-v,e[5]=1-u-f,e[6]=p+g,e[7]=0,e[8]=d+m,e[9]=p-g,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},Uq.frustum=function(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),u=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e},Uq.perspective=function(e,t,n,r,i){var o=1/Math.tan(t/2),a=1/(r-i);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*a,e[15]=0,e},Uq.ortho=function(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*u,e[15]=1,e},Uq.lookAt=function(e,t,n,r){var i,o,a,s,l,u,c,h,d,p,f=t[0],g=t[1],m=t[2],v=r[0],y=r[1],_=r[2],x=n[0],b=n[1],w=n[2];return Math.abs(f-x)<uq&&Math.abs(g-b)<uq&&Math.abs(m-w)<uq?Uq.identity(e):(c=f-x,h=g-b,d=m-w,i=y*(d*=p=1/Math.sqrt(c*c+h*h+d*d))-_*(h*=p),o=_*(c*=p)-v*d,a=v*h-y*c,(p=Math.sqrt(i*i+o*o+a*a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-d*o,l=d*i-c*a,u=c*o-h*i,(p=Math.sqrt(s*s+l*l+u*u))?(s*=p=1/p,l*=p,u*=p):(s=0,l=0,u=0),e[0]=i,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(i*f+o*g+a*m),e[13]=-(s*f+l*g+u*m),e[14]=-(c*f+h*g+d*m),e[15]=1,e)},Uq.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))};var Wq={create:function(){var e=new cq(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new cq(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,n){var r=new cq(3);return r[0]=e,r[1]=t,r[2]=n,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}};Wq.sub=Wq.subtract,Wq.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},Wq.mul=Wq.multiply,Wq.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},Wq.div=Wq.divide,Wq.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},Wq.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},Wq.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},Wq.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},Wq.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)},Wq.dist=Wq.distance,Wq.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i},Wq.sqrDist=Wq.squaredDistance,Wq.length=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)},Wq.len=Wq.length,Wq.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},Wq.sqrLen=Wq.squaredLength,Wq.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},Wq.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},Wq.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o),e},Wq.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},Wq.cross=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e},Wq.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e},Wq.random=function(e,t){t=t||1;var n=2*hq()*Math.PI,r=2*hq()-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e},Wq.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e},Wq.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},Wq.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},Wq.rotateX=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Wq.rotateY=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Wq.rotateZ=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},Wq.forEach=function(){var e=Wq.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}(),Wq.angle=function(e,t){var n=Wq.fromValues(e[0],e[1],e[2]),r=Wq.fromValues(t[0],t[1],t[2]);Wq.normalize(n,n),Wq.normalize(r,r);var i=Wq.dot(n,r);return i>1?0:Math.acos(i)},Vq.import(Hq);var Xq=Uq.create,jq={};function Yq(e){return e.material}function Zq(e,t,n){return t.uniforms[n].value}function qq(e,t,n,r){return n!==r}function Kq(e){return!0}function $q(){}var Jq={float:zZ.FLOAT,byte:zZ.BYTE,ubyte:zZ.UNSIGNED_BYTE,short:zZ.SHORT,ushort:zZ.UNSIGNED_SHORT};function Qq(e,t,n){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=n,this.vao=null}function eK(e){var t,n;this.bind=function(e){t||((t=FZ.createCanvas()).width=t.height=1,t.getContext("2d"));var r=e.gl,i=!n;i&&(n=r.createTexture()),r.bindTexture(r.TEXTURE_2D,n),i&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var tK=PZ.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=FZ.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new kZ(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(e){throw"Error creating WebGL Context "+e}this._programMgr=new Sq(this),this._placeholderTexture=new eK}),{resize:function(e,t){var n=this.canvas,r=this.devicePixelRatio;null!=e?(n.style&&(n.style.width=e+"px",n.style.height=t+"px"),n.width=e*r,n.height=t*r,this._width=e,this._height=t):(this._width=n.width/r,this._height=n.height/r),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,n,r,i){if("object"==typeof e){var o=e;e=o.x,t=o.y,n=o.width,r=o.height,i=o.devicePixelRatio}i=i||this.devicePixelRatio,this.gl.viewport(e*i,t*i,n*i,r*i),this.viewport={x:e,y:t,width:n,height:r,devicePixelRatio:i}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,n,r){var i=this.gl,o=this.clearColor;if(this.clearBit){i.colorMask(!0,!0,!0,!0),i.depthMask(!0);var a=this.viewport,s=!1,l=a.devicePixelRatio;(a.width!==this._width||a.height!==this._height||l&&l!==this.devicePixelRatio||a.x||a.y)&&(s=!0,i.enable(i.SCISSOR_TEST),i.scissor(a.x*l,a.y*l,a.width*l,a.height*l)),i.clearColor(o[0],o[1],o[2],o[3]),i.clear(this.clearBit),s&&i.disable(i.SCISSOR_TEST)}if(n||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var c=u.opaque,h=u.transparent,d=e.material;e.trigger("beforerender",this,e,t,u),r?(this.renderPreZ(c,e,t),i.depthFunc(i.LEQUAL)):i.depthFunc(i.LESS);for(var p=Xq(),f=Wq.create(),g=0;g<h.length;g++){var m=h[g];Uq.multiplyAffine(p,t.viewMatrix.array,m.worldTransform.array),Wq.transformMat4(f,m.position.array,p),m.__depth=f[2]}this.renderPass(c,t,{getMaterial:function(e){return d||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(h,t,{getMaterial:function(e){return d||e.material},sortCompare:this.transparentSortCompare}),e.trigger("afterrender",this,e,t,u),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(e,t,n){return t=t||e.material,this._programMgr.getProgram(e,t,n)},validateProgram:function(e){if(e.__error){var t=e.__error;if(jq[e.__uid__])return;if(jq[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,n){var r=n&&n.getMaterial||Yq;t=t||null;for(var i=0;i<e.length;i++){var o=e[i],a=r.call(this,o);if(i>0){var s=e[i-1],l=s.joints?s.joints.length:0;if((o.joints?o.joints.length:0)===l&&o.material===s.material&&o.lightGroup===s.lightGroup){o.__program=s.__program;continue}}var u=this._programMgr.getProgram(o,a,t);this.validateProgram(u),o.__program=u}},renderPass:function(e,t,n){this.trigger("beforerenderpass",this,e,t,n),(n=n||{}).getMaterial=n.getMaterial||Yq,n.getUniform=n.getUniform||Zq,n.isMaterialChanged=n.isMaterialChanged||qq,n.beforeRender=n.beforeRender||$q,n.afterRender=n.afterRender||$q;var r=n.ifRender||Kq;this.updatePrograms(e,this._sceneRendering,n),n.sortCompare&&e.sort(n.sortCompare);var i=this.viewport,o=i.devicePixelRatio,a=[i.x*o,i.y*o,i.width*o,i.height*o],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[a[2],a[3]],c=Date.now();t?(Uq.copy(nK.VIEW,t.viewMatrix.array),Uq.copy(nK.PROJECTION,t.projectionMatrix.array),Uq.copy(nK.VIEWINVERSE,t.worldTransform.array)):(Uq.identity(nK.VIEW),Uq.identity(nK.PROJECTION),Uq.identity(nK.VIEWINVERSE)),Uq.multiply(nK.VIEWPROJECTION,nK.PROJECTION,nK.VIEW),Uq.invert(nK.PROJECTIONINVERSE,nK.PROJECTION),Uq.invert(nK.VIEWPROJECTIONINVERSE,nK.VIEWPROJECTION);for(var h,d,p,f,g,m,v,y,_,x,b,w,S=this.gl,T=this._sceneRendering,M=null,A=0;A<e.length;A++){var C,D=e[A],E=null!=D.worldTransform;if(r(D)){E&&(C=D.isSkinnedMesh&&D.isSkinnedMesh()?D.offsetMatrix?D.offsetMatrix.array:nK.IDENTITY:D.worldTransform.array);var I=D.geometry,L=n.getMaterial.call(this,D),N=D.__program,P=L.shader,O=I.__uid__+"-"+N.__uid__,R=O!==x;x=O,E&&(Uq.copy(nK.WORLD,C),Uq.multiply(nK.WORLDVIEWPROJECTION,nK.VIEWPROJECTION,C),Uq.multiplyAffine(nK.WORLDVIEW,nK.VIEW,C),(P.matrixSemantics.WORLDINVERSE||P.matrixSemantics.WORLDINVERSETRANSPOSE)&&Uq.invert(nK.WORLDINVERSE,C),(P.matrixSemantics.WORLDVIEWINVERSE||P.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&Uq.invert(nK.WORLDVIEWINVERSE,nK.WORLDVIEW),(P.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||P.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&Uq.invert(nK.WORLDVIEWPROJECTIONINVERSE,nK.WORLDVIEWPROJECTION)),D.beforeRender&&D.beforeRender(this),n.beforeRender.call(this,D,L,h);var k=N!==d;k?(N.bind(this),N.setUniformOfSemantic(S,"VIEWPORT",a),N.setUniformOfSemantic(S,"WINDOW_SIZE",l),t&&(N.setUniformOfSemantic(S,"NEAR",t.near),N.setUniformOfSemantic(S,"FAR",t.far)),N.setUniformOfSemantic(S,"DEVICEPIXELRATIO",o),N.setUniformOfSemantic(S,"TIME",c),N.setUniformOfSemantic(S,"VIEWPORT_SIZE",u),T&&T.setLightUniforms(N,D.lightGroup,this)):N=d,(k||n.isMaterialChanged(D,p,L,h))&&(L.depthTest!==f&&(L.depthTest?S.enable(S.DEPTH_TEST):S.disable(S.DEPTH_TEST),f=L.depthTest),L.depthMask!==g&&(S.depthMask(L.depthMask),g=L.depthMask),L.transparent!==_&&(L.transparent?S.enable(S.BLEND):S.disable(S.BLEND),_=L.transparent),L.transparent&&(L.blend?L.blend(S):(S.blendEquationSeparate(S.FUNC_ADD,S.FUNC_ADD),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA))),w=this._bindMaterial(D,L,N,p||null,h||null,d||null,n.getUniform),h=L);var z=P.matrixSemanticKeys;if(E)for(var B=0;B<z.length;B++){var V=z[B],F=P.matrixSemantics[V],G=nK[V];if(F.isTranspose){var H=nK[F.semanticNoTranspose];Uq.transpose(G,H)}N.setUniform(S,F.type,F.symbol,G)}D.cullFace!==v&&(v=D.cullFace,S.cullFace(v)),D.frontFace!==y&&(y=D.frontFace,S.frontFace(y)),D.culling!==m&&((m=D.culling)?S.enable(S.CULL_FACE):S.disable(S.CULL_FACE)),this._updateSkeleton(D,N,w),R&&(b=this._bindVAO(M,P,I,N)),this._renderObject(D,b,N),n.afterRender(this,D),D.afterRender&&D.afterRender(this),d=N,p=D}}this.trigger("afterrenderpass",this,e,t,n)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(e,t,n){var r=this.gl,i=e.skeleton;if(i)if(i.update(),e.joints.length>this.getMaxJointNumber()){var o=i.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,o,n),t.setUniform(r,"1i","skinMatricesTexture",n),t.setUniform(r,"1f","skinMatricesTextureSize",o.width)}else{var a=i.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(r,"SKIN_MATRIX",a)}},_renderObject:function(e,t,n){var r=this.gl,i=e.geometry,o=e.mode;null==o&&(o=4);var a=null,s=e.isInstancedMesh&&e.isInstancedMesh();if(!s||(a=this.getGLExtension("ANGLE_instanced_arrays"))){var l;if(s&&(l=this._bindInstancedAttributes(e,n,a)),t.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint")&&i.indices instanceof Uint32Array?r.UNSIGNED_INT:r.UNSIGNED_SHORT;s?a.drawElementsInstancedANGLE(o,t.indicesBuffer.count,u,0,e.getInstanceCount()):r.drawElements(o,t.indicesBuffer.count,u,0)}else s?a.drawArraysInstancedANGLE(o,0,i.vertexCount,e.getInstanceCount()):r.drawArrays(o,0,i.vertexCount);if(s)for(var c=0;c<l.length;c++)r.disableVertexAttribArray(l[c])}else console.warn("Device not support ANGLE_instanced_arrays extension")},_bindInstancedAttributes:function(e,t,n){for(var r=this.gl,i=e.getInstancedAttributesBuffers(this),o=[],a=0;a<i.length;a++){var s=i[a],l=t.getAttribLocation(r,s.symbol);if(!(l<0)){var u=Jq[s.type]||r.FLOAT;r.enableVertexAttribArray(l),r.bindBuffer(r.ARRAY_BUFFER,s.buffer),r.vertexAttribPointer(l,s.size,u,!1,0,0),n.vertexAttribDivisorANGLE(l,s.divisor),o.push(l)}}return o},_bindMaterial:function(e,t,n,r,i,o,a){for(var s=this.gl,l=o===n,u=n.currentTextureSlot(),c=t.getEnabledUniforms(),h=t.getTextureUniforms(),d=this._placeholderTexture,p=0;p<h.length;p++){var f=a(e,t,v=h[p]);if("t"===(m=t.uniforms[v].type)&&f)f.__slot=-1;else if("tv"===m)for(var g=0;g<f.length;g++)f[g]&&(f[g].__slot=-1)}d.__slot=-1;for(p=0;p<c.length;p++){var m,v=c[p],y=t.uniforms[v],_=(f=a(e,t,v),"t"===(m=y.type));if(_&&(f&&f.isRenderable()||(f=d)),i&&l){var x=a(r,i,v);if(_&&(x&&x.isRenderable()||(x=d)),x===f){if(_)n.takeCurrentTextureSlot(this,null);else if("tv"===m&&f)for(g=0;g<f.length;g++)n.takeCurrentTextureSlot(this,null);continue}}if(null!=f)if(_)if(f.__slot<0){var b=n.currentTextureSlot();n.setUniform(s,"1i",v,b)&&(n.takeCurrentTextureSlot(this,f),f.__slot=b)}else n.setUniform(s,"1i",v,f.__slot);else if(Array.isArray(f)){if(0===f.length)continue;if("tv"===m){if(!n.hasUniform(v))continue;var w=[];for(g=0;g<f.length;g++){var S=f[g];if(S.__slot<0){b=n.currentTextureSlot();w.push(b),n.takeCurrentTextureSlot(this,S),S.__slot=b}else w.push(S.__slot)}n.setUniform(s,"1iv",v,w)}else n.setUniform(s,y.type,v,f)}else n.setUniform(s,y.type,v,f)}var T=n.currentTextureSlot();return n.resetTextureSlot(u),T},_bindVAO:function(e,t,n,r){var i=!n.dynamic,o=this.gl,a=this.__uid__+"-"+r.__uid__,s=n.__vaoCache[a];if(!s){var l=n.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],c=u.attributeBuffers,h=u.indicesBuffer,d=[],p=[],f=0;f<c.length;f++){var g,m=(w=c[f]).name,v=w.semantic;if(v){var y=t.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&r.attributes[g]&&(d.push(w),p.push(g))}s=new Qq(d,p,h),i&&(n.__vaoCache[a]=s)}var _=!0;e&&i&&(null==s.vao?s.vao=e.createVertexArrayOES():_=!1,e.bindVertexArrayOES(s.vao));d=s.availableAttributes,h=s.indicesBuffer;if(_){var x=r.enableAttributes(this,s.availableAttributeSymbols,e&&i&&s);for(f=0;f<d.length;f++){var b=x[f];if(-1!==b){var w,S=(w=d[f]).buffer,T=w.size,M=Jq[w.type]||o.FLOAT;o.bindBuffer(o.ARRAY_BUFFER,S),o.vertexAttribPointer(b,T,M,!1,0,0)}}n.isUseIndices()&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.buffer)}return s},renderPreZ:function(e,t,n){var r=this.gl,i=this._prezMaterial||new lq({shader:new Vq(Vq.source("clay.prez.vertex"),Vq.source("clay.prez.fragment"))});this._prezMaterial=i,r.colorMask(!1,!1,!1,!1),r.depthMask(!0),this.renderPass(e,n,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)},getUniform:function(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)},getMaterial:function(){return i},sort:this.opaqueSortCompare}),r.colorMask(!0,!0,!0,!0),r.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,n){e.getParent()&&e.getParent().remove(e);var r={};e.traverse((function(e){var i=e.material;if(e.geometry&&t&&e.geometry.dispose(this),n&&i&&!r[i.__uid__]){for(var o=i.getTextureUniforms(),a=0;a<o.length;a++){var s=o[a],l=i.uniforms[s].value,u=i.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var c=0;c<l.length;c++)l[c]&&l[c].dispose&&l[c].dispose(this)}r[i.__uid__]=!0}e.dispose&&e.dispose(this)}),this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,n){n||(n=new pq),t=this._height-t;var r=this.viewport,i=n.array;return i[0]=(e-r.x)/r.width,i[0]=2*i[0]-1,i[1]=(t-r.y)/r.height,i[1]=2*i[1]-1,n}});tK.opaqueSortCompare=tK.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},tK.transparentSortCompare=tK.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var nK={IDENTITY:Xq(),WORLD:Xq(),VIEW:Xq(),PROJECTION:Xq(),WORLDVIEW:Xq(),VIEWPROJECTION:Xq(),WORLDVIEWPROJECTION:Xq(),WORLDINVERSE:Xq(),VIEWINVERSE:Xq(),PROJECTIONINVERSE:Xq(),WORLDVIEWINVERSE:Xq(),VIEWPROJECTIONINVERSE:Xq(),WORLDVIEWPROJECTIONINVERSE:Xq(),WORLDTRANSPOSE:Xq(),VIEWTRANSPOSE:Xq(),PROJECTIONTRANSPOSE:Xq(),WORLDVIEWTRANSPOSE:Xq(),VIEWPROJECTIONTRANSPOSE:Xq(),WORLDVIEWPROJECTIONTRANSPOSE:Xq(),WORLDINVERSETRANSPOSE:Xq(),VIEWINVERSETRANSPOSE:Xq(),PROJECTIONINVERSETRANSPOSE:Xq(),WORLDVIEWINVERSETRANSPOSE:Xq(),VIEWPROJECTIONINVERSETRANSPOSE:Xq(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:Xq()};tK.COLOR_BUFFER_BIT=zZ.COLOR_BUFFER_BIT,tK.DEPTH_BUFFER_BIT=zZ.DEPTH_BUFFER_BIT,tK.STENCIL_BUFFER_BIT=zZ.STENCIL_BUFFER_BIT;var rK=function(e,t,n){e=e||0,t=t||0,n=n||0,this.array=Wq.fromValues(e,t,n),this._dirty=!0};rK.prototype={constructor:rK,add:function(e){return Wq.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new rK(this.x,this.y,this.z)},copy:function(e){return Wq.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return Wq.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return Wq.dist(this.array,e.array)},distance:function(e){return Wq.distance(this.array,e.array)},div:function(e){return Wq.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return Wq.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return Wq.dot(this.array,e.array)},len:function(){return Wq.len(this.array)},length:function(){return Wq.length(this.array)},lerp:function(e,t,n){return Wq.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return Wq.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return Wq.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return Wq.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return Wq.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return Wq.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Wq.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return Wq.random(this.array,e),this._dirty=!0,this},scale:function(e){return Wq.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return Wq.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return Wq.sqrDist(this.array,e.array)},squaredDistance:function(e){return Wq.squaredDistance(this.array,e.array)},sqrLen:function(){return Wq.sqrLen(this.array)},squaredLength:function(){return Wq.squaredLength(this.array)},sub:function(e){return Wq.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return Wq.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return Wq.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return Wq.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return Wq.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var n=-1/t[2];t[0]=e[0]*t[0]*n,t[1]=e[5]*t[1]*n,t[2]=(e[10]*t[2]+e[14])*n}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){rK.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){rK.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var iK=Object.defineProperty;if(iK){var oK=rK.prototype;iK(oK,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),iK(oK,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),iK(oK,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function aK(e,t,n){return e<t?t:e>n?n:e}rK.add=function(e,t,n){return Wq.add(e.array,t.array,n.array),e._dirty=!0,e},rK.set=function(e,t,n,r){Wq.set(e.array,t,n,r),e._dirty=!0},rK.copy=function(e,t){return Wq.copy(e.array,t.array),e._dirty=!0,e},rK.cross=function(e,t,n){return Wq.cross(e.array,t.array,n.array),e._dirty=!0,e},rK.dist=function(e,t){return Wq.distance(e.array,t.array)},rK.distance=rK.dist,rK.div=function(e,t,n){return Wq.divide(e.array,t.array,n.array),e._dirty=!0,e},rK.divide=rK.div,rK.dot=function(e,t){return Wq.dot(e.array,t.array)},rK.len=function(e){return Wq.length(e.array)},rK.lerp=function(e,t,n,r){return Wq.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},rK.min=function(e,t,n){return Wq.min(e.array,t.array,n.array),e._dirty=!0,e},rK.max=function(e,t,n){return Wq.max(e.array,t.array,n.array),e._dirty=!0,e},rK.mul=function(e,t,n){return Wq.multiply(e.array,t.array,n.array),e._dirty=!0,e},rK.multiply=rK.mul,rK.negate=function(e,t){return Wq.negate(e.array,t.array),e._dirty=!0,e},rK.normalize=function(e,t){return Wq.normalize(e.array,t.array),e._dirty=!0,e},rK.random=function(e,t){return Wq.random(e.array,t),e._dirty=!0,e},rK.scale=function(e,t,n){return Wq.scale(e.array,t.array,n),e._dirty=!0,e},rK.scaleAndAdd=function(e,t,n,r){return Wq.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},rK.sqrDist=function(e,t){return Wq.sqrDist(e.array,t.array)},rK.squaredDistance=rK.sqrDist,rK.sqrLen=function(e){return Wq.sqrLen(e.array)},rK.squaredLength=rK.sqrLen,rK.sub=function(e,t,n){return Wq.subtract(e.array,t.array,n.array),e._dirty=!0,e},rK.subtract=rK.sub,rK.transformMat3=function(e,t,n){return Wq.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},rK.transformMat4=function(e,t,n){return Wq.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},rK.transformQuat=function(e,t,n){return Wq.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var sK=Math.atan2,lK=Math.asin,uK=Math.abs;rK.eulerFromQuat=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=t[0],o=t[1],a=t[2],s=t[3],l=i*i,u=o*o,c=a*a,h=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=sK(2*(i*s-o*a),h-l-u+c),r[1]=lK(aK(2*(i*a+o*s),-1,1)),r[2]=sK(2*(a*s-i*o),h+l-u-c);break;case"YXZ":r[0]=lK(aK(2*(i*s-o*a),-1,1)),r[1]=sK(2*(i*a+o*s),h-l-u+c),r[2]=sK(2*(i*o+a*s),h-l+u-c);break;case"ZXY":r[0]=lK(aK(2*(i*s+o*a),-1,1)),r[1]=sK(2*(o*s-a*i),h-l-u+c),r[2]=sK(2*(a*s-i*o),h-l+u-c);break;case"ZYX":r[0]=sK(2*(i*s+a*o),h-l-u+c),r[1]=lK(aK(2*(o*s-i*a),-1,1)),r[2]=sK(2*(i*o+a*s),h+l-u-c);break;case"YZX":r[0]=sK(2*(i*s-a*o),h-l+u-c),r[1]=sK(2*(o*s-i*a),h+l-u-c),r[2]=lK(aK(2*(i*o+a*s),-1,1));break;case"XZY":r[0]=sK(2*(i*s+o*a),h-l+u-c),r[1]=sK(2*(i*a+o*s),h+l-u-c),r[2]=lK(aK(2*(a*s-i*o),-1,1));break;default:console.warn("Unkown order: "+n)}return e},rK.eulerFromMat3=function(e,t,n){var r=t.array,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],u=r[7],c=r[2],h=r[5],d=r[8],p=e.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":p[1]=lK(aK(a,-1,1)),uK(a)<.99999?(p[0]=sK(-u,d),p[2]=sK(-o,i)):(p[0]=sK(h,l),p[2]=0);break;case"YXZ":p[0]=lK(-aK(u,-1,1)),uK(u)<.99999?(p[1]=sK(a,d),p[2]=sK(s,l)):(p[1]=sK(-c,i),p[2]=0);break;case"ZXY":p[0]=lK(aK(h,-1,1)),uK(h)<.99999?(p[1]=sK(-c,d),p[2]=sK(-o,l)):(p[1]=0,p[2]=sK(s,i));break;case"ZYX":p[1]=lK(-aK(c,-1,1)),uK(c)<.99999?(p[0]=sK(h,d),p[2]=sK(s,i)):(p[0]=0,p[2]=sK(-o,l));break;case"YZX":p[2]=lK(aK(s,-1,1)),uK(s)<.99999?(p[0]=sK(-u,l),p[1]=sK(-c,i)):(p[0]=0,p[1]=sK(a,d));break;case"XZY":p[2]=lK(-aK(o,-1,1)),uK(o)<.99999?(p[0]=sK(h,l),p[1]=sK(a,i)):(p[0]=sK(-u,d),p[1]=0);break;default:console.warn("Unkown order: "+n)}return e._dirty=!0,e},Object.defineProperties(rK,{POSITIVE_X:{get:function(){return new rK(1,0,0)}},NEGATIVE_X:{get:function(){return new rK(-1,0,0)}},POSITIVE_Y:{get:function(){return new rK(0,1,0)}},NEGATIVE_Y:{get:function(){return new rK(0,-1,0)}},POSITIVE_Z:{get:function(){return new rK(0,0,1)}},NEGATIVE_Z:{get:function(){return new rK(0,0,-1)}},UP:{get:function(){return new rK(0,1,0)}},ZERO:{get:function(){return new rK}}});var cK,hK,dK,pK,fK=1e-5,gK=function(e,t){this.origin=e||new rK,this.direction=t||new rK};gK.prototype={constructor:gK,intersectPlane:function(e,t){var n=e.normal.array,r=e.distance,i=this.origin.array,o=this.direction.array,a=Wq.dot(n,o);if(0===a)return null;t||(t=new rK);var s=(Wq.dot(n,i)-r)/a;return Wq.scaleAndAdd(t.array,i,o,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=Wq.dot(e.normal.array,this.direction.array);Wq.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:function(){var e=Wq.create();return function(t){Wq.sub(e,t,this.origin.array);var n=Wq.dot(e,this.direction.array);if(n<0)return Wq.distance(this.origin.array,t);var r=Wq.lenSquared(e);return Math.sqrt(r-n*n)}}(),intersectSphere:function(){var e=Wq.create();return function(t,n,r){var i=this.origin.array,o=this.direction.array;t=t.array,Wq.sub(e,t,i);var a=Wq.dot(e,o),s=Wq.squaredLength(e)-a*a,l=n*n;if(!(s>l)){var u=Math.sqrt(l-s),c=a-u,h=a+u;return r||(r=new rK),c<0?h<0?null:(Wq.scaleAndAdd(r.array,i,o,h),r):(Wq.scaleAndAdd(r.array,i,o,c),r)}}}(),intersectBoundingBox:function(e,t){var n,r,i,o,a,s,l=this.direction.array,u=this.origin.array,c=e.min.array,h=e.max.array,d=1/l[0],p=1/l[1],f=1/l[2];if(d>=0?(n=(c[0]-u[0])*d,r=(h[0]-u[0])*d):(r=(c[0]-u[0])*d,n=(h[0]-u[0])*d),p>=0?(i=(c[1]-u[1])*p,o=(h[1]-u[1])*p):(o=(c[1]-u[1])*p,i=(h[1]-u[1])*p),n>o||i>r)return null;if((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),f>=0?(a=(c[2]-u[2])*f,s=(h[2]-u[2])*f):(s=(c[2]-u[2])*f,a=(h[2]-u[2])*f),n>s||a>r)return null;if((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0)return null;var g=n>=0?n:r;return t||(t=new rK),Wq.scaleAndAdd(t.array,u,l,g),t},intersectTriangle:(cK=Wq.create(),hK=Wq.create(),dK=Wq.create(),pK=Wq.create(),function(e,t,n,r,i,o){var a=this.direction.array,s=this.origin.array;e=e.array,t=t.array,n=n.array,Wq.sub(cK,t,e),Wq.sub(hK,n,e),Wq.cross(pK,hK,a);var l=Wq.dot(cK,pK);if(r){if(l>-1e-5)return null}else if(l>-1e-5&&l<fK)return null;Wq.sub(dK,s,e);var u=Wq.dot(pK,dK)/l;if(u<0||u>1)return null;Wq.cross(pK,cK,dK);var c=Wq.dot(a,pK)/l;if(c<0||c>1||u+c>1)return null;Wq.cross(pK,cK,hK);var h=-Wq.dot(dK,pK)/l;return h<0?null:(i||(i=new rK),o&&rK.set(o,1-u-c,u,c),Wq.scaleAndAdd(i.array,s,a,h),i)}),applyTransform:function(e){rK.add(this.direction,this.direction,this.origin),rK.transformMat4(this.origin,this.origin,e),rK.transformMat4(this.direction,this.direction,e),rK.sub(this.direction,this.direction,this.origin),rK.normalize(this.direction,this.direction)},copy:function(e){rK.copy(this.origin,e.origin),rK.copy(this.direction,e.direction)},clone:function(){var e=new gK;return e.copy(this),e}};var mK={create:function(){var e=new cq(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new cq(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,n,r){var i=new cq(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}};mK.sub=mK.subtract,mK.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},mK.mul=mK.multiply,mK.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},mK.div=mK.divide,mK.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},mK.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},mK.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},mK.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e},mK.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+o*o)},mK.dist=mK.distance,mK.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return n*n+r*r+i*i+o*o},mK.sqrDist=mK.squaredDistance,mK.length=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)},mK.len=mK.length,mK.squaredLength=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i},mK.sqrLen=mK.squaredLength,mK.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},mK.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},mK.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a),e},mK.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},mK.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e},mK.random=function(e,t){return t=t||1,e[0]=hq(),e[1]=hq(),e[2]=hq(),e[3]=hq(),mK.normalize(e,e),mK.scale(e,e,t),e},mK.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e},mK.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return e[0]=c*u+p*-a+h*-l-d*-s,e[1]=h*u+p*-s+d*-a-c*-l,e[2]=d*u+p*-l+c*-s-h*-a,e},mK.forEach=function(){var e=mK.create();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var vK={create:function(){var e=new cq(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new cq(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=c*a-s*u,d=-c*o+s*l,p=u*o-a*l,f=n*h+r*d+i*p;return f?(f=1/f,e[0]=h*f,e[1]=(-c*r+i*u)*f,e[2]=(s*r-i*a)*f,e[3]=d*f,e[4]=(c*n-i*l)*f,e[5]=(-s*n+i*o)*f,e[6]=p*f,e[7]=(-u*n+r*l)*f,e[8]=(a*n-r*o)*f,e):null},adjoint:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-s*u,e[1]=i*u-r*c,e[2]=r*s-i*a,e[3]=s*l-o*c,e[4]=n*c-i*l,e[5]=i*o-n*s,e[6]=o*u-a*l,e[7]=r*l-n*u,e[8]=n*a-r*o,e},determinant:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*(u*o-a*l)+n*(-u*i+a*s)+r*(l*i-o*s)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],v=n[5],y=n[6],_=n[7],x=n[8];return e[0]=d*r+p*a+f*u,e[1]=d*i+p*s+f*c,e[2]=d*o+p*l+f*h,e[3]=g*r+m*a+v*u,e[4]=g*i+m*s+v*c,e[5]=g*o+m*l+v*h,e[6]=y*r+_*a+x*u,e[7]=y*i+_*s+x*c,e[8]=y*o+_*l+x*h,e}};vK.mul=vK.multiply,vK.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=d*r+p*a+u,e[7]=d*i+p*s+c,e[8]=d*o+p*l+h,e},vK.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=Math.sin(n),p=Math.cos(n);return e[0]=p*r+d*a,e[1]=p*i+d*s,e[2]=p*o+d*l,e[3]=p*a-d*r,e[4]=p*s-d*i,e[5]=p*l-d*o,e[6]=u,e[7]=c,e[8]=h,e},vK.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},vK.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},vK.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return e[0]=1-h-f,e[3]=c-v,e[6]=d+m,e[1]=c+v,e[4]=1-u-f,e[7]=p-g,e[2]=d-m,e[5]=p+g,e[8]=1-u-h,e},vK.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=c*g-h*f,M=c*m-d*f,A=c*v-p*f,C=h*m-d*g,D=h*v-p*g,E=d*v-p*m,I=y*E-_*D+x*C+b*A-w*M+S*T;return I?(I=1/I,e[0]=(s*E-l*D+u*C)*I,e[1]=(l*A-a*E-u*M)*I,e[2]=(a*D-s*A+u*T)*I,e[3]=(i*D-r*E-o*C)*I,e[4]=(n*E-i*A+o*M)*I,e[5]=(r*A-n*D-o*T)*I,e[6]=(g*S-m*w+v*b)*I,e[7]=(m*x-f*S-v*_)*I,e[8]=(f*w-g*x+v*y)*I,e):null},vK.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))};var yK,_K,xK,bK,wK={};wK.create=function(){var e=new cq(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},wK.rotationTo=(yK=Wq.create(),_K=Wq.fromValues(1,0,0),xK=Wq.fromValues(0,1,0),function(e,t,n){var r=Wq.dot(t,n);return r<-.999999?(Wq.cross(yK,_K,t),Wq.length(yK)<1e-6&&Wq.cross(yK,xK,t),Wq.normalize(yK,yK),wK.setAxisAngle(e,yK,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Wq.cross(yK,t,n),e[0]=yK[0],e[1]=yK[1],e[2]=yK[2],e[3]=1+r,wK.normalize(e,e))}),wK.setAxes=(bK=vK.create(),function(e,t,n,r){return bK[0]=n[0],bK[3]=n[1],bK[6]=n[2],bK[1]=r[0],bK[4]=r[1],bK[7]=r[2],bK[2]=-t[0],bK[5]=-t[1],bK[8]=-t[2],wK.normalize(e,wK.fromMat3(e,bK))}),wK.clone=mK.clone,wK.fromValues=mK.fromValues,wK.copy=mK.copy,wK.set=mK.set,wK.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},wK.setAxisAngle=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e},wK.add=mK.add,wK.multiply=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*c+a*s+i*u-o*l,e[1]=i*c+a*l+o*s-r*u,e[2]=o*c+a*u+r*l-i*s,e[3]=a*c-r*s-i*l-o*u,e},wK.mul=wK.multiply,wK.scale=mK.scale,wK.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-r*s,e},wK.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=i*l+a*s,e[2]=o*l+r*s,e[3]=a*l-i*s,e},wK.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},wK.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},wK.dot=mK.dot,wK.lerp=mK.lerp,wK.slerp=function(e,t,n,r){var i,o,a,s,l,u=t[0],c=t[1],h=t[2],d=t[3],p=n[0],f=n[1],g=n[2],m=n[3];return(o=u*p+c*f+h*g+d*m)<0&&(o=-o,p=-p,f=-f,g=-g,m=-m),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),e[0]=s*u+l*p,e[1]=s*c+l*f,e[2]=s*h+l*g,e[3]=s*d+l*m,e},wK.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e},wK.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},wK.length=mK.length,wK.len=wK.length,wK.squaredLength=mK.squaredLength,wK.sqrLen=wK.squaredLength,wK.normalize=mK.normalize,wK.fromMat3=function(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e};var SK=function(){this._axisX=new rK,this._axisY=new rK,this._axisZ=new rK,this.array=Uq.create(),this._dirty=!0};SK.prototype={constructor:SK,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return Uq.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new SK).copy(this)},copy:function(e){return Uq.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return Uq.determinant(this.array)},fromQuat:function(e){return Uq.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return Uq.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return SK.fromMat2d(this,e),this},frustum:function(e,t,n,r,i,o){return Uq.frustum(this.array,e,t,n,r,i,o),this._dirty=!0,this},identity:function(){return Uq.identity(this.array),this._dirty=!0,this},invert:function(){return Uq.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,n){return Uq.lookAt(this.array,e.array,t.array,n.array),this._dirty=!0,this},mul:function(e){return Uq.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return Uq.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return Uq.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return Uq.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,n,r,i,o){return Uq.ortho(this.array,e,t,n,r,i,o),this._dirty=!0,this},perspective:function(e,t,n,r){return Uq.perspective(this.array,e,t,n,r),this._dirty=!0,this},rotate:function(e,t){return Uq.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return Uq.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return Uq.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return Uq.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return Uq.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return Uq.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return Uq.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var e=Wq.create(),t=Wq.create(),n=Wq.create(),r=vK.create();return function(i,o,a){var s=this.array;Wq.set(e,s[0],s[1],s[2]),Wq.set(t,s[4],s[5],s[6]),Wq.set(n,s[8],s[9],s[10]);var l=Wq.length(e),u=Wq.length(t),c=Wq.length(n);this.determinant()<0&&(l=-l),i&&i.set(l,u,c),a.set(s[12],s[13],s[14]),vK.fromMat4(r,s),r[0]/=l,r[1]/=l,r[2]/=l,r[3]/=u,r[4]/=u,r[5]/=u,r[6]/=c,r[7]/=c,r[8]/=c,wK.fromMat3(o.array,r),wK.normalize(o.array,o.array),o._dirty=!0,a._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var TK=Object.defineProperty;if(TK){var MK=SK.prototype;TK(MK,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),TK(MK,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),TK(MK,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}SK.adjoint=function(e,t){return Uq.adjoint(e.array,t.array),e._dirty=!0,e},SK.copy=function(e,t){return Uq.copy(e.array,t.array),e._dirty=!0,e},SK.determinant=function(e){return Uq.determinant(e.array)},SK.identity=function(e){return Uq.identity(e.array),e._dirty=!0,e},SK.ortho=function(e,t,n,r,i,o,a){return Uq.ortho(e.array,t,n,r,i,o,a),e._dirty=!0,e},SK.perspective=function(e,t,n,r,i){return Uq.perspective(e.array,t,n,r,i),e._dirty=!0,e},SK.lookAt=function(e,t,n,r){return Uq.lookAt(e.array,t.array,n.array,r.array),e._dirty=!0,e},SK.invert=function(e,t){return Uq.invert(e.array,t.array),e._dirty=!0,e},SK.mul=function(e,t,n){return Uq.mul(e.array,t.array,n.array),e._dirty=!0,e},SK.multiply=SK.mul,SK.fromQuat=function(e,t){return Uq.fromQuat(e.array,t.array),e._dirty=!0,e},SK.fromRotationTranslation=function(e,t,n){return Uq.fromRotationTranslation(e.array,t.array,n.array),e._dirty=!0,e},SK.fromMat2d=function(e,t){e._dirty=!0;t=t.array;return(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},SK.rotate=function(e,t,n,r){return Uq.rotate(e.array,t.array,n,r.array),e._dirty=!0,e},SK.rotateX=function(e,t,n){return Uq.rotateX(e.array,t.array,n),e._dirty=!0,e},SK.rotateY=function(e,t,n){return Uq.rotateY(e.array,t.array,n),e._dirty=!0,e},SK.rotateZ=function(e,t,n){return Uq.rotateZ(e.array,t.array,n),e._dirty=!0,e},SK.scale=function(e,t,n){return Uq.scale(e.array,t.array,n.array),e._dirty=!0,e},SK.transpose=function(e,t){return Uq.transpose(e.array,t.array),e._dirty=!0,e},SK.translate=function(e,t,n){return Uq.translate(e.array,t.array,n.array),e._dirty=!0,e};var AK,CK=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=void 0===r?1:r,this.array=wK.fromValues(e,t,n,r),this._dirty=!0};CK.prototype={constructor:CK,add:function(e){return wK.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return wK.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new CK(this.x,this.y,this.z,this.w)},conjugate:function(){return wK.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return wK.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return wK.dot(this.array,e.array)},fromMat3:function(e){return wK.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(AK=vK.create(),function(e){return vK.fromMat4(AK,e.array),vK.transpose(AK,AK),wK.fromMat3(this.array,AK),this._dirty=!0,this}),identity:function(){return wK.identity(this.array),this._dirty=!0,this},invert:function(){return wK.invert(this.array,this.array),this._dirty=!0,this},len:function(){return wK.len(this.array)},length:function(){return wK.length(this.array)},lerp:function(e,t,n){return wK.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},mul:function(e){return wK.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return wK.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return wK.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return wK.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return wK.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return wK.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return wK.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return wK.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return wK.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,n){return wK.setAxes(this.array,e.array,t.array,n.array),this._dirty=!0,this},setAxisAngle:function(e,t){return wK.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,n){return wK.slerp(this.array,e.array,t.array,n),this._dirty=!0,this},sqrLen:function(){return wK.sqrLen(this.array)},squaredLength:function(){return wK.squaredLength(this.array)},fromEuler:function(e,t){return CK.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var DK=Object.defineProperty;if(DK){var EK=CK.prototype;DK(EK,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),DK(EK,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),DK(EK,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),DK(EK,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}CK.add=function(e,t,n){return wK.add(e.array,t.array,n.array),e._dirty=!0,e},CK.set=function(e,t,n,r,i){wK.set(e.array,t,n,r,i),e._dirty=!0},CK.copy=function(e,t){return wK.copy(e.array,t.array),e._dirty=!0,e},CK.calculateW=function(e,t){return wK.calculateW(e.array,t.array),e._dirty=!0,e},CK.conjugate=function(e,t){return wK.conjugate(e.array,t.array),e._dirty=!0,e},CK.identity=function(e){return wK.identity(e.array),e._dirty=!0,e},CK.invert=function(e,t){return wK.invert(e.array,t.array),e._dirty=!0,e},CK.dot=function(e,t){return wK.dot(e.array,t.array)},CK.len=function(e){return wK.length(e.array)},CK.lerp=function(e,t,n,r){return wK.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},CK.slerp=function(e,t,n,r){return wK.slerp(e.array,t.array,n.array,r),e._dirty=!0,e},CK.mul=function(e,t,n){return wK.multiply(e.array,t.array,n.array),e._dirty=!0,e},CK.multiply=CK.mul,CK.rotateX=function(e,t,n){return wK.rotateX(e.array,t.array,n),e._dirty=!0,e},CK.rotateY=function(e,t,n){return wK.rotateY(e.array,t.array,n),e._dirty=!0,e},CK.rotateZ=function(e,t,n){return wK.rotateZ(e.array,t.array,n),e._dirty=!0,e},CK.setAxisAngle=function(e,t,n){return wK.setAxisAngle(e.array,t.array,n),e._dirty=!0,e},CK.normalize=function(e,t){return wK.normalize(e.array,t.array),e._dirty=!0,e},CK.squaredLength=CK.sqrLen=function(e){return wK.sqrLen(e.array)},CK.fromMat3=function(e,t){return wK.fromMat3(e.array,t.array),e._dirty=!0,e},CK.setAxes=function(e,t,n,r){return wK.setAxes(e.array,t.array,n.array,r.array),e._dirty=!0,e},CK.rotationTo=function(e,t,n){return wK.rotationTo(e.array,t.array,n.array),e._dirty=!0,e},CK.fromEuler=function(e,t,n){e._dirty=!0,t=t.array;var r=e.array,i=Math.cos(t[0]/2),o=Math.cos(t[1]/2),a=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"YXZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"ZXY":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"ZYX":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"YZX":r[0]=s*o*a+i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a-s*l*u;break;case"XZY":r[0]=s*o*a-i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a+s*l*u}};var IK,LK,NK,PK,OK,RK,kK=Wq.set,zK=Wq.copy,BK=function(e,t){this.min=e||new rK(1/0,1/0,1/0),this.max=t||new rK(-1/0,-1/0,-1/0),this.vertices=null};BK.prototype={constructor:BK,updateFromVertices:function(e){if(e.length>0){var t=this.min,n=this.max,r=t.array,i=n.array;zK(r,e[0]),zK(i,e[0]);for(var o=1;o<e.length;o++){var a=e[o];a[0]<r[0]&&(r[0]=a[0]),a[1]<r[1]&&(r[1]=a[1]),a[2]<r[2]&&(r[2]=a[2]),a[0]>i[0]&&(i[0]=a[0]),a[1]>i[1]&&(i[1]=a[1]),a[2]>i[2]&&(i[2]=a[2])}t._dirty=!0,n._dirty=!0}},union:function(e){var t=this.min,n=this.max;return Wq.min(t.array,t.array,e.min.array),Wq.max(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersection:function(e){var t=this.min,n=this.max;return Wq.max(t.array,t.array,e.min.array),Wq.min(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return!(t[0]>i[0]||t[1]>i[1]||t[2]>i[2]||n[0]<r[0]||n[1]<r[1]||n[2]<r[2])},containBoundingBox:function(e){var t=this.min.array,n=this.max.array,r=e.min.array,i=e.max.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},containPoint:function(e){var t=this.min.array,n=this.max.array,r=e.array;return t[0]<=r[0]&&t[1]<=r[1]&&t[2]<=r[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(IK=Wq.create(),LK=Wq.create(),NK=Wq.create(),PK=Wq.create(),OK=Wq.create(),RK=Wq.create(),function(e,t){var n=e.min.array,r=e.max.array,i=t.array;return IK[0]=i[0]*n[0],IK[1]=i[1]*n[0],IK[2]=i[2]*n[0],LK[0]=i[0]*r[0],LK[1]=i[1]*r[0],LK[2]=i[2]*r[0],NK[0]=i[4]*n[1],NK[1]=i[5]*n[1],NK[2]=i[6]*n[1],PK[0]=i[4]*r[1],PK[1]=i[5]*r[1],PK[2]=i[6]*r[1],OK[0]=i[8]*n[2],OK[1]=i[9]*n[2],OK[2]=i[10]*n[2],RK[0]=i[8]*r[2],RK[1]=i[9]*r[2],RK[2]=i[10]*r[2],n=this.min.array,r=this.max.array,n[0]=Math.min(IK[0],LK[0])+Math.min(NK[0],PK[0])+Math.min(OK[0],RK[0])+i[12],n[1]=Math.min(IK[1],LK[1])+Math.min(NK[1],PK[1])+Math.min(OK[1],RK[1])+i[13],n[2]=Math.min(IK[2],LK[2])+Math.min(NK[2],PK[2])+Math.min(OK[2],RK[2])+i[14],r[0]=Math.max(IK[0],LK[0])+Math.max(NK[0],PK[0])+Math.max(OK[0],RK[0])+i[12],r[1]=Math.max(IK[1],LK[1])+Math.max(NK[1],PK[1])+Math.max(OK[1],RK[1])+i[13],r[2]=Math.max(IK[2],LK[2])+Math.max(NK[2],PK[2])+Math.max(OK[2],RK[2])+i[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,n=this.max.array,r=e.array,i=t[0],o=t[1],a=t[2],s=n[0],l=n[1],u=t[2],c=n[0],h=n[1],d=n[2];if(1===r[15])t[0]=r[0]*i+r[12],t[1]=r[5]*o+r[13],n[2]=r[10]*a+r[14],n[0]=r[0]*c+r[12],n[1]=r[5]*h+r[13],t[2]=r[10]*d+r[14];else{var p=-1/a;t[0]=r[0]*i*p,t[1]=r[5]*o*p,n[2]=(r[10]*a+r[14])*p,p=-1/u,n[0]=r[0]*s*p,n[1]=r[5]*l*p,p=-1/d,t[2]=(r[10]*d+r[14])*p}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=Wq.fromValues(0,0,0);this.vertices=e}var n=this.min.array,r=this.max.array;return kK(e[0],n[0],n[1],n[2]),kK(e[1],n[0],r[1],n[2]),kK(e[2],r[0],n[1],n[2]),kK(e[3],r[0],r[1],n[2]),kK(e[4],n[0],n[1],r[2]),kK(e[5],n[0],r[1],r[2]),kK(e[6],r[0],n[1],r[2]),kK(e[7],r[0],r[1],r[2]),this},copy:function(e){var t=this.min,n=this.max;return zK(t.array,e.min.array),zK(n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},clone:function(){var e=new BK;return e.copy(this),e}};var VK,FK,GK=0,HK=PZ.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+GK++),this.position||(this.position=new rK),this.rotation||(this.rotation=new CK),this.scale||(this.scale=new rK(1,1,1)),this.worldTransform=new SK,this.localTransform=new SK,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var n=t._nodeRepository;delete n[this.name],n[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var n=this._scene;n&&n!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,n=t.indexOf(e);n<0||(t.splice(n,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},getDescendantByName:function(e){for(var t=this._children,n=0;n<t.length;n++){var r=t[n];if(r.name===e)return r;var i=r.getDescendantByName(e);if(i)return i}},queryNode:function(e){if(e){for(var t=e.split("/"),n=this,r=0;r<t.length;r++){var i=t[r];if(i){for(var o=!1,a=n._children,s=0;s<a.length;s++){var l=a[s];if(l.name===i){n=l,o=!0;break}}if(!o)return}}return n}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,n=this.name;t._parent&&(n=t.name+"/"+n,t._parent!=e);)t=t._parent;return!t._parent&&e?null:n},traverse:function(e,t){e.call(t,this);for(var n=this._children,r=0,i=n.length;r<i;r++)n[r].traverse(e,t)},eachChild:function(e,t){for(var n=this._children,r=0,i=n.length;r<i;r++){var o=n[r];e.call(t,o,r)}},setLocalTransform:function(e){Uq.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){Uq.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(VK=Uq.create(),function(e){var t=this.localTransform,n=this.worldTransform;this._parent?(Uq.invert(VK,this._parent.worldTransform.array),Uq.multiply(t.array,VK,n.array)):Uq.copy(t.array,n.array);var r=e?null:this.scale;t.decomposeMatrix(r,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var r=this.localTransform.array;Uq.fromRotationTranslation(r,t.array,e.array),Uq.scale(r,r,n.array),t._dirty=!1,n._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?Uq.multiplyAffine(t,this._parent.worldTransform.array,e):Uq.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,n=0,r=t.length;n<r;n++)t[n].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new BK,n=new SK,r=new SK;return function(i,o){return o=o||new BK,this._parent?SK.invert(r,this._parent.worldTransform):SK.identity(r),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),SK.multiply(n,r,e.worldTransform),t.applyTransform(n),o.union(t))}),this,e),o}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var n=e.array;return n[0]=t[12],n[1]=t[13],n[2]=t[14],e}return new rK(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var n=0;n<t.length;n++)e.add(t[n].clone());return e},rotateAround:function(){var e=new rK,t=new SK;return function(n,r,i){e.copy(this.position).subtract(n);var o=this.localTransform;o.identity(),o.translate(n),o.rotate(i,r),t.fromRotationTranslation(this.rotation,e),o.multiply(t),o.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var e=new SK;return function(t,n){e.lookAt(this.position,t,n||this.localTransform.y).invert(),this.setLocalTransform(e),this.target=t}}()}),UK=HK.extend({material:null,geometry:null,mode:zZ.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:zZ.BACK,frontFace:zZ.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=HK.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(FK=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=HK.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<FK.length;t++){var n=FK[t];e[n]!==this[n]&&(e[n]=this[n])}return e})});UK.POINTS=zZ.POINTS,UK.LINES=zZ.LINES,UK.LINE_LOOP=zZ.LINE_LOOP,UK.LINE_STRIP=zZ.LINE_STRIP,UK.TRIANGLES=zZ.TRIANGLES,UK.TRIANGLE_STRIP=zZ.TRIANGLE_STRIP,UK.TRIANGLE_FAN=zZ.TRIANGLE_FAN,UK.BACK=zZ.BACK,UK.FRONT=zZ.FRONT,UK.FRONT_AND_BACK=zZ.FRONT_AND_BACK,UK.CW=zZ.CW,UK.CCW=zZ.CCW;var WK=PZ.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new gK,this._ndc=new pq}),{pick:function(e,t,n){return this.pickAll(e,t,[],n)[0]||null},pickAll:function(e,t,n,r){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,r||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(e,t,n){e instanceof UK&&e.isRenderable()&&(e.ignorePicking&&!n||!(e.mode===zZ.TRIANGLES&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var r=0;r<e._children.length;r++)this._intersectNode(e._children[r],t,n)},_intersectRenderable:function(){var e=new rK,t=new rK,n=new rK,r=new gK,i=new SK;return function(o,a){var s=o.isSkinnedMesh();r.copy(this._ray),SK.invert(i,o.worldTransform),s||r.applyTransform(i);var l=o.geometry,u=s?o.skeleton.boundingBox:l.boundingBox;if(!u||r.intersectBoundingBox(u))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,o,a);else if(l.pickByRay)l.pickByRay(r,o,a);else{var c,h,d=o.cullFace===zZ.BACK&&o.frontFace===zZ.CCW||o.cullFace===zZ.FRONT&&o.frontFace===zZ.CW,p=l.indices,f=l.attributes.position,g=l.attributes.weight,m=l.attributes.joint,v=[];if(f&&f.value&&p){if(s){h=o.skeleton.getSubSkinMatrices(o.__uid__,o.joints);for(var y=0;y<o.joints.length;y++){v[y]=v[y]||[];for(var _=0;_<16;_++)v[y][_]=h[16*y+_]}var x=[],b=[],w=[],S=[],T=[],M=l.attributes.skinnedPosition;M&&M.value||(l.createAttribute("skinnedPosition","f",3),(M=l.attributes.skinnedPosition).init(l.vertexCount));for(y=0;y<l.vertexCount;y++){f.get(y,x),g.get(y,b),m.get(y,w),b[3]=1-b[0]-b[1]-b[2],Wq.set(S,0,0,0);for(_=0;_<4;_++)w[_]>=0&&b[_]>1e-4&&(Wq.transformMat4(T,x,v[w[_]]),Wq.scaleAndAdd(S,S,T,b[_]));M.set(y,S)}}for(y=0;y<p.length;y+=3){var A=p[y],C=p[y+1],D=p[y+2],E=s?l.attributes.skinnedPosition:f;if(E.get(A,e.array),E.get(C,t.array),E.get(D,n.array),c=d?r.intersectTriangle(e,t,n,o.culling):r.intersectTriangle(e,n,t,o.culling)){var I=new rK;s?rK.copy(I,c):rK.transformMat4(I,c,o.worldTransform),a.push(new WK.Intersection(c,I,o,[A,C,D],y/3,rK.dist(I,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});WK.Intersection=function(e,t,n,r,i,o){this.point=e,this.pointWorld=t,this.target=n,this.triangle=r,this.triangleIndex=i,this.distance=o};var XK="__dt__",jK=function(){this._contextId=0,this._caches=[],this._context={}};jK.prototype={use:function(e,t){var n=this._caches;n[e]||(n[e]={},t&&(n[e]=t())),this._contextId=e,this._context=n[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=XK+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=XK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!0)},fresh:function(e){var t=XK+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=XK+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!1)},isDirty:function(e){var t=XK+(e=e||""),n=this._context;return!n.hasOwnProperty(t)||!0===n[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(e,t){Object.keys(this._caches).forEach((function(n){e&&e.call(t,n)}))},miss:function(e){return!this._context.hasOwnProperty(e)}},jK.prototype.constructor=jK;var YK=PZ.extend({width:512,height:512,type:zZ.UNSIGNED_BYTE,format:zZ.RGBA,wrapS:zZ.REPEAT,wrapT:zZ.REPEAT,minFilter:zZ.LINEAR_MIPMAP_LINEAR,magFilter:zZ.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},(function(){this._cache=new jK}),{getWebGLTexture:function(e){var t=e.gl,n=this._cache;return n.use(e.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):n.isDirty()&&(this.update(e),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(e){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===zZ.DEPTH_COMPONENT&&(this.useMipmap=!1);var n=e.getGLExtension("EXT_sRGB");this.format!==YK.SRGB||n||(this.format=YK.RGB),this.format!==YK.SRGB_ALPHA||n||(this.format=YK.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?zZ.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?zZ.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===zZ.NEAREST_MIPMAP_NEAREST||e===zZ.NEAREST_MIPMAP_LINEAR?zZ.NEAREST:e===zZ.LINEAR_MIPMAP_LINEAR||e===zZ.LINEAR_MIPMAP_NEAREST?zZ.LINEAR:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("webgl_texture");n&&e.gl.deleteTexture(n),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(YK.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(YK.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),YK.BYTE=zZ.BYTE,YK.UNSIGNED_BYTE=zZ.UNSIGNED_BYTE,YK.SHORT=zZ.SHORT,YK.UNSIGNED_SHORT=zZ.UNSIGNED_SHORT,YK.INT=zZ.INT,YK.UNSIGNED_INT=zZ.UNSIGNED_INT,YK.FLOAT=zZ.FLOAT,YK.HALF_FLOAT=36193,YK.UNSIGNED_INT_24_8_WEBGL=34042,YK.DEPTH_COMPONENT=zZ.DEPTH_COMPONENT,YK.DEPTH_STENCIL=zZ.DEPTH_STENCIL,YK.ALPHA=zZ.ALPHA,YK.RGB=zZ.RGB,YK.RGBA=zZ.RGBA,YK.LUMINANCE=zZ.LUMINANCE,YK.LUMINANCE_ALPHA=zZ.LUMINANCE_ALPHA,YK.SRGB=35904,YK.SRGB_ALPHA=35906,YK.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,YK.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,YK.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,YK.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,YK.NEAREST=zZ.NEAREST,YK.LINEAR=zZ.LINEAR,YK.NEAREST_MIPMAP_NEAREST=zZ.NEAREST_MIPMAP_NEAREST,YK.LINEAR_MIPMAP_NEAREST=zZ.LINEAR_MIPMAP_NEAREST,YK.NEAREST_MIPMAP_LINEAR=zZ.NEAREST_MIPMAP_LINEAR,YK.LINEAR_MIPMAP_LINEAR=zZ.LINEAR_MIPMAP_LINEAR,YK.REPEAT=zZ.REPEAT,YK.CLAMP_TO_EDGE=zZ.CLAMP_TO_EDGE,YK.MIRRORED_REPEAT=zZ.MIRRORED_REPEAT;var ZK=UK.extend({skeleton:null,joints:null},(function(){this.joints||(this.joints=[])}),{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=UK.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});ZK.POINTS=zZ.POINTS,ZK.LINES=zZ.LINES,ZK.LINE_LOOP=zZ.LINE_LOOP,ZK.LINE_STRIP=zZ.LINE_STRIP,ZK.TRIANGLES=zZ.TRIANGLES,ZK.TRIANGLE_STRIP=zZ.TRIANGLE_STRIP,ZK.TRIANGLE_FAN=zZ.TRIANGLE_FAN,ZK.BACK=zZ.BACK,ZK.FRONT=zZ.FRONT,ZK.FRONT_AND_BACK=zZ.FRONT_AND_BACK,ZK.CW=zZ.CW,ZK.CCW=zZ.CCW;var qK={isPowerOfTwo:function(e){return!(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}},KK=qK.isPowerOfTwo;function $K(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var JK=YK.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type,i=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==YK.REPEAT&&this.wrapT!==YK.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i?this.minFilter:this.getAvailableMinFilter());var o=e.getGLExtension("EXT_texture_filter_anisotropic");(o&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,o.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=zZ.FLOAT));if(this.mipmaps.length)for(var a=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,a,s,n,r,!1),a/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r,i),!this.useMipmap||this.NPOT&&!i||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,n,r,i,o,a,s){if(t.image){var l=t.image;s&&(this._potCanvas=function(e,t){var n=$K(e.width),r=$K(e.height);return(t=t||document.createElement("canvas")).width=n,t.height=r,t.getContext("2d").drawImage(e.image,0,0,n,r),t}(this,this._potCanvas),l=this._potCanvas),e.texImage2D(e.TEXTURE_2D,n,o,o,a,l)}else o<=YK.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=YK.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,n,o,r,i,0,t.pixels):e.texImage2D(e.TEXTURE_2D,n,o,r,i,0,o,a,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return KK(this.width)&&KK(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var n=FZ.createImage();t&&(n.crossOrigin=t);var r=this;return n.onload=function(){r.dirty(),r.trigger("success",r)},n.onerror=function(){r.trigger("error",r)},n.src=e,this.image=n,this}});function QK(e){return{byte:FZ.Int8Array,ubyte:FZ.Uint8Array,short:FZ.Int16Array,ushort:FZ.Uint16Array}[e]||FZ.Float32Array}function e$(e){return"attr_"+e}function t$(e,t,n,r){switch(this.name=e,this.type=t,this.size=n,this.semantic=r||"",this.value=null,n){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var n=this.value;return t[0]=n[2*e],t[1]=n[2*e+1],t},this.set=function(e,t){var n=this.value;n[2*e]=t[0],n[2*e+1]=t[1]},this.copy=function(e,t){var n=this.value;t*=2,n[e*=2]=n[t],n[e+1]=n[t+1]};break;case 3:this.get=function(e,t){var n=3*e,r=this.value;return t[0]=r[n],t[1]=r[n+1],t[2]=r[n+2],t},this.set=function(e,t){var n=3*e,r=this.value;r[n]=t[0],r[n+1]=t[1],r[n+2]=t[2]},this.copy=function(e,t){var n=this.value;t*=3,n[e*=3]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2]};break;case 4:this.get=function(e,t){var n=this.value,r=4*e;return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],t},this.set=function(e,t){var n=this.value,r=4*e;n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3]},this.copy=function(e,t){var n=this.value;t*=4,n[e*=4]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2],n[e+3]=n[t+3]}}}function n$(e,t,n,r,i){this.name=e,this.type=t,this.buffer=n,this.size=r,this.semantic=i,this.symbol="",this.needsRemove=!1}function r$(e){this.buffer=e,this.count=0}Object.defineProperty(JK.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(JK.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t$.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=QK(this.type);this.value=new t(e*this.size)}},t$.prototype.fromArray=function(e){var t,n=QK(this.type);if(e[0]&&e[0].length){var r=0,i=this.size;t=new n(e.length*i);for(var o=0;o<e.length;o++)for(var a=0;a<i;a++)t[r++]=e[o][a]}else t=new n(e);this.value=t},t$.prototype.clone=function(e){var t=new t$(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var i$=PZ.extend((function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}}),(function(){this._cache=new jK,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}}),{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(e$(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=[]);var n=this.indices;return t[0]=n[3*e],t[1]=n[3*e+1],t[2]=n[3*e+2],t}},setTriangleIndices:function(e,t){var n=this.indices;n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,n=this.vertexCount>65535?FZ.Uint32Array:FZ.Uint16Array;if(e[0]&&e[0].length){var r=0;t=new n(3*e.length);for(var i=0;i<e.length;i++)for(var o=0;o<3;o++)t[r++]=e[i][o]}else t=new n(e);this.indices=t},createAttribute:function(e,t,n,r){var i=new t$(e,t,n,r);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=i,this._attributeList.push(e),i},removeAttribute:function(e){var t=this._attributeList,n=t.indexOf(e);return n>=0&&(t.splice(n,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var n=[],r=this.vertexCount,i=0;i<t.length;i++){var o=t[i],a=this.attributes[o];a.value&&a.value.length===r*a.size&&n.push(o)}return this._enabledAttributes=n,n},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var n=t.isDirty("attributes"),r=t.isDirty("indices");if(n||r){this._updateBuffer(e.gl,n,r);for(var i=this.getEnabledAttributes(),o=0;o<i.length;o++)t.fresh(e$(i[o]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,n){var r=this._cache,i=r.get("chunks"),o=!1;i||((i=[])[0]={attributeBuffers:[],indicesBuffer:null},r.put("chunks",i),o=!0);var a=i[0],s=a.attributeBuffers,l=a.indicesBuffer;if(t||o){var u=this.getEnabledAttributes(),c={};if(!o)for(var h=0;h<s.length;h++)c[s[h].name]=s[h];for(var d=0;d<u.length;d++){var p,f,g=u[d],m=this.attributes[g];o||(p=c[g]),f=p?p.buffer:e.createBuffer(),r.isDirty(e$(g))&&(e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,m.value,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW)),s[d]=new n$(g,m.type,f,m.size,m.semantic)}for(h=d;h<s.length;h++)e.deleteBuffer(s[h].buffer);s.length=d}this.isUseIndices()&&(n||o)&&(l||(l=new r$(e.createBuffer()),a.indicesBuffer=l),l.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(i$.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return e||(e=this.attributes[this._attributeList[0]]),e&&e.value?e.value.length/e.size:0}}),Object.defineProperty(i$.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),i$.STATIC_DRAW=zZ.STATIC_DRAW,i$.DYNAMIC_DRAW=zZ.DYNAMIC_DRAW,i$.STREAM_DRAW=zZ.STREAM_DRAW,i$.AttributeBuffer=n$,i$.IndicesBuffer=r$,i$.Attribute=t$;var o$=Wq.create,a$=Wq.add,s$=Wq.set,l$=i$.Attribute,u$=i$.extend((function(){return{attributes:{position:new l$("position","float",3,"POSITION"),texcoord0:new l$("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new l$("texcoord1","float",2,"TEXCOORD_1"),normal:new l$("normal","float",3,"NORMAL"),tangent:new l$("tangent","float",4,"TANGENT"),color:new l$("color","float",4,"COLOR"),weight:new l$("weight","float",3,"WEIGHT"),joint:new l$("joint","float",4,"JOINT"),barycentric:new l$("barycentric","float",3,null)},boundingBox:null}}),{mainAttribute:"position",updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new BK);var t=this.attributes.position.value;if(t&&t.length){var n=e.min,r=e.max,i=n.array,o=r.array;Wq.set(i,t[0],t[1],t[2]),Wq.set(o,t[0],t[1],t[2]);for(var a=3;a<t.length;){var s=t[a++],l=t[a++],u=t[a++];s<i[0]&&(i[0]=s),l<i[1]&&(i[1]=l),u<i[2]&&(i[2]=u),s>o[0]&&(o[0]=s),l>o[1]&&(o[1]=l),u>o[2]&&(o[2]=u)}n._dirty=!0,r._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value;if(r&&r.length===n.length)for(var i=0;i<r.length;i++)r[i]=0;else r=t.normal.value=new FZ.Float32Array(n.length);for(var o,a,s,l=o$(),u=o$(),c=o$(),h=o$(),d=o$(),p=o$(),f=e?e.length:this.vertexCount,g=0;g<f;){e?(o=e[g++],a=e[g++],s=e[g++]):(o=g++,a=g++,s=g++),s$(l,n[3*o],n[3*o+1],n[3*o+2]),s$(u,n[3*a],n[3*a+1],n[3*a+2]),s$(c,n[3*s],n[3*s+1],n[3*s+2]),Wq.sub(h,l,u),Wq.sub(d,u,c),Wq.cross(p,h,d);for(i=0;i<3;i++)r[3*o+i]=r[3*o+i]+p[i],r[3*a+i]=r[3*a+i]+p[i],r[3*s+i]=r[3*s+i]+p[i]}for(i=0;i<r.length;)s$(p,r[i],r[i+1],r[i+2]),Wq.normalize(p,p),r[i++]=p[0],r[i++]=p[1],r[i++]=p[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,n=t.position.value,r=t.normal.value,i=o$(),o=o$(),a=o$(),s=o$(),l=o$(),u=o$();r||(r=t.normal.value=new Float32Array(n.length));for(var c,h,d,p=e?e.length:this.vertexCount,f=0;f<p;){e?(c=e[f++],h=e[f++],d=e[f++]):(c=f++,h=f++,d=f++),s$(i,n[3*c],n[3*c+1],n[3*c+2]),s$(o,n[3*h],n[3*h+1],n[3*h+2]),s$(a,n[3*d],n[3*d+1],n[3*d+2]),Wq.sub(s,i,o),Wq.sub(l,o,a),Wq.cross(u,s,l),Wq.normalize(u,u);for(var g=0;g<3;g++)r[3*c+g]=u[g],r[3*h+g]=u[g],r[3*d+g]=u[g]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var n=t.texcoord0.value,r=t.position.value,i=t.tangent.value,o=t.normal.value;if(n){for(var a=[],s=[],l=0;l<e;l++)a[l]=[0,0,0],s[l]=[0,0,0];var u,c,h,d=[0,0,0],p=[0,0,0],f=this.indices,g=f?f.length:this.vertexCount;for(l=0;l<g;){f?(u=f[l++],c=f[l++],h=f[l++]):(u=l++,c=l++,h=l++);var m=n[2*u],v=n[2*c],y=n[2*h],_=n[2*u+1],x=n[2*c+1],b=n[2*h+1],w=r[3*u],S=r[3*c],T=r[3*h],M=r[3*u+1],A=r[3*c+1],C=r[3*h+1],D=r[3*u+2],E=S-w,I=T-w,L=A-M,N=C-M,P=r[3*c+2]-D,O=r[3*h+2]-D,R=v-m,k=y-m,z=x-_,B=b-_,V=1/(R*B-z*k);d[0]=(B*E-z*I)*V,d[1]=(B*L-z*N)*V,d[2]=(B*P-z*O)*V,p[0]=(R*I-k*E)*V,p[1]=(R*N-k*L)*V,p[2]=(R*O-k*P)*V,a$(a[u],a[u],d),a$(a[c],a[c],d),a$(a[h],a[h],d),a$(s[u],s[u],p),a$(s[c],s[c],p),a$(s[h],s[h],p)}var F=o$(),G=o$(),H=o$();for(l=0;l<e;l++){H[0]=o[3*l],H[1]=o[3*l+1],H[2]=o[3*l+2];var U=a[l];Wq.scale(F,H,Wq.dot(H,U)),Wq.sub(F,U,F),Wq.normalize(F,F),Wq.cross(G,H,U),i[4*l]=F[0],i[4*l+1]=F[1],i[4*l+2]=F[2],i[4*l+3]=Wq.dot(G,s[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new FZ.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,n=this.getEnabledAttributes(),r={},i=0;i<n.length;i++){r[l=n[i]]=e[l].value,e[l].init(this.indices.length)}for(var o=0,a=0;a<t.length;a++){var s=t[a];for(i=0;i<n.length;i++)for(var l,u=e[l=n[i]].value,c=e[l].size,h=0;h<c;h++)u[o*c+h]=r[l][s*c+h];t[a]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,n=this.indices;if(!t||t.length!==3*n.length){t=e.barycentric.value=new Float32Array(3*n.length);for(var r=0;r<(n?n.length:this.vertexCount/3);)for(var i=0;i<3;i++){t[3*(n?n[r++]:3*r+i)+i]=1}this.dirty()}}},applyTransform:function(e){var t=this.attributes,n=t.position.value,r=t.normal.value,i=t.tangent.value;e=e.array;var o=Uq.create();Uq.invert(o,e),Uq.transpose(o,o);var a=Wq.transformMat4,s=Wq.forEach;s(n,3,0,null,a,e),r&&s(r,3,0,null,a,o),i&&s(i,4,0,null,a,o),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];e.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});u$.STATIC_DRAW=i$.STATIC_DRAW,u$.DYNAMIC_DRAW=i$.DYNAMIC_DRAW,u$.STREAM_DRAW=i$.STREAM_DRAW,u$.AttributeBuffer=i$.AttributeBuffer,u$.IndicesBuffer=i$.IndicesBuffer,u$.Attribute=l$;var c$="uniform vec3 ",h$="uniform float ",d$="@export clay.header.",p$="@end",f$=":unconfigurable;",g$=[d$+"directional_light",c$+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+f$,c$+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+f$,p$,d$+"ambient_light",c$+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+f$,p$,d$+"ambient_sh_light",c$+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+f$,c$+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+f$,"vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}",p$,d$+"ambient_cubemap_light",c$+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+f$,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+f$,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+f$,p$,d$+"point_light",c$+"pointLightPosition[POINT_LIGHT_COUNT]"+f$,h$+"pointLightRange[POINT_LIGHT_COUNT]"+f$,c$+"pointLightColor[POINT_LIGHT_COUNT]"+f$,p$,d$+"spot_light",c$+"spotLightPosition[SPOT_LIGHT_COUNT]"+f$,c$+"spotLightDirection[SPOT_LIGHT_COUNT]"+f$,h$+"spotLightRange[SPOT_LIGHT_COUNT]"+f$,h$+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+f$,h$+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+f$,h$+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+f$,c$+"spotLightColor[SPOT_LIGHT_COUNT]"+f$,p$].join("\n");Vq.import(g$);var m$,v$,y$,_$,x$=HK.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=HK.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}}),b$=function(e,t){this.normal=e||new rK(0,1,0),this.distance=t||0};b$.prototype={constructor:b$,distanceToPoint:function(e){return Wq.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new rK);var n=this.distanceToPoint(e);return Wq.scaleAndAdd(t.array,e.array,this.normal.array,-n),t._dirty=!0,t},normalize:function(){var e=1/Wq.len(this.normal.array);Wq.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,n=this.normal.array,r=Wq.dot(t[0].array,n)>this.distance,i=1;i<8;i++)if(Wq.dot(t[i].array,n)>this.distance!=r)return!0},intersectLine:(_$=Wq.create(),function(e,t,n){var r=this.distanceToPoint(e),i=this.distanceToPoint(t);if(r>0&&i>0||r<0&&i<0)return null;var o=this.normal.array,a=this.distance,s=e.array;Wq.sub(_$,t.array,e.array),Wq.normalize(_$,_$);var l=Wq.dot(o,_$);if(0===l)return null;n||(n=new rK);var u=(Wq.dot(o,s)-a)/l;return Wq.scaleAndAdd(n.array,s,_$,-u),n._dirty=!0,n}),applyTransform:(m$=Uq.create(),v$=mK.create(),y$=mK.create(),y$[3]=1,function(e){e=e.array,Wq.scale(y$,this.normal.array,this.distance),mK.transformMat4(y$,y$,e),this.distance=Wq.dot(y$,this.normal.array),Uq.invert(m$,e),Uq.transpose(m$,m$),v$[3]=0,Wq.copy(v$,this.normal.array),mK.transformMat4(v$,v$,m$),Wq.copy(this.normal.array,v$)}),copy:function(e){Wq.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new b$;return e.copy(this),e}};var w$,S$=Wq.set,T$=Wq.copy,M$=Wq.transformMat4,A$=Math.min,C$=Math.max,D$=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new b$);this.boundingBox=new BK,this.vertices=[];for(e=0;e<8;e++)this.vertices[e]=Wq.fromValues(0,0,0)};D$.prototype={setFromProjection:function(e){var t=this.planes,n=e.array,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],g=n[12],m=n[13],v=n[14],y=n[15];S$(t[0].normal.array,a-r,c-s,f-h),t[0].distance=-(y-g),t[0].normalize(),S$(t[1].normal.array,a+r,c+s,f+h),t[1].distance=-(y+g),t[1].normalize(),S$(t[2].normal.array,a+i,c+l,f+d),t[2].distance=-(y+m),t[2].normalize(),S$(t[3].normal.array,a-i,c-l,f-d),t[3].distance=-(y-m),t[3].normalize(),S$(t[4].normal.array,a-o,c-u,f-p),t[4].distance=-(y-v),t[4].normalize(),S$(t[5].normal.array,a+o,c+u,f+p),t[5].distance=-(y+v),t[5].normalize();var _=this.boundingBox,x=this.vertices;if(0===y){var b=l/r,w=-v/(p-1),S=-v/(p+1),T=-S/l,M=-w/l;_.min.set(-T*b,-T,S),_.max.set(T*b,T,w),S$(x[0],-T*b,-T,S),S$(x[1],-T*b,T,S),S$(x[2],T*b,-T,S),S$(x[3],T*b,T,S),S$(x[4],-M*b,-M,w),S$(x[5],-M*b,M,w),S$(x[6],M*b,-M,w),S$(x[7],M*b,M,w)}else{var A=(-1-g)/r,C=(1-g)/r,D=(1-m)/l,E=(-1-m)/l,I=(-1-v)/p,L=(1-v)/p;_.min.set(Math.min(A,C),Math.min(E,D),Math.min(L,I)),_.max.set(Math.max(C,A),Math.max(D,E),Math.max(I,L));var N=_.min.array,P=_.max.array;S$(x[0],N[0],N[1],N[2]),S$(x[1],N[0],P[1],N[2]),S$(x[2],P[0],N[1],N[2]),S$(x[3],P[0],P[1],N[2]),S$(x[4],N[0],N[1],P[2]),S$(x[5],N[0],P[1],P[2]),S$(x[6],P[0],N[1],P[2]),S$(x[7],P[0],P[1],P[2])}},getTransformedBoundingBox:(w$=Wq.create(),function(e,t){var n=this.vertices,r=t.array,i=e.min,o=e.max,a=i.array,s=o.array,l=n[0];M$(w$,l,r),T$(a,w$),T$(s,w$);for(var u=1;u<8;u++)l=n[u],M$(w$,l,r),a[0]=A$(w$[0],a[0]),a[1]=A$(w$[1],a[1]),a[2]=A$(w$[2],a[2]),s[0]=C$(w$[0],s[0]),s[1]=C$(w$[1],s[1]),s[2]=C$(w$[2],s[2]);return i._dirty=!0,o._dirty=!0,e})};var E$,I$=HK.extend((function(){return{projectionMatrix:new SK,invProjectionMatrix:new SK,viewMatrix:new SK,frustum:new D$}}),(function(){this.update(!0)}),{update:function(e){HK.prototype.update.call(this,e),SK.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),SK.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){SK.copy(this.viewMatrix,e),SK.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){SK.copy(this.projectionMatrix,e),SK.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(E$=mK.create(),function(e,t){var n=void 0!==t?t:new gK,r=e.array[0],i=e.array[1];return mK.set(E$,r,i,-1,1),mK.transformMat4(E$,E$,this.invProjectionMatrix.array),mK.transformMat4(E$,E$,this.worldTransform.array),Wq.scale(n.origin.array,E$,1/E$[3]),mK.set(E$,r,i,1,1),mK.transformMat4(E$,E$,this.invProjectionMatrix.array),mK.transformMat4(E$,E$,this.worldTransform.array),Wq.scale(E$,E$,1/E$[3]),Wq.sub(n.direction.array,E$,n.origin.array),Wq.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})}),L$=Uq.create(),N$=Uq.create(),P$={};function O$(e){var t=[],n=Object.keys(e);n.sort();for(var r=0;r<n.length;r++){var i=n[r];t.push(i+" "+e[i])}var o=t.join("\n");if(P$[o])return P$[o];var a=NZ.genGUID();return P$[o]=a,a}function R$(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}R$.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},R$.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},R$.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var k$,z$,B$=HK.extend((function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new BK,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new UZ(20)}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof I$?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof x$&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof I$?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof x$&&(t=this.lights.indexOf(e))>=0&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},n=0;n<e.length;n++){var r=e[n];if(!r.invisible){var i=r.group;t[i]||(t[i]={}),t[i][r.type]=t[i][r.type]||0,t[i][r.type]++}}for(var o in this._lightNumber=t,t)this._lightProgramKeys[o]=O$(t[o]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),n={};return function e(t,r){n[t.__uid__]=r;for(var i=0;i<t._children.length;i++){e(t._children[i],r._children[i])}}(e,t),t.traverse((function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(n)),e.material&&(e.material=e.material.clone())})),t},updateRenderList:function(e,t){var n=e.__uid__,r=this._renderLists.get(n);r||(r=new R$,this._renderLists.put(n,r)),r.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var i=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,i,r,t),r.endCount(),r},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,n,r,i){if(!e.invisible)for(var o=0;o<e._children.length;o++){var a=e._children[o];if(a.isRenderable()){var s=a.isSkinnedMesh()?L$:a.worldTransform.array,l=a.geometry;Uq.multiplyAffine(N$,t.viewMatrix.array,s),(i&&!l.boundingBox||!this.isFrustumCulled(a,t,N$))&&r.add(a,a.material.transparent||n)}a._children.length>0&&this._doUpdateRenderList(a,t,n,r,i)}},isFrustumCulled:(k$=new BK,z$=new SK,function(e,t,n){var r=e.boundingBox;if(r||(r=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!r)return!1;if(z$.array=n,k$.transformFrom(r,z$),e.castShadow&&this.viewBoundingBoxLastFrame.union(k$),e.frustumCulling){if(!k$.intersectBoundingBox(t.frustum.boundingBox))return!0;z$.array=t.projectionMatrix.array,k$.max.array[2]>0&&k$.min.array[2]<0&&(k$.max.array[2]=-1e-20),k$.applyProjection(z$);var i=k$.min.array,o=k$.max.array;if(o[0]<-1||i[0]>1||o[1]<-1||i[1]>1||o[2]<-1||i[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(V$);var t=this._lightUniforms;for(var n in t)for(var r in t[n])t[n][r].value.length=0;for(var i=0;i<e.length;i++){var o=e[i];if(!o.invisible){n=o.group;for(var r in o.uniformTemplates){var a=o.uniformTemplates[r],s=a.value(o);if(null!=s){t[n]||(t[n]={}),t[n][r]||(t[n][r]={type:"",value:[]});var l=t[n][r];switch(l.type=a.type+"v",a.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+a.type)}}}}}},getLightGroups:function(){var e=[];for(var t in this._lightNumber)e.push(t);return e},getNumberChangedLightGroups:function(){var e=[];for(var t in this._lightNumber)this.isLightNumberChanged(t)&&e.push(t);return e},isLightNumberChanged:function(e){var t=this._previousLightNumber,n=this._lightNumber;for(var r in n[e]){if(!t[e])return!0;if(n[e][r]!==t[e][r])return!0}for(var r in t[e]){if(!n[e])return!0;if(n[e][r]!==t[e][r])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,n){for(var r in e){var i=e[r];if("tv"===i.type){if(!t.hasUniform(r))continue;for(var o=[],a=0;a<i.value.length;a++){var s=i.value[a],l=t.takeCurrentTextureSlot(n,s);o.push(l)}t.setUniform(n.gl,"1iv",r,o)}else t.setUniform(n.gl,i.type,r,i.value)}}return function(t,n,r){e(this._lightUniforms[n],t,r),e(this.shadowUniforms,t,r)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function V$(e,t){if(t.castShadow&&!e.castShadow)return!0}var F$=qK.isPowerOfTwo,G$=["px","nx","py","ny","pz","nz"],H$=YK.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{textureType:"textureCube",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,r=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=e.getGLExtension("EXT_texture_filter_anisotropic");(i&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(e.getGLExtension("OES_texture_half_float")||(r=zZ.FLOAT));if(this.mipmaps.length)for(var o=this.width,a=this.height,s=0;s<this.mipmaps.length;s++){var l=this.mipmaps[s];this._updateTextureData(t,l,s,o,a,n,r),o/=2,a/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,r),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,n,r,i,o,a){for(var s=0;s<6;s++){var l=G$[s],u=t.image&&t.image[l];u?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,o,a,u):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,r,i,0,o,a,t.pixels&&t.pixels[l])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?F$(this.image.px.width)&&F$(this.image.px.height):F$(this.width)&&F$(this.height)},isRenderable:function(){return this.image.px?U$(this.image.px)&&U$(this.image.nx)&&U$(this.image.py)&&U$(this.image.ny)&&U$(this.image.pz)&&U$(this.image.nz):!(!this.width||!this.height)},load:function(e,t){var n=0,r=this;return NZ.each(e,(function(e,i){var o=FZ.createImage();t&&(o.crossOrigin=t),o.onload=function(){0===--n&&(r.dirty(),r.trigger("success",r))},o.onerror=function(){n--},n++,o.src=e,r.image[i]=o})),this}});function U$(e){return e.width>0&&e.height>0}Object.defineProperty(H$.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(H$.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});var W$=I$.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=I$.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}}),X$="framebuffer",j$="renderbuffer",Y$=j$+"_width",Z$=j$+"_height",q$=j$+"_attached",K$="depthtexture_attached",$$=zZ.FRAMEBUFFER,J$=zZ.RENDERBUFFER,Q$=zZ.DEPTH_ATTACHMENT,eJ=zZ.COLOR_ATTACHMENT0,tJ=PZ.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new jK,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer($$,this._getFrameBufferGL(e)),this._boundRenderer=e;var n=this._cache;n.put("viewport",e.viewport);var r,i,o=!1;for(var a in this._textures){o=!0;var s=this._textures[a];s&&(r=s.texture.width,i=s.texture.height,this._doAttach(e,s.texture,a,s.target))}this._width=r,this._height=i,!o&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,r,i,1);var l=n.get("attached_textures");if(l)for(var a in l)if(!this._textures[a]){var u=l[a];this._doDetach(t,a,u)}if(!n.get(K$)&&this.depthBuffer){n.miss(j$)&&n.put(j$,t.createRenderbuffer());var c=n.get(j$);r===n.get(Y$)&&i===n.get(Z$)||(t.bindRenderbuffer(J$,c),t.renderbufferStorage(J$,t.DEPTH_COMPONENT16,r,i),n.put(Y$,r),n.put(Z$,i),t.bindRenderbuffer(J$,null)),n.get(q$)||(t.framebufferRenderbuffer($$,Q$,J$,c),n.put(q$,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer($$,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var n in this._textures){var r=this._textures[n];if(r){var i=r.texture;if(!i.NPOT&&i.useMipmap&&i.minFilter===YK.LINEAR_MIPMAP_LINEAR){var o="textureCube"===i.textureType?zZ.TEXTURE_CUBE_MAP:zZ.TEXTURE_2D;t.bindTexture(o,i.getWebGLTexture(e)),t.generateMipmap(o),t.bindTexture(o,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus($$)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(X$)&&t.put(X$,e.gl.createFramebuffer()),t.get(X$)},attach:function(e,t,n){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||eJ,n=n||zZ.TEXTURE_2D;var r,i=this._boundRenderer;if(i&&i.gl){var o=this._cache;o.use(i.__uid__),r=o.get("attached_textures")}var a=this._textures[t];if(!a||a.target!==n||a.texture!==e||!r||null==r[t]){var s=!0;i&&(s=this._doAttach(i,e,t,n),this.viewport||i.setViewport(0,0,e.width,e.height,1)),s&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=n)}},_doAttach:function(e,t,n,r){var i=e.gl,o=t.getWebGLTexture(e),a=this._cache.get("attached_textures");if(a&&a[n]){var s=a[n];if(s.texture===t&&s.target===r)return}var l=!0;if(((n=+n)===Q$||n===zZ.DEPTH_STENCIL_ATTACHMENT)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==zZ.DEPTH_COMPONENT&&t.format!==zZ.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l)){var u=this._cache.get(j$);u&&(i.framebufferRenderbuffer($$,Q$,J$,null),i.deleteRenderbuffer(u),this._cache.put(j$,!1)),this._cache.put(q$,!1),this._cache.put(K$,!0)}return i.framebufferTexture2D($$,n,r,o,0),a||(a={},this._cache.put("attached_textures",a)),a[n]=a[n]||{},a[n].texture=t,a[n].target=r,l},_doDetach:function(e,t,n){e.framebufferTexture2D($$,t,n,null,0);var r=this._cache.get("attached_textures");r&&r[t]&&(r[t]=null),t!==Q$&&t!==zZ.DEPTH_STENCIL_ATTACHMENT||this._cache.put(K$,!1)},detach:function(e,t){(this._textures[e]=null,this._boundRenderer)&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,n=this._cache;n.use(e.__uid__);var r=n.get(j$);r&&t.deleteRenderbuffer(r);var i=n.get(X$);i&&t.deleteFramebuffer(i),n.deleteContext(e.__uid__),this._textures={}}});tJ.DEPTH_ATTACHMENT=Q$,tJ.COLOR_ATTACHMENT0=eJ,tJ.STENCIL_ATTACHMENT=zZ.STENCIL_ATTACHMENT,tJ.DEPTH_STENCIL_ATTACHMENT=zZ.DEPTH_STENCIL_ATTACHMENT;var nJ=["px","nx","py","ny","pz","nz"],rJ=PZ.extend((function(){var e={position:new rK,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new W$({fov:90}),nx:new W$({fov:90}),py:new W$({fov:90}),ny:new W$({fov:90}),pz:new W$({fov:90}),nz:new W$({fov:90})};return t.px.lookAt(rK.POSITIVE_X,rK.NEGATIVE_Y),t.nx.lookAt(rK.NEGATIVE_X,rK.NEGATIVE_Y),t.py.lookAt(rK.POSITIVE_Y,rK.POSITIVE_Z),t.ny.lookAt(rK.NEGATIVE_Y,rK.NEGATIVE_Z),t.pz.lookAt(rK.POSITIVE_Z,rK.NEGATIVE_Y),t.nz.lookAt(rK.NEGATIVE_Z,rK.NEGATIVE_Y),e._frameBuffer=new tJ,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,n){var r=e.gl;n||t.update();for(var i=this.texture.width,o=2*Math.atan(i/(i-.5))/Math.PI*180,a=0;a<6;a++){var s=nJ[a],l=this._cameras[s];if(rK.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=o,this.shadowMapPass){l.update();var u=t.getBoundingBox();u.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}}),iJ=u$.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,n=this.attributes,r=[],i=[],o=[],a=[],s=0;s<=e;s++)for(var l=s/e,u=0;u<=t;u++){var c=u/t;if(r.push([2*c-1,2*l-1,0]),i&&i.push([c,l]),o&&o.push([0,0,1]),u<t&&s<e){var h=u+s*(t+1);a.push([h,h+1,h+t+1]),a.push([h+t+1,h+1,h+t+2])}}n.position.fromArray(r),n.texcoord0.fromArray(i),n.normal.fromArray(o),this.initIndicesFromArray(a),this.boundingBox=new BK,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}}),oJ=new SK,aJ=u$.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:sJ("px",this.depthSegments,this.heightSegments),nx:sJ("nx",this.depthSegments,this.heightSegments),py:sJ("py",this.widthSegments,this.depthSegments),ny:sJ("ny",this.widthSegments,this.depthSegments),pz:sJ("pz",this.widthSegments,this.heightSegments),nz:sJ("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],n=0,r=0;for(var i in e)n+=e[i].vertexCount,r+=e[i].indices.length;for(var o=0;o<t.length;o++)this.attributes[t[o]].init(n);this.indices=new FZ.Uint16Array(r);var a=0,s=0;for(var i in e){var l=e[i];for(o=0;o<t.length;o++)for(var u=t[o],c=l.attributes[u].value,h=l.attributes[u].size,d="normal"===u,p=0;p<c.length;p++){var f=c[p];this.inside&&d&&(f=-f),this.attributes[u].value[p+h*s]=f}var g=l.indices.length;for(p=0;p<l.indices.length;p++)this.indices[p+a]=s+l.indices[this.inside?g-p-1:p];a+=l.indices.length,s+=l.vertexCount}this.boundingBox=new BK,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function sJ(e,t,n){oJ.identity();var r=new iJ({widthSegments:t,heightSegments:n});switch(e){case"px":SK.translate(oJ,oJ,rK.POSITIVE_X),SK.rotateY(oJ,oJ,Math.PI/2);break;case"nx":SK.translate(oJ,oJ,rK.NEGATIVE_X),SK.rotateY(oJ,oJ,-Math.PI/2);break;case"py":SK.translate(oJ,oJ,rK.POSITIVE_Y),SK.rotateX(oJ,oJ,-Math.PI/2);break;case"ny":SK.translate(oJ,oJ,rK.NEGATIVE_Y),SK.rotateX(oJ,oJ,Math.PI/2);break;case"pz":SK.translate(oJ,oJ,rK.POSITIVE_Z);break;case"nz":SK.translate(oJ,oJ,rK.NEGATIVE_Z),SK.rotateY(oJ,oJ,Math.PI)}return r.applyTransform(oJ),r}Vq.import("@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end");var lJ=ZK.extend((function(){var e=new Vq({vertex:Vq.source("clay.skybox.vertex"),fragment:Vq.source("clay.skybox.fragment")}),t=new lq({shader:e,depthMask:!1});return{scene:null,geometry:new aJ,material:t,environmentMap:null,culling:!1,_dummyCamera:new W$}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skybox=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=YK.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,n){this.renderSkybox(e,n)},renderSkybox:function(e,t){var n=this._dummyCamera;n.aspect=e.getViewportAspect(),n.fov=t.fov||50,n.updateProjectionMatrix(),SK.invert(n.invProjectionMatrix,n.projectionMatrix),n.worldTransform.copy(t.worldTransform),n.viewMatrix.copy(t.viewMatrix),this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],n)}});function uJ(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var cJ=uJ("DXT1"),hJ=uJ("DXT3"),dJ=uJ("DXT5"),pJ=function(e,t){var n=new Int32Array(e,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var r,i,o=n(21),a=n[4],s=n[3],l=512&n[28],u=131072&n[2];switch(o){case cJ:r=8,i=YK.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case hJ:r=16,i=YK.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case dJ:r=16,i=YK.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var c=n[1]+4,h=l?6:1,d=1;u&&(d=Math.max(1,n[7]));for(var p=[],f=0;f<h;f++){var g=a,m=s;p[f]=new JK({width:g,height:m,format:i});for(var v=[],y=0;y<d;y++){var _=Math.max(4,g)/4*Math.max(4,m)/4*r,x=new Uint8Array(e,c,_);c+=_,g*=.5,m*=.5,v[y]=x}p[f].pixels=v[0],u&&(p[f].mipmaps=v)}if(!t)return p[0];t.width=p[0].width,t.height=p[0].height,t.format=p[0].format,t.pixels=p[0].pixels,t.mipmaps=p[0].mipmaps},fJ=String.fromCharCode;function gJ(e,t,n,r){if(e[3]>0){var i=Math.pow(2,e[3]-128-8+r);t[n+0]=e[0]*i,t[n+1]=e[1]*i,t[n+2]=e[2]*i}else t[n+0]=0,t[n+1]=0,t[n+2]=0;return t[n+3]=1,t}function mJ(e,t,n,r){for(var i,o,a=0,s=0,l=r;l>0;)if(e[s][0]=t[n++],e[s][1]=t[n++],e[s][2]=t[n++],e[s][3]=t[n++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<<a>>>0;u>0;u--)i=e[s-1],(o=e[s])[0]=i[0],o[1]=i[1],o[2]=i[2],o[3]=i[3],s++,l--;a+=8}else s++,l--,a=0;return n}function vJ(e,t,n,r){if(r<8|r>32767)return mJ(e,t,n,r);if(2!=(i=t[n++]))return mJ(e,t,n-1,r);if(e[0][1]=t[n++],e[0][2]=t[n++],i=t[n++],(e[0][2]<<8>>>0|i)>>>0!==r)return null;for(var i=0;i<4;i++)for(var o=0;o<r;){var a=t[n++];if(a>128){a=(127&a)>>>0;for(var s=t[n++];a--;)e[o++][i]=s}else for(;a--;)e[o++][i]=t[n++]}return n}var yJ=function(e,t,n){null==n&&(n=0);var r=new Uint8Array(e),i=r.length;if("#?"===function(e,t,n){for(var r="",i=t;i<n;i++)r+=fJ(e[i]);return r}(r,0,2)){for(var o=2;o<i&&("\n"!==fJ(r[o])||"\n"!==fJ(r[o+1]));o++);if(!(o>=i)){o+=2;for(var a="";o<i;o++){var s=fJ(r[o]);if("\n"===s)break;a+=s}var l=a.split(" "),u=parseInt(l[1]),c=parseInt(l[3]);if(c&&u){for(var h=o+1,d=[],p=0;p<c;p++){d[p]=[];for(var f=0;f<4;f++)d[p][f]=0}for(var g=new Float32Array(c*u*4),m=0,v=0;v<u;v++){if(!(h=vJ(d,r,h,c)))return null;for(p=0;p<c;p++)gJ(d[p],g,m,n),m+=4}return t||(t=new JK),t.width=c,t.height=u,t.pixels=g,t.type=YK.FLOAT,t}}}},_J={loadTexture:function(e,t,n,r){var i;if("function"==typeof t?(r=n=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return i=new JK({width:0,height:0,sRGB:!1}),_J._fetchTexture(e,(function(e){yJ(e,i,t.exposure),i.dirty(),n&&n(i)}),r),i;e.match(/.dds$/)||"dds"===t.fileType?(i=new JK({width:0,height:0}),_J._fetchTexture(e,(function(e){pJ(e,i),i.dirty(),n&&n(i)}),r)):((i=new JK).load(e),i.success(n),i.error(r))}else"object"==typeof e&&void 0!==e.px&&((i=new H$).load(e),i.success(n),i.error(r));return i},loadPanorama:function(e,t,n,r,i,o){var a=this;"function"==typeof r?(o=i=r,r={}):r=r||{},_J.loadTexture(t,r,(function(t){t.flipY=r.flipY||!1,a.panoramaToCubeMap(e,t,n,r),t.dispose(e),i&&i(n)}),o)},panoramaToCubeMap:function(e,t,n,r){var i=new rJ,o=new lJ({scene:new B$});return o.setEnvironmentMap(t),(r=r||{}).encodeRGBM&&o.material.define("fragment","RGBM_ENCODE"),n.sRGB=t.sRGB,i.texture=n,i.render(e,o.scene),i.texture=null,i.dispose(e),n},heightToNormal:function(e,t){var n=document.createElement("canvas"),r=n.width=e.width,i=n.height=e.height,o=n.getContext("2d");o.drawImage(e,0,0,r,i),t=t||!1;for(var a=o.getImageData(0,0,r,i),s=o.createImageData(r,i),l=0;l<a.data.length;l+=4){if(t){var u=a.data[l],c=a.data[l+1],h=a.data[l+2];if(Math.abs(u-c)+Math.abs(c-h)>20)return console.warn("Given image is not a height map"),e}var d,p,f,g;l%(4*r)==0?(d=a.data[l],f=a.data[l+4]):l%(4*r)==4*(r-1)?(d=a.data[l-4],f=a.data[l]):(d=a.data[l-4],f=a.data[l+4]),l<4*r?(p=a.data[l],g=a.data[l+4*r]):l>r*(i-1)*4?(p=a.data[l-4*r],g=a.data[l]):(p=a.data[l-4*r],g=a.data[l+4*r]),s.data[l]=d-f+127,s.data[l+1]=p-g+127,s.data[l+2]=255,s.data[l+3]=255}return o.putImageData(s,0,0),n},isHeightImage:function(e,t,n){if(!e||!e.width||!e.height)return!1;var r=document.createElement("canvas"),i=r.getContext("2d"),o=t||32;n=n||20,r.width=r.height=o,i.drawImage(e,0,0,o,o);for(var a=i.getImageData(0,0,o,o),s=0;s<a.data.length;s+=4){var l=a.data[s],u=a.data[s+1],c=a.data[s+2];if(Math.abs(l-u)+Math.abs(u-c)>n)return!1}return!0},_fetchTexture:function(e,t,n){FZ.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:n})},createChessboard:function(e,t,n,r){e=e||512,t=t||64,n=n||"black",r=r||"white";var i=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var a=o.getContext("2d");a.fillStyle=r,a.fillRect(0,0,e,e),a.fillStyle=n;for(var s=0;s<i;s++)for(var l=0;l<i;l++){(l%2?s%2:s%2-1)&&a.fillRect(s*t,l*t,t,t)}return new JK({image:o,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),new JK({image:t})}},xJ=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function bJ(e){return"_on"+e}var wJ=function(e){var t=this;this._texture=new JK({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),JK.prototype.dispose.call(this,e)}}),xJ.forEach((function(e){this[bJ(e)]=function(t){t.triangle&&this._meshes.forEach((function(n){this.dispatchEvent(e,n,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};wJ.prototype={constructor:wJ,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var n=this,r=e.getZr(),i=r.__oldRefreshImmediately||r.refreshImmediately;r.refreshImmediately=function(){i.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},r.__oldRefreshImmediately=i}else console.error("ECharts must init on canvas if it is used as texture."),t=document.createElement("canvas");this._texture.image=t,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var e=new rK,t=new rK,n=new rK,r=new pq,i=new pq,o=new pq,a=new pq,s=new rK;return function(l,u,c,h){var d=u.geometry,p=d.attributes.position,f=d.attributes.texcoord0,g=rK.dot,m=rK.cross;p.get(c[0],e.array),p.get(c[1],t.array),p.get(c[2],n.array),f.get(c[0],r.array),f.get(c[1],i.array),f.get(c[2],o.array),m(s,t,n);var v=g(e,s),y=g(h,s)/v;m(s,n,e);var _=g(h,s)/v;m(s,e,t);var x=g(h,s)/v;pq.scale(a,r,y),pq.scaleAndAdd(a,a,i,_),pq.scaleAndAdd(a,a,o,x);var b=a.x*this._chart.getWidth(),w=a.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:b,zrY:w})}}(),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(xJ.forEach((function(t){e.on(t,this[bJ(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),xJ.forEach((function(t){e.off(t,this[bJ(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}};var SJ=I$.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=I$.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});Vq.import("\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end");var TJ=new iJ,MJ=new ZK({geometry:TJ,frustumCulling:!1}),AJ=new SJ,CJ=PZ.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new Vq(Vq.source("clay.compositor.vertex"),this.fragment),t=new lq({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||zZ.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var n in this.outputs){var r=this.outputs[n];r&&t.attach(r,n)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var n=e.gl;if(t){this.bind(e,t);var r=e.getGLExtension("EXT_draw_buffers");if(r&&this.outputs){var i=[];for(var o in this.outputs)(o=+o)>=n.COLOR_ATTACHMENT0&&o<=n.COLOR_ATTACHMENT0+8&&i.push(o);r.drawBuffersEXT(i)}}this.trigger("beforerender",this,e);var a=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){a|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(a),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){MJ.material=this.material,e.renderPass([MJ],AJ)},dispose:function(e){}}),DJ={},EJ=["px","nx","py","ny","pz","nz"];DJ.prefilterEnvironmentMap=function(e,t,n,r,i){i&&r||(r=DJ.generateNormalDistribution(),i=DJ.integrateBRDF(e,r));var o=(n=n||{}).width||64,a=n.height||64,s=n.type||t.type,l=new H$({width:o,height:a,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(o,a),c=Math.log(u)/Math.log(2)+1,h=new lq({shader:new Vq({vertex:Vq.source("clay.skybox.vertex"),fragment:"#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"})});h.set("normalDistribution",r),n.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&h.define("fragment","RGBM_DECODE");var d,p=new B$;if("texture2D"===t.textureType){var f=new H$({width:o,height:a,type:s===YK.FLOAT?YK.HALF_FLOAT:s});_J.panoramaToCubeMap(e,t,f,{encodeRGBM:n.decodeRGBM}),t=f}(d=new lJ({scene:p,material:h})).material.set("environmentMap",t);var g=new rJ({texture:l});n.encodeRGBM&&(s=l.type=YK.UNSIGNED_BYTE);for(var m=new JK({width:o,height:a,type:s}),v=new tJ({depthBuffer:!1}),y=FZ[s===YK.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],_=0;_<c;_++){l.mipmaps[_]={pixels:{}},d.material.set("roughness",_/(c-1));for(var x=m.width,b=2*Math.atan(x/(x-.5))/Math.PI*180,w=0;w<EJ.length;w++){var S=new y(m.width*m.height*4);v.attach(m),v.bind(e);var T=g.getCamera(EJ[w]);T.fov=b,e.render(p,T),e.gl.readPixels(0,0,m.width,m.height,YK.RGBA,s,S),v.unbind(e),l.mipmaps[_].pixels[EJ[w]]=S}m.width/=2,m.height/=2,m.dirty()}return v.dispose(e),m.dispose(e),d.dispose(e),r.dispose(e),{environmentMap:l,brdfLookup:i,normalDistribution:r,maxMipmapLevel:c}},DJ.integrateBRDF=function(e,t){t=t||DJ.generateNormalDistribution();var n=new tJ({depthBuffer:!1}),r=new CJ({fragment:"#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"}),i=new JK({width:512,height:256,type:YK.HALF_FLOAT,wrapS:YK.CLAMP_TO_EDGE,wrapT:YK.CLAMP_TO_EDGE,minFilter:YK.NEAREST,magFilter:YK.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(i),r.render(e,n),n.dispose(e),i},DJ.generateNormalDistribution=function(e,t){for(var n=new JK({width:e=e||256,height:t=t||1024,type:YK.FLOAT,minFilter:YK.NEAREST,magFilter:YK.NEAREST,wrapS:YK.CLAMP_TO_EDGE,wrapT:YK.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(t*e*4),i=[],o=0;o<e;o++){for(var a=o/e,s=a*a,l=0;l<t;l++){var u=(l<<16|l>>>16)>>>0;u=(((16711935&(u=((252645135&(u=((858993459&(u=((1431655765&u)<<1|(2863311530&u)>>>1)>>>0))<<2|(3435973836&u)>>>2)>>>0))<<4|(4042322160&u)>>>4)>>>0))<<8|(4278255360&u)>>>8)>>>0)/4294967296;var c=Math.sqrt((1-u)/(1+(s*s-1)*u));i[l]=c}for(l=0;l<t;l++){var h=4*(l*e+o),d=(c=i[l],Math.sqrt(1-c*c)),p=l/t,f=2*Math.PI*p;r[h]=d*Math.cos(f),r[h+1]=c,r[h+2]=d*Math.sin(f),r[h+3]=1}}return n.pixels=r,n};var IJ=x$.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){if(e.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=DJ.generateNormalDistribution(),this._brdfLookup=DJ.integrateBRDF(e,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var r=DJ.prefilterEnvironmentMap(e,n,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=r.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(e)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}}),LJ=x$.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new FZ.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,n=0;n<e.coefficients.length;n++)t[n]=e.coefficients[n];return t}}}}),NJ={},PJ=["px","nx","py","ny","pz","nz"];function OJ(e,t){var n=e[0],r=e[1],i=e[2];return 0===t?1:1===t?n:2===t?r:3===t?i:4===t?n*i:5===t?r*i:6===t?n*r:7===t?3*i*i-1:n*n-r*r}var RJ={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};NJ.projectEnvironmentMap=function(e,t,n){var r;(n=n||{}).lod=n.lod||0;var i=new B$,o=64;"texture2D"===t.textureType||(o=t.image&&t.image.px?t.image.px.width:t.width),r=new lJ({scene:i,environmentMap:t});var a=Math.ceil(o/Math.pow(2,n.lod)),s=Math.ceil(o/Math.pow(2,n.lod)),l=new JK({width:a,height:s}),u=new tJ;r.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&r.material.define("fragment","RGBM_DECODE"),r.material.set("lod",n.lod);for(var c=new rJ({texture:l}),h={},d=0;d<PJ.length;d++){h[PJ[d]]=new Uint8Array(a*s*4);var p=c.getCamera(PJ[d]);p.fov=90,u.attach(l),u.bind(e),e.render(i,p),e.gl.readPixels(0,0,a,s,YK.RGBA,YK.UNSIGNED_BYTE,h[PJ[d]]),u.unbind(e)}return r.dispose(e),u.dispose(e),l.dispose(e),function(e,t,n,r){for(var i=new FZ.Float32Array(27),o=Wq.create(),a=Wq.create(),s=Wq.create(),l=0;l<9;l++){for(var u=Wq.create(),c=0;c<PJ.length;c++){for(var h=t[PJ[c]],d=Wq.create(),p=0,f=0,g=RJ[PJ[c]],m=0;m<r;m++)for(var v=0;v<n;v++){o[0]=v/(n-1)*2-1,o[1]=m/(r-1)*2-1,o[2]=-1,Wq.normalize(o,o),s[0]=o[g[0]]*g[3],s[1]=o[g[1]]*g[4],s[2]=o[g[2]]*g[5],a[0]=h[f++]/255,a[1]=h[f++]/255,a[2]=h[f++]/255;var y=h[f++]/255*8.12;a[0]*=y,a[1]*=y,a[2]*=y,Wq.scaleAndAdd(d,d,a,OJ(s,l)*-o[2]),p+=-o[2]}Wq.scaleAndAdd(u,u,d,1/p)}i[3*l]=u[0]/6,i[3*l+1]=u[1]/6,i[3*l+2]=u[2]/6}return i}(0,h,a,s)};var kJ=function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},zJ=function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?Zr(t.dataIndex)?Gr(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?Zr(t.name)?Gr(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},BJ=u$.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var e=this.heightSegments,t=this.widthSegments,n=this.attributes.position,r=this.attributes.texcoord0,i=this.attributes.normal,o=(t+1)*(e+1);n.init(o),r.init(o),i.init(o);var a,s,l,u,c,h,d,p,f,g,m,v=o>65535?Uint32Array:Uint16Array,y=this.indices=new v(t*e*6),_=this.radius,x=this.phiStart,b=this.phiLength,w=this.thetaStart,S=this.thetaLength,T=[],M=[],A=0,C=1/(_=this.radius);for(d=0;d<=e;d++)for(h=0;h<=t;h++)u=h/t,c=d/e,a=-_*Math.cos(x+u*b)*Math.sin(w+c*S),s=_*Math.cos(w+c*S),l=_*Math.sin(x+u*b)*Math.sin(w+c*S),T[0]=a,T[1]=s,T[2]=l,M[0]=u,M[1]=c,n.set(A,T),r.set(A,M),T[0]*=C,T[1]*=C,T[2]*=C,i.set(A,T),A++;var D=t+1,E=0;for(d=0;d<e;d++)for(h=0;h<t;h++)f=d*D+h,p=d*D+h+1,m=(d+1)*D+h+1,g=(d+1)*D+h,y[E++]=p,y[E++]=f,y[E++]=m,y[E++]=f,y[E++]=g,y[E++]=m;this.boundingBox=new BK,this.boundingBox.max.set(_,_,_),this.boundingBox.min.set(-_,-_,-_)}}),VJ=x$.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}}}),FJ=x$.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new rK,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=x$.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),GJ=x$.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=x$.prototype.clone.call(this);return e.range=this.range,e}}),HJ=x$.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new rK,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=x$.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}}),UJ=function(e,t,n,r){e=e||0,t=t||0,n=n||0,r=r||0,this.array=mK.fromValues(e,t,n,r),this._dirty=!0};UJ.prototype={constructor:UJ,add:function(e){return mK.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n,r){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new UJ(this.x,this.y,this.z,this.w)},copy:function(e){return mK.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return mK.dist(this.array,e.array)},distance:function(e){return mK.distance(this.array,e.array)},div:function(e){return mK.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return mK.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return mK.dot(this.array,e.array)},len:function(){return mK.len(this.array)},length:function(){return mK.length(this.array)},lerp:function(e,t,n){return mK.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return mK.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return mK.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return mK.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return mK.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return mK.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return mK.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return mK.random(this.array,e),this._dirty=!0,this},scale:function(e){return mK.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return mK.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return mK.sqrDist(this.array,e.array)},squaredDistance:function(e){return mK.squaredDistance(this.array,e.array)},sqrLen:function(){return mK.sqrLen(this.array)},squaredLength:function(){return mK.squaredLength(this.array)},sub:function(e){return mK.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return mK.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return mK.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return mK.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var WJ=Object.defineProperty;if(WJ){var XJ=UJ.prototype;WJ(XJ,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),WJ(XJ,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),WJ(XJ,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),WJ(XJ,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}UJ.add=function(e,t,n){return mK.add(e.array,t.array,n.array),e._dirty=!0,e},UJ.set=function(e,t,n,r,i){mK.set(e.array,t,n,r,i),e._dirty=!0},UJ.copy=function(e,t){return mK.copy(e.array,t.array),e._dirty=!0,e},UJ.distance=UJ.dist=function(e,t){return mK.distance(e.array,t.array)},UJ.div=function(e,t,n){return mK.divide(e.array,t.array,n.array),e._dirty=!0,e},UJ.divide=UJ.div,UJ.dot=function(e,t){return mK.dot(e.array,t.array)},UJ.len=function(e){return mK.length(e.array)},UJ.lerp=function(e,t,n,r){return mK.lerp(e.array,t.array,n.array,r),e._dirty=!0,e},UJ.min=function(e,t,n){return mK.min(e.array,t.array,n.array),e._dirty=!0,e},UJ.max=function(e,t,n){return mK.max(e.array,t.array,n.array),e._dirty=!0,e},UJ.mul=function(e,t,n){return mK.multiply(e.array,t.array,n.array),e._dirty=!0,e},UJ.multiply=UJ.mul,UJ.negate=function(e,t){return mK.negate(e.array,t.array),e._dirty=!0,e},UJ.normalize=function(e,t){return mK.normalize(e.array,t.array),e._dirty=!0,e},UJ.random=function(e,t){return mK.random(e.array,t),e._dirty=!0,e},UJ.scale=function(e,t,n){return mK.scale(e.array,t.array,n),e._dirty=!0,e},UJ.scaleAndAdd=function(e,t,n,r){return mK.scaleAndAdd(e.array,t.array,n.array,r),e._dirty=!0,e},UJ.squaredDistance=UJ.sqrDist=function(e,t){return mK.sqrDist(e.array,t.array)},UJ.squaredLength=UJ.sqrLen=function(e){return mK.sqrLen(e.array)},UJ.sub=function(e,t,n){return mK.subtract(e.array,t.array,n.array),e._dirty=!0,e},UJ.subtract=UJ.sub,UJ.transformMat4=function(e,t,n){return mK.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},UJ.transformQuat=function(e,t,n){return mK.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var jJ={create:function(){var e=new cq(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new cq(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null},adjoint:function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*s+o*l,e[1]=i*s+a*l,e[2]=r*u+o*c,e[3]=i*u+a*c,e}};jJ.mul=jJ.multiply,jJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l,e},jJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1];return e[0]=r*s,e[1]=i*s,e[2]=o*l,e[3]=a*l,e},jJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},jJ.LDU=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]};var YJ=function(){this.array=jJ.create(),this._dirty=!0};YJ.prototype={constructor:YJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new YJ).copy(this)},copy:function(e){return jJ.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return jJ.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return jJ.determinant(this.array)},identity:function(){return jJ.identity(this.array),this._dirty=!0,this},invert:function(){return jJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return jJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return jJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return jJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return jJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return jJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return jJ.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return jJ.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},YJ.adjoint=function(e,t){return jJ.adjoint(e.array,t.array),e._dirty=!0,e},YJ.copy=function(e,t){return jJ.copy(e.array,t.array),e._dirty=!0,e},YJ.determinant=function(e){return jJ.determinant(e.array)},YJ.identity=function(e){return jJ.identity(e.array),e._dirty=!0,e},YJ.invert=function(e,t){return jJ.invert(e.array,t.array),e._dirty=!0,e},YJ.mul=function(e,t,n){return jJ.mul(e.array,t.array,n.array),e._dirty=!0,e},YJ.multiply=YJ.mul,YJ.rotate=function(e,t,n){return jJ.rotate(e.array,t.array,n),e._dirty=!0,e},YJ.scale=function(e,t,n){return jJ.scale(e.array,t.array,n.array),e._dirty=!0,e},YJ.transpose=function(e,t){return jJ.transpose(e.array,t.array),e._dirty=!0,e};var ZJ={create:function(){var e=new cq(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new cq(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=n*o-r*i;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1],h=n[2],d=n[3],p=n[4],f=n[5];return e[0]=r*u+o*c,e[1]=i*u+a*c,e[2]=r*h+o*d,e[3]=i*h+a*d,e[4]=r*p+o*f+s,e[5]=i*p+a*f+l,e}};ZJ.mul=ZJ.multiply,ZJ.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*u,e[1]=i*c+a*u,e[2]=r*-u+o*c,e[3]=i*-u+a*c,e[4]=s,e[5]=l,e},ZJ.scale=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r*u,e[1]=i*u,e[2]=o*c,e[3]=a*c,e[4]=s,e[5]=l,e},ZJ.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=n[0],c=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=r*u+o*c+s,e[5]=i*u+a*c+l,e},ZJ.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)};var qJ=function(){this.array=ZJ.create(),this._dirty=!0};qJ.prototype={constructor:qJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new qJ).copy(this)},copy:function(e){return ZJ.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return ZJ.determinant(this.array)},identity:function(){return ZJ.identity(this.array),this._dirty=!0,this},invert:function(){return ZJ.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return ZJ.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return ZJ.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return ZJ.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return ZJ.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return ZJ.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return ZJ.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return ZJ.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},qJ.copy=function(e,t){return ZJ.copy(e.array,t.array),e._dirty=!0,e},qJ.determinant=function(e){return ZJ.determinant(e.array)},qJ.identity=function(e){return ZJ.identity(e.array),e._dirty=!0,e},qJ.invert=function(e,t){return ZJ.invert(e.array,t.array),e._dirty=!0,e},qJ.mul=function(e,t,n){return ZJ.mul(e.array,t.array,n.array),e._dirty=!0,e},qJ.multiply=qJ.mul,qJ.rotate=function(e,t,n){return ZJ.rotate(e.array,t.array,n),e._dirty=!0,e},qJ.scale=function(e,t,n){return ZJ.scale(e.array,t.array,n.array),e._dirty=!0,e},qJ.translate=function(e,t,n){return ZJ.translate(e.array,t.array,n.array),e._dirty=!0,e};var KJ=function(){this.array=vK.create(),this._dirty=!0};KJ.prototype={constructor:KJ,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return vK.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new KJ).copy(this)},copy:function(e){return vK.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return vK.determinant(this.array)},fromMat2d:function(e){return vK.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return vK.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return vK.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return vK.identity(this.array),this._dirty=!0,this},invert:function(){return vK.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return vK.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return vK.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return vK.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return vK.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return vK.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return vK.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return vK.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return vK.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return vK.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},KJ.adjoint=function(e,t){return vK.adjoint(e.array,t.array),e._dirty=!0,e},KJ.copy=function(e,t){return vK.copy(e.array,t.array),e._dirty=!0,e},KJ.determinant=function(e){return vK.determinant(e.array)},KJ.identity=function(e){return vK.identity(e.array),e._dirty=!0,e},KJ.invert=function(e,t){return vK.invert(e.array,t.array),e},KJ.mul=function(e,t,n){return vK.mul(e.array,t.array,n.array),e._dirty=!0,e},KJ.multiply=KJ.mul,KJ.fromMat2d=function(e,t){return vK.fromMat2d(e.array,t.array),e._dirty=!0,e},KJ.fromMat4=function(e,t){return vK.fromMat4(e.array,t.array),e._dirty=!0,e},KJ.fromQuat=function(e,t){return vK.fromQuat(e.array,t.array),e._dirty=!0,e},KJ.normalFromMat4=function(e,t){return vK.normalFromMat4(e.array,t.array),e._dirty=!0,e},KJ.rotate=function(e,t,n){return vK.rotate(e.array,t.array,n),e._dirty=!0,e},KJ.scale=function(e,t,n){return vK.scale(e.array,t.array,n.array),e._dirty=!0,e},KJ.transpose=function(e,t){return vK.transpose(e.array,t.array),e._dirty=!0,e},KJ.translate=function(e,t,n){return vK.translate(e.array,t.array,n.array),e._dirty=!0,e};var $J={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){this._animators=this._animators||[];var n;if(e){for(var r=e.split("."),i=this,o=0,a=r.length;o<a;o++)i&&(i=i[r[o]]);i&&(n=i)}else n=this;if(null==n)throw new Error("Target "+e+" not exists");var s=this._animators,l=new Ys(n,t),u=this;return l.during((function(){u.__zr&&u.__zr.refresh()})).done((function(){var e=s.indexOf(l);e>=0&&s.splice(e,1)})),s.push(l),this.__zr&&this.__zr.animation.addAnimator(l),l},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,n=t.length,r=0;r<n;r++)t[r].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}},JJ="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end";function QJ(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}Object.assign(HK.prototype,$J),Vq.import(JJ),Vq.import(Hq),Vq.import("\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"),Vq.import("@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"),Vq.import("/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),Vq.import("@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),Vq.import("@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"),Vq.import("@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end");var eQ=B$.prototype.addToScene,tQ=B$.prototype.removeFromScene;B$.prototype.addToScene=function(e){if(eQ.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},B$.prototype.removeFromScene=function(e){tQ.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},lq.prototype.setTextureImage=function(e,t,n,r){if(this.shader){var i,o,a=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(o=t)&&"none"!==o&&(i=nQ.loadTexture(t,n,r,(function(t){s.enableTexture(e),a&&a.refresh()})),s.set(e,i)),i}};var nQ={};nQ.Renderer=tK,nQ.Node=HK,nQ.Mesh=ZK,nQ.Shader=Vq,nQ.Material=lq,nQ.Texture=YK,nQ.Texture2D=JK,nQ.Geometry=u$,nQ.SphereGeometry=BJ,nQ.PlaneGeometry=iJ,nQ.CubeGeometry=aJ,nQ.AmbientLight=VJ,nQ.DirectionalLight=FJ,nQ.PointLight=GJ,nQ.SpotLight=HJ,nQ.PerspectiveCamera=W$,nQ.OrthographicCamera=SJ,nQ.Vector2=pq,nQ.Vector3=rK,nQ.Vector4=UJ,nQ.Quaternion=CK,nQ.Matrix2=YJ,nQ.Matrix2d=qJ,nQ.Matrix3=KJ,nQ.Matrix4=SK,nQ.Plane=b$,nQ.Ray=gK,nQ.BoundingBox=BK,nQ.Frustum=D$;var rQ=null;function iQ(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function oQ(e){if((e.wrapS===YK.REPEAT||e.wrapT===YK.REPEAT)&&e.image){var t=iQ(e.width),n=iQ(e.height);if(t!==e.width||n!==e.height){var r=document.createElement("canvas");r.width=t,r.height=n,r.getContext("2d").drawImage(e.image,0,0,t,n),e.image=r}}}nQ.loadTexture=function(e,t,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};for(var i=Object.keys(n).sort(),o="",a=0;a<i.length;a++)o+=i[a]+"_"+n[i[a]]+"_";var s,l=t.__textureCache=t.__textureCache||new Xa(20);if((s=e).getZr&&s.setOption){var u=e.__textureid__;if(h=l.get(o+u))h.texture.surface.setECharts(e),r&&r(h.texture);else{var c=new wJ(e);c.onupdate=function(){t.getZr().refresh()},h={texture:c.getTexture()};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_ec__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),r&&r(h.texture)}return h.texture}if(QJ(e)){var h;u=e.__textureid__;if(!(h=l.get(o+u))){h={texture:new nQ.Texture2D({image:e})};for(a=0;a<i.length;a++)h.texture[i[a]]=n[i[a]];u=e.__textureid__||"__ecgl_image__"+h.texture.__uid__,e.__textureid__=u,l.put(o+u,h),oQ(h.texture),r&&r(h.texture)}return h.texture}if(h=l.get(o+e))h.callbacks?h.callbacks.push(r):r&&r(h.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){h={callbacks:[r]};var d=_J.loadTexture(e,{exposure:n.exposure,fileType:"hdr"},(function(){d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null}));h.texture=d,l.put(o+e,h)}else{for(d=new nQ.Texture2D({image:new Image}),a=0;a<i.length;a++)d[i[a]]=n[i[a]];h={texture:d,callbacks:[r]};var p=d.image;p.onload=function(){d.image=p,oQ(d),d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null},p.crossOrigin="Anonymous",p.src=e,d.image=null!==rQ?rQ:rQ=_J.createBlank("rgba(255,255,255,0)").image,l.put(o+e,h)}return h.texture},nQ.createAmbientCubemap=function(e,t,n,r){var i=(e=e||{}).texture,o=kJ(e.exposure,1),a=new IJ({intensity:kJ(e.specularIntensity,1)}),s=new LJ({intensity:kJ(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return a.cubemap=nQ.loadTexture(i,n,{exposure:o},(function(){if(a.cubemap.flipY=!1,"production"!==process.env.NODE_ENV)var e=Date.now();if(a.prefilter(t,32),"production"!==process.env.NODE_ENV){var n=Date.now()-e;console.log("Prefilter environment map: "+n+"ms")}s.coefficients=NJ.projectEnvironmentMap(t,a.cubemap,{lod:1}),r&&r()})),{specular:a,diffuse:s}},nQ.createBlankTexture=_J.createBlank,nQ.isImage=QJ,nQ.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},nQ.parseColor=function(e,t){return e instanceof Array?(t||(t=[]),t[0]=e[0],t[1]=e[1],t[2]=e[2],e.length>3?t[3]=e[3]:t[3]=1,t):((t=is(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},nQ.directionFromAlphaBeta=function(e,t){var n=e/180*Math.PI+Math.PI/2,r=-t/180*Math.PI+Math.PI/2,i=[],o=Math.sin(n);return i[0]=o*Math.cos(r),i[1]=-Math.cos(n),i[2]=o*Math.sin(r),i},nQ.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},nQ.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],nQ.createShader=function(e){"ecgl.shadow"===e&&(e="ecgl.displayShadow");var t=Vq.source(e+".vertex"),n=Vq.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),n||console.error("Fragment shader of '%s' not exits",e);var r=new Vq(t,n);return r.name=e,r},nQ.createMaterial=function(e,t){t instanceof Array||(t=[t]);var n=nQ.createShader(e),r=new lq({shader:n});return t.forEach((function(e){"string"==typeof e&&r.define(e)})),r},nQ.setMaterialFromModel=function(e,t,n,r){t.autoUpdateTextureStatus=!1;var i=n.getModel(e+"Material"),o=i.get("detailTexture"),a=kJ(i.get("textureTiling"),1),s=kJ(i.get("textureOffset"),0);"number"==typeof a&&(a=[a,a]),"number"==typeof s&&(s=[s,s]);var l=a[0]>1||a[1]>1?nQ.Texture.REPEAT:nQ.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var c=i.get("roughness"),h=i.get("metalness");null!=h?isNaN(h)&&(t.setTextureImage("metalnessMap",h,r,u),h=kJ(i.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(t.setTextureImage("roughnessMap",c,r,u),c=kJ(i.get("roughnessAdjust"),.5)):c=.5;var d=i.get("normalTexture");t.setTextureImage("detailMap",o,r,u),t.setTextureImage("normalMap",d,r,u),t.set({roughness:c,metalness:h,detailUvRepeat:a,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",o,r,u),t.set({detailUvRepeat:a,detailUvOffset:s});else if("hatching"===e){var p=i.get("hatchingTextures")||[];p.length<6&&"production"!==process.env.NODE_ENV&&console.error("Invalid hatchingTextures.");for(var f=0;f<6;f++)t.setTextureImage("hatch"+(f+1),p[f],r,{anisotropic:8,wrapS:nQ.Texture.REPEAT,wrapT:nQ.Texture.REPEAT});t.set({detailUvRepeat:a,detailUvOffset:s})}},nQ.updateVertexAnimation=function(e,t,n,r){var i=r.get("animation"),o=r.get("animationDurationUpdate"),a=r.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(i&&t&&o>0&&t.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)n.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(o,{__percent:1}).during((function(){n.material.set("percent",n.__percent),s&&s.set("percent",n.__percent)})).done((function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(a)}else n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};var aQ=function(e,t){this.id=e,this.zr=t;try{this.renderer=new tK({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(e){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(e)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new WK({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new fd({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};function sQ(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}aQ.prototype.setUnpainted=function(){},aQ.prototype.addView=function(e){if(e.layer!==this){var t=this._viewsToDispose.indexOf(e);t>=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var n=this.zr;e.scene.traverse((function(e){e.__zr=n,e.addAnimatorsToZr&&e.addAnimatorsToZr(n)}))}},aQ.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(sQ,this),e.layer=null,this._viewsToDispose.push(e))}},aQ.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(sQ,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},aQ.prototype.resize=function(e,t){this.renderer.resize(e,t)},aQ.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},aQ.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},aQ.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},aQ.prototype.needsRefresh=function(){this.zr.refresh()},aQ.prototype.refresh=function(e){this._backgroundColor=e?nQ.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t<this.views.length;t++)this.views[t].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},aQ.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},aQ.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},aQ.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var lQ=1;function uQ(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function cQ(e,t){for(var n=0;n<t.length;n++)t[n].__used__||t[n].dispose(e)}function hQ(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function dQ(e,t,n){var r,i;e.traverse((function(e){if(e.isRenderable()){var o=e.geometry,a=e.material;if(a!==r)for(var s=a.getTextureUniforms(),l=0;l<s.length;l++){var u=s[l],c=a.uniforms[u].value;if(c)if(c instanceof YK)hQ(c,t);else if(c instanceof Array)for(var h=0;h<c.length;h++)c[h]instanceof YK&&hQ(c[h],t)}o!==i&&hQ(o,n),r=a,i=o}}));for(var o=0;o<e.lights.length;o++)e.lights[o].cubemap&&hQ(e.lights[o].cubemap,t)}aQ.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var n=!1,r=0;r<this.views.length;r++)n=this.views[r].needsAccumulate()||n;function i(r){if(t._accumulatingId&&r===t._accumulatingId){for(var o=!0,a=0;a<t.views.length;a++)o=t.views[a].isAccumulateFinished()&&n;o||(t._doRender(!0),e?i(r):pa((function(){i(r)})))}}n&&(this._accumulatingId=lQ++,e?i(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){i(t._accumulatingId)}),50))},aQ.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(uQ(this._textureList),uQ(this._geometriesList));for(var n=0;n<this.views.length;n++)dQ(this.views[n].scene,e,t);this._textureList&&(cQ(this.renderer,this._textureList),cQ(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},aQ.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(uQ(this._textureList),uQ(this._geometriesList),cQ(this.renderer,this._textureList),cQ(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)},aQ.prototype.onmousedown=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY}},aQ.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),n=t&&t.target,r=this._hovered;this._hovered=t,r&&n!==r.target&&(r.relatedTarget=n,this._dispatchEvent("mouseout",e,r),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),r&&n===r.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},aQ.prototype.onmouseup=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY}},aQ.prototype.onclick=aQ.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(t*t+n*n)>20)){e=e.event;var r=this.pickObject(e.offsetX,e.offsetY);r&&(this._dispatchEvent(e.type,e,r),this._dispatchDataEvent(e.type,e,r));var i=this._clickToSetFocusPoint(e);if(i)i.view.setDOFFocusOnPoint(i.distance)&&this.zr.refresh()}}},aQ.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,n=t.viewport,r=this.views.length-1;r>=0;r--){var i=this.views[r];if(i.hasDOF()&&i.containPoint(e.offsetX,e.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,t.viewport=i.viewport;var o=this._picking.pick(e.offsetX,e.offsetY,!0);if(o)return o.view=i,o}}t.viewport=n},aQ.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},aQ.prototype.pickObject=function(e,t){for(var n=[],r=this.renderer,i=r.viewport,o=0;o<this.views.length;o++){var a=this.views[o];a.containPoint(e,t)&&(this._picking.scene=a.scene,this._picking.camera=a.camera,r.viewport=a.viewport,this._picking.pickAll(e,t,n))}return r.viewport=i,n.sort((function(e,t){return e.distance-t.distance})),n[0]},aQ.prototype._dispatchEvent=function(e,t,n){n||(n={});var r=n.target;for(n.cancelBubble=!1,n.event=t,n.type=e,n.offsetX=t.offsetX,n.offsetY=t.offsetY;r&&(r.trigger(e,n),r=r.getParent(),!n.cancelBubble););this._dispatchToView(e,n)},aQ.prototype._dispatchDataEvent=function(e,t,n){var r=n&&n.target,i=r&&r.dataIndex,o=r&&r.seriesIndex,a=r&&r.eventData,s=!1,l=this._zrEventProxy;l.x=t.offsetX,l.y=t.offsetY,l.update();var u={target:l};const c=Ld(l);"mousemove"===e&&(null!=i?i!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(c.dataIndex=this._lastDataIndex,c.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=a&&a!==this._lastEventData&&(null!=this._lastEventData&&(c.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=a,this._lastDataIndex=i,this._lastSeriesIndex=o),c.eventData=a,c.dataIndex=i,c.seriesIndex=o,(null!=a||parseInt(i,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},aQ.prototype._dispatchToView=function(e,t){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(t.offsetX,t.offsetY)&&this.views[n].trigger(e,t)},Object.assign(aQ.prototype,EZ);var pQ=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function fQ(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,r=e[t].emphasis;n&&(e[t]=n),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r)}}function gQ(e){e&&(e instanceof Array||(e=[e]),Fr(e,(function(e){if(e.axisLabel){var t=e.axisLabel;Object.assign(t,t.textStyle),t.textStyle=null}})))}function mQ(e){this._layers={},this._zr=e}mQ.prototype.update=function(e,t){var n=this,r=t.getZr();if(r.getWidth()&&r.getHeight()){for(var i in this._layers)this._layers[i].removeViewsAll();e.eachComponent((function(n,r){if("series"!==n){var i=t.getViewOfComponentModel(r),s=r.coordinateSystem;if(i.__ecgl__){if(s){if(!s.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+r.id);l=s.viewGL}else{if(!r.viewGL)return void console.error("Can't find viewGL of component "+r.id);l=s.viewGL}var l=s.viewGL,u=o(r);u.addView(l),i.afterRender&&i.afterRender(r,e,t,u),a(i.groupGL,r.get("silent"))}}})),e.eachSeries((function(n){var r=t.getViewOfSeriesModel(n),i=n.coordinateSystem;if(r.__ecgl__){if(i&&!i.viewGL&&!r.viewGL)return void console.error("Can't find viewGL of series "+r.id);var s=i&&i.viewGL||r.viewGL,l=o(n);l.addView(s),r.afterRender&&r.afterRender(n,e,t,l),a(r.groupGL,n.get("silent"))}}))}else console.warn("Dom has no width or height");function o(e){var t;r.setSleepAfterStill(0),t=(e.coordinateSystem&&e.coordinateSystem.model,e.get("zlevel"));var i=n._layers,o=i[t];if(!o){if(o=i[t]=new aQ("gl-"+t,r),r.painter.isSingleCanvas()){o.virtual=!0;var a=new ad({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=a,r.add(a)}r.painter.insertLayer(t,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function a(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}},DS((function(e){var t=e.getZr(),n=t.painter.dispose;t.painter.dispose=function(){"function"==typeof this.eachOtherLayer&&this.eachOtherLayer((function(e){e instanceof aQ&&e.dispose()})),n.call(this)},t.painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),n=e.pixelRatio||this.dpr;t.width=this.getWidth()*n,t.height=this.getHeight()*n;var r=t.getContext("2d");r.dpr=n,r.clearRect(0,0,t.width,t.height),e.backgroundColor&&(r.fillStyle=e.backgroundColor,r.fillRect(0,0,t.width,t.height));var i,o=this.storage.getDisplayList(!0),a={},s=this;function l(e,t){var n,i=s._zlevelList;null==e&&(e=-1/0);for(var o=0;o<i.length;o++){var a=i[o],l=s._layers[a];if(!l.__builtin__&&a>e&&a<t){n=l;break}}n&&n.renderToCanvas&&(r.save(),n.renderToCanvas(r),r.restore())}for(var u={ctx:r},c=0;c<o.length;c++){var h=o[c];h.zlevel!==i&&(l(i,h.zlevel),i=h.zlevel),this._doPaintEl(h,u,!0,null,a)}return l(i,1/0),t}})),ES((function(e,t){var n=t.getZr();(n.__egl=n.__egl||new mQ(n)).update(e,t)})),AS((function(e){Fr(e.series,(function(t){kr(pQ,t.type)>=0&&(!function(e){fQ(e,"itemStyle"),fQ(e,"lineStyle"),fQ(e,"areaStyle"),fQ(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),gQ(e.xAxis3D),gQ(e.yAxis3D),gQ(e.zAxis3D),gQ(e.grid3D),fQ(e.geo3D)}));var vQ={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}},yQ={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},_Q={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}},xQ=Nv.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});Lr(xQ.prototype,vQ),Lr(xQ.prototype,yQ),Lr(xQ.prototype,_Q);var bQ=kJ,wQ={left:0,middle:1,right:2};function SQ(e){return e instanceof Array||(e=[e,e]),e}var TQ=PZ.extend((function(){return{zr:null,viewGL:null,_center:new rK,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new pq,_panVelocity:new pq,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(e){this[e]=this[e].bind(this)}),this)}),{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(e,t){var n=(t=t||{}).baseDistance||0,r=t.baseOrthoSize||1,i=e.get("projection");"perspective"!==i&&"orthographic"!==i&&"isometric"!==i&&("production"!==process.env.NODE_ENV&&console.error("Unkown projection type %s, use perspective projection instead.",i),i="perspective"),this._projection=i,this.viewGL.setProjection(i);var o=e.get("distance")+n,a=e.get("orthographicSize")+r;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(t){this[t[0]]=bQ(e.get(t[0]),t[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=r,this.maxOrthographicSize+=r;var s=e.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){l[t]=bQ(e.get(t),s&&s.get(t))}));var u=bQ(t.alpha,e.get("alpha"))||0,c=bQ(t.beta,e.get("beta"))||0,h=bQ(t.center,e.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:c,center:h,distance:o,orthographicSize:a,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(o),this.setAlpha(u),this.setBeta(c),this.setCenter(h),this.setOrthographicSize(a)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){"production"!==process.env.NODE_ENV&&(null==wQ[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==wQ[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection))},animateTo:function(e){var t=this.zr,n=this,r={},i={};return null!=e.distance&&(r.distance=this.getDistance(),i.distance=e.distance),null!=e.orthographicSize&&(r.orthographicSize=this.getOrthographicSize(),i.orthographicSize=e.orthographicSize),null!=e.alpha&&(r.alpha=this.getAlpha(),i.alpha=e.alpha),null!=e.beta&&(r.beta=this.getBeta(),i.beta=e.beta),null!=e.center&&(r.center=this.getCenter(),i.center=e.center),this._addAnimator(t.animation.animate(r).when(e.duration||1e3,i).during((function(){null!=r.alpha&&n.setAlpha(r.alpha),null!=r.beta&&n.setBeta(r.beta),null!=r.distance&&n.setDistance(r.distance),null!=r.center&&n.setCenter(r.center),null!=r.orthographicSize&&n.setOrthographicSize(r.orthographicSize),n._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),n=this._orthoSize,r=n/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-r/2,t.right=r/2,t.top=n/2,t.bottom=-n/2},_updatePan:function(e){var t=this._panVelocity,n=this._distance,r=this.getCamera(),i=r.worldTransform.y,o=r.worldTransform.x;this._center.scaleAndAdd(o,-t.x*n/200).scaleAndAdd(i,-t.y*n/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new rK,n=this._theta+Math.PI/2,r=this._phi+Math.PI/2,i=Math.sin(n);t.x=i*Math.cos(r),t.y=-Math.cos(n),t.z=i*Math.sin(r),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var n=e.len();(n*=t)<1e-4&&(n=0),e.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),n=Math.atan2(e.x,e.z);this._theta=t,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,n=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===wQ[this.rotateMouseButton]?this._mode="rotate":e.event.button===wQ[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy||this._isAnimating())){var t=SQ(this.panSensitivity),n=SQ(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var n,r=e.offsetX,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(r,i))n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var n=t.indexOf(e);n>=0&&t.splice(n,1)})),e}});Object.defineProperty(TQ.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});var MQ={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var n in t)e||!t[n].value?t[n].value=[]:t[n].value=Array.prototype.slice.call(t[n].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},AQ={vec2:dq,vec3:Wq,vec4:mK,mat2:jJ,mat2d:ZJ,mat3:vK,mat4:Uq,quat:wK},CQ=AQ.vec3,DQ=[[0,0],[1,1]],EQ=u$.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new u$.Attribute("position","float",3,"POSITION"),positionPrev:new u$.Attribute("positionPrev","float",3),positionNext:new u$.Attribute("positionNext","float",3),prevPositionPrev:new u$.Attribute("prevPositionPrev","float",3),prevPosition:new u$.Attribute("prevPosition","float",3),prevPositionNext:new u$.Attribute("prevPositionNext","float",3),offset:new u$.Attribute("offset","float",1),color:new u$.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(CQ.dist(e,t)+CQ.dist(n,t)+CQ.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(DQ)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(DQ)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=e[2],u=t[0],c=t[1],h=t[2],d=n[0],p=n[1],f=n[2],g=r[0],m=r[1],v=r[2],y=this._getCubicCurveApproxStep(e,t,n,r),_=y*y,x=_*y,b=3*y,w=3*_,S=6*_,T=6*x,M=a-2*u+d,A=s-2*c+p,C=l-2*h+f,D=3*(u-d)-a+g,E=3*(c-p)-s+m,I=3*(h-f)-l+v,L=a,N=s,P=l,O=(u-a)*b+M*w+D*x,R=(c-s)*b+A*w+E*x,k=(h-l)*b+C*w+I*x,z=M*S+D*T,B=A*S+E*T,V=C*S+I*T,F=D*T,G=E*T,H=I*T,U=0,W=0,X=Math.ceil(1/y),j=new Float32Array(3*(X+1)),Y=(j=[],0);for(W=0;W<X+1;W++)j[Y++]=L,j[Y++]=N,j[Y++]=P,L+=O,N+=R,P+=k,O+=z,R+=B,k+=V,z+=F,B+=G,V+=H,(U+=y)>1&&(L=O>0?Math.min(L,g):Math.max(L,g),N=R>0?Math.min(N,m):Math.max(N,m),P=k>0?Math.min(P,v):Math.max(P,v));return this.addPolyline(j,i,o)},addLine:function(e,t,n,r){return this.addPolyline([e,t],n,r)},addPolyline:function(e,t,n,r,i){if(e.length){var o="number"!=typeof e[0];if(null==i&&(i=o?e.length:e.length/3),!(i<2)){null==r&&(r=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var a,s,l=(o="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===i,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,p=this.attributes.offset,f=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=r;m<i;m++){if(o)a=e[m],s=l?t[m]:t;else{var v=3*m;if((a=a||[])[0]=e[v],a[1]=e[v+1],a[2]=e[v+2],l){var y=4*m;(s=s||[])[0]=t[y],s[1]=t[y+1],s[2]=t[y+2],s[3]=t[y+3]}else s=t}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<i-1&&(c.set(g+2,a),c.set(g+3,a)),m>0&&(h.set(g-2,a),h.set(g-1,a)),u.set(g,a),u.set(g+1,a),d.set(g,s),d.set(g+1,s),p.set(g,n/2),p.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,a),g++;else if(m>0){var _=3*this._triangleOffset;(f=this.indices)[_]=g-4,f[_+1]=g-3,f[_+2]=g-2,f[_+3]=g-3,f[_+4]=g-1,f[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*i;c.copy(x,x+2),c.copy(x+1,x+3),h.copy(b-1,b-3),h.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});function IQ(e,t,n,r,i,o,a){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=r,this.height=i,this.offsetX=t,this.offsetY=n,this.dpr=a,this.gap=o}function LQ(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new JK({image:t,flipY:!1});var n=this;this._zr=tu(t);var r=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){r.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new IQ(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}function NQ(){}Or(EQ.prototype,MQ),IQ.prototype={constructor:IQ,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,n){var r=e.getBoundingRect();null==t&&(t=r.width),null==n&&(n=r.height),t*=this.dpr,n*=this.dpr,this._fitElement(e,t,n);var i=this._x,o=this._y,a=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(i+t+l>a&&(i=this._x=0,o+=this._rowHeight+l,this._y=o,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,n),o+n+l>s)return null;e.x+=this.offsetX*this.dpr+i,e.y+=this.offsetY*this.dpr+o,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[i/a+u[0],o/s+u[1]],[(i+t)/a+u[0],(o+n)/s+u[1]]]},_fitElement:function(e,t,n){var r=e.getBoundingRect(),i=t/r.width,o=n/r.height;e.x=-r.x*i,e.y=-r.y*o,e.scaleX=i,e.scaleY=o,e.update()}},LQ.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,n=t*this._nodeWidth%e,r=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(r>=e)){var i=(n+this._nodeWidth)*this._dpr,o=(r+this._nodeHeight)*this._dpr;try{this._zr.resize({width:i,height:o})}catch(e){this._canvas.width=i,this._canvas.height=o}var a=new IQ(this._zr,n,r,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(a),a}"production"!==process.env.NODE_ENV&&console.error("Too much labels. Some will be ignored.")},add:function(e,t,n){if(this._coords[e.id])return"production"!==process.env.NODE_ENV&&console.warn("Element already been add"),this._coords[e.id];var r=this._getCurrentNode().add(e,t,n);if(!r){var i=this._expand();if(!i)return;r=i.add(e,t,n)}return this._coords[e.id]=r,r},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}},NQ.prototype={constructor:NQ,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new nQ.DirectionalLight({shadowBias:.005}),this.ambientLight=new nQ.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,n=this.ambientLight,r=e.getModel("light"),i=r.getModel("main"),o=r.getModel("ambient");t.intensity=i.get("intensity"),n.intensity=o.get("intensity"),t.color=nQ.parseColor(i.get("color")).slice(0,3),n.color=nQ.parseColor(o.get("color")).slice(0,3);var a=i.get("alpha")||0,s=i.get("beta")||0;t.position.setArray(nQ.directionFromAlphaBeta(a,s)),t.lookAt(nQ.Vector3.ZERO),t.castShadow=i.get("shadow"),t.shadowResolution=nQ.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(e,t,n){var r=t.getModel("light.ambientCubemap"),i=r.get("texture");if(i){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[i];if(!o){var a=this;o=this._cubemapLightsCache[i]=nQ.createAmbientCubemap(r.option,e,n,(function(){a._isSkyboxFromAmbientCubemap&&a._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,n){var r=t.get("environment"),i=this;var o=(i._skybox=i._skybox||new lJ,i._skybox);if(r&&"none"!==r)if("auto"===r)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var a=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(a),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof r&&r.colorStops||"string"==typeof r&&is(r)){this._isSkyboxFromAmbientCubemap=!1;var s=new nQ.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(s);var l=s.image=document.createElement("canvas");l.width=l.height=16,mw(l.getContext("2d"),new fd({shape:{x:0,y:0,width:16,height:16},style:{fill:r}})),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;s=nQ.loadTexture(r,n,{anisotropic:8,flipY:!1});o.setEnvironmentMap(s),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var u=t.coordinateSystem;if(this._skybox)if(!u||!u.viewGL||"auto"===r||r.match&&r.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var c=u.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[c]("fragment","SRGB_DECODE")}}};var PQ=AQ.vec3,OQ=u$.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new u$.Attribute("position","float",3,"POSITION"),normal:new u$.Attribute("normal","float",3,"NORMAL"),color:new u$.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,n=this.getQuadVertexCount()*e,r=this.getQuadTriangleCount()*e;this.vertexCount!==n&&(t.position.init(n),t.normal.init(n),t.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=PQ.create(),t=PQ.create(),n=PQ.create(),r=[0,3,1,3,2,1];return function(i,o){var a=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;PQ.sub(e,i[1],i[0]),PQ.sub(t,i[2],i[1]),PQ.cross(n,e,t),PQ.normalize(n,n);for(var u=0;u<4;u++)a.set(this._vertexOffset+u,i[u]),l.set(this._vertexOffset+u,o),s.set(this._vertexOffset+u,n);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=r[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});Or(OQ.prototype,MQ);var RQ=kJ,kQ={x:0,y:2,z:1};function zQ(e,t,n){this.rootNode=new nQ.Node;var r=new nQ.Mesh({geometry:new EQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new nQ.Mesh({geometry:new OQ,material:n,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(r),this.faceInfo=e,this.plane=new nQ.Plane,this.linesMesh=r,this.quadsMesh=i}zQ.prototype.update=function(e,t,n){var r=e.coordinateSystem,i=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,a=this.quadsMesh.geometry;o.convertToDynamicArray(!0),a.convertToDynamicArray(!0),this._updateSplitLines(o,i,e,n),this._udpateSplitAreas(a,i,e,n),o.convertToTypedArray(),a.convertToTypedArray();var s=r.getAxis(this.faceInfo[2]);!function(e,t,n,r){var i=[0,0,0],o=r<0?n.getExtentMin():n.getExtentMax();i[kQ[n.dim]]=o,e.position.setArray(i),e.rotation.identity(),t.distance=-Math.abs(o),t.normal.set(0,0,0),"x"===n.dim?(e.rotation.rotateY(r*Math.PI/2),t.normal.x=-r):"z"===n.dim?(e.rotation.rotateX(-r*Math.PI/2),t.normal.y=-r):(r>0&&e.rotation.rotateY(Math.PI),t.normal.z=-r)}(this.rootNode,this.plane,s,this.faceInfo[3])},zQ.prototype._updateSplitLines=function(e,t,n,r){var i=r.getDevicePixelRatio();t.forEach((function(r,o){var a=r.model,s=t[1-o].getExtent();if(!r.scale.isBlank()){var l=a.getModel("splitLine",n.getModel("splitLine"));if(l.get("show")){var u=l.getModel("lineStyle"),c=u.get("color"),h=RQ(u.get("opacity"),1),d=RQ(u.get("width"),1);c=Zr(c)?c:[c];for(var p=r.getTicksCoords({tickModel:l}),f=0,g=0;g<p.length;g++){var m=p[g].coord,v=nQ.parseColor(c[f%c.length]);v[3]*=h;var y=[0,0,0],_=[0,0,0];y[o]=_[o]=m,y[1-o]=s[0],_[1-o]=s[1],e.addLine(y,_,v,d*i),f++}}}}))},zQ.prototype._udpateSplitAreas=function(e,t,n,r){t.forEach((function(r,i){var o=r.model,a=t[1-i].getExtent();if(!r.scale.isBlank()){var s=o.getModel("splitArea",n.getModel("splitArea"));if(s.get("show")){var l=s.getModel("areaStyle"),u=l.get("color"),c=RQ(l.get("opacity"),1);u=Zr(u)?u:[u];for(var h=r.getTicksCoords({tickModel:s,clamp:!0}),d=0,p=[0,0,0],f=[0,0,0],g=0;g<h.length;g++){var m=h[g].coord,v=[0,0,0],y=[0,0,0];if(v[i]=y[i]=m,v[1-i]=a[0],y[1-i]=a[1],0!==g){var _=nQ.parseColor(u[d%u.length]);_[3]*=c,e.addQuad([p,v,y,f],_),p=v,f=y,d++}else p=v,f=y}}}}))};var BQ=[0,1,2,0,2,3],VQ=u$.extend((function(){return{attributes:{position:new u$.Attribute("position","float",3,"POSITION"),texcoord:new u$.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new u$.Attribute("offset","float",2),color:new u$.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,n=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==n&&(this.indices=t>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(e,t,n,r,i){var o,a,s,l;switch(null==n&&(n="left"),null==r&&(r="top"),i=i||0,n){case"left":o=i,s=t[0]+i;break;case"center":case"middle":o=-t[0]/2,s=t[0]/2;break;case"right":o=-t[0]-i,s=-i}switch(r){case"bottom":a=i,l=t[1]+i;break;case"middle":a=-t[1]/2,l=t[1]/2;break;case"top":a=-t[1]-i,l=-i}var u=4*e,c=this.attributes.offset;c.set(u,[o,l]),c.set(u+1,[s,l]),c.set(u+2,[s,a]),c.set(u+3,[o,a])},addSprite:function(e,t,n,r,i,o){var a=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,n,r,i,o);for(var s=0;s<BQ.length;s++)this.indices[3*this._faceOffset+s]=BQ[s]+a;return this._faceOffset+=2,this._vertexOffset+=4,a/4},setSprite:function(e,t,n,r,i,o,a){for(var s=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,t);var c=l.texcoord;c.set(s,[r[0][0],r[0][1]]),c.set(s+1,[r[1][0],r[0][1]]),c.set(s+2,[r[1][0],r[1][1]]),c.set(s+3,[r[0][0],r[1][1]]),this.setSpriteAlign(e,n,i,o,a)}});Or(VQ.prototype,MQ);nQ.Shader.import("@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end");var FQ=nQ.Mesh.extend((function(){return{geometry:new VQ({dynamic:!0}),material:new nQ.Material({shader:nQ.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}})),GQ=kJ,HQ={x:0,y:2,z:1};function UQ(e,t){var n=new nQ.Mesh({geometry:new EQ({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),r=new FQ;r.material.depthMask=!1;var i=new nQ.Node;i.add(n),i.add(r),this.rootNode=i,this.dim=e,this.linesMesh=n,this.labelsMesh=r,this.axisLineCoords=null,this.labelElements=[]}var WQ={x:"y",y:"x",z:"y"};UQ.prototype.update=function(e,t,n){var r=e.coordinateSystem.getAxis(this.dim),i=this.linesMesh.geometry,o=this.labelsMesh.geometry;i.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var a=r.model,s=r.getExtent(),l=n.getDevicePixelRatio(),u=a.getModel("axisLine",e.getModel("axisLine")),c=a.getModel("axisTick",e.getModel("axisTick")),h=a.getModel("axisLabel",e.getModel("axisLabel")),d=u.get("lineStyle.color");if(u.get("show")){var p=u.getModel("lineStyle"),f=[0,0,0];(T=[0,0,0])[M=HQ[r.dim]]=s[0],f[M]=s[1],this.axisLineCoords=[T,f];var g=nQ.parseColor(d),m=GQ(p.get("width"),1),v=GQ(p.get("opacity"),1);g[3]*=v,i.addLine(T,f,g,m*l)}if(c.get("show")){var y=c.getModel("lineStyle"),_=nQ.parseColor(GQ(y.get("color"),d));m=GQ(y.get("width"),1);_[3]*=GQ(y.get("opacity"),1);for(var x=r.getTicksCoords(),b=c.get("length"),w=0;w<x.length;w++){var S=x[w].coord,T=[0,0,0],M=(f=[0,0,0],HQ[r.dim]),A=HQ[WQ[r.dim]];T[M]=f[M]=S,f[A]=b,i.addLine(T,f,_,m*l)}}this.labelElements=[];l=n.getDevicePixelRatio();if(h.get("show")){x=r.getTicksCoords();var C=a.get("data"),D=h.get("margin"),E=r.getViewLabels();for(w=0;w<E.length;w++){var I=E[w].tickValue,L=E[w].formattedLabel,N=E[w].rawLabel,P=(S=r.dataToCoord(I),[0,0,0]);M=HQ[r.dim],A=HQ[WQ[r.dim]];P[M]=P[M]=S,P[A]=D;var O=h;C&&C[I]&&C[I].textStyle&&(O=new xm(C[I].textStyle,h,a.ecModel));var R=GQ(O.get("color"),d),k=new Id({style:$g(O,{text:L,fill:"function"==typeof R?R("category"===r.type?N:"value"===r.type?I+"":I,w):R,verticalAlign:"top",align:"left"})}),z=t.add(k),B=k.getBoundingRect();o.addSprite(P,[B.width*l,B.height*l],z),this.labelElements.push(k)}}if(a.get("name")){var V=a.getModel("nameTextStyle"),F=(P=[0,0,0],M=HQ[r.dim],A=HQ[WQ[r.dim]],GQ(V.get("color"),d)),G=V.get("borderColor");m=V.get("borderWidth");P[M]=P[M]=(s[0]+s[1])/2,P[A]=a.get("nameGap");k=new Id({style:$g(V,{text:a.get("name"),fill:F,stroke:G,lineWidth:m})}),z=t.add(k),B=k.getBoundingRect();o.addSprite(P,[B.width*l,B.height*l],z),k.__idx=this.labelElements.length,this.nameLabelElement=k}this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),i.convertToTypedArray(),o.convertToTypedArray()},UQ.prototype.setSpriteAlign=function(e,t,n){for(var r=n.getDevicePixelRatio(),i=this.labelsMesh.geometry,o=0;o<this.labelElements.length;o++){var a=this.labelElements[o].getBoundingRect();i.setSpriteAlign(o,[a.width*r,a.height*r],e,t)}var s=this.nameLabelElement;if(s){a=s.getBoundingRect();i.setSpriteAlign(s.__idx,[a.width*r,a.height*r],e,t),i.dirty()}this.textAlign=e,this.textVerticalAlign=t};var XQ="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",jQ=kJ;nQ.Shader.import(XQ);var YQ={x:0,y:2,z:1},ZQ=Cx.extend({type:"grid3D",__ecgl__:!0,init:function(e,t){var n=new nQ.Material({shader:nQ.createShader("ecgl.color"),depthMask:!1,transparent:!0}),r=new nQ.Material({shader:nQ.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new nQ.Node,this._control=new TQ({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(e){var t=new zQ(e,r,n);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new UQ(e,r);return this.groupGL.add(t.rootNode),t}),this);var i=t.getDevicePixelRatio();this._axisLabelSurface=new LQ({width:256,height:256,devicePixelRatio:i}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new nQ.Mesh({geometry:new EQ({useNativeLine:!1}),material:r,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new LQ({width:128,height:128,devicePixelRatio:i}),this._axisPointerLabelsMesh=new FQ({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new nQ.Node,this._sceneHelper=new NQ,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,n){this._model=e,this._api=n;var r=e.coordinateSystem;r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._axisLabelSurface.clear(),i.off("update"),e.get("show")&&(this._faces.forEach((function(r){r.update(e,t,n)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,n)}),this)),i.on("update",this._onCameraChange.bind(this,e,n),this),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},showAxisPointer:function(e,t,n,r){this._doShowAxisPointer(),this._updateAxisPointer(r.value)},hideAxisPointer:function(e,t,n,r){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,n=this._model.coordinateSystem,r=n.viewGL,i=r.castRay(e.offsetX,e.offsetY,new nQ.Ray),o=0;o<this._faces.length;o++){var a=this._faces[o];if(!a.rootNode.invisible){a.plane.normal.dot(r.camera.worldTransform.z)<0&&a.plane.normal.negate();var s=i.intersectPlane(a.plane);if(s){var l=n.getAxis(a.faceInfo[0]),u=n.getAxis(a.faceInfo[1]),c=YQ[a.faceInfo[0]],h=YQ[a.faceInfo[1]];l.contain(s.array[c])&&u.contain(s.array[h])&&(t=s)}}}if(t){var d=n.pointToData(t.array,[],!0);this._updateAxisPointer(d),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new nQ.Vector3;e.update();for(var n=0;n<this._faces.length/2;n++){for(var r=[],i=0;i<2;i++){this._faces[2*n+i].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),r[i]=t.z}var o=r[0]>r[1]?0:1,a=this._faces[2*n+o],s=this._faces[2*n+1-o];a.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),n=e.getAxis("y"),r=e.getAxis("z"),i=r.getExtentMax(),o=r.getExtentMin(),a=t.getExtentMin(),s=t.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,p=this._faces,f=p[4].rootNode.invisible?u:l,g=p[2].rootNode.invisible?i:o,m=p[0].rootNode.invisible?a:s,v=p[2].rootNode.invisible?i:o,y=p[0].rootNode.invisible?s:a,_=p[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),p[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),p[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),p[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,g,f),h.position.set(m,v,0),d.position.set(y,0,_),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new nQ.Vector4,new nQ.Vector4],n=new nQ.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(r){var i=r.axisLineCoords;r.labelsMesh.geometry;for(var o=0;o<t.length;o++)t[o].setArray(i[o]),t[o].w=1,t[o].transformMat4(r.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[o].x/=t[o].w,t[o].y/=t[o].w;var a,s,l=t[1].x-t[0].x,u=t[1].y-t[0].y,c=(t[1].x+t[0].x)/2,h=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(a="center",s=h>n.y?"bottom":"top"):(s="middle",a=c>n.x?"left":"right"),r.setSpriteAlign(a,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,n=t.dataToPoint(e),r=this._axisPointerLineMesh.geometry,i=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function a(e){return kJ(e.model.get("axisPointer.show"),i.get("show"))}function s(e){var t=e.model.getModel("axisPointer",i).getModel("lineStyle"),n=nQ.parseColor(t.get("color")),r=jQ(t.get("width"),1),o=jQ(t.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:r}}r.convertToDynamicArray(!0);for(var l=0;l<this._faces.length;l++){var u=this._faces[l];if(!u.rootNode.invisible){for(var c=u.faceInfo,h=c[3]<0?t.getAxis(c[2]).getExtentMin():t.getAxis(c[2]).getExtentMax(),d=YQ[c[2]],p=0;p<2;p++){var f=c[p],g=c[1-p],m=t.getAxis(f),v=t.getAxis(g);if(a(m)){var y=YQ[f],_=YQ[g];(w=[0,0,0])[y]=(b=[0,0,0])[y]=n[y],w[d]=b[d]=h,w[_]=v.getExtentMin(),b[_]=v.getExtentMax();var x=s(m);r.addLine(w,b,x.color,x.lineWidth*o)}}if(a(t.getAxis(c[2]))){var b,w=n.slice();(b=n.slice())[d]=h;x=s(t.getAxis(c[2]));r.addLine(w,b,x.color,x.lineWidth*o)}}}r.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,n=this._axisPointerLabelsMesh,r=this._axisPointerLabelsSurface,i=t.coordinateSystem,o=t.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),r.clear();var a={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,s){var l=i.getAxis(t.dim),u=l.model.getModel("axisPointer",o),c=u.getModel("label"),h=u.get("lineStyle.color");if(c.get("show")&&u.get("show")){var d=e[s],p=c.get("formatter"),f=l.scale.getLabel({value:d});if(null!=p)f=p(f,e);else if("interval"===l.scale.type||"log"===l.scale.type){var g=pu(l.scale.getTicks()[0]);f=d.toFixed(g+2)}var m=c.get("color"),v=new Id({style:$g(c,{text:f,fill:m||h,align:"left",verticalAlign:"top"})}),y=r.add(v),_=v.getBoundingRect(),x=this._api.getDevicePixelRatio(),b=t.rootNode.position.toArray();b[YQ[a[t.dim]]]+=(t.flipped?-1:1)*c.get("margin"),b[YQ[t.dim]]=l.dataToCoord(e[s]),n.geometry.addSprite(b,[_.width*x,_.height*x],y,t.textAlign,t.textVerticalAlign)}}),this),r.getZr().refreshImmediately(),n.material.set("uvScale",r.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function qQ(e){gI.call(this,e),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}function KQ(e,t,n){yA.call(this,e,t,n)}qQ.prototype={constructor:qQ,model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],n),t[2]=this.getAxis("y").dataToCoord(e[1],n),t[1]=this.getAxis("z").dataToCoord(e[2],n),t},pointToData:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],n),t[1]=this.getAxis("y").coordToData(e[2],n),t[2]=this.getAxis("z").coordToData(e[1],n),t}},zr(qQ,gI),KQ.prototype={constructor:KQ,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},zr(KQ,yA);var $Q=function(){this._pool={},this._allocatedTextures=[]};$Q.prototype={constructor:$Q,get:function(e){var t=e0(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var n=this._pool[t];if(!n.length){var r=new JK(e);return this._allocatedTextures.push(r),r}return n.pop()},put:function(e){var t=e0(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var JQ={width:512,height:512,type:zZ.UNSIGNED_BYTE,format:zZ.RGBA,wrapS:zZ.CLAMP_TO_EDGE,wrapT:zZ.CLAMP_TO_EDGE,minFilter:zZ.LINEAR_MIPMAP_LINEAR,magFilter:zZ.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},QQ=Object.keys(JQ);function e0(e){NZ.defaultsWithPropList(e,JQ,QQ),function(e){var t=(n=e.width,r=e.height,!(n&n-1||r&r-1));var n,r;e.format===zZ.DEPTH_COMPONENT&&(e.useMipmap=!1);t&&e.useMipmap||(e.minFilter==zZ.NEAREST_MIPMAP_NEAREST||e.minFilter==zZ.NEAREST_MIPMAP_LINEAR?e.minFilter=zZ.NEAREST:e.minFilter!=zZ.LINEAR_MIPMAP_LINEAR&&e.minFilter!=zZ.LINEAR_MIPMAP_NEAREST||(e.minFilter=zZ.LINEAR));t||(e.wrapS=zZ.CLAMP_TO_EDGE,e.wrapT=zZ.CLAMP_TO_EDGE)}(e);for(var t="",n=0;n<QQ.length;n++){t+=e[QQ[n]].toString()}return t}var t0=["px","nx","py","ny","pz","nz"];function n0(e,t,n){return"alphaMap"===n?e.material.get("diffuseMap"):"alphaCutoff"===n?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:"uvRepeat"===n?e.material.get("uvRepeat"):"uvOffset"===n?e.material.get("uvOffset"):t.get(n)}function r0(e,t){var n=e.material,r=t.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)}Vq.import("@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nuniform vec2 uvRepeat = vec2(1.0, 1.0);\nuniform vec2 uvOffset = vec2(0.0, 0.0);\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n v_ViewPosition = worldViewProjection * P;\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end");var i0,o0,a0,s0,l0,u0,c0,h0=PZ.extend((function(){return{softShadow:h0.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new tJ,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new $Q}}),(function(){this._gaussianPassH=new CJ({fragment:Vq.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new CJ({fragment:Vq.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new CJ({fragment:Vq.source("clay.sm.debug_depth")})}),{render:function(e,t,n,r){n||(n=t.getMainCamera()),this.trigger("beforerender",this,e,t,n),this._renderShadowPass(e,t,n,r),this.trigger("afterrender",this,e,t,n)},renderDebug:function(e,t){e.saveClear();var n=e.viewport,r=0,i=t||n.width/4,o=i;for(var a in this.softShadow===h0.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[a];e.setViewport(r,0,i*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),r+=i*s.width/s.height}e.setViewport(n),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===h0.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?t.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var n=this;t.traverse((function(t){t.isRenderable()&&n._updateReceivers(e,t)}));for(var r=0;r<t.lights.length;r++){var i=t.lights[r];i.castShadow&&!i.invisible&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(e,t,n,r){for(var i in this._shadowMapNumber)this._shadowMapNumber[i]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var o=e.gl;if(r||t.update(),n&&n.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,o.enable(o.DEPTH_TEST),o.depthMask(!0),o.disable(o.BLEND),o.clearColor(1,1,1,1);for(var a,s=[],l=[],u=[],c=[],h=[],d=[],p=0;p<this._lightsCastShadow.length;p++){var f=this._lightsCastShadow[p];if("DIRECTIONAL_LIGHT"===f.type){if(a){console.warn("Only one direectional light supported with shadow cascade");continue}if(f.shadowCascade>4){console.warn("Support at most 4 cascade");continue}f.shadowCascade>1&&(a=f),this.renderDirectionalLightShadow(e,t,n,f,h,c,u)}else"SPOT_LIGHT"===f.type?this.renderSpotLightShadow(e,t,f,l,s):"POINT_LIGHT"===f.type&&this.renderPointLightShadow(e,t,f,d);this._shadowMapNumber[f.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(p=0;p<this._receivers.length;p++){(y=this._receivers[p].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}}for(p=0;p<this._receivers.length;p++){var y=this._receivers[p].material;a?y.define("fragment","SHADOW_CASCADE",a.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=t.shadowUniforms;if(u.length>0){var x=u.map(T);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:c,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},a){var b=h.slice(),w=h.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),c.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var S=s.map(T);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function T(e){return e.height}},renderDirectionalLightShadow:(i0=new D$,o0=new SK,a0=new BK,s0=new SK,l0=new SK,u0=new SK,c0=new SK,function(e,t,n,r,i,o,a){var s=this._getDepthMaterial(r),l={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:r0,getUniform:n0,ifRender:function(e){return e.castShadow},sortCompare:tK.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var u=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(u).applyTransform(n.viewMatrix)}var c=Math.min(-t.viewBoundingBoxLastFrame.min.z,n.far),h=Math.max(-t.viewBoundingBoxLastFrame.max.z,n.near),d=this._getDirectionalLightCamera(r,t,n),p=u0.array;c0.copy(d.projectionMatrix),Uq.invert(l0.array,d.worldTransform.array),Uq.multiply(l0.array,l0.array,n.worldTransform.array),Uq.multiply(p,c0.array,l0.array);for(var f=[],g=n instanceof W$,m=(n.near+n.far)/(n.near-n.far),v=2*n.near*n.far/(n.near-n.far),y=0;y<=r.shadowCascade;y++){var _=h*Math.pow(c/h,y/r.shadowCascade),x=h+(c-h)*y/r.shadowCascade,b=_*r.cascadeSplitLogFactor+x*(1-r.cascadeSplitLogFactor);f.push(b),i.push(-(-b*m+v)/-b)}var w=this._getTexture(r,r.shadowCascade);a.push(w);var S=e.viewport,T=e.gl;for(this._frameBuffer.attach(w),this._frameBuffer.bind(e),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT),y=0;y<r.shadowCascade;y++){var M=f[y],A=f[y+1];g?Uq.perspective(o0.array,n.fov/180*Math.PI,n.aspect,M,A):Uq.ortho(o0.array,n.left,n.right,n.bottom,n.top,M,A),i0.setFromProjection(o0),i0.getTransformedBoundingBox(a0,l0),a0.applyProjection(c0);var C=a0.min.array,D=a0.max.array;C[0]=Math.max(C[0],-1),C[1]=Math.max(C[1],-1),D[0]=Math.min(D[0],1),D[1]=Math.min(D[1],1),s0.ortho(C[0],D[0],C[1],D[1],1,-1),d.projectionMatrix.multiplyLeft(s0);var E=r.shadowResolution||512;e.setViewport((r.shadowCascade-y-1)*E,0,E,E,1);var I=t.updateRenderList(d);e.renderPass(I.opaque,d,l),this.softShadow===h0.VSM&&this._gaussianFilter(e,w,w.width);var L=new SK;L.copy(d.viewMatrix).multiplyLeft(d.projectionMatrix),o.push(L.array),d.projectionMatrix.copy(c0)}this._frameBuffer.unbind(e),e.setViewport(S)}),renderSpotLightShadow:function(e,t,n,r,i){var o=this._getTexture(n),a=this._getSpotLightCamera(n),s=e.gl;this._frameBuffer.attach(o),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(n),u={getMaterial:function(e){return e.shadowDepthMaterial||l},isMaterialChanged:r0,getUniform:n0,ifRender:function(e){return e.castShadow},sortCompare:tK.opaqueSortCompare},c=t.updateRenderList(a);e.renderPass(c.opaque,a,u),this._frameBuffer.unbind(e),this.softShadow===h0.VSM&&this._gaussianFilter(e,o,o.width);var h=new SK;h.copy(a.worldTransform).invert().multiplyLeft(a.projectionMatrix),i.push(o),r.push(h.array)},renderPointLightShadow:function(e,t,n,r){var i=this._getTexture(n),o=e.gl;r.push(i);var a=this._getDepthMaterial(n),s={getMaterial:function(e){return e.shadowDepthMaterial||a},getUniform:n0,sortCompare:tK.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new BK,c=n.getWorldPosition().array,h=new BK,d=n.range;h.min.setArray(c),h.max.setArray(c);var p=new rK(d,d,d);h.max.add(p),h.min.sub(p);var f={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};t.traverse((function(e){if(e.isRenderable()&&e.castShadow){var t=e.geometry;if(!t.boundingBox){for(var n=0;n<t0.length;n++)l[t0[n]].push(e);return}if(u.transformFrom(t.boundingBox,e.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(n=0;n<t0.length;n++)f[t0[n]]=!1;for(n=0;n<8;n++){var r=u.vertices[n],i=r[0]-c[0],o=r[1]-c[1],a=r[2]-c[2],s=Math.abs(i),d=Math.abs(o),p=Math.abs(a);s>d?s>p?f[i>0?"px":"nx"]=!0:f[a>0?"pz":"nz"]=!0:d>p?f[o>0?"py":"ny"]=!0:f[a>0?"pz":"nz"]=!0}for(n=0;n<t0.length;n++)f[t0[n]]&&l[t0[n]].push(e)}}));for(var g=0;g<6;g++){var m=t0[g],v=this._getPointLightCamera(n,m);this._frameBuffer.attach(i,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+g),this._frameBuffer.bind(e),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),e.renderPass(l[m],v,s)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],n="POINT_LIGHT"===e.type;if(!t){var r=n?"clay.sm.distance.":"clay.sm.depth.";t=new lq({precision:this.precision,shader:new Vq(Vq.source(r+"vertex"),Vq.source(r+"fragment"))}),this._lightMaterials[e.__uid__]=t}return null!=e.shadowSlopeScale&&t.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&t.setUniform("bias",e.shadowBias),this.softShadow===h0.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),n&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,n){var r={width:n,height:n,type:YK.FLOAT},i=this._texturePool.get(r);this._frameBuffer.attach(i),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",i),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(i)},_getTexture:function(e,t){var n=e.__uid__,r=this._textures[n],i=e.shadowResolution||512;return t=t||1,r||((r="POINT_LIGHT"===e.type?new H$:new JK).width=i*t,r.height=i,this.softShadow===h0.VSM?(r.type=YK.FLOAT,r.anisotropic=4):(r.minFilter=zZ.NEAREST,r.magFilter=zZ.NEAREST,r.useMipmap=!1),this._textures[n]=r),r},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new W$,nx:new W$,py:new W$,ny:new W$,pz:new W$,nz:new W$});var n=this._lightCameras.point[t];switch(n.far=e.range,n.fov=90,n.position.set(0,0,0),t){case"px":n.lookAt(rK.POSITIVE_X,rK.NEGATIVE_Y);break;case"nx":n.lookAt(rK.NEGATIVE_X,rK.NEGATIVE_Y);break;case"py":n.lookAt(rK.POSITIVE_Y,rK.POSITIVE_Z);break;case"ny":n.lookAt(rK.NEGATIVE_Y,rK.NEGATIVE_Z);break;case"pz":n.lookAt(rK.POSITIVE_Z,rK.NEGATIVE_Y);break;case"nz":n.lookAt(rK.NEGATIVE_Z,rK.NEGATIVE_Y)}return e.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var e=new SK,t=new BK,n=new BK;return function(r,i,o){this._lightCameras.directional||(this._lightCameras.directional=new SJ);var a=this._lightCameras.directional;t.copy(i.viewBoundingBoxLastFrame),t.intersection(o.frustum.boundingBox),a.position.copy(t.min).add(t.max).scale(.5).transformMat4(o.worldTransform),a.rotation.copy(r.rotation),a.scale.copy(r.scale),a.updateWorldTransform(),SK.invert(e,a.worldTransform),SK.multiply(e,e,o.worldTransform),n.copy(t).applyTransform(e);var s=n.min.array,l=n.max.array;return a.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(a.worldTransform),a.near=0,a.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?a.far*=4:a.far+=this.lightFrustumBias,a.left=s[0],a.right=l[0],a.top=l[1],a.bottom=s[1],a.update(!0),a}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new W$);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),Uq.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var n in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[n].dispose(t);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var r=0;r<this._receivers.length;r++){var i=this._receivers[r];if(i.material){var o=i.material;o.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),o.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),o.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),o.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});h0.VSM=1,h0.PCF=2;var d0=PZ.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n=o.width instanceof Function?o.width.call(this,t):o.width,r=o.height instanceof Function?o.height.call(this,t):o.height,a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),a.width=n,a.height=r,a},setParameter:function(e,t){},getParameter:function(e){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var n=this.outputs[t];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},link:function(e,t,n){this.inputLinks[e]={node:t,pin:n},t.outputLinks[n]||(t.outputLinks[n]=[]),t.outputLinks[n].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var n=this.inputLinks[t];n.node.updateReference(n.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks){if(this._outputReferences[e]>0)this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}}),p0=PZ.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t=this.nodes[e];if(t.inputs)for(var n in t.inputs)if(t.inputs[n])if(!t.pass||t.pass.material.isUniformEnabled(n)){var r=t.inputs[n],i=this.findPin(r);i?t.link(n,i.node,i.pin):"string"==typeof r?console.warn("Node "+r+" not exist"):console.warn("Pin of "+r.node+"."+r.pin+" not exist")}else console.warn("Pin "+t.name+"."+n+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof d0)&&(e={node:e}),"string"==typeof e.node)for(var n=0;n<this.nodes.length;n++){var r=this.nodes[n];r.name===e.node&&(t=r)}else t=e.node;if(t){var i=e.pin;if(i||t.outputs&&(i=Object.keys(t.outputs)[0]),t.outputs[i])return{node:t,pin:i}}}}),f0=p0.extend((function(){return{_outputs:[],_texturePool:new $Q,_frameBuffer:new tJ({depthBuffer:!1})}}),{addNode:function(e){p0.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(e,t);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}}),g0=d0.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new tJ}),{render:function(e){this._rendering=!0;var t,n=e.gl;if(this.trigger("beforerender"),this.outputs){var r=this.frameBuffer;for(var i in this.outputs){var o=this.updateParameter(i,e),a=this.outputs[i],s=this._compositor.allocateTexture(o);this._outputTextures[i]=s,"string"==typeof(c=a.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),r.attach(s,c)}r.bind(e);var l=e.getGLExtension("EXT_draw_buffers");if(l){var u=[];for(var c in this.outputs)(c=parseInt(c))>=n.COLOR_ATTACHMENT0&&c<=n.COLOR_ATTACHMENT0+8&&u.push(c);l.drawBuffersEXT(u)}e.saveClear(),e.clearBit=zZ.DEPTH_BUFFER_BIT|zZ.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),r.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}}),m0=d0.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),v0=d0.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new CJ({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var n=e.gl;for(var r in this.inputLinks){var i=(h=this.inputLinks[r]).node.getOutput(e,h.pin);this.pass.setUniform(r,i)}if(this.outputs){this.pass.outputs={};var o={};for(var a in this.outputs){var s=this.updateParameter(a,e);isNaN(s.width)&&this.updateParameter(a,e);var l=this.outputs[a],u=this._compositor.allocateTexture(s);this._outputTextures[a]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),o[c]=u}for(var c in this._compositor.getFrameBuffer().bind(e),o)this._compositor.getFrameBuffer().attach(o[c],c);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var r in this.inputLinks){var h;(h=this.inputLinks[r]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var n,r,i=this.outputs[e],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n="function"==typeof o.width?o.width.call(this,t):o.width,r="function"==typeof o.height?o.height.call(this,t):o.height,n=Math.ceil(n),r=Math.ceil(r),a.width===n&&a.height===r||this._outputTextures[e]&&this._outputTextures[e].dispose(t),a.width=n,a.height=r,a},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){(this._outputReferences[e]--,0===this._outputReferences[e])&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){d0.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),y0="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",_0="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",x0="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",b0="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",w0="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",S0="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",T0="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",M0="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",A0="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";!function(e){e.import("@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"),e.import(y0),e.import("@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"),e.import(_0),e.import("@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"),e.import(x0),e.import(b0),e.import(w0),e.import(S0),e.import(T0),e.import("@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"),e.import(M0),e.import(A0)}(Vq);var C0=/^#source\((.*?)\)/;function D0(e,t){var n=new f0;t=t||{};var r={textures:{},parameters:{}};for(var i in e.parameters){var o=e.parameters[i];r.parameters[i]=N0(o)}return function(e,t,n,r){if(!e.textures)return void r({});var i={},o=0,a=!1,s=n.textureRootPath;NZ.each(e.textures,(function(e,t){var n,l=e.path,u=N0(e.parameters);if(Array.isArray(l)&&6===l.length)s&&(l=l.map((function(e){return NZ.relative2absolute(e,s)}))),n=new H$(u);else{if("string"!=typeof l)return;s&&(l=NZ.relative2absolute(l,s)),n=new JK(u)}n.load(l),o++,n.once("success",(function(){i[t]=n,0===--o&&(r(i),a=!0)}))})),0!==o||a||r(i)}(e,0,t,(function(i){r.textures=i,function(i,o){for(var a=0;a<e.nodes.length;a++){var s=E0(e.nodes[a],r,t);s&&n.addNode(s)}}()})),n}function E0(e,t,n){var r,i,o,a,s=e.type||"filter";if("filter"===s){var l=e.shader.trim(),u=C0.exec(l);if(u?r=Vq.source(u[1].trim()):"#"===l.charAt(0)&&(r=t.shaders[l.substr(1)]),r||(r=l),!r)return}if(e.inputs)for(var c in i={},e.inputs)"string"==typeof e.inputs[c]?i[c]=e.inputs[c]:i[c]={node:e.inputs[c].node,pin:e.inputs[c].pin};if(e.outputs)for(var c in o={},e.outputs){var h=e.outputs[c];o[c]={},null!=h.attachment&&(o[c].attachment=h.attachment),null!=h.keepLastFrame&&(o[c].keepLastFrame=h.keepLastFrame),null!=h.outputLastFrame&&(o[c].outputLastFrame=h.outputLastFrame),h.parameters&&(o[c].parameters=N0(h.parameters))}if(a="scene"===s?new g0({name:e.name,scene:n.scene,camera:n.camera,outputs:o}):"texture"===s?new m0({name:e.name,outputs:o}):new v0({name:e.name,shader:r,inputs:i,outputs:o})){if(e.parameters)for(var c in e.parameters){"string"==typeof(d=e.parameters[c])?"#"===(d=d.trim()).charAt(0)?d=t.textures[d.substr(1)]:a.on("beforerender",P0(c,O0(d))):"function"==typeof d&&a.on("beforerender",d),a.setParameter(c,d)}if(e.defines&&a.pass)for(var c in e.defines){var d=e.defines[c];a.pass.material.define("fragment",c,d)}}return a}function I0(e,t){return e}function L0(e,t){return t}function N0(e){var t={};if(!e)return t;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var r=e[n];null!=r&&("string"==typeof r&&(r=YK[r]),t[n]=r)}));var n=e.scale||1;return["width","height"].forEach((function(r){if(null!=e[r]){var i=e[r];"string"==typeof i?(i=i.trim(),t[r]=function(e,t,n){return n=n||1,function(e){var r=e.getDevicePixelRatio(),i=e.getWidth()*n,o=e.getHeight()*n;return t(i,o,r)}}(0,O0(i),n)):t[r]=i}})),t.width||(t.width=I0),t.height||(t.height=L0),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t}function P0(e,t){return function(n){var r=n.getDevicePixelRatio(),i=n.getWidth(),o=n.getHeight(),a=t(i,o,r);this.setParameter(e,a)}}function O0(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var n=new Function("width","height","dpr","return "+t[1]);return n(1,1),n}catch(e){throw new Error("Invalid expression.")}}function R0(e,t){for(var n=0,r=1/t,i=e;i>0;)n+=r*(i%t),i=Math.floor(i/t),r/=t;return n}function k0(e){for(var t=new Uint8Array(e*e*4),n=0,r=new rK,i=0;i<e;i++)for(var o=0;o<e;o++)r.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[n++]=255*(.5*r.x+.5),t[n++]=255*(.5*r.y+.5),t[n++]=0,t[n++]=255;return t}function z0(e){return new JK({pixels:k0(e),wrapS:YK.REPEAT,wrapT:YK.REPEAT,width:e,height:e})}function B0(e,t,n){var r=new Float32Array(3*e);t=t||0;for(var i=0;i<e;i++){var o=R0(i+t,2)*(n?1:2)*Math.PI,a=R0(i+t,3)*Math.PI,s=Math.random(),l=Math.cos(o)*Math.sin(a)*s,u=Math.cos(a)*s,c=Math.sin(o)*Math.sin(a)*s;r[3*i]=l,r[3*i+1]=u,r[3*i+2]=c}return r}function V0(e){e=e||{},this._ssaoPass=new CJ({fragment:Vq.source("ecgl.ssao.estimate")}),this._blurPass=new CJ({fragment:Vq.source("ecgl.ssao.blur")}),this._framebuffer=new tJ({depthBuffer:!1}),this._ssaoTexture=new JK,this._blurTexture=new JK,this._blurTexture2=new JK,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}Vq.import("@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"),V0.prototype.setDepthTexture=function(e){this._depthTex=e},V0.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},V0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._ssaoPass,a=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new SK;SK.transpose(s,t.worldTransform),o.setUniform("projection",t.projectionMatrix.array),o.setUniform("projectionInv",t.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,c=this._blurTexture2;l.width=r/2,l.height=i/2,u.width=r,u.height=i,c.width=r,c.height=i,this._framebuffer.attach(l),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),o.render(e),a.setUniform("textureSize",[r/2,i/2]),a.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(u),a.setUniform("direction",0),a.setUniform("ssaoTexture",l),a.render(e),this._framebuffer.attach(c),a.setUniform("textureSize",[r,i]),a.setUniform("direction",1),a.setUniform("ssaoTexture",u),a.render(e),this._framebuffer.unbind(e);var h=e.clearColor;e.gl.clearColor(h[0],h[1],h[2],h[3])},V0.prototype.getTargetTexture=function(){return this._blurTexture2},V0.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},V0.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=B0(e,t*e,!!this._normalTex)},V0.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=k0(e),t.width=t.height=e,t.dirty()):(t=z0(e),this._ssaoPass.setUniform("noiseTex",z0(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},V0.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)};function F0(e){e=e||{},this._ssrPass=new CJ({fragment:Vq.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new CJ({fragment:Vq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new CJ({fragment:Vq.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new CJ({fragment:Vq.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new JK({type:YK.HALF_FLOAT}),this._texture2=new JK({type:YK.HALF_FLOAT}),this._texture3=new JK({type:YK.HALF_FLOAT}),this._prevTexture=new JK({type:YK.HALF_FLOAT}),this._currentTexture=new JK({type:YK.HALF_FLOAT}),this._frameBuffer=new tJ({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}Vq.import("@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"),F0.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var n=e&&t;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},F0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._ssrTexture,s=this._texture2,l=this._texture3;a.width=this._prevTexture.width=this._currentTexture.width=i/this._downScale,a.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,s.width=l.width=i,s.height=l.height=o;var u=this._frameBuffer,c=this._ssrPass,h=this._blurPass1,d=this._blurPass2,p=this._blendPass,f=new SK,g=new SK;SK.transpose(f,t.worldTransform),SK.transpose(g,t.viewMatrix),c.setUniform("sourceTexture",n),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",f.array),c.setUniform("toWorldSpace",g.array),c.setUniform("nearZ",t.near);var m=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",m),c.setUniform("sampleOffset",r*this._samplePerFrame),h.setUniform("textureSize",[a.width,a.height]),d.setUniform("textureSize",[i,o]),d.setUniform("sourceTexture",n),h.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),u.attach(a),u.bind(e),c.render(e),this._physicallyCorrect&&(u.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",a),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),u.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:a),h.render(e),u.attach(l),d.setUniform("texture",s),d.render(e),u.unbind(e),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},F0.prototype.getTargetTexture=function(){return this._texture3},F0.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},F0.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=DJ.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},F0.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},F0.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},F0.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};var G0=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925];function H0(e,t,n,r,i){var o=e.gl;t.setUniform(o,"1i",n,i),o.activeTexture(o.TEXTURE0+i),r.isRenderable()?r.bind(e):r.unbind(e)}function U0(e,t,n,r,i){var o,a,s,l,u=e.gl;return function(i,c,h){if(!l||l.material!==i.material){var d=i.material,p=i.__program,f=d.get("roughness");null==f&&(f=1);var g=d.get("normalMap")||t,m=d.get("roughnessMap"),v=d.get("bumpMap"),y=d.get("uvRepeat"),_=d.get("uvOffset"),x=d.get("detailUvRepeat"),b=d.get("detailUvOffset"),w=!!v&&d.isTextureEnabled("bumpMap"),S=!!m&&d.isTextureEnabled("roughnessMap"),T=d.isDefined("fragment","DOUBLE_SIDED");v=v||n,m=m||r,h!==c?(c.set("normalMap",g),c.set("bumpMap",v),c.set("roughnessMap",m),c.set("useBumpMap",w),c.set("useRoughnessMap",S),c.set("doubleSide",T),null!=y&&c.set("uvRepeat",y),null!=_&&c.set("uvOffset",_),null!=x&&c.set("detailUvRepeat",x),null!=b&&c.set("detailUvOffset",b),c.set("roughness",f)):(p.setUniform(u,"1f","roughness",f),o!==g&&H0(e,p,"normalMap",g,0),a!==v&&v&&H0(e,p,"bumpMap",v,1),s!==m&&m&&H0(e,p,"roughnessMap",m,2),null!=y&&p.setUniform(u,"2f","uvRepeat",y),null!=_&&p.setUniform(u,"2f","uvOffset",_),null!=x&&p.setUniform(u,"2f","detailUvRepeat",x),null!=b&&p.setUniform(u,"2f","detailUvOffset",b),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+T)),o=g,a=v,s=m,l=i}}}function W0(e){this._depthTex=new JK({format:YK.DEPTH_COMPONENT,type:YK.UNSIGNED_INT}),this._normalTex=new JK({type:YK.HALF_FLOAT}),this._framebuffer=new tJ,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,tJ.DEPTH_ATTACHMENT),this._normalMaterial=new lq({shader:new Vq(Vq.source("ecgl.normal.vertex"),Vq.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=_J.createBlank("#000"),this._defaultBumpMap=_J.createBlank("#000"),this._defaultRoughessMap=_J.createBlank("#000"),this._debugPass=new CJ({fragment:Vq.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}function X0(e){e=e||{},this._edgePass=new CJ({fragment:Vq.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new JK({type:YK.HALF_FLOAT}),this._frameBuffer=new tJ,this._frameBuffer.attach(this._targetTexture)}Vq.import("@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"),W0.prototype.getDepthTexture=function(){return this._depthTex},W0.prototype.getNormalTexture=function(){return this._normalTex},W0.prototype.update=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),o=this._depthTex,a=this._normalTex,s=this._normalMaterial;o.width=r,o.height=i,a.width=r,a.height=i;var l=t.getRenderList(n).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:U0(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},W0.prototype.renderDebug=function(e){this._debugPass.render(e)},W0.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},X0.prototype.update=function(e,t,n,r){var i=e.getWidth(),o=e.getHeight(),a=this._targetTexture;a.width=i,a.height=o;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,o]),this._edgePass.setUniform("texture",n),this._edgePass.render(e),s.unbind(e)},X0.prototype.getTargetTexture=function(){return this._targetTexture},X0.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},X0.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};var j0={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]};function Y0(e,t){return{color:{parameters:{width:e,height:t}}}}Vq.import(y0),Vq.import(_0),Vq.import(x0),Vq.import(b0),Vq.import(w0),Vq.import(S0),Vq.import(T0),Vq.import(M0),Vq.import(A0),Vq.import("@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"),Vq.import("@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end");var Z0=["composite","FXAA"];function q0(){this._width,this._height,this._dpr,this._sourceTexture=new JK({type:YK.HALF_FLOAT}),this._depthTexture=new JK({format:YK.DEPTH_COMPONENT,type:YK.UNSIGNED_INT}),this._framebuffer=new tJ,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,tJ.DEPTH_ATTACHMENT),this._normalPass=new W0,this._compositor=D0(j0);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=Z0.map((function(e){return this._compositor.getNodeByName(e)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new V0(n),this._ssrPass=new F0(n),this._edgePass=new X0(n)}function K0(e){for(var t=[],n=0;n<30;n++)t.push([R0(n,2),R0(n,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new JK,this._sourceFb=new tJ,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new JK,this._outputTex=new JK;var r=this._blendPass=new CJ({fragment:Vq.source("clay.compositor.blend")});r.material.disableTexturesAll(),r.material.enableTexture(["texture1","texture2"]),this._blendFb=new tJ({depthBuffer:!1}),this._outputPass=new CJ({fragment:Vq.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}function $0(e){e=e||"perspective",this.layer=null,this.scene=new B$,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new q0,this._temporalSS=new K0,this._shadowMapPass=new h0;for(var t=[],n=0,r=0;r<30;r++){for(var i=[],o=0;o<6;o++)i.push(4*R0(n,2)-2),i.push(4*R0(n,3)-2),n++;t.push(i)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n)}),this)}q0.prototype.resize=function(e,t,n){e*=n=n||1,t*=n;var r=this._sourceTexture,i=this._depthTexture;r.width=e,r.height=t,i.width=e,i.height=t;var o={getWidth:function(){return e},getHeight:function(){return t},getDevicePixelRatio:function(){return n}};function a(e,t){if("function"==typeof e[t]){var n=e[t].__original||e[t];e[t]=function(e){return n.call(this,o)},e[t].__original=n}}this._compositor.nodes.forEach((function(e){for(var t in e.outputs){var n=e.outputs[t].parameters;n&&(a(n,"width"),a(n,"height"))}for(var r in e.parameters)a(e.parameters,r)})),this._width=e,this._height=t,this._dpr=n},q0.prototype.getWidth=function(){return this._width},q0.prototype.getHeight=function(){return this._height},q0.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},q0.prototype._getPrevNode=function(e){for(var t=Z0.indexOf(e.name)-1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t-=1,n=this._finalNodesChain[t];return n},q0.prototype._getNextNode=function(e){for(var t=Z0.indexOf(e.name)+1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t+=1,n=this._finalNodesChain[t];return n},q0.prototype._addChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(e.inputs.texture=t.name,n?(e.outputs=Y0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},q0.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(n?(t.outputs=Y0(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},q0.prototype.updateNormal=function(e,t,n,r){this._ifRenderNormalPass()&&this._normalPass.update(e,t,n)},q0.prototype.updateSSAO=function(e,t,n,r){this._ssaoPass.update(e,n,r)},q0.prototype.enableSSAO=function(){this._enableSSAO=!0},q0.prototype.disableSSAO=function(){this._enableSSAO=!1},q0.prototype.enableSSR=function(){this._enableSSR=!0},q0.prototype.disableSSR=function(){this._enableSSR=!1},q0.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},q0.prototype.getSourceFrameBuffer=function(){return this._framebuffer},q0.prototype.getSourceTexture=function(){return this._sourceTexture},q0.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},q0.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},q0.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},q0.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},q0.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},q0.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},q0.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},q0.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},q0.prototype.enableEdge=function(){this._enableEdge=!0},q0.prototype.disableEdge=function(){this._enableEdge=!1},q0.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},q0.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var n={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown SSAO parameter "+e)}},q0.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",t);break;case"quality":var r={low:4,medium:8,high:16,ultra:32}[t]||8;this._dofBlurKernelSize=r;for(n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",r);this._dofBlurKernel=new Float32Array(2*r);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unkown DOF parameter "+e)}},q0.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var n={low:10,medium:15,high:30,ultra:80}[t]||20,r={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",r);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;case"physical":this.setPhysicallyCorrectSSR(t);break;default:console.warn("Unkown SSR parameter "+e)}},q0.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},q0.prototype.setEdgeColor=function(e){var t=nQ.parseColor(e);this._edgePass.setParameter("edgeColor",t)},q0.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},q0.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:nQ.Texture.NEAREST,magFilter:nQ.Texture.NEAREST,flipY:!1})},q0.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},q0.prototype.isSSREnabled=function(){return this._enableSSR},q0.prototype.composite=function(e,t,n,r,i){var o=this._sourceTexture,a=o;this._enableEdge&&(this._edgePass.update(e,n,o,i),o=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,n,o,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=i%Math.floor(G0.length/2/l),c=0;c<2*l;c++)s[c]=G0[c+u*l*2];for(c=0;c<this._dofBlurNodes.length;c++)this._dofBlurNodes[c].setParameter("percent",i/30),this._dofBlurNodes[c].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",n.near),this._cocNode.setParameter("zFar",n.far),this._compositor.render(e,r)},q0.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},K0.prototype={constructor:K0,jitterProjection:function(e,t){var n=e.viewport,r=n.devicePixelRatio||e.getDevicePixelRatio(),i=n.width*r,o=n.height*r,a=this._haltonSequence[this._frame%this._haltonSequence.length],s=new SK;s.array[12]=(2*a[0]-1)/i,s.array[13]=(2*a[1]-1)/o,SK.mul(t.projectionMatrix,s,t.projectionMatrix),SK.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,n){var r=this._blendPass;0===this._frame?(r.setUniform("weight1",0),r.setUniform("weight2",1)):(r.setUniform("weight1",.9),r.setUniform("weight2",.1)),r.setUniform("texture1",this._prevFrameTex),r.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),r.render(e),this._blendFb.unbind(e),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},$0.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof W$||(this.camera=new W$,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof SJ||(this.camera=new SJ,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},$0.prototype.setViewport=function(e,t,n,r,i){this.camera instanceof W$&&(this.camera.aspect=n/r),i=i||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=n,this.viewport.height=r,this.viewport.devicePixelRatio=i,this._compositor.resize(n*i,r*i),this._temporalSS.resize(n*i,r*i)},$0.prototype.containPoint=function(e,t){var n=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=n.x&&t>=n.y&&e<=n.x+n.width&&t<=n.y+n.height};var J0=new pq;function Q0(e,t){var n=Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=e.get("boxWidth"),i=e.get("boxHeight"),o=e.get("boxDepth");"production"!==process.env.NODE_ENV&&["x","y","z"].forEach((function(t){if(!this.getAxis(t))throw new Error("Grid"+e.id+" don't have "+t+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-i/2,i/2),this.size=[r,i,o]}function e1(e,t){var n={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(e){t.mapDimensionsAll(e,!0).forEach((function(r){!function(e,t){n[e]=n[e]||[1/0,-1/0],n[e][0]=Math.min(t[0],n[e][0]),n[e][1]=Math.max(t[1],n[e][1])}(e,t.getDataExtent(r,!0))}))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var r=t.charAt(0),i=e.getReferringComponents("grid3D").models[0],o=i.coordinateSystem;if(o===this){var a=o.getAxis(r);if(a)"production"!==process.env.NODE_ENV&&console.warn("Can't have two %s in one grid3D",t);else{(a=new KQ(r,BM(n[r]||[1/0,-1/0],e))).type=e.get("type");var s="category"===a.type;a.onBand=s&&e.get("boundaryGap"),a.inverse=e.get("inverse"),e.axis=a,a.model=e,a.getLabelModel=function(){return e.getModel("axisLabel",i.getModel("axisLabel"))},a.getTickModel=function(){return e.getModel("axisTick",i.getModel("axisTick"))},o.addAxis(a)}}}),this)}),this),this.resize(this.model,t)}$0.prototype.castRay=function(e,t,n){var r=this.layer.renderer,i=r.viewport;return r.viewport=this.viewport,r.screenToNDC(e,t,J0),this.camera.castRay(J0,n),r.viewport=i,n},$0.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t<e.transparent.length;t++){var n=e.transparent[t].geometry;n.needsSortVerticesProgressively&&n.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),n.needsSortTrianglesProgressively&&n.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},$0.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},$0.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},$0.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},$0.prototype.hasDOF=function(){return this._enableDOF},$0.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},$0.prototype._doRender=function(e,t,n){var r=this.scene,i=this.camera;n=n||0,this._updateTransparent(e,r,i,n),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,r,i,!0)),this._updateShadowPCFKernel(n);var o,a=e.clearColor;(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i),this._compositor.updateNormal(e,r,i,this._temporalSS.getFrame())),this._updateSSAO(e,r,i,this._temporalSS.getFrame()),this._enablePostEffect)?((o=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(r,i,!0,!0),o.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,r,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,r,i,null,0))):this.needsTemporalSS()&&t?((o=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(r,i,!0,!0),e.restoreClear(),o.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(r,i,!0,!0))},$0.prototype._updateTransparent=function(e,t,n,r){for(var i=new rK,o=new SK,a=n.getWorldPosition(),s=t.getRenderList(n).transparent,l=0;l<s.length;l++){var u=s[l],c=u.geometry;SK.invert(o,u.worldTransform),rK.transformMat4(i,a,o),c.needsSortTriangles&&c.needsSortTriangles()&&c.doSortTriangles(i,r),c.needsSortVertices&&c.needsSortVertices()&&c.doSortVertices(i,r)}},$0.prototype._updateSSAO=function(e,t,n){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(e,t,n,this._temporalSS.getFrame());for(var i=t.getRenderList(n),o=0;o<i.opaque.length;o++){var a=i.opaque[o];a.renderNormal&&a.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&a.material.set("ssaoMap",this._compositor.getSSAOTexture())}},$0.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],n=this.scene.getRenderList(this.camera).opaque,r=0;r<n.length;r++)n[r].receiveShadow&&(n[r].material.set("pcfKernel",t),n[r].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},$0.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},$0.prototype.setPostEffect=function(e,t){var n=this._compositor;this._enablePostEffect=e.get("enable");var r=e.getModel("bloom"),i=e.getModel("edge"),o=e.getModel("DOF",e.getModel("depthOfField")),a=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");r.get("enable")?n.enableBloom():n.disableBloom(),o.get("enable")?n.enableDOF():n.disableDOF(),s.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),i.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=o.get("enable"),this._enableSSAO=a.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(r.get("intensity")),n.setEdgeColor(i.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),t),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){n.setSSAOParameter(e,a.get(e))})),["quality","maxRoughness","physical"].forEach((function(e){n.setSSRParameter(e,s.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){n.setDOFParameter(e,o.get(e))})),["brightness","contrast","saturation"].forEach((function(e){n.setColorCorrection(e,u.get(e))}))},$0.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},$0.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},$0.prototype.isLinearSpace=function(){return this._enablePostEffect},$0.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),n=0;n<t.length;n++)e.add(t[n]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},$0.prototype.add=function(e){this.rootNode.add(e)},$0.prototype.remove=function(e){this.rootNode.remove(e)},$0.prototype.removeAll=function(e){this.rootNode.removeAll(e)},Object.assign($0.prototype,EZ);var t1={dimensions:qQ.prototype.dimensions,create:function(e,t){var n=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new $0;var t=new qQ;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,n.push(t),t.resize=Q0,t.update=e1}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(i=t.getReferringComponents("grid3D").models[0])){var n=function(e,t){return r.map((function(n){var r=e.getReferringComponents(n).models[0];if(null==r&&(r=t.getComponent(n)),"production"!==process.env.NODE_ENV&&!r)throw new Error(n+' "'+kJ(e.get(n+"Index"),e.get(n+"Id"),0)+'" not found');return r}))}(t,e),i=n[0].getCoordSysModel();n.forEach((function(e){var t=e.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!t)throw new Error('grid3D "'+kJ(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}}))}var o=i.coordinateSystem;t.coordinateSystem=o}})),n}},n1=Nv.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});VM(n1);var r1={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},i1=Lr({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},r1),o1=Lr({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},r1),a1=Or({scale:!0,min:"dataMin",max:"dataMax"},o1),s1=Or({logBase:10},o1);s1.scale=!0;var l1={categoryAxis3D:i1,valueAxis3D:o1,timeAxis3D:a1,logAxis3D:s1},u1=["value","category","time","log"];function c1(e,t){return t.type||(t.data?"category":"value")}WS((function(e){e.registerComponentModel(xQ),e.registerComponentView(ZQ),e.registerCoordinateSystem("grid3D",t1),["x","y","z"].forEach((function(t){!function(e,t,n,r,i){u1.forEach((function(o){var a=n.extend({type:t+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(e,n){Lr(e,n.getTheme().get(o+"Axis3D")),Lr(e,this.getDefaultOption()),e.type=r(t,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=LT.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:Lr(Ir(l1[o+"Axis3D"]),i||{},!0)});e.registerComponentModel(a)})),e.registerSubTypeDefaulter(t+"Axis3D",Yr(r,t))}(e,t,n1,c1,{name:t.toUpperCase()});const n=e.ComponentView.extend({type:t+"Axis3D"});e.registerComponentView(n)})),e.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),e.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))}));var h1={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}},d1={getFilledRegions:function(e,t){var n,r=(e||[]).slice();if("string"==typeof t?n=(t=FS(t))&&t.geoJson:t&&t.features&&(n=t),!n)return"production"!==process.env.NODE_ENV&&(console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D")),[];for(var i={},o=n.features,a=0;a<r.length;a++)i[r[a].name]=r[a];for(a=0;a<o.length;a++){var s=o[a].properties.name;i[s]||r.push({name:s})}return r},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}},p1=Nv.extend({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=_T(e.data||[],{coordDimensions:["value"],encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),n=new yT(t,this);n.initData(e.regions);var r={};n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new xm(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),n=this.coordinateSystem.getRegion(t);return n?n.geometries:[]},getFormattedLabel:function(e,t){var n=this._data.getName(e),r=this.getRegionModel(e),i=r.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=r.get(["label","formatter"]));var o={name:n};if("function"==typeof i)return o.status=t,i(o);if("string"==typeof i){var a=o.seriesName;return i.replace("{a}",null!=a?a:"")}return n},defaultOption:{regions:[]}});function f1(e,t,n){n=n||2;var r,i,o,a,s,l,u,c=t&&t.length,h=c?t[0]*n:e.length,d=g1(e,0,h,n,!0),p=[];if(!d)return p;if(c&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=g1(e,t[i]*r,i<o-1?t[i+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(M1(a));for(s.sort(w1),i=0;i<s.length;i++)S1(s[i],n),n=m1(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(l=e[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=Math.max(o-r,a-i)}return v1(d,p,n,r,i,u),p}function g1(e,t,n,r,i){var o,a;if(i===k1(e,t,n,r)>0)for(o=t;o<n;o+=r)a=P1(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=P1(o,e[o],e[o+1],a);return a&&E1(a,a.next)&&(O1(a),a=a.next),a}function m1(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!E1(r,r.next)&&0!==D1(r.prev,r,r.next))r=r.next;else{if(O1(r),(r=t=r.prev)===r.next)return null;n=!0}}while(n||r!==t);return t}function v1(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=T1(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,u=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?_1(e,r,i,o):y1(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),O1(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?v1(e=x1(e,t,n),t,n,r,i,o,2):2===a&&b1(e,t,n,r,i,o):v1(m1(e),t,n,r,i,o,1);break}}}function y1(e){var t=e.prev,n=e,r=e.next;if(D1(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(A1(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&D1(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function _1(e,t,n,r){var i=e.prev,o=e,a=e.next;if(D1(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=T1(s,l,t,n,r),d=T1(u,c,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&A1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&D1(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&A1(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&D1(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function x1(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!E1(i,o)&&I1(i,r,r.next,o)&&L1(i,o)&&L1(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),O1(r),O1(r.next),r=e=o),r=r.next}while(r!==e);return r}function b1(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&C1(a,s)){var l=N1(a,s);return a=m1(a,a.next),l=m1(l,l.next),v1(a,t,n,r,i,o),void v1(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function w1(e,t){return e.x-t.x}function S1(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=c&&i!==r.x&&A1(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&((l=Math.abs(o-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&L1(r,e)&&(n=r,d=l),r=r.next;return n}(e,t),t){var n=N1(t,e);m1(n,n.next)}}function T1(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)/i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function M1(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function A1(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function C1(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&I1(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&L1(e,t)&&L1(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function D1(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function E1(e,t){return e.x===t.x&&e.y===t.y}function I1(e,t,n,r){return!!(E1(e,t)&&E1(n,r)||E1(e,r)&&E1(n,t))||D1(e,t,n)>0!=D1(e,t,r)>0&&D1(n,r,e)>0!=D1(n,r,t)>0}function L1(e,t){return D1(e.prev,e,e.next)<0?D1(e,t,e.next)>=0&&D1(e,e.prev,t)>=0:D1(e,t,e.prev)<0||D1(e,e.next,t)<0}function N1(e,t){var n=new R1(e.i,e.x,e.y),r=new R1(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function P1(e,t,n,r){var i=new R1(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O1(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function R1(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k1(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}function z1(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function B1(e,t,n,r,i){var o=n,a=e[t];z1(e,t,r);for(var s=n;s<r;s++)i(e[s],a)<0&&(z1(e,s,o),o++);return z1(e,r,o),o}function V1(e,t,n,r){if(n<r){var i=B1(e,Math.floor((n+r)/2),n,r,t);V1(e,t,n,i-1),V1(e,t,i+1,r)}}function F1(){this._parts=[]}Lr(p1.prototype,d1),Lr(p1.prototype,vQ),Lr(p1.prototype,yQ),Lr(p1.prototype,_Q),Lr(p1.prototype,h1),f1.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(k1(e,0,o,n));if(i)for(var s=0,l=t.length;s<l;s++){var u=t[s]*n,c=s<l-1?t[s+1]*n:e.length;a-=Math.abs(k1(e,u,c,n))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,p=r[s+1]*n,f=r[s+2]*n;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},F1.prototype.step=function(e,t,n){var r=e.length;if(0===n){this._parts=[],this._sorted=!1;var i=Math.floor(r/2);this._parts.push({pivot:i,left:0,right:r-1}),this._currentSortPartIdx=0}if(!this._sorted){var o=this._parts;if(0===o.length)return this._sorted=!0,!0;if(o.length<512){for(var a=0;a<o.length;a++)o[a].pivot=B1(e,o[a].pivot,o[a].left,o[a].right,t);var s=[];for(a=0;a<o.length;a++){var l=o[a].left;(u=o[a].pivot-1)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var u;l=o[a].pivot+1;(u=o[a].right)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}o=this._parts=s}else for(a=0;a<Math.floor(o.length/10);a++){var c=o.length-1-this._currentSortPartIdx;if(V1(e,t,o[c].left,o[c].right),this._currentSortPartIdx++,this._currentSortPartIdx===o.length)return this._sorted=!0,!0}return!1}},F1.sort=V1;var G1=AQ.vec3,H1=G1.create(),U1=G1.create(),W1=G1.create(),X1={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var n=this.indices;if(0===t){var r=this.attributes.position;e=e.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var i,o=0,a=0;a<n.length;){r.get(n[a++],H1),r.get(n[a++],U1),r.get(n[a++],W1);var s=G1.sqrDist(H1,e),l=G1.sqrDist(U1,e),u=G1.sqrDist(W1,e),c=Math.min(s,l);c=Math.min(c,u),3===a?(i=c,c=0):c-=i,this._triangleZList[o++]=c}}var h=this._sortedTriangleIndices;for(a=0;a<h.length;a++)h[a]=a;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);var d=this._indicesTmp,p=this._triangleZListTmp,f=this._triangleZList;for(a=0;a<this.triangleCount;a++){var g=3*h[a],m=3*a;d[m++]=n[g++],d[m++]=n[g++],d[m]=n[g],p[a]=f[h[a]]}var v=this._indicesTmp;this._indicesTmp=this.indices,this.indices=v;v=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=v,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):F1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new F1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}};function j1(e,t){const n=e.getItemVisual(t,"style");if(n){return n[e.getVisual("drawType")]}}function Y1(e,t){const n=e.getItemVisual(t,"style");return n&&n.opacity}function Z1(e,t,n){this._labelsMesh=new FQ,this._labelTextureSurface=new LQ({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}Z1.prototype.getLabelPosition=function(e,t,n){return[0,0,0]},Z1.prototype.getLabelDistance=function(e,t,n){return 0},Z1.prototype.getMesh=function(){return this._labelsMesh},Z1.prototype.updateData=function(e,t,n){null==t&&(t=0),null==n&&(n=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-t||(this._labelsVisibilitiesBits=new Uint8Array(n-t));for(var r=["label","show"],i=["emphasis","label","show"],o=t;o<n;o++){var a=e.getItemModel(o),s=a.get(r),l=a.get(i);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[o-t]=u}this._start=t,this._end=n,this._data=e},Z1.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,n={},r=0;r<e.length;r++)n[e[r]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var i=["label"],o=["emphasis","label"],a=this._data.hostModel,s=this._data,l=a.getModel(i),u=a.getModel(o,l),c={left:"right",right:"left",top:"center",bottom:"center"},h={left:"middle",right:"middle",top:"bottom",bottom:"top"},d=this._start;d<this._end;d++){var p=!1;if(t&&n[d]&&(p=!0),this._labelsVisibilitiesBits[d-this._start]&(p?2:1)){var f=s.getItemModel(d).getModel(p?o:i,p?u:l),g=f.get("distance")||0,m=f.get("position"),v=this._api.getDevicePixelRatio(),y=a.getFormattedLabel(d,p?"emphasis":"normal");if(null==y||""===y)return;var _=new Id({style:$g(f,{text:y,fill:f.get("color")||j1(s,d)||"#000",align:"left",verticalAlign:"top",opacity:kJ(f.get("opacity"),Y1(s,d),1)})}),x=_.getBoundingRect();x.height*=1.2;var b=this._labelTextureSurface.add(_),w=c[m]||"center",S=h[m]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(d,m,g),[x.width*v,x.height*v],b,w,S,this.getLabelDistance(d,m,g)*v)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},Z1.prototype.dispose=function(){this._labelTextureSurface.dispose()};var q1=AQ.vec3;function K1(e){this.rootNode=new nQ.Node,this._triangulationResults={},this._shadersMap=nQ.COMMON_SHADERS.filter((function(e){return"shadow"!==e})).reduce((function(e,t){return e[t]=nQ.createShader("ecgl."+t),e}),{}),this._linesShader=nQ.createShader("ecgl.meshLines3D");var t={};nQ.COMMON_SHADERS.forEach((function(e){t[e]=new nQ.Material({shader:nQ.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new nQ.Mesh({geometry:new nQ.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new Z1(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}nQ.Shader.import(XQ),K1.prototype={constructor:K1,extrudeY:!0,update:function(e,t,n,r,i){var o=e.getData();null==r&&(r=0),null==i&&(i=o.count()),this._startIndex=r,this._endIndex=i-1,this._triangulation(e,r,i);var a=this._getShader(e.get("shading"));this._prepareMesh(e,a,n,r,i),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,n,r,i);var s=e.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(e,s,n);var l=this;this._labelsBuilder.updateData(o,r,i),this._labelsBuilder.getLabelPosition=function(e,t,n){var r=o.getName(e),i=n;if("geo3D"===s.type){var a=s.getRegion(r);return a?(c=a.getCenter(),s.dataToPoint([c[0],c[1],i])):[NaN,NaN,NaN]}var u=l._triangulationResults[e-l._startIndex],c=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+i,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+i]},this._data=o,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e=this;var t=function(){var t=new nQ.Mesh({name:"Polygon",material:new nQ.Material({shader:e._shadersMap.lambert}),geometry:new nQ.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0});return Object.assign(t.geometry,X1),t}(),n=new nQ.Mesh({material:new nQ.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new EQ({useNativeLine:!1})});this.rootNode.add(t),this.rootNode.add(n),t.material.define("both","VERTEX_COLOR"),t.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=t,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,n,r,i){for(var o=0,a=0,s=0,l=0,u=r;u<i;u++){var c=this._getRegionPolygonInfo(u),h=this._getRegionLinesInfo(u,e,this._linesMesh.geometry);o+=c.vertexCount,a+=c.triangleCount,s+=h.vertexCount,l+=h.triangleCount}var d=this._polygonMesh,p=d.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(o)})),p.indices=o>65535?new Uint32Array(3*a):new Uint16Array(3*a),d.material.shader!==t&&d.material.attachShader(t,!0),nQ.setMaterialFromModel(t.__shading,d.material,e,n),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(i-r))},_updateRegionMesh:function(e,t,n,r){for(var i=e.getData(),o=0,a=0,s=!1,l=this._polygonMesh,u=this._linesMesh,c=n;c<r;c++){var h=e.getRegionModel(c),d=h.getModel("itemStyle"),p=kJ(j1(i,c),d.get("color"),"#fff"),f=kJ(Y1(i,c),d.get("opacity"),1),g=nQ.parseColor(p),m=nQ.parseColor(d.get("borderColor"));g[3]*=f,m[3]*=f;var v=g[3]<.99;l.material.set("color",[1,1,1,1]),s=s||v;for(var y=kJ(h.get("height",!0),e.get("regionHeight")),_=this._updatePolygonGeometry(e,l.geometry,c,y,o,a,g),x=o;x<_.vertexOffset;x++)this._dataIndexOfVertex[x]=c;this._vertexRangeOfDataIndex[2*(c-n)]=o,this._vertexRangeOfDataIndex[2*(c-n)+1]=_.vertexOffset,o=_.vertexOffset,a=_.triangleOffset;var b=d.get("borderWidth"),w=b>0;w&&(b*=t.getDevicePixelRatio(),this._updateLinesGeometry(u.geometry,e,c,y,b,e.coordinateSystem.transform)),u.invisible=!w,u.material.set({color:m})}(l=this._polygonMesh).material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?nQ.Mesh.CCW:nQ.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=e.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var n=nQ.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=kJ(t.get("lineStyle.width"),1),i=this._polygonMesh;i.geometry.generateBarycentric(),i.material.define("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",n),i.material.set("wireframeLineWidth",r)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,n){var r=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!r.get("show",!0),!this._groundMesh.invisible){var i=e.get("shading"),o=this._groundMaterials[i];o||("production"!==process.env.NODE_ENV&&console.warn("Unkown shading "+i),o=this._groundMaterials.lambert),nQ.setMaterialFromModel(i,o,r,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",nQ.parseColor(r.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,n){this._triangulationResults=[];for(var r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],o=e.coordinateSystem,a=t;a<n;a++){for(var s=[],l=e.getRegionPolygonCoords(a),u=0;u<l.length;u++){var c=l[u].exterior,h=l[u].interiors,d=[],p=[];if(!(c.length<3)){for(var f=0,g=0;g<c.length;g++){var m=c[g];d[f++]=m[0],d[f++]=m[1]}for(g=0;g<h.length;g++)if(!(h[g].length<3)){for(var v=d.length/2,y=0;y<h[g].length;y++){m=h[g][y];d.push(m[0]),d.push(m[1])}p.push(v)}var _=f1(d,p),x=new Float64Array(d.length/2*3),b=[],w=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],T=0;for(g=0;g<d.length;)q1.set(b,d[g++],0,d[g++]),o&&o.transform&&q1.transformMat4(b,b,o.transform),q1.min(w,w,b),q1.max(S,S,b),x[T++]=b[0],x[T++]=b[1],x[T++]=b[2];q1.min(r,r,w),q1.max(i,i,S),s.push({points:x,indices:_,min:w,max:S})}}this._triangulationResults.push(s)}this._geoBoundingBox=[r,i]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],n=0,r=0,i=0;i<t.length;i++)n+=t[i].points.length/3,r+=t[i].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*r+2*n}},_updatePolygonGeometry:function(e,t,n,r,i,o,a){var s=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,c=t.attributes.texcoord0,h=t.attributes.color,d=this._triangulationResults[n-this._startIndex],p=h.value&&a,f=t.indices,g=this.extrudeY?1:2,m=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=q1.mul([],this._geoBoundingBox[0],v),_=q1.mul([],this._geoBoundingBox[1],v),x=Math.max(_[0]-y[0],_[2]-y[2]);function b(e,t,n){var r=i;!function(e,t,n){for(var r=e.points,o=r.length,s=[],u=[],d=0;d<o;d+=3)s[0]=r[d],s[g]=t,s[m]=r[d+2],u[0]=(r[d]*v[0]-y[0])/x,u[1]=(r[d+2]*v[m]-y[2])/x,l.set(i,s),p&&h.set(i,a),c.set(i++,u)}(e,t);for(var s=e.indices.length,u=0;u<s;u++)f[3*o+u]=e.indices[u]+r;o+=e.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],S=q1.negate([],w),T=0;T<d.length;T++){var M=i,A=d[T];b(A,0),b(A,r);for(var C=A.points.length/3,D=0;D<C;D++)u.set(M+D,S),u.set(M+D+C,w);var E=[0,3,1,1,3,2],I=[[],[],[],[]],L=[],N=[],P=[],O=[],R=0;for(D=0;D<C;D++){for(var k=(D+1)%C,z=(A.points[3*k]-A.points[3*D])*v[0],B=(A.points[3*k+2]-A.points[3*D+2])*v[m],V=Math.sqrt(z*z+B*B),F=0;F<4;F++){var G=0===F||3===F,H=3*(G?D:k);I[F][0]=A.points[H],I[F][g]=F>1?r:0,I[F][m]=A.points[H+2],l.set(i+F,I[F]),s?(O[0]=(A.points[H]*v[0]-y[0])/x,O[1]=(A.points[H+2]*v[m]-y[m])/x):(O[0]=(G?R:R+V)/x,O[1]=(I[F][g]*v[g]-y[g])/x),c.set(i+F,O)}q1.sub(L,I[1],I[0]),q1.sub(N,I[3],I[0]),q1.cross(P,L,N),q1.normalize(P,P);for(F=0;F<4;F++)u.set(i+F,P),p&&h.set(i+F,a);for(F=0;F<6;F++)f[3*o+F]=E[F]+i;i+=4,o+=2,R+=V}}return t.dirty(),{vertexOffset:i,triangleOffset:o}},_getRegionLinesInfo:function(e,t,n){var r=0,i=0;t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,o=e.interiors;r+=n.getPolylineVertexCount(t),i+=n.getPolylineTriangleCount(t);for(var a=0;a<o.length;a++)r+=n.getPolylineVertexCount(o[a]),i+=n.getPolylineTriangleCount(o[a])}),this);return{vertexCount:r,triangleCount:i}},_updateLinesGeometry:function(e,t,n,r,i,o){function a(e){for(var t=new Float64Array(3*e.length),n=0,i=[],a=0;a<e.length;a++)i[0]=e[a][0],i[1]=r+.1,i[2]=e[a][1],o&&q1.transformMat4(i,i,o),t[n++]=i[0],t[n++]=i[1],t[n++]=i[2];return t}var s=[1,1,1,1];t.getRegionPolygonCoords(n).forEach((function(t){var n=t.exterior,r=t.interiors;e.addPolyline(a(n),s,i);for(var o=0;o<r.length;o++)e.addPolyline(a(r[o]),s,i)}))},highlight:function(e){var t=this._data;if(t){var n=t.getItemModel(e).getModel(["emphasis","itemStyle"]),r=n.get("color"),i=kJ(n.get("opacity"),Y1(t,e),1);if(null==r)r=as(j1(t,e),-.4);null==i&&(i=Y1(t,e));var o=nQ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},downplay:function(e){var t=this._data;if(t){var n=t.getItemModel(e),r=kJ(j1(t,e),n.get(["itemStyle","color"]),"#fff"),i=kJ(Y1(t,e),n.get(["itemStyle","opacity"]),1),o=nQ.parseColor(r);o[3]*=i,this._setColorOfDataIndex(t,e,o)}},dispose:function(){this._labelsBuilder.dispose()},_setColorOfDataIndex:function(e,t,n){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var r=this._vertexRangeOfDataIndex[2*t];r<this._vertexRangeOfDataIndex[2*t+1];r++)this._polygonMesh.geometry.attributes.color.set(r,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}};var $1=Cx.extend({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new K1(t),this.groupGL=new nQ.Node,this._lightRoot=new nQ.Node,this._sceneHelper=new NQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new TQ({zr:t.getZr()}),this._control.init()},render:function(e,t,n){this.groupGL.add(this._geo3DBuilder.rootNode);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=e.getModel("viewControl");i.setFromViewControlModel(o,0),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")})),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,geo3DId:e.id})})),i.update()}},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},dispose:function(){this._control.dispose(),this._geo3DBuilder.dispose()}}),J1={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var Q1=AQ.vec3,e2=AQ.mat4,t2=[nN,function(e,t){if("world"===e){var n=J1[t.name];if(n){var r=[n[0],n[1]];t.setCenter(r)}}}];function n2(e,t,n,r,i){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,r,i),this.transform=e2.identity(new Float64Array(16)),this.invTransform=e2.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}function r2(e,t){var n=Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=this.getGeoBoundingRect(),i=r.width/r.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),a=e.get("boxDepth"),s=e.get("boxHeight");null==s&&(s=5),isNaN(o)&&isNaN(a)&&(o=100),isNaN(a)?a=o/i:isNaN(o)&&(o=a/i),this.setSize(o,s,a),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(s-this.regionHeight,0))}function i2(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),n&&isFinite(n[1]-n[0])){var r=BM(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new yA("altitude",r),this.resize(this.model,t)}}if(n2.prototype={constructor:n2,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,n){var r=eA||eA;try{this.regions=e?r(e):[]}catch(e){throw"Invalid geoJson format\n"+e}t=t||{},n=n||{};for(var i=this.regions,o={},a=0;a<i.length;a++){var s=i[a].name;s=n[s]||s,i[a].name=s,o[s]=i[a],this.addGeoCoord(s,i[a].getCenter());var l=t[s];l&&i[a].transformTo(l.left,l.top,l.width,l.height)}this._regionsMap=o,this._geoRect=null,t2.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,n=0;n<t.length;n++){var r=t[n].getBoundingRect();(e=e||r.clone()).union(r)}return this._geoRect=e||new Uo(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,n=0;n<t.length;n++)if(t[n].contain(e))return t[n]},setSize:function(e,t,n){this.size=[e,t,n];var r=this.getGeoBoundingRect(),i=e/r.width,o=-n/r.height,a=-e/2-r.x*i,s=n/2-r.y*o,l=this.extrudeY?[a,0,s]:[a,s,0],u=this.extrudeY?[i,1,o]:[i,o,1],c=this.transform;e2.identity(c),e2.translate(c,c,l),e2.scale(c,c,u),e2.invert(this.invTransform,c)},dataToPoint:function(e,t){t=t||[];var n=this.extrudeY?1:2,r=this.extrudeY?2:1,i=e[2];return isNaN(i)&&(i=0),t[0]=e[0],t[r]=e[1],this.altitudeAxis?t[n]=this.altitudeAxis.dataToCoord(i):t[n]=0,t[n]+=this.regionHeight,Q1.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},"production"!==process.env.NODE_ENV)var o2=function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")};var a2=0,s2={dimensions:n2.prototype.dimensions,create:function(e,t){var n=[];if(!FS)throw new Error("geo3D component depends on geo component");function r(e,r){var i=s2.createGeo3D(e);e.__viewGL=e.__viewGL||new $0,i.viewGL=e.__viewGL,e.coordinateSystem=i,i.model=e,n.push(i),i.resize=r2,i.resize(e,t),i.update=i2}return e.eachComponent("geo3D",(function(e,t){r(e)})),e.eachSeriesByType("map3D",(function(e,t){var n=e.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&r(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var n=t.getReferringComponents("geo3D").models[0];if(n||(n=e.getComponent("geo3D")),!n)throw new Error('geo "'+kJ(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n},createGeo3D:function(e){var t,n=e.get("map");if("string"==typeof n?(t=n,n=FS(n)):n&&n.features&&(n={geoJson:n}),"production"!==process.env.NODE_ENV&&(n||o2(n),!n.geoJson.features))throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+a2++),new n2(t+a2++,t,n&&n.geoJson,n&&n.specialAreas,e.get("nameMap"))}};function l2(e){e.registerComponentModel(p1),e.registerComponentView($1),e.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))})),e.registerCoordinateSystem("geo3D",s2)}function u2(e,t){e.id=e.id||e.name||t+""}WS(l2);var c2=Nv.extend({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){c2.superApply(this,"init",arguments),Fr(this.option.layers,(function(e,t){Lr(e,this.defaultLayerOption),u2(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function n(e){return Hr(e,(function(e,t,n){return u2(t,n),e[t.id]=t,e}),{})}if(this.option.layers=null,c2.superApply(this,"mergeOption",arguments),t&&t.length){var r=n(e.layers),i=n(t);for(var o in r)i[o]?Lr(i[o],r[o],!0):t.push(e.layers[o]);this.option.layers=t}Fr(this.option.layers,(function(e){Lr(e,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},atmosphere:{show:!1,offset:5,color:"#ffffff",glowPower:6,innerGlowPower:2},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});Lr(c2.prototype,vQ),Lr(c2.prototype,yQ),Lr(c2.prototype,_Q),Lr(c2.prototype,h1);var h2=Math.PI,d2=Math.sin,p2=Math.cos,f2=Math.tan,g2=Math.asin,m2=Math.atan2,v2=h2/180,y2=864e5,_2=2440588;function x2(e){return function(e){return e.valueOf()/y2-.5+_2}(e)-2451545}var b2=23.4397*v2;function w2(e,t){return m2(d2(e)*p2(b2)-f2(t)*d2(b2),p2(e))}function S2(e,t,n){return m2(d2(e),p2(e)*d2(t)-f2(n)*p2(t))}function T2(e,t,n){return g2(d2(t)*d2(n)+p2(t)*p2(n)*p2(e))}function M2(e){var t,n,r=function(e){return v2*(357.5291+.98560028*e)}(e),i=function(e){return e+v2*(1.9148*d2(e)+.02*d2(2*e)+3e-4*d2(3*e))+102.9372*v2+h2}(r);return{dec:(t=i,n=0,g2(d2(n)*p2(b2)+p2(n)*d2(b2)*d2(t))),ra:w2(i,0)}}var A2={};A2.getPosition=function(e,t,n){var r=v2*-n,i=v2*t,o=x2(e),a=M2(o),s=function(e,t){return v2*(280.16+360.9856235*e)-t}(o,r)-a.ra;return{azimuth:S2(s,i,a.dec),altitude:T2(s,i,a.dec)}};nQ.Shader.import(JJ),nQ.Shader.import("@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end");var C2=Cx.extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new nQ.Node,this._sphereGeometry=new nQ.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new nQ.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new nQ.PlaneGeometry,this._earthMesh=new nQ.Mesh({renderNormal:!0}),this._atmosphereMesh=new nQ.Mesh,this._atmosphereGeometry=new nQ.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new nQ.Material({shader:new nQ.Shader(nQ.Shader.source("ecgl.atmosphere.vertex"),nQ.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=nQ.Mesh.CW,this._lightRoot=new nQ.Node,this._sceneHelper=new NQ,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new TQ({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,n){var r=e.coordinateSystem,i=e.get("shading");r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL),this._sceneHelper.setScene(r.viewGL.scene),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var a="ecgl."+i;o.material&&o.material.shader.name===a||(o.material=nQ.createMaterial(a)),nQ.setMaterialFromModel(i,o.material,e,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",nQ.parseColor(e.get("baseColor")));var s=.99*r.radius;if(o.scale.set(s,s,s),e.get("atmosphere.show")){o.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:e.get("atmosphere.glowPower")||6,glowColor:e.get("atmosphere.color")||"#ffffff"}),o.material.setUniforms({glowPower:e.get("atmosphere.innerGlowPower")||2,glowColor:e.get("atmosphere.color")||"#ffffff"});var l=e.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else o.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var c=o.material.setTextureImage("bumpMap",e.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,n),this._displaceVertices(e,n),this._updateViewControl(e,n),this._updateLayers(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},_updateLayers:function(e,t){var n=e.coordinateSystem,r=e.get("layers"),i=n.radius,o=[],a=[],s=[],l=[];Fr(r,(function(e){var r=new xm(e),u=r.get("type"),c=nQ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8});if(c.surface&&c.surface.attachToMesh(this._earthMesh),"blend"===u){var h=r.get("blendTo"),d=kJ(r.get("intensity"),1);"emission"===h?(s.push(c),l.push(d)):(o.push(c),a.push(d))}else{var p=r.get("id"),f=this._layerMeshes[p];f||(f=this._layerMeshes[p]=new nQ.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===r.get("shading")?(f.material=f.__lambertMaterial||new nQ.Material({autoUpdateTextureStatus:!1,shader:nQ.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),f.__lambertMaterial=f.material):(f.material=f.__colorMaterial||new nQ.Material({autoUpdateTextureStatus:!1,shader:nQ.createShader("ecgl.color"),transparent:!0,depthMask:!1}),f.__colorMaterial=f.material),f.material.enableTexture("diffuseMap");var g=r.get("distance"),m=i+(null==g?n.radius/100:g);f.scale.set(m,m,m),i=m;var v=this._blankTexture||(this._blankTexture=nQ.createBlankTexture("rgba(255, 255, 255, 0)"));f.material.set("diffuseMap",v),nQ.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(f),f.material.set("diffuseMap",e),t.getZr().refresh()})),r.get("show")?this.groupGL.add(f):this.groupGL.remove(f)}}),this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",s.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",a),u.set("layerEmissiveMap",s),u.set("layerEmissionIntensity",l);var c=e.getModel("debug.wireframe");if(c.get("show")){u.define("both","WIREFRAME_TRIANGLE");var h=nQ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)"),d=kJ(c.get("lineStyle.width"),1);u.set("wireframeLineWidth",d),u.set("wireframeLineColor",h)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var n=e.coordinateSystem,r=e.getModel("viewControl");n.viewGL.camera;var i=this;var o=this._control;o.setViewGL(n.viewGL);var a,s,l=r.get("targetCoord");null!=l&&(s=l[0]+90,a=l[1]),o.setFromViewControlModel(r,{baseDistance:n.radius,alpha:a,beta:s}),o.off("update"),o.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-n.radius,center:o.getCenter(),from:i.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var n=e.get("displacementQuality"),r=e.get("debug.wireframe.show"),i=e.coordinateSystem;if(e.isDisplacementChanged()||n!==this._displacementQuality||r!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=r;var o=this._sphereGeometry,a={low:100,medium:200,high:400,ultra:800}[n]||200,s=a/2;(o.widthSegments!==a||r)&&(o.widthSegments=a,o.heightSegments=s,o.build()),this._doDisplaceVertices(o,i),r&&o.generateBarycentric()}},_doDisplaceVertices:function(e,t){var n=e.attributes.position.value,r=e.attributes.texcoord0.value,i=e.__originalPosition;i&&i.length===n.length||((i=new Float32Array(n.length)).set(n),e.__originalPosition=i);for(var o=t.displacementWidth,a=t.displacementHeight,s=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,c=2*l,h=i[u+1],d=i[u+2],p=i[u+3],f=r[c++],g=r[c++],m=Math.round(f*(o-1)),v=Math.round(g*(a-1)),y=s?s[v*o+m]:0;n[u+1]=h+h*y,n[u+2]=d+d*y,n[u+3]=p+p*y}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var n=this._earthMesh;this._sceneHelper.updateLight(e);var r=this._sceneHelper.mainLight,i=e.get("light.main.time")||new Date,o=A2.getPosition(bu(i),0,0),a=Math.cos(o.altitude);r.position.y=-a*Math.cos(o.azimuth),r.position.x=Math.sin(o.altitude),r.position.z=a*Math.sin(o.azimuth),r.lookAt(n.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}}),D2=AQ.vec3;function E2(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}function I2(e,t){var n=Tv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var r=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function L2(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=t.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}}),this),n&&isFinite(n[1]-n[0])){var r=BM(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new yA("altitude",r),this.resize(this.model,t)}}E2.prototype={constructor:E2,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},_getDisplacementScale:function(e,t){var n=(e+180)/360*(this.displacementWidth-1),r=(90-t)/180*(this.displacementHeight-1),i=Math.round(n)+Math.round(r)*this.displacementWidth;return this.displacementData[i]},dataToPoint:function(e,t){var n=e[0],r=e[1],i=e[2]||0,o=this.radius;this.displacementData&&(o*=1+this._getDisplacementScale(n,r)),this.altitudeAxis&&(o+=this.altitudeAxis.dataToCoord(i)),n=n*Math.PI/180,r=r*Math.PI/180;var a=Math.cos(r)*o;return(t=t||[])[0]=-a*Math.cos(n+Math.PI),t[1]=Math.sin(r)*o,t[2]=a*Math.sin(n+Math.PI),t},pointToData:function(e,t){var n=e[0],r=e[1],i=e[2],o=D2.len(e);n/=o,r/=o,i/=o;var a=Math.asin(r),s=Math.atan2(i,-n);s<0&&(s=2*Math.PI+s);var l=180*a/Math.PI,u=180*s/Math.PI-180;return(t=t||[])[0]=u,t[1]=l,t[2]=o-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}};var N2={dimensions:E2.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new $0;var r=new E2;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,n.push(r),r.resize=I2,r.resize(e,t),r.update=L2})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var n=t.getReferringComponents("globe").models[0];if(n||(n=e.getComponent("globe")),!n)throw new Error('globe "'+kJ(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var r=n.coordinateSystem;t.coordinateSystem=r}})),e.eachComponent("globe",(function(e,n){var r=e.coordinateSystem,i=e.getDisplacementTexture(),o=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var a=!0;nQ.loadTexture(i,t,(function(n){var r=function(e,t){var n=document.createElement("canvas"),r=n.getContext("2d"),i=e.width,o=e.height;n.width=i,n.height=o,r.drawImage(e,0,0,i,o);for(var a=r.getImageData(0,0,i,o).data,s=new Float32Array(a.length/4),l=0;l<a.length/4;l++){var u=a[4*l];s[l]=u/255*t}return{data:s,width:i,height:o}}(n.image,o);e.setDisplacementData(r.data,r.width,r.height),a||t.dispatchAction({type:"globeUpdateDisplacment"})})),a=!1}else r.setDisplacementData(null,0,0);r.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),n}};WS((function(e){e.registerComponentModel(c2),e.registerComponentView(C2),e.registerCoordinateSystem("globe",N2),e.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))}));var P2=["zoom","center","pitch","bearing"],O2=Nv.extend({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var e=this;return P2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMapboxCameraOption:function(e){null!=e&&P2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});function R2(e,t){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}Lr(O2.prototype,yQ),Lr(O2.prototype,_Q),R2.prototype.setUnpainted=function(){},R2.prototype.resize=function(){this._mapbox.resize()},R2.prototype.getMapbox=function(){return this._mapbox},R2.prototype.clear=function(){},R2.prototype.refresh=function(){this._mapbox.resize()};var k2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];R2.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},k2.forEach((function(t){this._handlers[t]=function(t){var n={};for(var r in t)n[r]=t[r];n.bubbles=!1;var i=new t.constructor(t.type,n);e.dispatchEvent(i)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},R2.prototype.dispose=function(){k2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)};var z2="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end";nQ.Shader.import(z2);var B2=Cx.extend({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var n=t.getZr();this._zrLayer=new R2("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new nQ.Node,this._sceneHelper=new NQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMapbox(),i=this._dispatchInteractAction.bind(this,t,r);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){r.on(e,i)})),this._groundMesh=new nQ.Mesh({geometry:new nQ.PlaneGeometry,material:new nQ.Material({shader:new nQ.Shader({vertex:nQ.Shader.source("ecgl.displayShadow.vertex"),fragment:nQ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,n){var r=this._zrLayer.getMapbox(),i=e.get("style"),o=JSON.stringify(i);o!==this._oldStyleStr&&i&&r.setStyle(i),this._oldStyleStr=o,r.setCenter(e.get("center")),r.setZoom(e.get("zoom")),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMapbox(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){e.dispatchAction({type:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var e=this._mapbox3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new nQ.Plane(new nQ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new nQ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new nQ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}}),V2=AQ.mat4,F2=512,G2=.6435011087932844,H2=Math.PI,U2=.1;function W2(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}function X2(){W2.apply(this,arguments)}function j2(e,t,n){function r(e,t){var n=t.getWidth(),r=t.getHeight(),i=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,r,i),this.width=n,this.height=r,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function i(e,t){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),r=e.coordDimToDataDim("alt")[0];if(r){var i=t.getDataExtent(r,!0);n[0]=Math.min(n[0],i[0]),n[1]=Math.max(n[1],i[1])}}}),this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}return{dimensions:t.prototype.dimensions,create:function(o,a){var s=[];return o.eachComponent(e,(function(e){var n=e.__viewGL;n||(n=e.__viewGL=new $0).setRootNode(new nQ.Node);var o=new t;o.viewGL=e.__viewGL,o.resize=r,o.resize(e,a),s.push(o),e.coordinateSystem=o,o.model=e,o.update=i})),o.eachSeries((function(t){if(t.get("coordinateSystem")===e){var n=t.getReferringComponents(e).models[0];if(n||(n=o.getComponent(e)),!n)throw new Error(e+' "'+kJ(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n&&n(s,o,a),s}}}W2.prototype={constructor:W2,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,F2)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(G2/2)*this.height*U2,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,n=G2/2,r=Math.PI/2+t,i=Math.sin(n)*e/Math.sin(Math.PI-r-n),o=1.1*(Math.cos(Math.PI/2-t)*i+e);this.pitch>50&&(o=1e3);var a=[];V2.perspective(a,G2,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix();a=V2.identity([]);var s=this.dataToPoint(this.center);V2.scale(a,a,[1,-1,1]),V2.translate(a,a,[0,0,-e]),V2.rotateX(a,a,t),V2.rotateZ(a,a,-this.bearing/180*Math.PI),V2.translate(a,a,[-s[0]*this.getScale()*U2,-s[1]*this.getScale()*U2,0]),this.viewGL.camera.viewMatrix.array=a;var l=[];V2.invert(l,a),this.viewGL.camera.worldTransform.array=l,this.viewGL.camera.decomposeWorldTransform();var u,c=F2*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var h=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/h*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=c/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*U2;this.viewGL.rootNode.scale.set(this.getScale()*U2,this.getScale()*U2,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*F2,t)},projectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1]*H2/180,o=t*(r*H2/180+H2)/(2*H2),a=t*(H2-Math.log(Math.tan(H2/4+.5*i)))/(2*H2);return(n=n||[])[0]=o,n[1]=a,n},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*F2,t)},unprojectOnTileWithScale:function(e,t,n){var r=e[0],i=e[1],o=r/t*(2*H2)-H2,a=2*(Math.atan(Math.exp(H2-i/t*(2*H2)))-H2/4);return(n=n||[])[0]=180*o/H2,n[1]=180*a/H2,n},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,F2,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},X2.prototype=new W2,X2.prototype.constructor=X2,X2.prototype.type="mapbox3D";var Y2=j2("mapbox3D",X2,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))}));WS((function(e){e.registerComponentModel(O2),e.registerComponentView(B2),e.registerCoordinateSystem("mapbox3D",Y2),e.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))}));var Z2=["zoom","center","pitch","bearing"],q2=Nv.extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return Z2.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMaptalksCameraOption:function(e){null!=e&&Z2.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});function K2(e,t,n,r){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:n,zoom:r,doubleClickZoom:!1,fog:!1}),this._initEvents()}Lr(q2.prototype,yQ),Lr(q2.prototype,_Q),K2.prototype.setUnpainted=function(){},K2.prototype.resize=function(){this._maptalks.checkSize()},K2.prototype.getMaptalks=function(){return this._maptalks},K2.prototype.clear=function(){},K2.prototype.refresh=function(){this._maptalks.checkSize()};var $2=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];K2.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},$2.forEach((function(t){this._handlers[t]=function(n){var r={};for(var i in n)r[i]=n[i];r.bubbles=!1;var o=new n.constructor(n.type,r);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(o):e.firstElementChild.dispatchEvent(o)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},K2.prototype.dispose=function(){$2.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},nQ.Shader.import(z2);var J2=Cx.extend({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new nQ.Mesh({geometry:new nQ.PlaneGeometry,material:new nQ.Material({shader:new nQ.Shader({vertex:nQ.Shader.source("ecgl.displayShadow.vertex"),fragment:nQ.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var n=t.getZr();this._zrLayer=new K2("maptalks3D",n,e.get("center"),e.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new nQ.Node,this._sceneHelper=new NQ(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,t,r);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach((function(e){r.on(e,i)}))},render:function(e,t,n){this._zrLayer||this._initMaptalksLayer(e,n);var r=this._zrLayer.getMaptalks(),i=e.get("urlTemplate"),o=r.getBaseLayer();i!==this._oldUrlTemplate&&(o?o.setOptions({urlTemplate:i,attribution:e.get("attribution")}):(o=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:i,subdomains:["a","b","c"],attribution:e.get("attribution")}),r.setBaseLayer(o))),this._oldUrlTemplate=i,r.setCenter(e.get("center")),r.setZoom(e.get("zoom"),{animation:!1}),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMaptalks(r);var a=e.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(e),a.viewGL.setPostEffect(e.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){var r;e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:(r=t.getResolution(),19-Math.log(r/Q2)/Math.LN2+1),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new nQ.Plane(new nQ.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new nQ.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new nQ.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}});const Q2=12756274*Math.PI/(256*Math.pow(2,20));function e3(){W2.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}e3.prototype=new W2,e3.prototype.constructor=e3,e3.prototype.type="maptalks3D";var t3=j2("maptalks3D",e3,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))}));WS((function(e){e.registerComponentModel(q2),e.registerComponentView(J2),e.registerCoordinateSystem("maptalks3D",t3),e.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))}));var n3=AQ.vec3,r3=zM.isDimensionStacked;function i3(e,t,n){for(var r=e.getDataExtent(t),i=e.getDataExtent(n),o=r[1]-r[0]||r[0],a=i[1]-i[0]||i[0],s=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),c=e.get(n,l),h=Math.floor((u-r[0])/o*49),d=50*Math.floor((c-i[0])/a*49)+h;s[d]=s[d]||1}var p=0;for(l=0;l<s.length;l++)s[l]&&p++;return p/s.length}var o3=AQ.vec3,a3=zM.isDimensionStacked;function s3(e,t){var n=a3(e,t[2]);return{dimension:n?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:n}}function l3(e){e.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,n=t&&t.type;if("globe"===n)!function(e,t){var n=e.getData(),r=e.get("minHeight")||0,i=e.get("barSize"),o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==i){var a=t.radius*Math.PI,s=i3(n,o[0],o[1]);i=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else Zr(i)||(i=[i,i]);var l=s3(n,o);n.each(o,(function(e,o,a,s){var u=n.get(l.dimension,s),c=l.isStacked?u-a:t.altitudeAxis.scale.getExtent()[0],h=Math.max(t.altitudeAxis.dataToCoord(a),r),d=t.dataToPoint([e,o,c]),p=t.dataToPoint([e,o,u]),f=o3.sub([],p,d);o3.normalize(f,f);var g=[i[0],h,i[1]];n.setItemLayout(s,[d,f,g])})),n.setLayout("orient",rK.UP.array)}(e,t);else if("cartesian3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize");if(null==r){var i,o,a=t.size,s=t.getAxis("x"),l=t.getAxis("y");i="category"===s.type?.7*s.getBandWidth():.6*Math.round(a[0]/Math.sqrt(n.count())),o="category"===l.type?.7*l.getBandWidth():.6*Math.round(a[1]/Math.sqrt(n.count())),r=[i,o]}else Zr(r)||(r=[r,r]);var u=t.getAxis("z").scale.getExtent(),c=function(e){var t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}(u),h=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),d=r3(n,h[2]),p=d?n.getCalculationInfo("stackResultDimension"):h[2];n.each(h,(function(e,i,o,a){var s=n.get(p,a),l=d?s-o:c?0:u[0],h=t.dataToPoint([e,i,l]),f=t.dataToPoint([e,i,s]),g=n3.dist(h,f),m=[0,f[1]<h[1]?-1:1,0];0===Math.abs(g)&&(g=.1);var v=[r[0],g,r[1]];n.setItemLayout(a,[h,m,v])})),n.setLayout("orient",[1,0,0])}(e,t);else if("geo3D"===n)!function(e,t){var n=e.getData(),r=e.get("barSize"),i=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==r){var a=Math.min(t.size[0],t.size[2]),s=i3(n,o[0],o[1]);r=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else Zr(r)||(r=[r,r]);var l=[0,1,0],u=s3(n,o);n.each(o,(function(e,o,a,s){var c=n.get(u.dimension,s),h=u.isStacked?c-a:t.altitudeAxis.scale.getExtent()[0],d=Math.max(t.altitudeAxis.dataToCoord(a),i),p=t.dataToPoint([e,o,h]),f=[r[0],d,r[1]];n.setItemLayout(s,[p,l,f])})),n.setLayout("orient",[1,0,0])}(e,t);else if("mapbox3D"===n||"maptalks3D"===n)!function(e,t){var n=e.getData(),r=e.coordDimToDataDim("lng")[0],i=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],a=e.get("barSize"),s=e.get("minHeight")||0;if(null==a){var l=n.getDataExtent(r),u=n.getDataExtent(i),c=t.dataToPoint([l[0],u[0]]),h=t.dataToPoint([l[1],u[1]]),d=Math.min(Math.abs(c[0]-h[0]),Math.abs(c[1]-h[1]))||1,p=i3(n,r,i);a=[d/Math.sqrt(n.count()/p),d/Math.sqrt(n.count()/p)]}else Zr(a)||(a=[a,a]),a[0]/=t.getScale()/16,a[1]/=t.getScale()/16;var f=[0,0,1],g=[r,i,o],m=s3(n,g);n.each(g,(function(e,r,i,o){var l=n.get(m.dimension,o),u=m.isStacked?l-i:0,c=t.dataToPoint([e,r,u]),h=t.dataToPoint([e,r,l]),d=Math.max(h[2]-c[2],s),p=[a[0],d,a[1]];n.setItemLayout(o,[c,f,p])})),n.setLayout("orient",[1,0,0])}(e,t);else if("production"!==process.env.NODE_ENV)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.")}))}))}var u3={};function c3(e,t,n){var r=e.getData(),i=e.getRawValue(t),o=Zr(i)?function(e){var i=[],o=function(e,t){var n=[];return Fr(e.dimensions,(function(r){var i=e.getDimensionInfo(r),o=i.otherDims[t];null!=o&&!1!==o&&(n[o]=i.name)})),n}(r,"tooltip");function a(e,t){var o=r.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var a=o.type,s="- "+(o.tooltipName||o.name)+": "+("ordinal"===a?e+"":"time"===a?n?"":mv("yyyy/MM/dd hh:mm:ss",e):lv(e));s&&i.push(lo(s))}}return o.length?Fr(o,(function(e){a(r.get(e,t),e)})):Fr(e,a),"<br/>"+i.join("<br/>")}(i):lo(lv(i)),a=r.getName(t),s=j1(r,t);Qr(s)&&s.colorStops&&(s=(s.colorStops[0]||{}).color);var l=gv(s=s||"transparent"),u=e.name;return"\0-"===u&&(u=""),u=u?lo(u)+(n?": ":"<br/>"):"",n?l+u+o:u+l+(a?lo(a)+": "+o:o)}function h3(e,t,n){n=n||e.getSource();var r=t||PS(e.get("coordinateSystem"))||["x","y","z"],i=_T(n,{dimensionsDefine:n.dimensionsDefine||e.get("dimensions"),encodeDefine:n.encodeDefine||e.get("encode"),coordDimensions:r.map((function(t){var n=e.getReferringComponents(t+"Axis3D").models[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&i.forEach((function(t){if(r.indexOf(t.coordDim)>=0){var n=e.getReferringComponents(t.coordDim+"Axis3D").models[0];n&&"category"===n.get("type")&&(t.ordinalMeta=n.getOrdinalMeta())}}));var o=zM.enableDataStack(e,i,{byIndex:!0,stackedCoordDimension:"z"}),a=new yT(i,e);return a.setCalculationInfo(o),a.initData(n),a}u3.getFormattedLabel=function(e,t,n,r,i){n=n||"normal";var o=e.getData(r).getItemModel(t),a=e.getDataParams(t,r);null!=i&&a.value instanceof Array&&(a.value=a.value[i]);var s,l=o.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==l&&(l=o.get(["label","formatter"])),"function"==typeof l?(a.status=n,s=l(a)):"string"==typeof l&&(s=fv(l,a)),s},u3.normalizeToArray=function(e){return e instanceof Array?e:null==e?[]:[e]};var d3=Mx.extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(e,t){return h3(this)},getFormattedLabel:function(e,t,n,r){var i=u3.getFormattedLabel(this,e,t,n,r);return null==i&&(i=this.getData().get("z",e)),i},formatTooltip:function(e){return c3(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});Lr(d3.prototype,h1);var p3,f3,g3,m3,v3,y3,_3,x3,b3=AQ.vec3,w3=AQ.mat3,S3=u$.extend((function(){return{attributes:{position:new u$.Attribute("position","float",3,"POSITION"),normal:new u$.Attribute("normal","float",3,"NORMAL"),color:new u$.Attribute("color","float",4,"COLOR"),prevPosition:new u$.Attribute("prevPosition","float",3),prevNormal:new u$.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,n=this.getBarVertexCount()*e,r=this.getBarTriangleCount()*e;this.vertexCount!==n&&(this.attributes.position.init(n),t?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var n=this.getBarVertexCount(),r=n*(e+1),i=n*e;i<r;i++)this.attributes.color.set(i,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=b3.create,t=b3.scaleAndAdd,n=e(),r=e(),i=e(),o=e(),a=e(),s=e(),l=e(),u=[],c=[],h=0;h<8;h++)u[h]=e();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],p=[0,1,2,0,2,3],f=[];for(h=0;h<d.length;h++)for(var g=d[h],m=0;m<2;m++){for(var v=[],y=0;y<3;y++)v.push(g[p[3*m+y]]);f.push(v)}return function(e,h,g,m,v,y){var _=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,h,g,m,this.bevelSize,this.bevelSegments,v);else{b3.copy(i,h),b3.normalize(i,i),b3.cross(o,g,i),b3.normalize(o,o),b3.cross(r,i,o),b3.normalize(o,o),b3.negate(a,r),b3.negate(s,i),b3.negate(l,o),t(u[0],e,r,m[0]/2),t(u[0],u[0],o,m[2]/2),t(u[1],e,r,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,a,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,a,m[0]/2),t(u[3],u[3],o,m[2]/2),t(n,e,i,m[1]),t(u[4],n,r,m[0]/2),t(u[4],u[4],o,m[2]/2),t(u[5],n,r,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],n,a,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],n,a,m[0]/2),t(u[7],u[7],o,m[2]/2);var x=this.attributes;if(this.enableNormal){c[0]=r,c[1]=a,c[2]=i,c[3]=s,c[4]=o,c[5]=l;for(var b=this._vertexOffset,w=0;w<d.length;w++){for(var S=3*this._triangleOffset,T=0;T<6;T++)this.indices[S++]=b+p[T];b+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var M=c[w];for(T=0;T<4;T++){var A=d[w][T];x.position.set(this._vertexOffset,u[A]),x.normal.set(this._vertexOffset,M),x.color.set(this._vertexOffset++,v)}}}else{for(w=0;w<f.length;w++){for(S=3*this._triangleOffset,T=0;T<3;T++)this.indices[S+T]=f[w][T]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)x.position.set(this._vertexOffset,u[w]),x.color.set(this._vertexOffset++,v)}}var C=this._vertexOffset;for(w=_;w<C;w++)this._dataIndices[w]=y}}(),_addBevelBar:(p3=b3.create(),f3=b3.create(),g3=b3.create(),m3=w3.create(),v3=[],y3=[1,-1,-1,1],_3=[1,1,-1,-1],x3=[2,0],function(e,t,n,r,i,o,a){b3.copy(f3,t),b3.normalize(f3,f3),b3.cross(g3,n,f3),b3.normalize(g3,g3),b3.cross(p3,f3,g3),b3.normalize(g3,g3),m3[0]=p3[0],m3[1]=p3[1],m3[2]=p3[2],m3[3]=f3[0],m3[4]=f3[1],m3[5]=f3[2],m3[6]=g3[0],m3[7]=g3[1],m3[8]=g3[2],i=Math.min(r[0],r[2])/2*i;for(var s=0;s<3;s++)v3[s]=Math.max(r[s]-2*i,0);var l=(r[0]-v3[0])/2,u=(r[1]-v3[1])/2,c=(r[2]-v3[2])/2,h=[],d=[],p=this._vertexOffset,f=[];for(s=0;s<2;s++){f[s]=f[s]=[];for(var g=0;g<=o;g++)for(var m=0;m<4;m++){(0===g&&0===s||1===s&&g===o)&&f[s].push(p);for(var v=0;v<=o;v++){var y=v/o*Math.PI/2+Math.PI/2*m,_=g/o*Math.PI/2+Math.PI/2*s;d[0]=l*Math.cos(y)*Math.sin(_),d[1]=u*Math.cos(_),d[2]=c*Math.sin(y)*Math.sin(_),h[0]=d[0]+y3[m]*v3[0]/2,h[1]=d[1]+u+x3[s]*v3[1]/2,h[2]=d[2]+_3[m]*v3[2]/2,Math.abs(l-u)<1e-6&&Math.abs(u-c)<1e-6||(d[0]/=l*l,d[1]/=u*u,d[2]/=c*c),b3.normalize(d,d),b3.transformMat3(h,h,m3),b3.transformMat3(d,d,m3),b3.add(h,h,e),this.attributes.position.set(p,h),this.enableNormal&&this.attributes.normal.set(p,d),this.attributes.color.set(p,a),p++}}}var x=4*o+3,b=2*o+1,w=x+1;for(m=0;m<b;m++)for(s=0;s<=x;s++){var S=m*w+s+this._vertexOffset,T=m*w+(s+1)%w+this._vertexOffset,M=(m+1)*w+(s+1)%w+this._vertexOffset,A=(m+1)*w+s+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[M,S,T]),this.setTriangleIndices(this._triangleOffset++,[M,A,S])}this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][2],f[0][1]]),this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][3],f[0][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][1],f[1][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][2],f[1][3]]),this._vertexOffset=p})});Or(S3.prototype,MQ),Or(S3.prototype,X1);var T3=AQ.vec3,M3=zx.extend({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this._api=t,this._labelsBuilder=new Z1(256,256,t);var n=this;this._labelsBuilder.getLabelPosition=function(e,t,r){if(n._data){var i=n._data.getItemLayout(e),o=i[0],a=i[1],s=i[2][1];return T3.scaleAndAdd([],o,a,r+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,n){var r=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=r,this._barMesh||(this._barMesh=new nQ.Mesh({geometry:new S3,shadowDepthMaterial:new nQ.Material({shader:new nQ.Shader(nQ.Shader.source("ecgl.sm.depth.vertex"),nQ.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var i=e.coordinateSystem;if(this._doRender(e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){nQ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var n=e.getData(),r=e.get("shading"),i="color"!==r,o=this,a=this._barMesh,s="ecgl."+r;a.material&&a.material.shader.name===s||(a.material=nQ.createMaterial(s,["VERTEX_COLOR"])),nQ.setMaterialFromModel(r,a.material,e,t),a.geometry.enableNormal=i,a.geometry.resetOffset();var l=e.get("bevelSize"),u=e.get("bevelSmoothness");a.geometry.bevelSegments=u,a.geometry.bevelSize=l;var c=[],h=new Float32Array(4*n.count()),d=0,p=0,f=!1;n.each((function(e){if(n.hasValue(e)){var t=j1(n,e),r=Y1(n,e);null==r&&(r=1),nQ.parseColor(t,c),c[3]*=r,h[d++]=c[0],h[d++]=c[1],h[d++]=c[2],h[d++]=c[3],c[3]>0&&(p++,c[3]<.99&&(f=!0))}})),a.geometry.setBarCount(p);var g=n.getLayout("orient"),m=this._barIndexOfData=new Int32Array(n.count());p=0;n.each((function(e){if(n.hasValue(e)){var t=n.getItemLayout(e),r=t[0],i=t[1],a=t[2],s=4*e;c[0]=h[s++],c[1]=h[s++],c[2]=h[s++],c[3]=h[s++],c[3]>0&&(o._barMesh.geometry.addBar(r,i,g,a,c,e),m[e]=p++)}else m[e]=-1})),a.geometry.dirty(),a.geometry.updateBoundingBox();var v=a.material;v.transparent=f,v.depthMask=!f,a.geometry.sortTriangles=f,this._initHandler(e,t)},_initHandler:function(e,t){var n=e.getData(),r=this._barMesh,i="cartesian3D"===e.coordinateSystem.type;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=r.geometry.getDataIndexOfVertex(e.triangle[0]);a!==o&&(this._downplay(o),this._highlight(a),this._labelsBuilder.updateLabels([a]),i&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",a),n.get("y",a),n.get("z",a,!0)]})),o=a,r.dataIndex=a}),this),r.on("mouseout",(function(e){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,r.dataIndex=-1,i&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=t.getItemModel(e).getModel("emphasis.itemStyle"),i=r.get("color"),o=r.get("opacity");if(null==i)i=as(j1(t,e),-.4);null==o&&(o=Y1(t,e));var a=nQ.parseColor(i);a[3]*=o,this._barMesh.geometry.setColor(n,a),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=j1(t,e),i=Y1(t,e),o=nQ.parseColor(r);o[3]*=i,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=zJ(o,i),s=this;null!=a?Fr(u3.normalizeToArray(a),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):o.each((function(t){"highlight"===e?s._highlight(t):s._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});WS((function(e){e.registerChartView(M3),e.registerSeriesModel(d3),l3(e),e.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))}));var A3=Mx.extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){return h3(this)},formatTooltip:function(e){return c3(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),C3=AQ.vec3;nQ.Shader.import(XQ);var D3=zx.extend({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this._api=t},render:function(e,t,n){var r=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=r,this._line3DMesh||(this._line3DMesh=new nQ.Mesh({geometry:new EQ({useNativeLine:!1,sortTriangles:!0}),material:new nQ.Material({shader:nQ.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var i=e.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(e,n),this._data=e.getData(),this._camera=i.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var n=e.getData(),r=this._line3DMesh;r.geometry.resetOffset();var i=n.getLayout("points"),o=[],a=new Float32Array(i.length/3*4),s=0,l=!1;n.each((function(e){var t=j1(n,e),r=Y1(n,e);null==r&&(r=1),nQ.parseColor(t,o),o[3]*=r,a[s++]=o[0],a[s++]=o[1],a[s++]=o[2],a[s++]=o[3],o[3]<.99&&(l=!0)})),r.geometry.setVertexCount(r.geometry.getPolylineVertexCount(i)),r.geometry.setTriangleCount(r.geometry.getPolylineTriangleCount(i)),r.geometry.addPolyline(i,a,kJ(e.get("lineStyle.width"),1)),r.geometry.dirty(),r.geometry.updateBoundingBox();var u=r.material;u.transparent=l,u.depthMask=!l;var c=e.getModel("debug.wireframe");c.get("show")?(r.geometry.createAttribute("barycentric","float",3),r.geometry.generateBarycentric(),r.material.set("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",nQ.parseColor(c.get("lineStyle.color")||"rgba(0,0,0,0.5)")),r.material.set("wireframeLineWidth",kJ(c.get("lineStyle.width"),1))):r.material.set("both","WIREFRAME_TRIANGLE"),this._points=i,this._initHandler(e,t)},_updateAnimation:function(e){nQ.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var n=e.getData(),r=e.coordinateSystem,i=this._line3DMesh,o=-1;i.seriesIndex=e.seriesIndex,i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var a=r.pointToData(e.point.array),s=n.indicesOfNearest("x",a[0])[0];s!==o&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s)]}),i.dataIndex=s),o=s}),this),i.on("mouseout",(function(e){o=-1,i.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new SK,t=this._camera;SK.multiply(e,t.projectionMatrix,t.viewMatrix);var n=this._positionNDC,r=this._points,i=r.length/3;n&&n.length/2===i||(n=this._positionNDC=new Float32Array(2*i));for(var o=[],a=0;a<i;a++){var s=3*a,l=2*a;o[0]=r[s],o[1]=r[s+1],o[2]=r[s+2],o[3]=1,C3.transformMat4(o,o,e.array),n[l]=o[0]/o[3],n[l+1]=o[1]/o[3]}},_pick:function(e,t,n,r,i,o){var a=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,u=.5*n.viewport.width,c=.5*n.viewport.height;e=(e+1)*u,t=(t+1)*c;for(var h=1;h<a.length/2;h++){var d=(a[2*(h-1)]+1)*u,p=(a[2*(h-1)+1]+1)*c,f=(a[2*h]+1)*u,g=(a[2*h+1]+1)*c;if(Oh(d,p,f,g,s,e,t))l=(d-e)*(d-e)+(p-t)*(p-t)<(f-e)*(f-e)+(g-t)*(g-t)?h-1:h}if(l>=0){var m=3*l,v=new rK(this._points[m],this._points[m+1],this._points[m+2]);o.push({dataIndex:l,point:v,pointWorld:v.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(v)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});WS((function(e){e.registerChartView(D3),e.registerSeriesModel(A3),e.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),n=e.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void("production"!==process.env.NODE_ENV&&console.error("line3D needs cartesian3D coordinateSystem"));var r=new Float32Array(3*t.count()),i=[],o=[],a=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n&&t.each(a,(function(e,t,a,s){i[0]=e,i[1]=t,i[2]=a,n.dataToPoint(i,o),r[3*s]=o[0],r[3*s+1]=o[1],r[3*s+2]=o[2]})),t.setLayout("points",r)}}))}))}));var E3=Mx.extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(e,t){return h3(this)},getFormattedLabel:function(e,t,n,r){var i=u3.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},formatTooltip:function(e){return c3(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function I3(e,t,n){(t=t||document.createElement("canvas")).width=e,t.height=e;var r=t.getContext("2d");return n&&n(r),t}var L3={getMarginByStyle:function(e){var t=e.minMargin||0,n=0;e.stroke&&"none"!==e.stroke&&(n=null==e.lineWidth?1:e.lineWidth);var r=e.shadowBlur||0,i=e.shadowOffsetX||0,o=e.shadowOffsetY||0,a={};return a.left=Math.max(n/2,-i+r,t),a.right=Math.max(n/2,i+r,t),a.top=Math.max(n/2,-o+r,t),a.bottom=Math.max(n/2,o+r,t),a},createSymbolSprite:function(e,t,n,r){var i=function(e,t,n,r){Zr(t)||(t=[t,t]);var i=L3.getMarginByStyle(n,r),o=t[0]+i.left+i.right,a=t[1]+i.top+i.bottom,s=Wb(e,0,0,t[0],t[1]),l=Math.max(o,a);s.x=i.left,s.y=i.top,o>a?s.y+=(l-a)/2:s.x+=(l-o)/2;var u=s.getBoundingRect();return s.x-=u.x,s.y-=u.y,s.setStyle(n),s.update(),s.__size=l,s}(e,t,n),o=L3.getMarginByStyle(n);return{image:I3(i.__size,r,(function(e){mw(e,i)})),margin:o}},createSDFFromCanvas:function(e,t,n,r){return I3(t,r,(function(t){var r=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,n){var r=t.width,i=t.height,o=e.canvas.width,a=e.canvas.height,s=r/o,l=i/a;function u(e){return e<128?1:-1}function c(e,o){var a=1/0;e=Math.floor(e*s);for(var c=(o=Math.floor(o*l))*r+e,h=u(t.data[4*c]),d=Math.max(o-n,0);d<Math.min(o+n,i);d++)for(var p=Math.max(e-n,0);p<Math.min(e+n,r);p++){c=d*r+p;var f=p-e,g=d-o;if(h!==u(t.data[4*c])){var m=f*f+g*g;m<a&&(a=m)}}return h*Math.sqrt(a)}for(var h=e.createImageData(o,a),d=0;d<a;d++)for(var p=0;p<o;p++){var f=c(p,d)/n*.5+.5,g=4*(d*o+p);h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255*(1-f),h.data[g++]=255}return h}(t,r,n),0,0)}))},createSimpleSprite:function(e,t){return I3(e,t,(function(t){var n=e/2;t.beginPath(),t.arc(n,n,60,0,2*Math.PI,!1),t.closePath();var r=t.createRadialGradient(n,n,0,n,n,n);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=r,t.fill()}))}},N3=AQ.vec3,P3={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var n=this.indices,r=N3.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var i=0;i<n.length;i++)n[i]=i}if(0===t){var o,a=this.attributes.position,s=(e=e.array,0);this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount));for(i=0;i<this.vertexCount;i++){a.get(i,r);var l=N3.sqrDist(r,e);isNaN(l)&&(l=1e7,s++),0===i?(o=l,l=0):l-=o,this._zList[i]=l}this._noneCount=s}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(i=0;i<3;i++)this._progressiveQuickSort(3*t+i);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,n=this.indices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):F1.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._zList,n=this.indices;this._quickSort=this._quickSort||new F1,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}},O3=AQ.vec4;nQ.Shader.import("@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end");var R3=nQ.Mesh.extend((function(){var e=new nQ.Geometry({dynamic:!0,attributes:{color:new nQ.Geometry.Attribute("color","float",4,"COLOR"),position:new nQ.Geometry.Attribute("position","float",3,"POSITION"),size:new nQ.Geometry.Attribute("size","float",1),prevPosition:new nQ.Geometry.Attribute("prevPosition","float",3),prevSize:new nQ.Geometry.Attribute("prevSize","float",1)}});Object.assign(e,P3);var t=new nQ.Material({shader:nQ.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var n=new nQ.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",n),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:nQ.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,n,r,i,o){var a=this._positionNDC;if(a)for(var s=n.viewport,l=2/s.width,u=2/s.height,c=this.geometry.vertexCount-1;c>=0;c--){var h,d=a[2*(h=this.geometry.indices?this.geometry.indices[c]:c)],p=a[2*h+1],f=this.geometry.attributes.size.get(h)/this.sizeScale/2;if(e>d-f*l&&e<d+f*l&&t>p-f*u&&t<p+f*u){var g=new nQ.Vector3,m=new nQ.Vector3;this.geometry.attributes.position.get(h,g.array),nQ.Vector3.transformMat4(m,g,this.worldTransform),o.push({vertexIndex:h,point:g,pointWorld:m,target:this,distance:m.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,n){var r=this._positionNDC,i=this.geometry;r&&r.length/2===i.vertexCount||(r=this._positionNDC=new Float32Array(2*i.vertexCount));for(var o=O3.create(),a=0;a<i.vertexCount;a++)i.attributes.position.get(a,o),o[3]=1,O3.transformMat4(o,o,e.array),O3.scale(o,o,1/o[3]),r[2*a]=o[0],r[2*a+1]=o[1]}});function k3(e,t){this.rootNode=new nQ.Node,this.is2D=e,this._labelsBuilder=new Z1(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}k3.prototype={constructor:k3,highlightOnMouseover:!0,update:function(e,t,n,r,i){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var a=e.getData();if(null==r&&(r=0),null==i&&(i=a.count()),this._startDataIndex=r,this._endDataIndex=i-1,!this._mesh){var s=this._prevMesh&&this._prevMesh.material;this._mesh=new R3({renderOrder:10,frustumCulling:!1}),s&&(this._mesh.material=s)}s=this._mesh.material;var l=this._mesh.geometry,u=l.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var c=this._getSymbolInfo(e,r,i),h=n.getDevicePixelRatio(),d=e.getModel("itemStyle").getItemStyle(),p=e.get("large"),f=1;c.maxSize>2?(f=this._updateSymbolSprite(e,d,c,h),s.enableTexture("sprite")):s.disableTexture("sprite"),u.position.init(i-r);var g=[];if(p){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var m=function(e){const t=e.getVisual("style");if(t)return t[e.getVisual("drawType")]}(a),v=function(e){return e.getVisual("style").opacity}(a);nQ.parseColor(m,g),g[3]*=v,s.set({color:g,u_Size:c.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),u.size.init(i-r),u.color.init(i-r),this._originalOpacity=new Float32Array(i-r);for(var y=a.getLayout("points"),_=u.position.value,x=0;x<i-r;x++){var b=3*x,w=2*x;if(this.is2D?(_[b]=y[w],_[b+1]=y[w+1],_[b+2]=-10):(_[b]=y[b],_[b+1]=y[b+1],_[b+2]=y[b+2]),!p){m=j1(a,x),v=Y1(a,x);nQ.parseColor(m,g),g[3]*=v,u.color.set(x,g),g[3];var S=a.getItemVisual(x,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),u.size.value[x]=S*f*this._sizeScale,this._originalOpacity[x]=g[3]}}this._mesh.sizeScale=f,l.updateBoundingBox(),l.dirty(),this._updateMaterial(e,d);var T=e.coordinateSystem;T&&T.viewGL&&s[T.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE");p||this._updateLabelBuilder(e,r,i),this._updateHandler(e,t,n),this._updateAnimation(e),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},dispose:function(){this._labelsBuilder.dispose()},_updateSymbolSprite:function(e,t,n,r){n.maxSize=Math.min(2*n.maxSize,200);var i,o,a=[];return n.aspect>1?(a[0]=n.maxSize,a[1]=n.maxSize/n.aspect):(a[1]=n.maxSize,a[0]=n.maxSize*n.aspect),a[0]=a[0]||1,a[1]=a[1]||1,this._symbolType===n.type&&(i=this._symbolSize,o=a,i&&o&&i[0]===o[0]&&i[1]===o[1])&&this._lineWidth===t.lineWidth||(L3.createSymbolSprite(n.type,a,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(a[0]/2,10)},this._spriteImageCanvas),L3.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=a,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/n.maxSize*r},_updateMaterial:function(e,t){var n="lighter"===e.get("blendMode")?nQ.additiveBlend:null,r=this._mesh.material;r.blend=n,r.set("lineWidth",t.lineWidth/20);var i=nQ.parseColor(t.stroke);r.set("strokeColor",i),r.transparent=!0,r.depthMask=!1,r.depthTest=!this.is2D,r.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,n){var r=e.getData(),i=this._mesh.geometry,o=i.attributes.position.value,a=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(r,t,n),this._labelsBuilder.getLabelPosition=function(e,n,r){var i=3*(e-t);return[o[i],o[i+1],o[i+2]]},this._labelsBuilder.getLabelDistance=function(e,n,r){return i.attributes.size.get(e-t)/a/2+r},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){nQ.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,n){var r,i=e.getData(),o=this._mesh,a=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(r=e.coordinateSystem.model),o.seriesIndex=e.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",(function(t){var u=t.vertexIndex+a._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(i,s),this.highlight(i,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get(e.coordDimToDataDim("x")[0],u),i.get(e.coordDimToDataDim("y")[0],u),i.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:r.componentIndex})),o.dataIndex=u,s=u}),this),o.on("mouseout",(function(e){var t=e.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(i,t),this._labelsBuilder.updateLabels()),s=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:r.componentIndex})}),this)},updateLayout:function(e,t,n){var r=e.getData();if(this._mesh){var i=this._mesh.geometry.attributes.position.value,o=r.getLayout("points");if(this.is2D)for(var a=0;a<o.length/2;a++){var s=3*a,l=2*a;i[s]=o[l],i[s+1]=o[l+1],i[s+2]=-10}else for(a=0;a<o.length;a++)i[a]=o[a];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new SK;SK.mul(t,e.viewMatrix,this._mesh.worldTransform),SK.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api)}},highlight:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=e.getItemModel(t).getModel("emphasis.itemStyle"),r=n.get("color"),i=n.get("opacity");if(null==r)r=as(j1(e,t),-.4);null==i&&(i=Y1(e,t));var o=nQ.parseColor(r);o[3]*=i,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,o),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=j1(e,t),r=Y1(e,t),i=nQ.parseColor(n);i[3]*=r,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,i),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,n=0;n<t.vertexCount;n++){var r=this._originalOpacity[n]*e;t.attributes.color.value[4*n+3]=r}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var n=this._mesh.geometry.attributes;if(n.size.value)for(var r=0;r<n.size.value.length;r++)n.size.value[r]=n.size.value[r]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,n){if(e.get("large"))return(h=kJ(e.get("symbolSize"),1))instanceof Array?(l=Math.max(h[0],h[1]),r=h[0]/h[1]):(l=h,r=1),{maxSize:h,type:e.get("symbol"),aspect:r};for(var r,i=e.getData(),o=!1,a=i.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=t;u<n;u++){var c,h=i.getItemVisual(u,"symbolSize"),d=i.getItemVisual(u,"symbol");if(h instanceof Array)c=h[0]/h[1],l=Math.max(Math.max(h[0],h[1]),l);else{if(isNaN(h))continue;c=1,l=Math.max(h,l)}"production"!==process.env.NODE_ENV&&(null!=r&&Math.abs(c-r)>.05&&(o=!0),d!==a&&(s=!0)),a=d,r=c}return"production"!==process.env.NODE_ENV&&(o&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored.")),{maxSize:l,type:a,aspect:r}}};var z3=zx.extend({type:"scatter3D",hasSymbolVisual:!0,__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,n){if(this.groupGL.removeAll(),e.getData().count()){var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new k3(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),i.update(e,t,n),i.updateView(r.viewGL.camera)}else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system")}},incrementalPrepareRender:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL)r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;else if("production"!==process.env.NODE_ENV)throw new Error("Invalid coordinate system");this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new k3(!1,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),i.update(t,n,r,e.start,e.end),i.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,i){var o=t.getData(),a=zJ(o,i),s="highlight"===e;null!=a?Fr(u3.normalizeToArray(a),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}),this):o.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];s?n.highlight(o,e):n.downplay(o,e)}}))},dispose:function(){this._pointsBuilderList.forEach((function(e){e.dispose()})),this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});WS((function(e){e.registerChartView(z3),e.registerSeriesModel(E3),e.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var n=t.dimensions;if(n.length<3)return void("production"!==process.env.NODE_ENV&&console.error("scatter3D needs 3D coordinateSystem"));var r=n.map((function(t){return e.coordDimToDataDim(t)[0]})),i=[],o=[];return{progress:function(e,n){for(var a=new Float32Array(3*(e.end-e.start)),s=e.start;s<e.end;s++){var l=3*(s-e.start);i[0]=n.get(r[0],s),i[1]=n.get(r[1],s),i[2]=n.get(r[2],s),t.dataToPoint(i,o),a[l]=o[0],a[l+1]=o[1],a[l+2]=o[2]}n.setLayout("points",a)}}}}})}));var B3=AQ.vec3,V3=AQ.vec2,F3=B3.normalize,G3=B3.cross,H3=B3.sub,U3=B3.add,W3=B3.create,X3=W3(),j3=W3(),Y3=W3(),Z3=W3(),q3=[],K3=[];function $3(e,t){V3.copy(q3,e[0]),V3.copy(K3,e[1]);var n=[],r=n[0]=W3(),i=n[1]=W3(),o=n[2]=W3(),a=n[3]=W3();t.dataToPoint(q3,r),t.dataToPoint(K3,a),F3(X3,r),H3(j3,a,r),F3(j3,j3),G3(Y3,j3,X3),F3(Y3,Y3),G3(j3,X3,Y3),U3(i,X3,j3),F3(i,i),F3(X3,a),H3(j3,r,a),F3(j3,j3),G3(Y3,j3,X3),F3(Y3,Y3),G3(j3,X3,Y3),U3(o,X3,j3),F3(o,o),U3(Z3,r,a),F3(Z3,Z3);var s=B3.dot(r,Z3),l=B3.dot(Z3,i),u=(Math.max(B3.len(r),B3.len(a))-s)/l*2;return B3.scaleAndAdd(i,r,i,u),B3.scaleAndAdd(o,a,o,u),n}function J3(e,t){for(var n=new Float32Array(3*e.length),r=0,i=[],o=0;o<e.length;o++)t.dataToPoint(e[o],i),n[r++]=i[0],n[r++]=i[1],n[r++]=i[2];return n}function Q3(e){var t=[];return e.each((function(n){var r=e.getItemModel(n),i=r.option instanceof Array?r.option:r.getShallow("coords",!0);if("production"!==process.env.NODE_ENV&&!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");t.push(i)})),{coordsList:t}}function e5(e,t,n){var r=e.getData(),i=e.get("polyline"),o=Q3(r);r.setLayout("lineType",i?"polyline":"cubicBezier"),r.each((function(e){var a=o.coordsList[e],s=i?J3(a,t):function(e,t,n){var r=[],i=r[0]=B3.create(),o=r[1]=B3.create(),a=r[2]=B3.create(),s=r[3]=B3.create();t.dataToPoint(e[0],i),t.dataToPoint(e[1],s);var l=B3.dist(i,s);return B3.lerp(o,i,s,.3),B3.lerp(a,i,s,.3),B3.scaleAndAdd(o,o,n,Math.min(.1*l,10)),B3.scaleAndAdd(a,a,n,Math.min(.1*l,10)),r}(a,t,n);r.setItemLayout(e,s)}))}function t5(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var n=e.getData(),r=e.get("polyline");n.setLayout("lineType",r?"polyline":"cubicBezier");var i=Q3(n);n.each((function(e){var o=i.coordsList[e],a=r?J3:$3;n.setItemLayout(e,a(o,t))}))}(e,t):"geo3D"===t.type?e5(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||e5(e,t,[0,0,1])}))}var n5=Mx.extend({type:"series.lines3D",dependencies:["globe"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){var n=new yT(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}}),r5=AQ.vec3;nQ.Shader.import("@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end");var i5=nQ.Mesh.extend((function(){var e=new nQ.Material({shader:new nQ.Shader(nQ.Shader.source("ecgl.trail2.vertex"),nQ.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new EQ({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,n){var r=e.hostModel,i=this.geometry,o=r.getModel("effect"),a=o.get("trailWidth")*t.getDevicePixelRatio(),s=o.get("trailLength"),l=r.get("effect.constantSpeed"),u=1e3*r.get("effect.period"),c=null!=l;"production"!==process.env.NODE_ENV&&(this.getScene()||console.error("TrailMesh must been add to scene before updateData")),c?this.material.set("speed",l/1e3):this.material.set("period",u),this.material[c?"define":"undefine"]("vertex","CONSTANT_SPEED");var h=r.get("polyline");i.trailLength=s,this.material.set("trailLength",s),i.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){i.attributes[e].value=n.attributes[e].value}));["dist","distAll","start","offset","color"].forEach((function(e){i.attributes[e].init(i.vertexCount)})),i.indices=n.indices;var d=[],p=o.get("trailColor"),f=o.get("trailOpacity"),g=null!=p,m=null!=f;this.updateWorldTransform();var v=this.worldTransform.x.len(),y=this.worldTransform.y.len(),_=this.worldTransform.z.len(),x=0,b=0;e.each((function(t){var r=e.getItemLayout(t),o=m?f:Y1(e,t),s=j1(e,t);null==o&&(o=1),(d=nQ.parseColor(g?p:s,d))[3]*=o;for(var l=h?n.getPolylineVertexCount(r):n.getCubicCurveVertexCount(r[0],r[1],r[2],r[3]),w=0,S=[],T=[],M=x;M<x+l;M++)i.attributes.position.get(M,S),S[0]*=v,S[1]*=y,S[2]*=_,M>x&&(w+=r5.dist(S,T)),i.attributes.dist.set(M,w),r5.copy(T,S);b=Math.max(b,w);var A=Math.random()*(c?w:u);for(M=x;M<x+l;M++)i.attributes.distAll.set(M,w),i.attributes.start.set(M,A),i.attributes.offset.set(M,(n.attributes.offset.get(M)>0?1:-1)*a/2),i.attributes.color.set(M,d);x+=l})),this.material.set("spotSize",.1*b*s),this.material.set("spotIntensity",o.get("spotIntensity")),i.dirty()},setAnimationTime:function(e){this.material.set("time",e)}});nQ.Shader.import(XQ);var o5=zx.extend({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this._meshLinesMaterial=new nQ.Material({shader:nQ.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new nQ.Mesh({geometry:new EQ,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new i5},render:function(e,t,n){this.groupGL.add(this._linesMesh);var r=e.coordinateSystem,i=e.getData();if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._updateLines(e,t,n);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var a=this._trailMesh;if(a.stopAnimation(),e.get("effect.show")){this.groupGL.add(a),a.updateData(i,n,this._linesMesh.geometry),a.__time=a.__time||0;var s=36e5;this._curveEffectsAnimator=a.animate("",{loop:!0}).when(s,{__time:s}).during((function(){a.setAnimationTime(a.__time)})).start()}else this.groupGL.remove(a),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?nQ.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,n){var r=e.getData(),i=e.coordinateSystem,o=this._linesMesh.geometry,a=e.get("polyline");o.expandLine=!0;var s=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(i);o.segmentScale=s/20;var l="lineStyle.width".split("."),u=n.getDevicePixelRatio();r.each((function(e){var t=r.getItemModel(e).get(l);null==t&&(t=1),r.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,h=0;r.each((function(e){var t=r.getItemLayout(e);a?(c+=o.getPolylineVertexCount(t),h+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),h+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(h),o.resetOffset();var d=[];r.each((function(e){var t=r.getItemLayout(e),n=j1(r,e),i=Y1(r,e),s=r.getItemVisual(e,"lineWidth")*u;null==i&&(i=1),(d=nQ.parseColor(n,d))[3]*=i,a?o.addPolyline(t,d,s):o.addCubicCurve(t[0],t[1],t[2],t[3],d,s)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function a5(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}WS((function(e){e.registerChartView(o5),e.registerSeriesModel(n5),e.registerLayout(t5),e.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),e.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),e.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))}));var s5=Mx.extend({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getItemModel(e),r=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(r=[r]);for(var i=[],o=0;o<r.length;o++){for(var a=[],s=1;s<r[o].length;s++)a.push(a5(t,r[o][s]));i.push({exterior:a5(t,r[o][0]),interiors:a})}return i},getInitialData:function(e){var t=new yT(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,n,r,i){if(e instanceof Array)return NaN;t.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),t},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});Lr(s5.prototype,h1);var l5=zx.extend({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL);var i=this._geo3DBuilderList[0];i||((i=new K1(n)).extrudeY="mapbox3D"!==r.type&&"maptalks3D"!==r.type,this._geo3DBuilderList[0]=i),this._updateShaderDefines(r,i),i.update(e,t,n),this._geo3DBuilderList.length=1,this.groupGL.add(i.rootNode)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll();var r=e.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,n,r){var i=this._geo3DBuilderList[this._currentStep],o=t.coordinateSystem;i||((i=new K1(r)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=i),i.update(t,n,r,e.start,e.end),this.groupGL.add(i.rootNode),this._updateShaderDefines(o,i),this._currentStep++},_updateShaderDefines:function(e,t){var n=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[n]("fragment","SRGB_DECODE"),"mapbox3D"!==e.type&&"maptalks3D"!==e.type||(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll(),this._geo3DBuilderList.forEach((function(e){e.dispose()}))}});WS((function(e){e.registerChartView(l5),e.registerSeriesModel(s5)}));var u5=Mx.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return c3(this,e)},getInitialData:function(e,t){var n=e.data;function r(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function i(e){var t=pu;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!n)if(e.parametric){var o=e.parametricEquation||{},a=o.u||{},s=o.v||{};["u","v"].forEach((function(e){r(o[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof o[e]||"production"!==process.env.NODE_ENV&&console.error("parametricEquation.%s needs to be function",e)}));var l=Math.floor((a.max+a.step-a.min)/a.step),u=Math.floor((s.max+s.step-s.min)/s.step);n=new Float32Array(l*u*5);var c=i(a),h=i(s);for(S=0,T=0;T<u;T++)for(M=0;M<l;M++){var d=M*a.step+a.min,p=T*s.step+s.min,f=cu(Math.min(d,a.max),c),g=cu(Math.min(p,s.max),h);A=o.x(f,g),C=o.y(f,g),I=o.z(f,g);n[S++]=A,n[S++]=C,n[S++]=I,n[S++]=f,n[S++]=g}}else{var m=e.equation||{},v=m.x||{},y=m.y||{};if(["x","y"].forEach((function(e){r(m[e])||"production"!==process.env.NODE_ENV&&console.error("Invalid equation.%s",e)})),"function"!=typeof m.z)return void("production"!==process.env.NODE_ENV&&console.error("equation.z needs to be function"));var _=Math.floor((v.max+v.step-v.min)/v.step),x=Math.floor((y.max+y.step-y.min)/y.step);n=new Float32Array(_*x*3);for(var b=i(v),w=i(y),S=0,T=0;T<x;T++)for(var M=0;M<_;M++){var A=M*v.step+v.min,C=T*y.step+y.min,D=cu(Math.min(A,v.max),b),E=cu(Math.min(C,y.max),w),I=m.z(D,E);n[S++]=D,n[S++]=E,n[S++]=I}}var L=["x","y","z"];return e.parametric&&L.push("u","v"),h3(this,L,n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});Lr(u5.prototype,h1);var c5=AQ.vec3;function h5(e){return isNaN(e[0])||isNaN(e[1])||isNaN(e[2])}var d5=zx.extend({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node},render:function(e,t,n){var r=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=r,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var i=e.coordinateSystem,o=e.get("shading"),a=e.getData(),s="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===s||(this._surfaceMesh.material=nQ.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),nQ.setMaterialFromModel(o,this._surfaceMesh.material,e,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var l=i.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=e.get("parametric"),c=e.get("dataShape");c||(c=this._getDataShape(a,u),"production"!==process.env.NODE_ENV&&e.get("data")&&console.warn("dataShape is not provided. Guess it is ",c));var h=e.getModel("wireframe"),d=h.get("lineStyle.width"),p=h.get("show")&&d>0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var f=this._surfaceMesh.material;p?(f.define("WIREFRAME_QUAD"),f.set("wireframeLineWidth",d),f.set("wireframeLineColor",nQ.parseColor(h.get("lineStyle.color")))):f.undefine("WIREFRAME_QUAD"),this._initHandler(e,n),this._updateAnimation(e)},_updateAnimation:function(e){nQ.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new nQ.Mesh({geometry:new nQ.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new nQ.Material({shader:new nQ.Shader(nQ.Shader.source("ecgl.sm.depth.vertex"),nQ.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,X1),e},_initHandler:function(e,t){var n=e.getData(),r=this._surfaceMesh,i=e.coordinateSystem;r.seriesIndex=e.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var a=function(e,t){for(var n=1/0,i=-1,o=[],a=0;a<e.length;a++){r.geometry.attributes.position.get(e[a],o);var s=c5.dist(t.array,o);s<n&&(n=s,i=e[a])}return i}(e.triangle,e.point);if(a>=0){var s=[];r.geometry.attributes.position.get(a,s);for(var l=i.pointToData(s),u=1/0,c=-1,h=[],d=0;d<n.count();d++){h[0]=n.get("x",d),h[1]=n.get("y",d),h[2]=n.get("z",d);var p=c5.squaredDistance(h,l);p<u&&(c=d,u=p)}c!==o&&t.dispatchAction({type:"grid3DShowAxisPointer",value:l}),o=c,r.dataIndex=c}else r.dataIndex=-1}),this),r.on("mouseout",(function(e){o=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,n,r){var i=e.geometry,o=t.getData(),a=o.getLayout("points"),s=0;o.each((function(e){o.hasValue(e)||s++}));var l=s||r,u=i.attributes.position,c=i.attributes.normal,h=i.attributes.texcoord0,d=i.attributes.barycentric,p=i.attributes.color,f=n[0],g=n[1],m="color"!==t.get("shading");if(l){var v=(f-1)*(g-1)*4;u.init(v),r&&d.init(v)}else u.value=new Float32Array(a);p.init(i.vertexCount),h.init(i.vertexCount);var y=[0,3,1,1,3,2],_=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],x=i.indices=new(i.vertexCount>65535?Uint32Array:Uint16Array)((f-1)*(g-1)*6),b=function(e,t,n){n[1]=e*g+t,n[0]=e*g+t+1,n[3]=(e+1)*g+t+1,n[2]=(e+1)*g+t},w=!1;if(l){var S=[],T=[],M=0;m?c.init(i.vertexCount):c.value=null;for(var A=[[],[],[]],C=[],D=[],E=c5.create(),I=function(e,t,n){var r=3*t;return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n},L=new Float32Array(a.length),N=new Float32Array(a.length/3*4),P=0;P<o.count();P++)if(o.hasValue(P)){var O=nQ.parseColor(j1(o,P));null!=(X=Y1(o,P))&&(O[3]*=X),O[3]<.99&&(w=!0);for(var R=0;R<4;R++)N[4*P+R]=O[R]}var k=[1e7,1e7,1e7];for(P=0;P<f-1;P++)for(var z=0;z<g-1;z++){var B=4*(P*(g-1)+z);b(P,z,S);var V=!1;for(R=0;R<4;R++)I(a,S[R],T),h5(T)&&(V=!0);for(R=0;R<4;R++)V?u.set(B+R,k):(I(a,S[R],T),u.set(B+R,T)),r&&d.set(B+R,_[R]);for(R=0;R<6;R++)x[M++]=y[R]+B;if(m&&!V)for(R=0;R<2;R++){for(var F=3*R,G=0;G<3;G++){I(a,W=S[y[F]+G],A[G])}c5.sub(C,A[0],A[1]),c5.sub(D,A[1],A[2]),c5.cross(E,C,D);for(G=0;G<3;G++){var H=3*S[y[F]+G];L[H]=L[H]+E[0],L[H+1]=L[H+1]+E[1],L[H+2]=L[H+2]+E[2]}}}if(m)for(P=0;P<L.length/3;P++)I(L,P,E),c5.normalize(E,E),L[3*P]=E[0],L[3*P+1]=E[1],L[3*P+2]=E[2];O=[];var U=[];for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){B=4*(P*(g-1)+z);b(P,z,S);for(R=0;R<4;R++){for(G=0;G<4;G++)O[G]=N[4*S[R]+G];p.set(B+R,O),m&&(I(L,S[R],E),c.set(B+R,E));var W=S[R];U[0]=W%g/(g-1),U[1]=Math.floor(W/g)/(f-1),h.set(B+R,U)}0}}else{for(U=[],P=0;P<o.count();P++){U[0]=P%g/(g-1),U[1]=Math.floor(P/g)/(f-1);var X;O=nQ.parseColor(j1(o,P));null!=(X=Y1(o,P))&&(O[3]*=X),O[3]<.99&&(w=!0),p.set(P,O),h.set(P,U)}S=[];var j=0;for(P=0;P<f-1;P++)for(z=0;z<g-1;z++){b(P,z,S);for(R=0;R<6;R++)x[j++]=S[y[R]]}m?i.generateVertexNormals():c.value=null}e.material.get("normalMap")&&i.generateTangents(),i.updateBoundingBox(),i.dirty(),e.material.transparent=w,e.material.depthMask=!w},_getDataShape:function(e,t){for(var n=-1/0,r=0,i=0,o=0,a=!1,s=t?"u":"x",l=e.count(),u=0;u<l;u++){var c=e.get(s,u);c<n&&(o&&o!==i&&"production"!==process.env.NODE_ENV&&(a=!0),o=i,i=0,r++),n=c,i++}if(r&&1!==i||(a=!0),!a)return[r+1,i];for(var h=Math.floor(Math.sqrt(l));h>0;){if(Math.floor(l/h)===l/h)return[h,l/h];h--}return[h=Math.floor(Math.sqrt(l)),h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function p5(e,t){for(var n=[],r=0;r<t.length;r++)n.push(e.dataToPoint(t[r]));return n}WS((function(e){e.registerChartView(d5),e.registerSeriesModel(u5),e.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||"production"!==process.env.NODE_ENV&&console.error("Surface chart only support cartesian3D coordinateSystem");var n=e.getData(),r=new Float32Array(3*n.count()),i=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var o=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n.each(o,(function(e,o,a,s){var l;l=n.hasValue(s)?t.dataToPoint([e,o,a]):i,r[3*s]=l[0],r[3*s+1]=l[1],r[3*s+2]=l[2]}))}n.setLayout("points",r)}))}))}));var f5=Mx.extend({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualStyleAccessPath:"itemStyle",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){if("production"!==process.env.NODE_ENV){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&n.push(t)})),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),t)}this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=_T(e.data,{coordDimensions:["value"]}),n=new yT(t,this);n.initData(e.data);var r={};return n.each((function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i})),this._regionModelMap=r,n},formatTooltip:function(e){return c3(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new xm(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getName(e);if(t.transform)return(r=t.getRegion(n))?r.geometries:[];this._geo||(this._geo=s2.createGeo3D(this));for(var r=this._geo.getRegion(n),i=[],o=0;o<r.geometries.length;o++){var a=r.geometries[o],s=[],l=p5(t,a.exterior);if(s&&s.length)for(var u=0;u<a.interiors.length;u++)s.push(p5(t,s[u]));i.push({interiors:s,exterior:l})}return i},getFormattedLabel:function(e,t){var n=u3.getFormattedLabel(this,e,t);return null==n&&(n=this.getData().getName(e)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});Lr(f5.prototype,d1),Lr(f5.prototype,vQ),Lr(f5.prototype,yQ),Lr(f5.prototype,_Q),Lr(f5.prototype,h1);var g5=zx.extend({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new K1(t),this.groupGL=new nQ.Node},render:function(e,t,n){var r=e.coordinateSystem;if(r&&r.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),r.viewGL.add(this.groupGL),"geo3D"===r.type){this._sceneHelper||(this._sceneHelper=new NQ,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var i=this._control;i||(i=this._control=new TQ({zr:n.getZr()}),this._control.init());var o=e.getModel("viewControl");i.setViewGL(r.viewGL),i.setFromViewControlModel(o,0),i.off("update"),i.on("update",(function(){n.dispatchAction({type:"map3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),from:this.uid,map3DId:e.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(e,t,n,0,e.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,n,r){var i=r.renderer,o=e.coordinateSystem;o&&"geo3D"===o.type&&(this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._geo3DBuilder.dispose()}});WS((function(e){l2(e),e.registerChartView(g5),e.registerSeriesModel(f5),e.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))}));var m5=Mx.extend({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(){return kM(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}});function v5(e){this.viewGL=e}v5.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=[1,0,0,1,0,0],this.updateTransform(e,t)},v5.prototype.updateTransform=function(e,t){var n=e.coordinateSystem;n.getRoamTransform&&(Io(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},v5.prototype.dataToPoint=function(e,t,n){n=e.dataToPoint(t,null,n);var r=this._viewTransform;r&&ji(n,n,r)},v5.prototype.removeTransformInPoint=function(e){return this._viewTransform&&ji(e,e,this._viewTransform),e},v5.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},v5.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},v5.prototype._updateCamera=function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.top=0,r.bottom=t,r.right=e,r.near=0,r.far=100};var y5=zx.extend({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this.viewGL=new $0("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new v5(this.viewGL)},render:function(e,t,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,n),e.getData().count()){var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new k3(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),r.update(e,t,n),this.viewGL.setPostEffect(e.getModel("postEffect"),n)}},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){if(!(e.end<=e.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new k3(!0,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),i.setSizeScale(this._sizeScale),i.update(t,n,r,e.start,e.end),r.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,n){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,n);var r=this._glViewHelper.getZoom(),i=Math.max((e.get("zoomScale")||0)*(r-1)+1,0);this._sizeScale=i,this._pointsBuilderList.forEach((function(e){e.setSizeScale(i)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],n=0;n<e.length;n+=2)t[0]=e[n],t[1]=e[n+1],this._glViewHelper.removeTransformInPoint(t),e[n]=t[0],e[n+1]=t[1]},dispose:function(){this.groupGL.removeAll(),this._pointsBuilderList.forEach((function(e){e.dispose()}))},remove:function(){this.groupGL.removeAll()}});WS((function(e){e.registerChartView(y5),e.registerSeriesModel(m5),e.registerLayout({seriesType:"scatterGL",reset:function(e){var t,n=e.coordinateSystem,r=e.getData();if(n){var i=n.dimensions.map((function(e){return r.mapDimension(e)})).slice(0,2),o=[];1===i.length?t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),o=e.start;o<e.end;o++){var a=2*(o-e.start),s=r.get(i[0],o),l=n.dataToPoint(s);t[a]=l[0],t[a+1]=l[1]}r.setLayout("points",t)}:2===i.length&&(t=function(e){for(var t=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var s=2*(a-e.start),l=r.get(i[0],a),u=r.get(i[1],a);o[0]=l,o[1]=u,o=n.dataToPoint(o),t[s]=o[0],t[s+1]=o[1]}r.setLayout("points",t)})}return{progress:t}}})}));var _5=Mx.extend({type:"series.graphGL",visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,init:function(e){_5.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){_5.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,n,r){var i=u3.getFormattedLabel(this,e,t,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,e)}return i},getInitialData:function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;if(r&&n)return function(e,t,n,r,i){for(var o=new MR(r),a=0;a<e.length;a++)o.addNode(kJ(e[a].id,e[a].name,a),a);var s,l=[],u=[],c=0;for(a=0;a<t.length;a++){var h=t[a],d=h.source,p=h.target;o.addEdge(d,p,c)&&(u.push(h),l.push(kJ(h.id,d+" > "+p)),c++)}var f=_T(e,{coordDimensions:["value"]});(s=new yT(f,n)).initData(e);var g=new yT(["value"],n);return g.initData(u,l),i&&i(s,g),lP({mainData:s,struct:o,structAttr:"graph",datas:{node:s,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(r,n,this,!0,(function(e,n){e.wrapMethod("getItemModel",(function(e){const t=i._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));const r=t.getModel([]).getModel;function o(e,t){const n=r.call(this,e,t);return n.resolveParentPath=a,n}function a(e){if(e&&("label"===e[0]||"label"===e[1])){const t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}n.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=a,e.getModel=o,e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(e,n),o=r.graph.getEdgeByIndex(e),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=lo(l.join(" > ")),i.value&&(l+=" : "+lo(i.value)),l}return _5.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:Object.assign({value:0},e)})),t=new yT(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t<e.length/2;t++){var n=e[2*t],r=e[2*t+1],i=this.getData().getRawDataItem(t);i.x=n,i.y=r}},isAnimationEnabled:function(){return _5.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}}),x5=AQ.vec2,b5=[[0,0],[1,1]],w5=u$.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new u$.Attribute("position","float",2,"POSITION"),normal:new u$.Attribute("normal","float",2),offset:new u$.Attribute("offset","float",1),color:new u$.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,r){return 1/(x5.dist(e,t)+x5.dist(n,t)+x5.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(e,t,n,r){var i=this._getCubicCurveApproxStep(e,t,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(b5)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(b5)},getPolylineVertexCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;"number"==typeof e?t=e:t="number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,n,r,i,o){null==o&&(o=1);var a=e[0],s=e[1],l=t[0],u=t[1],c=n[0],h=n[1],d=r[0],p=r[1],f=this._getCubicCurveApproxStep(e,t,n,r),g=f*f,m=g*f,v=3*f,y=3*g,_=6*g,x=6*m,b=a-2*l+c,w=s-2*u+h,S=3*(l-c)-a+d,T=3*(u-h)-s+p,M=a,A=s,C=(l-a)*v+b*y+S*m,D=(u-s)*v+w*y+T*m,E=b*_+S*x,I=w*_+T*x,L=S*x,N=T*x,P=0,O=0,R=Math.ceil(1/f),k=new Float32Array(3*(R+1)),z=(k=[],0);for(O=0;O<R+1;O++)k[z++]=M,k[z++]=A,M+=C,A+=D,C+=E,D+=I,E+=L,I+=N,(P+=f)>1&&(M=C>0?Math.min(M,d):Math.max(M,d),A=D>0?Math.min(A,p):Math.max(A,p));this.addPolyline(k,i,o)},addLine:function(e,t,n,r){this.addPolyline([e,t],n,r)},addPolyline:function(){var e=x5.create(),t=x5.create(),n=x5.create(),r=x5.create(),i=[],o=[],a=[];return function(s,l,u,c,h){if(s.length){var d="number"!=typeof s[0];if(null==h&&(h=d?s.length:s.length/2),!(h<2)){null==c&&(c=0),null==u&&(u=1),this._itemVertexOffsets.push(this._vertexOffset);for(var p,f=d?"number"!=typeof l[0]:l.length/4===h,g=this.attributes.position,m=this.attributes.color,v=this.attributes.offset,y=this.attributes.normal,_=this.indices,x=this._vertexOffset,b=0;b<h;b++){if(d)i=s[b+c],p=f?l[b+c]:l;else{var w=2*b+c;if((i=i||[])[0]=s[w],i[1]=s[w+1],f){var S=4*b+c;(p=p||[])[0]=l[S],p[1]=l[S+1],p[2]=l[S+2],p[3]=l[S+3]}else p=l}if(this.useNativeLine)b>1&&(g.copy(x,x-1),m.copy(x,x-1),x++);else{var T;if(b<h-1){if(d)x5.copy(o,s[b+1]);else{w=2*(b+1)+c;(o=o||[])[0]=s[w],o[1]=s[w+1]}if(b>0){x5.sub(e,i,a),x5.sub(t,o,i),x5.normalize(e,e),x5.normalize(t,t),x5.add(r,e,t),x5.normalize(r,r);var M=u/2*Math.min(1/x5.dot(e,r),2);n[0]=-r[1],n[1]=r[0],T=M}else x5.sub(e,o,i),x5.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2}else x5.sub(e,i,a),x5.normalize(e,e),n[0]=-e[1],n[1]=e[0],T=u/2;y.set(x,n),y.set(x+1,n),v.set(x,T),v.set(x+1,-T),x5.copy(a,i),g.set(x,i),g.set(x+1,i),m.set(x,p),m.set(x+1,p),x+=2}if(this.useNativeLine)m.set(x,p),g.set(x,i),x++;else if(b>0){var A=3*this._faceOffset;(_=this.indices)[A]=x-4,_[A+1]=x-3,_[A+2]=x-2,_[A+3]=x-3,_[A+4]=x-1,_[A+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],r=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,t);this.dirty("color")}});Or(w5.prototype,MQ);nQ.Shader.import("@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end");var S5={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function T5(e){var t={type:nQ.Texture.FLOAT,minFilter:nQ.Texture.NEAREST,magFilter:nQ.Texture.NEAREST};this._positionSourceTex=new nQ.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new nQ.Texture2D(t),this._positionPrevTex=new nQ.Texture2D(t),this._forceTex=new nQ.Texture2D(t),this._forcePrevTex=new nQ.Texture2D(t),this._weightedSumTex=new nQ.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new nQ.Texture2D(t),this._globalSpeedPrevTex=new nQ.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new CJ({fragment:nQ.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new CJ({fragment:nQ.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new CJ({fragment:nQ.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new CJ({fragment:nQ.Shader.source("clay.compositor.output")});var n=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new nQ.Mesh({geometry:new nQ.Geometry({attributes:{node1:new nQ.Geometry.Attribute("node1","float",2),node2:new nQ.Geometry.Attribute("node2","float",2),weight:new nQ.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new nQ.Material({transparent:!0,shader:nQ.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:nQ.Mesh.POINTS}),this._weightedSumMesh=new nQ.Mesh({geometry:new nQ.Geometry({attributes:{node:new nQ.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new nQ.Material({transparent:!0,shader:nQ.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:nQ.Mesh.POINTS}),this._framebuffer=new tJ({depthBuffer:!1}),this._dummyCamera=new nQ.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}T5.prototype.updateOption=function(e){for(var t in S5)this[t]=S5[t];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,e)for(var t in S5)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var r=this._positionSourceTex.pixels,i=0;i<this._nodes.length;i++)r[4*i+2]=(this._nodes[i].degree||0)+1},T5.prototype._updateGravityCenter=function(e){var t=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var r=[1/0,1/0],i=[-1/0,-1/0],o=0;o<t.length;o++)r[0]=Math.min(t[o].x,r[0]),r[1]=Math.min(t[o].y,r[1]),i[0]=Math.max(t[o].x,i[0]),i[1]=Math.max(t[o].y,i[1]);this._gravityCenter=[.5*(r[0]+i[0]),.5*(r[1]+i[1])]}for(o=0;o<n.length;o++){var a=n[o].node1,s=n[o].node2;t[a].degree=(t[a].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},T5.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(e.length)),r=n,i=new Float32Array(n*r*4);this._resize(n,r);for(var o=0,a=0;a<e.length;a++){var s=e[a];i[o++]=s.x||0,i[o++]=s.y||0,i[o++]=s.mass||1,i[o++]=s.size||1}this._positionSourceTex.pixels=i;var l=this._edgeForceMesh.geometry,u=t.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var c=[];for(a=0;a<t.length;a++){var h=l.attributes,d=t[a].weight;null==d&&(d=1),h.node1.set(a,this.getNodeUV(t[a].node1,c)),h.node2.set(a,this.getNodeUV(t[a].node2,c)),h.weight.set(a,d),h.node1.set(a+u,this.getNodeUV(t[a].node2,c)),h.node2.set(a+u,this.getNodeUV(t[a].node1,c)),h.weight.set(a+u,d)}var p=this._weightedSumMesh.geometry;p.attributes.node.init(e.length);for(a=0;a<e.length;a++)p.attributes.node.set(a,this.getNodeUV(a,c));l.dirty(),p.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,r]),this._inited=!1,this._frame=0},T5.prototype.getNodes=function(){return this._nodes},T5.prototype.getEdges=function(){return this._edges},T5.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var r=this._weightedSumMesh;r.material.set("positionTex",this._positionPrevTex),r.material.set("forceTex",this._forceTex),r.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([r],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var i=this._globalSpeedPass;i.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),i.setUniform("weightedSumTex",this._weightedSumTex),i.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),i.render(e);var o=this._positionPass;this._framebuffer.attach(this._positionTex),o.setUniform("globalSpeedTex",this._globalSpeedTex),o.setUniform("positionTex",this._positionPrevTex),o.setUniform("forceTex",this._forceTex),o.setUniform("forcePrevTex",this._forcePrevTex),o.render(e),this._framebuffer.unbind(e),this._swapTexture()},T5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1);for(var r=0;r<t;r++)this.step(e);n&&n()},T5.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},T5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1)||0,t},T5.prototype.getNodePosition=function(e,t){var n=this._positionArr,r=this._positionTex.width,i=this._positionTex.height,o=r*i;n&&n.length===4*o||(n=this._positionArr=new Float32Array(4*o)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,n),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var a=0;a<this._nodes.length;a++)t[2*a]=n[4*a],t[2*a+1]=n[4*a+1];return t},T5.prototype.getTextureData=function(e,t){var n=this["_"+t+"Tex"],r=n.width,i=n.height;this._framebuffer.bind(e),this._framebuffer.attach(n);var o=new Float32Array(r*i*4);return e.gl.readPixels(0,0,r,i,e.gl.RGBA,e.gl.FLOAT,o),this._framebuffer.unbind(e),o},T5.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},T5.prototype.isFinished=function(e){return this._frame>e},T5.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},T5.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},T5.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=e,this[n].height=t,this[n].dirty()}),this)},T5.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)};var M5=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},n=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},r=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},i=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},o=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},a=function(e,t){return e[0]=t[0],e[1]=t[1],e},s=function(e,t,n){return e[0]=t,e[1]=n,e};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function c(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function h(e,t){this.source=e,this.target=t,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=e(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},u.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},u.findSubRegion=function(e,t){for(var n=0;n<this.nSubRegions;n++){var r=this.subRegions[n];if(r.contain(e,t))return r}},u.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},u._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new l,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},u._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,o=(n[2]-n[0])/2,a=(n[3]-n[1])/2,s=e.position[0]>=r?1:0,l=e.position[1]>=i?1:0;(t=this._newSubRegion()).setBBox(s*o+n[0],l*a+n[1],(s+1)*o+n[0],(l+1)*a+n[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass};var p=d.prototype;p.initNodes=function(e,t,n){var r=t.length;this.nodes.length=0;for(var i=void 0!==n,o=0;o<r;o++){var a=new c;a.position[0]=e[2*o],a.position[1]=e[2*o+1],a.mass=t[o],i&&(a.size=n[o]),this.nodes.push(a)}this._massArr=t,this._swingingArr=new Float32Array(r),i&&(this._sizeArr=n)},p.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var r=0;r<n;r++){var i=e[2*r],o=e[2*r+1],a=this.nodes[i],s=this.nodes[o];if(!a||!s)return void console.error("Node not exists, try initNodes before initEdges");a.outDegree++,s.inDegree++;var l=new h(a,s);t&&(l.weight=t[r]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++){(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1}else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},p.update=function(){var o=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<o;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<o;l++){var u=this.nodes[l];a(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<o;l++){var c=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,c);else for(var h=l+1;h<o;h++){var d=this.nodes[h];this.applyNodeToNodeRepulsion(c,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var p=0,f=0,g=e();for(l=0;l<o;l++){u=this.nodes[l];p+=(v=t(u.force,u.forcePrev))*u.mass,i(g,u.force,u.forcePrev),f+=.5*n(g)*u.mass,this._swingingArr[l]=v}var m=this.jitterTolerence*this.jitterTolerence*f/p;this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m;for(l=0;l<o;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=n(u.force);_>0&&(y=Math.min(_*y,10)/_,r(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=function(){var t=e();return function(e,n){if(e.node)this.applyNodeToNodeRepulsion(e.node,n,!0);else{o(t,n.position,e.centerOfMass);var i=t[0]*t[0]+t[1]*t[1];if(i>this.barnesHutTheta*e.size*e.size){var a=this.scaling*n.mass*e.mass/i;r(n.force,n.force,t,a)}else for(var s=0;s<e.nSubRegions;s++)this.applyRegionToNodeRepulsion(e.subRegions[s],n)}}}(),p.applyNodeToNodeRepulsion=function(){var t=e();return function(e,n,i){if(e!=n){o(t,e.position,n.position);var a=t[0]*t[0]+t[1]*t[1];if(0!==a){var s;if(this.preventOverlap){var l=Math.sqrt(a);if((l=l-e.size-n.size)>0)s=this.scaling*e.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*n.mass}}else s=this.scaling*e.mass*n.mass/a;r(e.force,e.force,t,s),r(n.force,n.force,t,-s)}}}}(),p.applyEdgeAttraction=function(){var t=e();return function(e){var i=e.source,a=e.target;o(t,i.position,a.position);var s,l,u=n(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-i.size-a.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,r(i.force,i.force,t,l),r(a.force,a.force,t,-l))}}(),p.applyNodeGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position);var i=n(t);r(e.force,e.force,t,this.gravity*e.mass/(i+1))}}(),p.applyNodeStrongGravity=function(){var t=e();return function(e){o(t,this.gravityCenter,e.position),r(e.force,e.force,t,this.gravity*e.mass)}}(),p.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,r=-1/0,i=0;i<this.nodes.length;i++){var o=this.nodes[i].position;e=Math.min(e,o[0]),t=Math.min(t,o[1]),n=Math.max(n,o[0]),r=Math.max(r,o[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r},p.getGlobalSpeed=function(){return this._globalSpeed};var f=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(f=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),f.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(f)for(var t in e.data.config)f[t]=e.data.config[t];break;case"update":var n=e.data.steps;if(f){for(var r=0;r<n;r++)f.update();var i=f.nodes.length,o=new Float32Array(2*i);for(r=0;r<i;r++){var a=f.nodes[r];o[2*r]=a.position[0],o[2*r+1]=a.position[1]}self.postMessage({buffer:o.buffer,globalSpeed:f.getGlobalSpeed()},[o.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:f.getGlobalSpeed()},[s.buffer])}}}}.toString();M5=M5.slice(M5.indexOf("{")+1,M5.lastIndexOf("}"));var A5={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},C5=function(e){for(var t in A5)this[t]=A5[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new JK({type:YK.FLOAT,flipY:!1,minFilter:YK.NEAREST,magFilter:YK.NEAREST})};C5.prototype.initData=function(e,t){var n=new Blob([M5]),r=window.URL.createObjectURL(n);this._worker=new Worker(r),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var i=e.length,o=t.length,a=new Float32Array(2*i),s=new Float32Array(i),l=new Float32Array(i),u=new Float32Array(2*o),c=new Float32Array(o),h=0;h<e.length;h++){var d=e[h];a[2*h]=d.x,a[2*h+1]=d.y,s[h]=null==d.mass?1:d.mass,l[h]=null==d.size?1:d.size}for(h=0;h<t.length;h++){var p=t[h],f=p.node1,g=p.node2;u[2*h]=f,u[2*h+1]=g,c[h]=null==p.weight?1:p.weight}var m=Math.ceil(Math.sqrt(e.length)),v=m,y=new Float32Array(m*v*4),_=this._positionTex;_.width=m,_.height=v,_.pixels=y,this._worker.postMessage({cmd:"init",nodesPosition:a,nodesMass:s,nodesSize:l,edges:u,edgesWeight:c}),this._globalSpeed=1/0},C5.prototype.updateOption=function(e){var t={};for(var n in A5)t[n]=A5[n];var r=this._nodes,i=this._edges,o=r.length;if(t.jitterTolerence=o>5e4?10:o>5e3?1:.1,t.scaling=o>100?2:10,t.barnesHutOptimize=o>1e3,e)for(var n in A5)null!=e[n]&&(t[n]=e[n]);if(!t.gravityCenter){for(var a=[1/0,1/0],s=[-1/0,-1/0],l=0;l<r.length;l++)a[0]=Math.min(r[l].x,a[0]),a[1]=Math.min(r[l].y,a[1]),s[0]=Math.max(r[l].x,s[0]),s[1]=Math.max(r[l].y,s[1]);t.gravityCenter=[.5*(a[0]+s[0]),.5*(a[1]+s[1])]}for(l=0;l<i.length;l++){var u=i[l].node1,c=i[l].node2;r[u].degree=(r[u].degree||0)+1,r[c].degree=(r[c].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},C5.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},C5.prototype._$onupdate=function(e){if(!this._disposed){var t=new Float32Array(e.data.buffer);this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate()}},C5.prototype.getNodePositionTexture=function(){return this._positionTex},C5.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,r=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(r-1),t},C5.prototype.getNodes=function(){return this._nodes},C5.prototype.getEdges=function(){return this._edges},C5.prototype.isFinished=function(e){return this._frame>e},C5.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)t[n]=this._positionArr[n];return t},C5.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,n=0,r=0;r<e.length;)t[n++]=e[r++],t[n++]=e[r++],t[n++]=1,t[n++]=1;this._positionTex.dirty()},C5.prototype.dispose=function(e){this._disposed=!0,this._worker=null};var D5=PZ.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var e=this._target,t=this._zoom;e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(e){if(!e.target){var t=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var r=this._convertPos(t,n);this._x=r.x,this._y=r.y}}},_convertPos:function(e,t){var n=this.viewGL.camera,r=this.viewGL.viewport;return{x:(e-r.x)/r.width*(n.right-n.left)+n.left,y:(t-r.y)/r.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(e){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t=(e=e.event).wheelDelta||-e.detail;if(0!==t){var n=e.offsetX,r=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,r)){var i=t>0?1.1:.9,o=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom);i=o/this._zoom;var a=this._convertPos(n,r),s=(a.x-this._dx)*(i-1),l=(a.y-this._dy)*(i-1);this._dx-=s,this._dy-=l,this._zoom=o,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}),E5=AQ.vec2;nQ.Shader.import("@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end");var I5=1,L5=zx.extend({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this.viewGL=new $0("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new k3(!0,t),this._forceEdgesMesh=new nQ.Mesh({material:new nQ.Material({shader:nQ.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new nQ.Geometry({attributes:{node:new nQ.Geometry.Attribute("node","float",2),color:new nQ.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:nQ.Mesh.LINES}),this._edgesMesh=new nQ.Mesh({material:new nQ.Material({shader:nQ.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new w5({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new D5({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=n,this._initLayout(e,t,n),this._pointsBuilder.update(e,t,n),this._forceLayoutInstance instanceof T5||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(kJ(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var r=this._pointsBuilder.getPointsMesh();if(r.off("mousemove",this._mousemoveHandler),r.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var i=e.get("focusNodeAdjacencyOn");"click"===i?n.getZr().on("click",this._clickHandler):"mouseover"===i?(r.on("mousemove",this._mousemoveHandler,this),r.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):"production"!==process.env.NODE_ENV&&console.warn("Unkown focusNodeAdjacencyOn value s"+i)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var n=this._forceEdgesMesh.geometry,r=t.getEdgeData(),i=0,o=this._forceLayoutInstance,a=2*r.count();n.attributes.node.init(a),n.attributes.color.init(a),r.each((function(t){var a=e[t];n.attributes.node.set(i,o.getNodeUV(a.node1)),n.attributes.node.set(i+1,o.getNodeUV(a.node2));var s=j1(r,a.dataIndex),l=nQ.parseColor(s);l[3]*=kJ(Y1(r,a.dataIndex),1),n.attributes.color.set(i,l),n.attributes.color.set(i+1,l),i+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,n=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var r=[],i=[],o=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(a){var s=e.graph.getEdgeByIndex(a),l=2*s.node1.dataIndex,u=2*s.node2.dataIndex;r[0]=n[l],r[1]=n[l+1],i[0]=n[u],i[1]=n[u+1];var c=j1(e,s.dataIndex),h=nQ.parseColor(c);h[3]*=kJ(Y1(e,s.dataIndex),1);var d=e.getItemModel(s.dataIndex),p=kJ(d.get(o),1)*this._api.getDevicePixelRatio();t.addLine(r,i,h,p);for(var f=0;f<4;f++)this._originalEdgeColors[4*s.dataIndex+f]=h[f];this._edgeIndicesMap[s.dataIndex]=a}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),n=[],r=0;r<e.count();r++)this._forceLayoutInstance.getNodeUV(r,n),t.geometry.attributes.position.set(r,n);t.geometry.dirty("position")},_initLayout:function(e,t,n){var r=e.get("layout"),i=e.getGraph(),o=Tv(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()});"force"===r&&("production"!==process.env.NODE_ENV&&console.warn("Currently only forceAtlas2 layout supported."),r="forceAtlas2"),this.stopLayout(e,t,n,{beforeLayout:!0});var a=e.getData(),s=e.getData();if("forceAtlas2"===r){var l=e.getModel("forceAtlas2"),u=this._forceLayoutInstance,c=[],h=[],d=a.getDataExtent("value"),p=s.getDataExtent("value"),f=kJ(l.get("edgeWeight"),1),g=kJ(l.get("nodeWeight"),1);"number"==typeof f&&(f=[f,f]),"number"==typeof g&&(g=[g,g]);var m=0,v={},y=new Float32Array(2*a.count());if(i.eachNode((function(e){var t,n,r=e.dataIndex,i=a.get("value",r);if(a.hasItemOption){var s=a.getItemModel(r);t=s.get("x"),n=s.get("y")}null==t&&(t=o.x+Math.random()*o.width,n=o.y+Math.random()*o.height),y[2*m]=t,y[2*m+1]=n,v[e.id]=m++;var l=lu(i,d,g);isNaN(l)&&(l=isNaN(g[0])?1:g[0]),c.push({x:t,y:n,mass:l,size:a.getItemVisual(r,"symbolSize")})})),a.setLayout("points",y),i.eachEdge((function(e){var t=e.dataIndex,n=lu(a.get("value",t),p,f);isNaN(n)&&(n=isNaN(f[0])?1:f[0]),h.push({node1:v[e.node1.id],node2:v[e.node2.id],weight:n,dataIndex:t})})),!u){var _=l.get("GPU");this._forceLayoutInstance&&((!_||this._forceLayoutInstance instanceof T5)&&(_||this._forceLayoutInstance instanceof C5)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),u=this._forceLayoutInstance=_?new T5:new C5}u.initData(c,h),u.updateOption(l.option),this._updateForceEdgesGeometry(u.getEdges(),e),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else{y=new Float32Array(2*a.count()),m=0;i.eachNode((function(e){var t,n,r=e.dataIndex;if(a.hasItemOption){var i=a.getItemModel(r);t=i.get("x"),n=i.get("y")}y[m++]=t,y[m++]=n})),a.setLayout("points",y),this._updateAfterLayout(e,t,n)}},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,n,r){if(!r||null==r.from||r.from===this.uid){var i=this.viewGL,o=(n=this._api,this._forceLayoutInstance),a=this._model.getData(),s=this._model.getModel("forceAtlas2");if(o){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(e.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=I5++,c=s.getShallow("maxSteps"),h=s.getShallow("steps"),d=0,p=Math.max(2*h,20),f=function(t){if(t===l._layoutId)return o.isFinished(c)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:a.getLayout("points"),from:l.uid})):void o.update(i.layer.renderer,h,(function(){l._updatePositionTexture(),(d+=h)>=p&&(l._syncNodePosition(e),d=0),n.getZr().refresh(),pa((function(){f(t)}))}))};pa((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(i.layer.renderer),l._forceLayoutInstanceToDispose=null),f(u)})),this._layouting=!0}}else"production"!==process.env.NODE_ENV&&console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,n,r){r&&null!=r.from&&r.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(r&&r.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,n,r){var i=this._model.getData();this._downplayAll();var o=r.dataIndex,a=i.graph,s=[],l=a.getNodeByIndex(o);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(i,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(e){return e.dataIndex})));var u=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),u.push(e))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,n,r){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),n=nQ.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),r=kJ(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);n[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:function(){var e=[];return function(t,n){this._getColor(t,e),e[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var n=0;n<4;n++)t[n]=this._originalEdgeColors[4*e+n];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var n=this.viewGL.camera,r=e.getData().getLayout("points"),i=E5.create(1/0,1/0),o=E5.create(-1/0,-1/0),a=[],s=0;s<r.length;)a[0]=r[s++],a[1]=r[s++],E5.min(i,i,a),E5.max(o,o,a);var l=(o[1]+i[1])/2,u=(o[0]+i[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var c=Math.max(o[0]-i[0],10),h=c/t.getWidth()*t.getHeight();c*=1.4,h*=1.4,i[0]-=.2*c,n.left=i[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+i[0],n.near=0,n.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}});function N5(e){return e instanceof Array||(e=[e,e]),e}WS((function(e){function t(){}e.registerChartView(L5),e.registerSeriesModel(_5),e.registerVisual((function(e){const t={};e.eachSeriesByType("graphGL",(function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each((function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),n.setItemVisual(r,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let e=0;e<l.length;e++){var u=a.getShallow(l[e],!0);null!=u&&n.setItemVisual(r,l[e],u)}})),n.count()&&r.each((function(e){let t=r.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=i["ec-"+t]);var o=n.getItemVisual(t,"style");Pr(r.ensureUniqueItemVisual(e,"style"),o);var a=["symbol","symbolSize","symbolKeepAspect"];for(let i=0;i<a.length;i++)r.setItemVisual(e,a[i],n.getItemVisual(t,a[i]))}}))}))})),e.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),n=e.getEdgeData(),r=N5(e.get("edgeSymbol")),i=N5(e.get("edgeSymbolSize"));n.setVisual("drawType","stroke"),n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each((function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),o=N5(r.getShallow("symbol",!0)),a=N5(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(e,"style");switch(Pr(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])}))}))})),e.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),e.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},t),e.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},t),e.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},t),e.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},t)}));var P5=Mx.extend({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualStyleAccessPath:"itemStyle",getInitialData:function(e,t){var n=this.get("coordinateSystem"),r="geo"===n?["lng","lat"]:PS(n)||["x","y"];if("production"!==process.env.NODE_ENV&&r.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");r.push("vx","vy");var i=_T(this.getSource(),{coordDimensions:r,encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),o=new yT(i,this);return o.initData(this.getSource()),o},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}}),O5=u$.extend((function(){return{dynamic:!0,attributes:{position:new u$.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,n=4*e,r=2*e;this.vertexCount!==n&&t.position.init(n),this.triangleCount!==r&&(this.indices=0===r?null:this.vertexCount>65535?new Uint32Array(3*r):new Uint16Array(3*r))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}});Vq.import("@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n");var R5=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new JK({type:YK.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};R5.prototype={constructor:R5,init:function(){var e={type:YK.FLOAT,minFilter:YK.NEAREST,magFilter:YK.NEAREST,useMipmap:!1};this._spawnTexture=new JK(e),this._particleTexture0=new JK(e),this._particleTexture1=new JK(e),this._frameBuffer=new tJ({depthBuffer:!1}),this._particlePass=new CJ({fragment:Vq.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new CJ({fragment:Vq.source("clay.compositor.downsample")});var t=new ZK({renderOrder:10,material:new lq({shader:new Vq(Vq.source("ecgl.vfParticle.renderPoints.vertex"),Vq.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:ZK.POINTS,geometry:new u$({dynamic:!0,mainAttribute:"texcoord0"})}),n=new ZK({renderOrder:10,material:new lq({shader:new Vq(Vq.source("ecgl.vfParticle.renderLines.vertex"),Vq.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new O5,culling:!1}),r=new ZK({material:new lq({shader:new Vq(Vq.source("ecgl.color.vertex"),Vq.source("ecgl.color.fragment"))}),geometry:new iJ});r.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=r,this._camera=new SJ,this._thisFrameTexture=new JK,this._lastFrameTexture=new JK},setParticleDensity:function(e,t){for(var n=new Float32Array(4*(e*t)),r=0,i=this.particleLife,o=0;o<e;o++)for(var a=0;a<t;a++,r++){n[4*r]=Math.random(),n[4*r+1]=Math.random(),n[4*r+2]=Math.random();var s=(i[1]-i[0])*Math.random()+i[0];n[4*r+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var n=e*t,r=this._particlePointsMesh.geometry,i=r.attributes;i.texcoord0.init(n);for(var o=0,a=0;a<e;a++)for(var s=0;s<t;s++,o++)i.texcoord0.value[2*o]=a/e,i.texcoord0.value[2*o+1]=s/t;r.dirty()},_setLineGeometry:function(e,t){var n=e*t,r=this._getParticleMesh().geometry;r.setLineCount(n),r.resetOffset();for(var i=0;i<e;i++)for(var o=0;o<t;o++)r.addLine([i/e,o/t]);r.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,n,r){var i=this._getParticleMesh(),o=this._frameBuffer,a=this._particlePass;r&&this._updateDownsampleTextures(e,t),i.material.set("size",this._particleSize*this._supersampling),i.material.set("color",this.particleColor),a.setUniform("speedScaling",this.particleSpeedScaling),o.attach(this._particleTexture1),a.setUniform("firstFrameTime",r?(this.particleLife[1]+this.particleLife[0])/2:0),a.setUniform("particleTexture",this._particleTexture0),a.setUniform("deltaTime",n),a.setUniform("elapsedTime",this._elapsedTime),a.render(e,o),i.material.set("particleTexture",this._particleTexture1),i.material.set("prevParticleTexture",this._particleTexture0),o.attach(this._thisFrameTexture),o.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([s,i],this._camera),o.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=n},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var n=0,r=this._thisFrameTexture,i=t[n];i;)this._frameBuffer.attach(i),this._downsamplePass.setUniform("texture",r),this._downsamplePass.setUniform("textureSize",[r.width,r.height]),this._downsamplePass.render(e,this._frameBuffer),r=i,i=t[++n]},getSurfaceTexture:function(){var e=this._downsampleTextures;return e.length>0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new JK),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var n=t.getContext("2d");return n.fillStyle="#fff",n.arc(e/2,e/2,e/2,0,2*Math.PI),n.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var n=this._downsampleTextures,r=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),i=2,o=this._width*this._supersampling,a=this._height*this._supersampling,s=0;s<r;s++)n[s]=n[s]||new JK,n[s].width=o/i,n[s].height=a/i,i*=2;for(;s<n.length;s++)n[s].dispose(e);n.length=r},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e;e=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(e){e.disposeFrameBuffer(this._frameBuffer),e.disposeTexture(this.vectorFieldTexture),e.disposeTexture(this._spawnTexture),e.disposeTexture(this._particleTexture0),e.disposeTexture(this._particleTexture1),e.disposeTexture(this._thisFrameTexture),e.disposeTexture(this._lastFrameTexture),e.disposeGeometry(this._particleLinesMesh.geometry),e.disposeGeometry(this._particlePointsMesh.geometry),e.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&e.disposeTexture(this._spriteTexture),this._particlePass.dispose(e),this._downsamplePass.dispose(e),this._downsampleTextures.forEach((function(t){t.dispose(e)}))}};var k5=zx.extend({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new $0("orthographic"),this.groupGL=new nQ.Node,this.viewGL.add(this.groupGL),this._particleSurface=new R5;var n=new nQ.Mesh({geometry:new nQ.PlaneGeometry,material:new nQ.Material({shader:new nQ.Shader({vertex:nQ.Shader.source("ecgl.color.vertex"),fragment:nQ.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(e,t,n){var r=this._particleSurface;r.setParticleType(e.get("particleType")),r.setSupersampling(e.get("supersampling")),this._updateData(e,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var i=kJ(e.get("particleDensity"),128);r.setParticleDensity(i,i);var o=this._planeMesh,a=+new Date,s=this,l=!0;o.__percent=0,o.stopAnimation(),o.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-a,20);a+=t,s._renderer&&(r.update(s._renderer,n,t/1e3,l),o.material.set("diffuseMap",r.getSurfaceTexture())),l=!1})).start();var u=e.getModel("itemStyle"),c=nQ.parseColor(u.get("color"));c[3]*=kJ(u.get("opacity"),1),o.material.set("color",c),r.setColorTextureImage(e.get("colorTexture"),n),r.setParticleSize(e.get("particleSize")),r.particleSpeedScaling=e.get("particleSpeed"),r.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,n){this._updateData(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._renderer=i},_updateData:function(e,t){var n=e.coordinateSystem,r=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),i=e.getData(),o=i.getDataExtent(r[0]),a=i.getDataExtent(r[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(o[1]-o[0])/(a[1]-a[0]);s=Math.round(Math.sqrt(u*i.count()))}null!=l&&"auto"!==l||(l=Math.ceil(i.count()/s));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*s*4)for(var d=0;d<h.length;d++)h[d]=0;else h=c.pixels=new Float32Array(s*l*4);var p=0,f=1/0,g=new Float32Array(2*i.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];i.each([r[0],r[1],"vx","vy"],(function(e,t,r,i){var o=n.dataToPoint([e,t]);g[m++]=o[0],g[m++]=o[1],v[0][0]=Math.min(o[0],v[0][0]),v[0][1]=Math.min(o[1],v[0][1]),v[1][0]=Math.max(o[0],v[1][0]),v[1][1]=Math.max(o[1],v[1][1]);var a=Math.sqrt(r*r+i*i);p=Math.max(p,a),f=Math.min(f,a)})),i.each(["vx","vy"],(function(e,t,n){var r=Math.round((g[2*n]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),i=4*((l-1-Math.round((g[2*n+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+r);h[i]=e/p*.5+.5,h[i+1]=t/p*.5+.5,h[i+3]=1})),c.width=s,c.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(c),c.dirty(),this._updatePlanePosition(v[0],v[1],e,t),this._updateGradientTexture(i.getVisual("visualMeta"),[f,p])},_fillEmptyPixels:function(e){var t=e.pixels,n=e.width,r=e.height;function i(e,i,o){e=Math.max(Math.min(e,n-1),0);var a=4*((i=Math.max(Math.min(i,r-1),0))*(n-1)+e);return 0!==t[a+3]&&(o[0]=t[a],o[1]=t[a+1],!0)}function o(e,t,n){n[0]=e[0]+t[0],n[1]=e[1]+t[1]}for(var a=[],s=[],l=[],u=[],c=[],h=0,d=0;d<r;d++)for(var p=0;p<n;p++){var f=4*(d*(n-1)+p);0===t[f+3]&&(h=a[0]=a[1]=0,i(p-1,d,s)&&(h++,o(s,a,a)),i(p+1,d,l)&&(h++,o(l,a,a)),i(p,d-1,u)&&(h++,o(u,a,a)),i(p,d+1,c)&&(h++,o(c,a,a)),a[0]/=h,a[1]/=h,t[f]=a[0],t[f+1]=a[1]),t[f+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new nQ.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,r=n.image;r.width=200,r.height=1;var i=r.getContext("2d"),o=i.createLinearGradient(0,.5,r.width,.5);e[0].stops.forEach((function(e){var n;t[1]===t[0]?n=0:(n=e.value/t[1],n=Math.min(Math.max(n,0),1)),o.addColorStop(n,e.color)})),i.fillStyle=o,i.fillRect(0,0,r.width,r.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,n,r){var i=this._limitInViewportAndFullFill(e,t,n,r);e=i.leftTop,t=i.rightBottom,this._particleSurface.setRegion(i.region),this._planeMesh.position.set((e[0]+t[0])/2,r.getHeight()-(e[1]+t[1])/2,0);var o=t[0]-e[0],a=t[1]-e[1];this._planeMesh.scale.set(o/2,a/2,1),this._particleSurface.resize(Math.max(Math.min(o,2048),1),Math.max(Math.min(a,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,n,r){var i=[Math.max(e[0],0),Math.max(e[1],0)],o=[Math.min(t[0],r.getWidth()),Math.min(t[1],r.getHeight())];if("bmap"===n.get("coordinateSystem")){var a=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(a[1]-a[0])>=359&&(i[0]>0&&(i[0]=0),o[0]<r.getWidth()&&(o[0]=r.getWidth()))}var s=t[0]-e[0],l=t[1]-e[1],u=o[0]-i[0],c=o[1]-i[1];return{leftTop:i,rightBottom:o,region:[(i[0]-e[0])/s,1-c/l-(i[1]-e[1])/l,u/s,c/l]}},_updateCamera:function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var r=this.viewGL.camera;r.left=r.bottom=0,r.top=t,r.right=e,r.near=0,r.far=100,r.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}});WS((function(e){e.registerChartView(k5),e.registerSeriesModel(P5)}));var z5=Mx.extend({type:"series.linesGL",dependencies:["grid","geo"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),z5.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),z5.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=bi(this._flatCoords,t.flatCoords),this._flatCoordsOffset=bi(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+2*i],t[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(e);for(i=0;i<o.length;i++)t[i]=t[i]||[],t[i][0]=o[i][0],t[i][1]=o[i][1];return o.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var n=e.length,r=new Uint32Array(n),i=new Float64Array(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=e[l++];r[a++]=o+t,r[a++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(i[o++]=h,i[o++]=d,l>n&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var n=new yT(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var o=e.value;return null!=o?o instanceof Array?o[i]:o:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}),B5=zx.extend({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new nQ.Node,this.viewGL=new $0("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new v5(this.viewGL),this._nativeLinesShader=nQ.createShader("ecgl.lines3D"),this._meshLinesShader=nQ.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n);var r=this._linesMeshes[0];r||(r=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(r),this._updateLinesMesh(e,r,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){var i=this._linesMeshes[this._currentStep];i||(i=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=i),this._updateLinesMesh(t,i,e.start,e.end),this.groupGL.add(i),r.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,n){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,n)},_createLinesMesh:function(e){return new nQ.Mesh({$ignorePicking:!0,material:new nQ.Material({shader:nQ.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new w5({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:nQ.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,n,r){var i=e.getData();t.material.blend="lighter"===e.get("blendMode")?nQ.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,a=e.get("polyline"),s=t.geometry,l=e.coordinateSystem,u=kJ(e.get("lineStyle.width"),1);u>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=nQ.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=nQ.Mesh.LINES),n=n||0,r=r||i.count(),s.resetOffset();var c=0,h=0,d=[],p=[],f=[],g=[],m=[],v=.3,y=.7;function _(){p[0]=d[0]*y+g[0]*v-(d[1]-g[1])*o,p[1]=d[1]*y+g[1]*v-(g[0]-d[0])*o,f[0]=d[0]*v+g[0]*y-(d[1]-g[1])*o,f[1]=d[1]*v+g[1]*y-(g[0]-d[0])*o}if(a||0!==o)for(var x=n;x<r;x++)if(a){var b=e.getLineCoordsCount(x);c+=s.getPolylineVertexCount(b),h+=s.getPolylineTriangleCount(b)}else e.getLineCoords(x,m),this._glViewHelper.dataToPoint(l,m[0],d),this._glViewHelper.dataToPoint(l,m[1],g),_(),c+=s.getCubicCurveVertexCount(d,p,f,g),h+=s.getCubicCurveTriangleCount(d,p,f,g);else{var w=r-n;c+=w*s.getLineVertexCount(),h+=w*s.getLineVertexCount()}s.setVertexCount(c),s.setTriangleCount(h);var S=n,T=[];for(x=n;x<r;x++){nQ.parseColor(j1(i,S),T);var M=kJ(Y1(i,S),1);T[3]*=M;b=e.getLineCoords(x,m);for(var A=0;A<b;A++)this._glViewHelper.dataToPoint(l,m[A],m[A]);a?s.addPolyline(m,T,u,0,b):0!==o?(d=m[0],g=m[1],_(),s.addCubicCurve(d,p,f,g,T,u)):s.addPolyline(m,T,u,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});WS((function(e){e.registerChartView(B5),e.registerSeriesModel(z5)}));const V5=({className:e="",style:n={},extraOption:r={},lineStyles:i={},pointsStyles:s={},pointsData:l=[],linesData:u=[],globeOption:c={}})=>{const h=t(null),[d,f]=o();return a((()=>{const e=bS(h.current);f(e);const t=rr(e.resize,500),n=()=>{t()};return globalThis.addEventListener("resize",n),()=>{globalThis.removeEventListener("resize",n)}}),[]),a((()=>{if(d){const e=[];e.push(Object.assign({type:"lines3D",name:"lines3D",effect:{show:!0,trailWidth:2,trailLength:.15,trailOpacity:1,trailColor:"rgb(30, 30, 60)"},lineStyle:{width:5,color:"rgb(50, 50, 150)",opacity:.3},blendMode:"lighter",data:u},i)),e.push(Object.assign({type:"scatter3D",coordinateSystem:"globe",zlevel:3,rippleEffect:{brushType:"stroke"},label:{fontSize:8,show:!0,position:"right",formatter:"{b}"},itemStyle:{normal:{color:"#f5f802"}},data:l},s)),d.setOption(Object.assign({backgroundColor:"#000",baseColor:"#000",shading:"realistic",globe:Object.assign({environment:"https://img.alicdn.com/imgextra/i2/O1CN017x8UE61p6wqej1Y0c_!!6000000005312-0-tps-2048-1024.jpg",heightTexture:"https://img.alicdn.com/imgextra/i2/O1CN01BB16kM1ILFttfdYZg_!!6000000000876-0-tps-4096-2048.jpg",baseTexture:"https://img.alicdn.com/imgextra/i4/O1CN01fs70Dq25ElSd8mU6C_!!6000000007495-0-tps-5400-2700.jpg",shading:"lambert",light:{ambient:{intensity:1},main:{intensity:.1}},viewControl:{autoRotate:!0,distance:2e3}},c),series:e},r));const t=setTimeout((()=>{d.resize()}),500);return()=>{clearTimeout(t)}}}),[d,r,c,i,u,l,s]),p.jsx(sn,{ref:h,className:e,style:n})};export{V5 as EarthChart,TZ as WinChart,ln as WinChartType,TZ as default,cZ as echarts};
22
+ //# sourceMappingURL=bundle.esm.js.map