realchart 0.9.32 → 0.9.34
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.
- package/dist/index.d.ts +199 -172
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v0.9.
|
|
3
|
+
* RealChart v0.9.34
|
|
4
4
|
* Copyright (C) 2023-2024 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t="http://www.w3.org/2000/svg",e=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,i=function(t,e){return Array.isArray(t)&&t.length>=e},r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=Object.assign,o=Math.floor,l=Math.ceil,c=Math.cos,_=Math.sin,u=function(t){return Math.pow(10,t)},d=Math.log10,g=Math.min,p=Math.max,m=Math.abs,w=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},f=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},x=function(t,e){return void 0!==t?t:e},b=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},y=(t,s)=>{const i=h({},t);for(const r in s){const n=s[r];e(n)&&e(t[r])?i[r]=y(t[r],n):i[r]=n}return i};let v=0;class V{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(v++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroyed=!0,this.$_destroying=!0,this._doDestory()),null}_doDestory(){}get destroying(){return this.$_destroying}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class S extends V{constructor(){super(...arguments),this._listeners=[]}addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const P={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",A=P[C];const k=(t,s)=>{if(t&&e(s)&&(A=P[t]=s,"en"!==t)){const t=P.en;for(const e in t)A[e]=A[e]||t[e]}},E=void 0,L="%".charCodeAt(0),T=2*Math.PI,N=-Math.PI/2,R=2*Math.PI/360,O=360/Math.PI/2;function M(t){return t>T?t%T:t}function D(t){return parseFloat(t.toPrecision(12))}function B(t){return null==t?null:String(t)}function $(t){return t+"px"}function I(t){return null==t||Number.isNaN(t)||""===t}function F(t){return t<10?"0"+t:String(t)}function z(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const s={};return s[t]=e,s}function G(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===L?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;Q(A.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function j(t,e){return G(t,!0)||G(e,!1)}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Y="fill",X={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},U=function(t){const e=X[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return X[t]=e,e}return e};class Z extends Error{}const K=function(t,e){if(!t)throw new Z(e)};var q;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(q||(q={}));const Q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var J,tt,et,st;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(J||(J={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(tt||(tt={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(et||(et={})),function(t){t.CHART="chart",t.BODY="body",t.PARENT="parent"}(st||(st={}));const it=function(t,i,r,a=!0,o=!0,l=!1,c){let _,u;if(a&&(i=-Number.MAX_VALUE,r=Number.MAX_VALUE),s(t))_=[],t.forEach((t=>{if(e(t)&&n(t.color)){const e={fromValue:w(t.fromValue,u?u.toValue:i),toValue:w(t.toValue,r),color:t.color,style:t.style?h({},t.style):E};e.fromValue<e.toValue&&(_.push(e),u=e)}})),_=_.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=i&&t.fromValue<r)),o&&_.forEach((t=>{t.fromValue=p(t.fromValue,i),t.toValue=g(t.toValue,r)}));else if(e(t)&&s(t.colors)&&t.colors.length>0){const e=t.colors,n=s(t.styles)?t.styles:null;if(_=[],s(t.steps)&&t.steps.length>0){const a=s(t.steps)?t.steps:null;i<a[0]&&a.unshift(i),r>a[a.length-1]&&a.push(r);for(let t=0;t<a.length-1;t++)_.push({fromValue:a[t],toValue:a[t+1],color:e[g(t,e.length-1)],style:n?n[g(t,n.length-1)]:E})}else{let s=w(t.fromValue,i);const a=w(t.toValue,r),h=(a-s)/e.length;let o=0;for(;s<a;)_.push({fromValue:s,toValue:s+=h,color:e[g(o,e.length-1)],style:n?n[g(o,n.length-1)]:E}),o++}}if(l&&_&&_.length>0){let t=0,e=i;for(;t<_.length;)_[t].fromValue>e&&_.splice(t,0,{fromValue:e,toValue:_[t].fromValue,color:c}),e=_[t].toValue,t++;_[t-1].toValue<r&&_.push({fromValue:_[t-1].toValue,toValue:r,color:c})}return _};var rt;!function(t){t.CLIP="clip",t.ELLIPSIS="ellipsis",t.WRAP="wrap"}(rt||(rt={}));class nt{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const at=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class ht{static log(...t){this.LOGGING&&console.log(...t)}static now(){return+new Date}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,o=e+Math.ceil((a+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===o?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=t.getDate()+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!s(t))return h({},t)}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNumber(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static checkEnumValue(t,e,s){const i=Object.keys(t);for(let s=i.length-1;s>=0;s--)if(t[i[s]]===e)return e;return s}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-at}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=p(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=p(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static pickNum(...t){const e=t.length;for(let s=0;s<e;s++)if(!isNaN(t[s])&&null!==t[s])return t[s];return NaN}static included(t,...e){const s=e.length;for(let i=0;i<s;i++)if(e[i]==t)return!0;return!1}static compareTextValue(t,e,s,i){if(t===e)return!0;let r=String(t),n=null==e?void 0:String(e);return!r&&!n||!(!r||!n)&&(s||(r=r.toLowerCase(),n=n.toLowerCase()),i?n.indexOf(r)>=0:r==n)}static irandom(t,e){if(void 0!==e){const s=t>>0,i=e>>0;return Math.random()*(i-s)+s>>>0}{const e=t>>0;return Math.random()*e>>0}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[Math.random()*t.length>>0]}static iarandom(t,e,s){const i=new Array;for(let s=t;s<e;s++)i.push(s);for(;i.length>s;)i.splice(ht.irandom(i.length),1);return i}static alert(t){window.alert(t)}static toInt(t,e){const s=parseInt(t,e||10);return isNaN(s)?0:s}static toFloat(t){const e=parseFloat(t);return isNaN(e)?0:e}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static equalObjects(t,e){if(t===e)return!0;if(!t&&!e)return!0;if(!t||!e)return!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(var s in e)if(e.hasOwnProperty(s)&&t[s]!==e[s])return!1;return!0}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(g(s,ht.month_days[ht.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static getTextLength2(t){let e=0,s=0,i=0;for(;i=t.charCodeAt(s++);e+=i>>7?2:1);return e}static getClassName(t){if(t&&t.constructor)return t.constructor.name||function(t){let e=t.toString();return e=e.substring(9),e=e.substring(0,e.indexOf("(")),e}(t.constructor)}static isInteger(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=s(t)?[]:{};for(let s of Object.keys(t))e[s]=ht.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),ht.log(t,+new Date-s+"ms")}static clamp(t,e,s){return p(e,g(s,t))}static makeIntArray(t,e){const s=new Array(p(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=m(t);if(i>=1e3){let r=e.length-1;for(;r;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}}var ot;ht.LOGGING=!1,ht.week_days=["일","월","화","수","목","금","토"],ht.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ht.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],ht.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(ot||(ot={}));const lt={name:"RealChart",version:"0.9.32",license:"enterprise",code:""};class ct{static decode(t){const e=ct.CHARS,s=ct.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}ct.PAD="=",ct.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class _t{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let a=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return a=(a>>16^i>>16)<<16|65535&(65535&a^65535&i),(a>>16)+(s>>16)+((65535&a)+(65535&s)>>16)<<16|(65535&a)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=_t.xor,i=_t.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=_t.xor,i=_t.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=_t.kb,i=_t._encryptBlock;let r,n,a,h=0,o=0,l={left:0,right:0};const c={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)o=o*_t.POW8|e[h++%i];return(t>>16^o>>16)<<16|65535&(65535&t^65535&o)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,a=c.p.length;r<a;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,a=c["s"+r].length;n<a;)i(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const s=_t._decryptBlock;let i=_t._init(e),r=[],n=ct.decode(t),a=n.length>>3,h=0,o={left:null,right:null};for(let t=0;t<a;t++){o.left=n[h]*_t.POW24|n[h+1]*_t.POW16|n[h+2]*_t.POW8|n[h+3],o.right=n[h+4]*_t.POW24|n[h+5]*_t.POW16|n[h+6]*_t.POW8|n[h+7],s(o,i);const t=o.left,e=o.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),h+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}_t.POW2=Math.pow(2,2),_t.POW3=Math.pow(2,3),_t.POW4=Math.pow(2,4),_t.POW8=Math.pow(2,8),_t.POW16=Math.pow(2,16),_t.POW24=Math.pow(2,24),_t.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class ut{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=_t.decrypt(t,"dkdl"+this._getLDKey(_t.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}class dt extends V{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._dom.setPointerCapture(t.pointerId),this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._dom.releasePointerCapture(t.pointerId),this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=ut.decrypt(e);if("RealChart"!==i.name||"RealChart"!==lt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(lt.license!=ot.Developer&&!ut.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(ot).includes(n))throw new Error(s);if(lt.code=i.code,lt.license=i.lic,n==ot.Evaluation||n==ot.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this.$_initControl(t||document,e,s||dt.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestory(){this._unresigterEventHandlers(this._dom),nt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}clipContainer(){return this._defs}setData(t,e,s){I(e)?(delete this._root.dom.dataset[t],s&&delete this._dom.dataset[t]):(this._root.dom.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){nt.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children;for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(gt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(gt.TEMP_KEY)}appendDom(t){t&&this._htmlRoot.append(t)}addElement(t){t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new ft(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipRect(t){return this.clipBounds(t.x,t.y,t.width,t.height)}clipCircle(){const t=new yt(this.doc());return this._defs.appendChild(t.dom),t}clipPath(){const t=new bt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.x-i.x,y:s+r.y-i.y}}_setTesting(){this._testing=!0,gt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s){t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}$_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||Q(A.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");h(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const a=this._svg=r.createElementNS(t,"svg");a.classList.add("rct-svg"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const o=r.createElement("desc");o.textContent="Created by RealChart v0.9.32",a.appendChild(o);const l=this._defs=r.createElementNS(t,"defs");this._initDefs(r,l),a.appendChild(l),n.appendChild(a),this._root=new mt(this),a.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),h(this._htmlRoot.style,{position:"absolute"})}_initDefs(e,s){let i=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");i.setAttribute("id",dt.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-olor","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):setTimeout((()=>{this.$_render()}),0)}updateNow(){this.$_render()}$_render(){if(+new Date<=this._toAnimation)this.$_requestRender();else{ht.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;h(this._htmlRoot.style,{left:$(e.left-t.left),top:$(e.top-t.top)}),this._doRenderBackground(this._container.firstElementChild,this._root,s,i);const r=this._padding=nt.getPadding(this._root.dom);this._doRender({x:r.left,y:r.top,width:s-r.left-r.right,height:i-r.top-r.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),ht.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}}dt.CLASS_NAME="rct-control",dt.SHADOW_FILTER="rr-chart-shadow-filter",dt._animatable=!0;class gt extends V{constructor(e,s,i=E){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return I(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}setAttrsEx(t){for(let e in t){const s=t[e];I(s)?this._dom.removeAttribute(e):this._dom.setAttribute(e,s)}return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t===this._tx&&e===this._ty||(ht.isValidNumber(t)&&(this._tx=t),ht.isValidNumber(e)&&(this._ty=e),this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=ht.isNumber(t)?t:this._tx,e=ht.isNumber(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx}px,${this._ty}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()}))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&ht.isValidNumber(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&ht.isValidNumber(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width)),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height)),this}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(U(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(U(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t)this._styles[i]!==t[i]&&(s[i]=this._styles[i]=t[i],e=!0);e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this._dom.classList.add(t):e(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=x(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVis(!1)}))}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(gt.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&this!==t[r-1]&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){this.control.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}_testing(){return gt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(ht.isValidNumber(e)||ht.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),ht.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+ht.pick(this._originX,t.getAttribute("x"),0)+" "+ht.pick(this._originY,t.getAttribute("y")||0)+")");const r=ht.getNumber(this._scaleX,1),n=ht.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}gt.DEBUGGING=!1,gt.TESTING=!1,gt.ASSET_KEY="_asset_",gt.TEMP_KEY="_temp_";class pt extends gt{constructor(t,e){super(t,e,"g")}}class mt extends gt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class wt extends gt{constructor(t){super(t,E,"clipPath");const e=this._id=ht.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ft extends wt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,a=0){super(t);const h=this._rect=new gt(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e),this}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class xt extends gt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class bt extends wt{constructor(t){super(t),this._path=new xt(t),this.add(this._path)}setPath(t){this._path.setPath(t)}}class yt extends wt{constructor(t){super(t),this.add(this._circle=new gt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class vt{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._doCanceled()}finally{this.end(-1,-1)}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}const Vt="0".charCodeAt(0),St="#".charCodeAt(0),Pt=",".charCodeAt(0),Ct="s".charCodeAt(0),At="a".charCodeAt(0);class kt{static getFormatter(t){let e=kt.Formatters[t];return e||(kt.Formatters[t]=e=new kt(t)),e}static get Default(){return kt.getFormatter(kt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===Vt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===St;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===Vt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Pt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Ct){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===At){s.signDisplay="never";break}}return s.minimumIntegerDigits=p(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}kt.DEFAULT_FORMAT="",kt.Formatters={};const Et=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Lt=[".","/","-",":"],Tt="Z".charCodeAt(0),Nt="z".charCodeAt(0),Rt="A".charCodeAt(0),Ot="a".charCodeAt(0),Mt="y".charCodeAt(0),Dt="M".charCodeAt(0),Bt="m".charCodeAt(0),$t="W".charCodeAt(0),It="w".charCodeAt(0),Ft="d".charCodeAt(0),zt="H".charCodeAt(0),Ht="h".charCodeAt(0),Gt="S".charCodeAt(0),jt="s".charCodeAt(0);class Wt{static getFormatter(t){let e=Wt.Formatters[t];return e||(Wt.Formatters[t]=e=new Wt(t)),e}static get Default(){return Wt.getFormatter(A.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var a=s[r],h=a.length;switch(a.charCodeAt(0)){case Mt:i+=h>2?t.getFullYear():F(t.getFullYear()%100);break;case Dt:i+=h>1?F(t.getMonth()+1):t.getMonth()+1;break;case Ft:i+=h>1?F(t.getDate()):t.getDate();break;case $t:i+=h>1?F(ht.weekOfYear(t,e)):ht.weekOfMonth(t,e,!0);break;case It:i+=h>1?ht.long_week_days[t.getDay()]:ht.week_days[t.getDay()];break;case zt:i+=h>1?F(t.getHours()):t.getHours();break;case Ht:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?F(e):e}else i+=h>1?F(t.getHours()):t.getHours();break;case Bt:i+=h>1?F(t.getMinutes()):t.getMinutes();break;case jt:i+=h>1?F(t.getSeconds()):t.getSeconds();break;case Ot:case Rt:t.getHours()<12?i+=A.am:i+=A.pm;break;case Gt:let s=t.getMilliseconds();i+=3==h?z(s):2==h?F(s):s.toString().substring(0,h);break;default:i+=a}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(Lt.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),Et.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Rt&&e<=Tt||e>=Ot&&e<=Nt)&&Q(A.invalidDateFormat,t)}e.push(n)}if(r<i&&ht.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&ht.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Wt.Formatters={};class Yt{static isBright(t){return new Yt(t).isBright()}static getContrast(t,e,s){return new Yt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(ht.startsWith(t,"rgb(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):ht.startsWith(t,"rgba(")&&ht.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):ht.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Yt(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var Xt,Ut,Zt;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Xt||(Xt={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Ut||(Ut={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Zt||(Zt={}));class Kt extends gt{constructor(t,e=E){super(t,e,"text"),this._layout=Ut.TOP,this._overflow=Zt.WRAP,this._dirty=!0,this._text="",this.anchor=Xt.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Ut.MIDDLE:i=Math.floor(s/2);break;case Ut.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=p(0,t),(e=g(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Yt.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const qt="$_TH";class Qt{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e.callback){let i=this.text;for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?kt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Wt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}return this.text}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),a=n.indexOf(";");if(a>0){const t=n.indexOf(";",a+1);t>=a?this._literals.push(r,n.substring(0,a),n.substring(a+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,a),n.substring(a+1),E),0===this._literals[2].length&&(this._literals[2]=E)}else this._literals.push(r,n,E,E);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Jt extends Qt{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf("<",r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.innerHTML=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}const te={t:class extends Jt{get type(){return"t"}},b:class extends Jt{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends Jt{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class ee{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new Qt).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){const s=t[i],r=t[i+1];if("<"==s){let s;if(r in te){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+r+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);s=(new te[r]).parse(e),i+=e.length}}}if(!s){e(t.substring(i));break}this._words.push(s)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const se=/<br.*?>|\r\n|\n/;class ie{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=w(this.lineHeight,1),h=this._lines,o=h.length,l=[];let c;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,_=null;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r),a=s.getBBox();o+=a.width,s.$_TW=a.width,c=p(c,s[qt]=a.height),_||(_=s)}l.push(_),s[qt]=c*a}if(o>0){c=h[0][qt];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(c-t.getAscent(c))+t.getAscent(h[e][qt]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="​",c=h[e][qt]}t.layoutText(h[0][qt])}}layout(t,e,s,i,r){const n=t.getBBox();let a,h=p(r.top,r.top+(i-n.height)/2);switch(e){case J.CENTER:t.anchor=Xt.MIDDLE,a=r.left+(s-r.left-r.right)/2;break;case J.RIGHT:t.anchor=Xt.END,a=t.getBBox().width-r.right;break;default:t.anchor=Xt.START,a=r.left}t.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(se);for(let t of s)e.push((new ee).parse(t))}}}var re,ne;!function(t){t.NORMAL="normal",t.SHUFFLE="shuffle",t.RANDOM="random"}(re||(re={})),function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(ne||(ne={}));class ae{constructor(t){this.source=t}hasDef(){return!0}}class he extends ae{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),a=this.source.color,h=I(this.source.opacity)?1:this.source.opacity,o=s(a)?a[0]:a,l=s(a)&&a.length>1?a[1]:"white",c=s(h)?h[0]:h,_=s(h)&&h.length>1?h[1]:h;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",l),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",o),n.setAttribute("stop-opacity",_),i.appendChild(r),i.appendChild(n)}}class oe extends he{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:a,y2:h}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":a=1;break;case"right":n=1;break;case"left":r=1;break;default:h=1}return i.setAttribute("x1",r),i.setAttribute("y1",a),i.setAttribute("x2",n),i.setAttribute("y2",h),i}}oe.TYPE="lineargradient";class le extends he{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return I(s.cx)||i.setAttribute("cx",s.cx),I(s.cy)||i.setAttribute("cy",s.cy),I(s.rd)||i.setAttribute("rd",s.rd),this._setStops(e,i),i}}le.TYPE="radialgradient";class ce extends ae{getEelement(s,i){const r=s.createElementNS(t,"pattern"),a=s.createElementNS(t,"path");let o=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),a.classList.add("rct-pattern"),+i.pattern>=0){const t=ce.STOCK[+i.pattern%ce.STOCK.length];a.setAttribute("d",t.path),t.style&&h(a.style,t.style),o=!t.fill,r.setAttribute("width",String(t.width||20)),r.setAttribute("height",String(t.height||20))}else n(i.pattern)&&(a.setAttribute("d",i.pattern),r.setAttribute("width",String(i.width||i.height||20)),r.setAttribute("height",String(i.height||i.width||20)));return e(i.style)&&h(a.style,i.style),o&&(a.style.fill="none"),r.append(a),r}}ce.TYPE="pattern",ce.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class _e extends ae{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===re.RANDOM?this._index=-1:(t.mode===re.SHUFFLE&&ht.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=s(e.colors)?e.colors:[]}}_e.TYPE="colors";class ue extends ae{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ue.SIZE,height:e.height||e.width||ue.SIZE})}}ue.TYPE="images",ue.SIZE=20;class de{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(t))t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}));else if(e(t)){const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(gt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t,e){this._items.forEach((t=>{e.removeDef(t.source.id)}))}get(t){return this._map[t]}$_loadItem(t){if(e(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ce.TYPE:s(t.colors)?e=_e.TYPE:s(t.images)&&(e=ue.TYPE)),e)switch(e.toLowerCase()){case oe.TYPE:return new oe(t);case le.TYPE:return new le(t);case ce.TYPE:return new ce(t);case _e.TYPE:return new _e(t);case ue.TYPE:return new ue(t)}}}}let ge=0;class pe extends V{constructor(t,e){super(),this.INVALID={},this.chart=t,this._visible=e,ge++}get visible(){return this._visible}set visible(t){var e;t!==this._visible&&(this._visible=t,null===(e=this.chart)||void 0===e||e._visibleChanged(this))}load(t){if(void 0!==t&&!this._doLoadSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(t)}return this}save(){const t={visible:this.visible};return this._doSave(t),t}$_parseProp(t){if(t.indexOf(".")>=0){const e=t.split("."),s=e.length-1;let i=this;for(let t=0;t<s;t++)if(i=i[e[t]],!(i instanceof V))return this.INVALID;return{obj:i,prop:e[s]}}}getProp(t){if(n(t)){const e=this.$_parseProp(t);return e?e===this.INVALID?E:e.obj[e.prop]:this[t]}}setProp(t,e,s){if(n(t)){const i=this.$_parseProp(t);if(i)i.obj instanceof pe?i.obj.setProp(i.prop,e,s):i.obj instanceof V&&e!==i.obj[i.prop]&&(i.obj[i.prop]=e,s&&this._changed());else if(t in this){const i=this[t];if(i instanceof pe)return i.setProps(e,s);if(e!==i)return this[t]=e,s&&this._changed(),!0}}}setProps(t,s){let i=!1;if(e(t))for(const e in t)this.setProp(e,t[e],!1)&&(i=!0);else this._doLoadSimple(t)&&(i=!0);return i&&s&&this._changed(),i}prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoadSimple(t){if("boolean"==typeof t)return this.visible=t,!0}_doLoad(t){for(const i in t){let r=t[i];this._doLoadProp(i,r)||(this[i]instanceof pe?this[i].load(r):s(r)?this[i]=r.slice(0):r instanceof Date?this[i]=new Date(r):e(r)?this[i]=h({},r):this[i]=r)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}_loadStroke(t){if(n(t))return this.visible=!0,this.style={stroke:t},!0}}var me,we,fe,xe,be,ye,ve,Ve,Se,Pe;pe.UPDATED="updated",function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}(me||(me={})),function(t){t.CLIP="clip",t.ELLIPSIS="ellipsis",t.WRAP="wrap"}(we||(we={}));class Ce extends pe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px",this.effect=me.NONE,this.autoContrast=!0}get outlineThickness(){return this._outlineThickness}set outlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=w(t,2)+"px")}}class Ae extends Ce{constructor(t,e){super(t,e),this.numberSymbols="k,M,G,T,P,E",this.numberFormat="#,##0.#"}get numberSymbols(){return this._numberSymbols}set numberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?kt.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ie),this._richTextImpl.setFormat(t)):this._richTextImpl=null}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}_doLoadSimple(t){return n(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(ht.isValidNumber(t)){const i=this._numSymbols&&e&&ht.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i=!1){let r=t||this.$_getNumberText(e,s,i)||e;return this.prefix&&(r=this.prefix+r),this.suffix&&(r+=this.suffix),r}}!function(t){t.DEFAULT="default",t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"}(fe||(fe={}));class ke extends Ae{constructor(){super(...arguments),this.iconPosition=fe.DEFAULT,this.iconGap=2}getIconPos(){return this.iconPosition===fe.DEFAULT?this.getDefaultIconPos():this.iconPosition}_doPrepareRender(t){if(this._images=null,this.imageList){const e=t.assets.get(this.imageList);e instanceof ue&&(this._images=e)}this._root=this._images?"":this.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart.assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof ue?s.getImage(i):i}return this._root+t}}}class Ee extends pe{}!function(t){t.CHART="chart",t.CONTAINER="container"}(xe||(xe={}));class Le extends pe{constructor(t){super(t,!0),this.front=!1,this.align=J.LEFT,this.verticalAlign=tt.TOP,this.offsetX=0,this.offsetY=0,this.scope=xe.CHART}getPosition(t,e,s,i,r,n,a){let h=e,o=s;switch(this.align){case J.CENTER:h+=(i-n)/2+this.offsetX;break;case J.RIGHT:h+=i-this.offsetX-n;break;default:h+=this.offsetX}switch(this.verticalAlign){case tt.MIDDLE:o+=(r-a)/2-this.offsetY;break;case tt.BOTTOM:o+=r-this.offsetY-a;break;default:o+=this.offsetY}return{x:h,y:o}}update(){this._changed(pe.UPDATED)}_doPrepareRender(t){this._seriesObj=t.seriesByName(this.series)}}class Te{constructor(t){this._map={},this._items=[],this._visibles=[],this.chart=t.chart}get count(){return this._items.length}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof Le)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const i=this.chart,r=this._items=[],n=this._map={};s(t)?t.forEach(((t,e)=>{r.push(this.$_loadItem(i,t,e))})):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach((t=>{t.name&&(n[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,s){let i=e.type;i||(i=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const r=t._getAnnotationType(i);if(!r)throw new Error("Invalid annotation type: "+e.type);const a=new r(t,e.name||`annotation ${s+1}`);return a.load(e),a.index=s,a}}class Ne extends Le{get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=G(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=G(this._height=t,!0))}getSize(t,e){return{width:W(this._widthDim,t),height:W(this._heightDim,e)}}}!function(t){t.AUTO="auto",t.LINE="line"}(be||(be={}));class Re extends pe{constructor(){super(...arguments),this.minWidth=50}}class Oe extends pe{constructor(t){super(t.chart,!0),this.axis=t,this.type=be.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.timeFormat="yyyy-MM-dd HH:mm",this.flag=new Re(t.chart,!0),this.visible=!1,this._args={axis:E,pos:E,flag:E}}isBar(){return!this.axis.continuous()&&this.type===be.AUTO}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof Date?Wt.getFormatter(this.timeFormat).toStr(new Date(s),this.chart.startOfWeek):kt.getFormatter(this.numberFormat).toStr(s)}moved(t,e){this.onChange&&(this._args.pos=t,this._args.flag=e,this.onChange(this._args))}_doLoadSimple(t){return r(t)?(this.visible=!0,this.onChange=t,!0):super._doLoadSimple(t)}}class Me extends pe{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class De extends Me{constructor(t,e){super(t,e&&t._isX)}_doLoadSimple(t){return this._loadStroke(t)||super._doLoadSimple(t)}}!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ye||(ye={}));class Be extends Me{constructor(){super(...arguments),this.align=ye.MIDDLE,this.offset=0,this.gap=5}get rotation(){return this._rotation}set rotation(t){let e=+t;Number.isNaN(e)||90===e||270===e||-90===e||-270===e||(e=0),this._rotation=e}isVisible(){return this.visible&&!I(this.text)}getRotation(t){return t._isHorz?0:isNaN(this._rotation)?t.position===Se.OPPOSITE?90:270:this._rotation}_doLoadSimple(t){return n(t)?(this.text=t,!0):super._doLoadSimple(t)}}class $e extends Me{getRows(){const t=this.axis,e=this.colors,s=e?e.length:0,i=[];if(this.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let a=1;a<r.length;a++,n++)e[n%s]&&i.push({axis:t,from:r[a-1].value,to:r[a].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doLoadSimple(t){return n(t)?(this.colors=[t,null],!0):s(t)?(this.colors=t,!0):super._doLoadSimple(t)}}class Ie extends Me{constructor(t){super(t,null),this.firstVisible=!1,this.rows=new $e(this.axis),this.lastVisible=!t._isX}isVisible(t){return t?!1!==this.visible:null==this.visible?!this.axis._isX:this.visible}}class Fe extends ke{constructor(t){super(t,!0),this.align=J.LEFT,this.verticalAlign=tt.TOP,this.offsetX=3,this.offsetY=3}getDefaultIconPos(){return fe.LEFT}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}(ve||(ve={}));class ze extends Me{constructor(t){super(t),this.front=!1,this.zindex=0,this.label=new Fe(t.chart)}canConstainedTo(t,e){if(s(this.col)){for(const t of this.col)if(e==t)return!0;return!1}if(!isNaN(this.col)&&e!=this.col)return!1;if(s(this.row)){for(const e of this.row)if(t==e)return!0;return!1}return!(!isNaN(this.row)&&t!=this.row)}}class He extends ze{}class Ge extends ze{}class je extends Me{constructor(t){super(t,!1),this.length=7,this.gap=3}_doLoadSimple(t){return ht.canNumber(t)?(this.length=+t,!0):super._doLoadSimple(t)}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(Ve||(Ve={}));class We extends ke{constructor(t){super(t&&t.chart,!0),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)},this.step=0,this.startStep=0,this.rows=0,this.maxRows=3,this.autoArrange=Ve.ROTATE,this.overflow=we.CLIP,this.numberFormat=null}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){const s=t.index;if(this.textCallback){const e=this.textCallback(this.axis.getTickLabelArgs(s,t.value));if(null!=e)return e}return 0===s?x(this.firstText,this.text):s===e-1?x(this.lastText,this.text):this.text}getLabelStyle(t,s){const i=t.index;if(this.styleCallback){const s=this.styleCallback(this.axis.getTickLabelArgs(i,t.value));if(e(s))return s}return 0===i?this.firstStyle:i===s-1?this.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?fe.TOP:fe.RIGHT}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}!function(t){t.AUTO="auto",t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base",t.BETWEEN="between"}(Se||(Se={}));class Ye extends Me{constructor(t){super(t,!1),this._thickness=10,this._minThumbSize=32,this._gap=3,this._gapFar=3}get thickness(){return this._thickness}set thickness(t){this._thickness=+t||this._thickness}get minThumbSize(){return this._minThumbSize}set minThumbSize(t){this._minThumbSize=+t||this._minThumbSize}get gap(){return this._gap}set gap(t){this._gap=+t||this._gap}get gapFar(){return this._gapFar}set gapFar(t){this._gapFar=+t||this._gapFar}}class Xe{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}resize(t,e,s){if((t=isNaN(t)?this.start:p(this.min,g(this.max,t)))>(e=isNaN(e)?this.end:p(t,g(this.max,e)))){const s=t;t=e,e=s}const i=this.max-this.min;if((t!==this.start||e!==this.end)&&e>t&&(isNaN(s)||(e-t)/i>=s)&&i/(e-t)>1)return this.start=t,this.end=e,!0}}class Ue extends De{}class Ze extends pe{constructor(t,e,s){super(t,!0),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this.crosshair=new Oe(this),this.scrollBar=new Ye(this),this.row=0,this.col=0,this.startAngle=0,this.totalAngle=360,this.position=Se.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this.tooltipHeader="<b>${name}</b>",this.tooltipRow="${series}:<b> ${yValue}</b>",this.animatable=!0,this._isX=e,this.name=s,this.title=new Be(this),this.line=new De(this,!0),this.sectorLine=new Ue(this,!0),this.tick=this._createTickModel(),this.label=this._createLabel(),this.grid=this._createGrid()}isEmpty(){return this._series.length<1}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return N+R*this.startAngle}getTotalAngle(){return R*p(0,g(360,w(this.totalAngle,360)))}isArced(){return this.totalAngle>0&&this.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}value2Tooltip(t){return t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectRanges(){this._series.forEach((t=>{t.collectRanges(this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){var t;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&this.position===Se.BETWEEN&&this._isX,this._isOpposite=this.position===Se.OPPOSITE,this._runPos=this.position,this.crosshair._args.axis=this._labelArgs.axis=null===(t=this.chart._proxy)||void 0===t?void 0:t.getChartObject(this),this._doPrepareRender(),this.label.prepareRender();const e=this._series,s=this._values;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!ht.equalArrays(e,this._prevSeries)))for(const t of e)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalculateRange(s),this._isX&&e.length>0)if(this.chart.isSplitted()){const t=[e[0]._row];for(let s=1;s<e.length;s++)t.indexOf(e[s]._row)<0&&t.push(e[s]._row);t.forEach((t=>{let s=0,i=0;e.forEach((e=>{e._row==t&&e.clusterable()&&(s+=w(e.groupWidth,1))})),e.forEach((e=>{if(e._row==t&&e.clusterable()){const t=w(e.groupWidth,1)/s;e.setCluster(t,i),i+=t}}))}))}else{let t=0,s=0;e.forEach((e=>{e.clusterable()&&(t+=w(e.groupWidth,1))})),e.forEach((e=>{if(e.clusterable()){const i=w(e.groupWidth,1)/t;e.setCluster(i,s),s+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t),this._labelArgs.count=this._ticks.length}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}contains(t){return t>=this._range.min&&t<=this._range.max}resetZoom(){this._zoom&&(this._zoom=null,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Xe(this),this.buildTicks(this._vlen),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return i.isFull()&&(this._zoom=null),this._changed(),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXValue(t){return t}setPrevRate(t){this._prevRate=t}prev(t){return isNaN(this._prevRate)?t:t*this._prevRate}_doLoadProp(t,i){if("guide"===t||"guides"===t)return this.guides.length=0,s(i)?this.$_loadGuides(i):e(i)&&this.$_loadGuides([i]),!0}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;i="range"===s.type?new Ge(this):"line"===s.type||isNaN(s.startValue)||isNaN(s.endValue)?new He(this):new Ge(this),i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(g(...t)||0):NaN,max:t.length>0?D(p(...t)||0):NaN}}}class Ke{constructor(t,e){this._items=[],this._map=new Map,this.chart=t,this.isX=e}get count(){return this._items.length}get first(){return this._items[0]}get items(){return this._items.slice(0)}internalItems(){return this._items}load(t){const e=this.chart;s(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}$_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(t)))}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return a(s)&&s>=0&&s<e.length?i=e[s]:n(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&(i._connect(t),this.isX?t.setCol(w(t.col,i.col)):t.setRow(w(t.row,i.row))),i}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,i){var r;let n=t._getAxisType(e.type);if(!n){let a;if(s(e.categories))a="category";else if(this.isX){const s=t._getSeries().internalItems();if(s.length>0){a="category";for(const t of s)if(!t.canCategorized()){if(e.name&&t.xAxis===e.name){a=E;break}if(t.xAxis===i){a=E;break}if(I(t.xAxis)&&0===i){a=E;break}}}}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defaultYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,this.isX,e.name);return a.load(e),a._index=i,a._isPolar=t.isPolar(),a}}class qe{constructor(){this._axes=[]}isEmpty(){return this._axes.length<1}}class Qe{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}buildTicks(t){const e=this.isX;this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()||s.buildTicks(t[e?s.col:s.row])}))}))})),this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()&&s.buildTicks(t[e?s.col:s.row])}))}))}))}calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{const r=s?i.col:i.row;i.calcPoints(t[r],e)}))}))}))}}class Je extends Qe{constructor(t){super(t,!0)}prepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new qe)}t.forEach((t=>{const s=t.position;let r=t._row;s===Se.OPPOSITE?(r++,t._runPos=s):r<e-1&&s===Se.BETWEEN?(r++,t._runPos=Se.NORMAL):t._runPos=s,i[r][t._col]._axes.push(t)}))}}class ts extends Qe{constructor(t){super(t,!1)}prepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new qe)}t.forEach((t=>{const e=t.position;let r=t._col;e===Se.OPPOSITE?(r++,t._runPos=e):t._col<s-1&&e===Se.BETWEEN?(r++,t._runPos=Se.NORMAL):t._runPos=e,i[t._row][r]._axes.push(t)}))}}!function(t){t.NONE="none",t.X="x",t.Y="y",t.BOTH="both"}(Pe||(Pe={}));let es=class extends pe{constructor(t){super(t.chart,E),this.body=t}isVisible(){return!1!==this.visible&&this.body.isZoomed()&&this.body.canZoom()}};class ss extends pe{constructor(t){super(t.chart,!1),this.body=t,this.size=.5}}class is extends pe{constructor(t){super(t,!0),this.split=new ss(this),this.circular=!0,this.image=new Ee(null,!0),this.zoomType=Pe.NONE,this.zoomButton=new es(this),this._annotations=new Te(this),this.radius="45%",this.centerX="50%",this.centerY="50%"}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=G(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=G(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=G(t,!0))}canZoom(){return this.zoomType===Pe.X||this.zoomType===Pe.Y||this.zoomType===Pe.BOTH}calcRadius(t,e){return W(this._radiusDim,g(t,e))}setPolar(t,e){return this._cx=W(this._cxDim,t),this._cy=W(this._cyDim,e),this._rd=W(this._radiusDim,g(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd}:E}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}_doLoadProp(t,i){if("annotations"===t||"annotation"===t)return s(i)?this.$_loadAnnotations(i):e(i)&&this.$_loadAnnotations([i]),!0}_doPrepareRender(t){this._annotations.prepareRender()}$_loadAnnotations(t){this._annotations.load(t)}}class rs extends pe{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class ns extends pe{constructor(t,e){super(t.chart,!0),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}var as,hs,os;ns.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.BODY="body"}(as||(as={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(hs||(hs={})),function(t){t.START="start",t.CENTER="center",t.END="end"}(os||(os={}));class ls extends rs{constructor(t){super(t,void 0),this.location=as.BOTTOM,this.layout=hs.AUTO,this.alignBase=st.BODY,this.gap=6,this.itemGap=8,this.markerVisible=!0,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=os.CENTER,this.seriesHovering=!0,this.visible=void 0}items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocatiion(){return this._location}getLayout(){if(this.layout!==hs.AUTO||this._location===as.BODY)return this.layout;switch(this._location){case as.BOTTOM:case as.TOP:return hs.HORIZONTAL;default:return hs.VERTICAL}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=G(this.maxWidth,!0),this._maxHeightDim=G(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=ht.checkEnumValue(as,this.location,as.BOTTOM),this._items=this.$_collectItems()}$_collectItems(){return this.chart._getLegendSources().map((t=>new ns(this,t)))}}const cs=Math.pow,_s=Math.sqrt,us=Math.sin,ds=Math.cos,gs=Math.PI,ps=1.70158,ms=1.525*ps,ws=ps+1,fs=2*gs/3,xs=2*gs/4.5,bs=function(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},ys={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-cs(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-cs(1-t,3),outCubic2:t=>1-cs(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-cs(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-cs(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-cs(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-cs(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-cs(-2*t+2,5)/2,inSine:t=>1-ds(t*gs/2),outSine:t=>us(t*gs/2),inOutSine:t=>-(ds(gs*t)-1)/2,inExpo:t=>0===t?0:cs(2,10*t-10),outExpo:t=>1===t?1:1-cs(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?cs(2,20*t-10)/2:(2-cs(2,-20*t+10))/2,inCirc:t=>1-_s(1-cs(t,2)),outCirc:t=>_s(1-cs(t-1,2)),inOutCirc:t=>t<.5?(1-_s(1-cs(2*t,2)))/2:(_s(1-cs(-2*t+2,2))+1)/2,inBack:t=>ws*t*t*t-ps*t*t,outBack:t=>1+ws*cs(t-1,3)+ps*cs(t-1,2),inOutBack:t=>t<.5?cs(2*t,2)*(7.189819*t-ms)/2:(cs(2*t-2,2)*((ms+1)*(2*t-2)+ms)+2)/2,inElastic:t=>0===t?0:1===t?1:-cs(2,10*t-10)*us((10*t-10.75)*fs),outElastic:t=>0===t?0:1===t?1:cs(2,-10*t)*us((10*t-.75)*fs)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-cs(2,20*t-10)*us((20*t-11.125)*xs)/2:cs(2,-20*t+10)*us((20*t-11.125)*xs)/2+1,inBounce:t=>1-bs(1-t),outBounce:bs,inOutBounce:t=>t<.5?(1-bs(1-2*t))/2:(1+bs(2*t-1))/2},vs=function(t,e,s,i,r,n){const a=null!=s?H(e,s):{},h=H(e,i),o=t.animate([a,h],{duration:r,fill:"none"});return o&&n&&o.addEventListener("finish",n),o};class Vs{constructor(){this.delay=0,this.duration=Vs.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=g(1,p(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&window.requestAnimationFrame(this._handler)}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=w(t,Vs.DURATION),this.delay=e||0,this._easing=ys[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}var Ss;Vs.DURATION=700,Vs.SHORT_DURATION=300,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.SQUARE="square",t.TRIANGLE="triangle",t.STAR="star",t.ITRIANGLE="itriangle",t.RECTANGLE="rectangle"}(Ss||(Ss={}));const Ps=ht.getEnumValues(Ss),Cs=.001,As=Math.PI;class ks{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){return r>0?n>0?(r=g(-i/2,s/2,r),["M",t,e-(n=g(-i/2,s/2,n)),"v",i+n+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",i+(r=g(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:n>0?["M",t,e-(n=g(-i/2,s/2,n)),"v",i+n,"h",s,"v",-i-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=g(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static arc(t,e,s,i,r,n,a,h=!1){const o=M(m(n-r)),l=2*As-o<.01,u=o-As<.01?0:1,d=a?1:0,g=c(r),p=_(r),w=c(n-=l?d?Cs:-.001:0),f=_(n),x=[];return x.push("M",t+s*g,e+i*p,"A",s,i,0,u,d,t+s*w,e+i*f),l&&x.push("M",t,e),h&&x.push("Z"),x}static sector(t,e,s,i,r,n,a,h){const o=M(m(a-n)),l=2*As-o<Cs;let u=o-As<Cs?0:1;const d=h?1:0,g=c(n),p=_(n),w=c(a-=l?d?Cs:-.001:0),f=_(a),x=s*r,b=i*r,y=[];return y.push("M",t+s*g,e+i*p,"A",s,i,0,u,d,t+s*w,e+i*f),l?y.push("M",t+x*w,e+b*f):y.push("L",t+x*w,e+b*f),isNaN(x)||y.push("A",x,b,0,u,1-d,t+x*g,e+b*p),y.push("Z"),y}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,a=e+i/2+(i/2-i/2*_(r+6*Math.PI/5))/2,h=s/2,o=i/2,l=s/4,u=i/4,d=2*Math.PI/5,g=d/2,p=[];p.push("M",n+h*c(r),a+o*_(r));for(let t=0;t<5;t++)p.push("L",n+h*c(r),a+o*_(r),"L",n+l*c(r+g),a+u*_(r+g)),r+=d;return p.push("Z"),p}static setShape(t,e,s,i){let r;switch(e){case Ss.SQUARE:case Ss.DIAMOND:case Ss.TRIANGLE:case Ss.ITRIANGLE:case Ss.STAR:case Ss.RECTANGLE:r=ks[e](0,0,2*s,2*i);break;default:r=ks.circle(s,i,g(s,i))}t.setPath(r)}}class Es extends gt{static create(t,e,s,i,r,n,a=0){return new Es(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=E,s=E){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Ls extends xt{constructor(t,e=E){super(t,e)}setBox(t,e,s,i){return this.setPath(ks.box(t,e,s,i)),this}}const Ts=function(t){return t&&"object"==typeof t};class Ns extends S{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),s(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let i;i=s(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}_internalValues(){return this._rows}$_readRow(t){let e={};if(s(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else Ts(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e,s){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&Q(A.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class Rs{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const i=t[e];let r;s(i)?r=new Ns({},i):Ts(i)&&s(i.values)&&(r=new Ns(i.options,i.values)),this._map[e]=r}}}let Os=0;class Ms{constructor(t){this.pid=Os++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}proxy(){return{pid:this.pid,xValue:this.xValue,yValue:this.yValue,zValue:this.zValue}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null==(e=this.source)||isNaN(e)?this.source:this.source[t];var e}parse(t){const i=this.source;null==i?this.isNull=!0:s(i)?0===i.length?this.isNull=!0:this._readArray(t,i):e(i)?(this._readObject(t,i),(s(i.drillDown)||e(i.drillDown))&&(this.drillDown=i.drillDown)):this._readSingle(i)}getLabel(t){return this.label===E?this.yValue:this.label}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getTooltipPos(){return{x:this.xPos,y:this.yPos}}updateValue(t,e){e?(this.yPrev=this.yValue,this.yNew=t,this.ani=e):this.y=t}cleanValue(){this.y=this.yNew,delete this.yPrev,delete this.yNew}getTooltip(t){var e;return t in this?this[t]:null===(e=this.source)||void 0===e?void 0:e[t]}_assignTo(t){return h(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,source:this.source})}_readArray(t,e){const s=+t.colorField;e.length>1?(this.x=e[w(t.xField,0)],this.y=e[w(t.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=b(t._yFielder(e),e.y,e.value),this.color=x(t._colorFielder(e),e.color)}_readSingle(t){this.y=t}}class Ds{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t){if(e(t)){const e=t.pid;for(const t of this._points)if(t.pid===e)return t}else for(const e of this._points)if(e.xValue===t)return e}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return this._points.splice(e,1),!0}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}getProxies(){return this._points.map((t=>t.assignTo()))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getPoints(t,e){const s=t._zoom;if(s){const e=this._points,i=e.length;let r=s.start,n=s.end;if(t.continuous()){let t,s,a=0;for(s=Number.MIN_VALUE;a<i-1;a++){if(t=e[a],r>=s&&r<t.xValue+(e[a+1].xValue-t.xValue)/2){r=a;break}s=t.xValue}for(r!==a&&(r=i-1),s=Number.MAX_VALUE,a=i-1;a>0;a--){if(t=e[a],n<s&&n>t.xValue-(t.xValue-e[a-1].xValue)/2){n=a;break}s=t.xValue}n!==a&&(n=0),r=p(r-1,0),n=g(n+1,i-1)}else r=p(0,Math.floor(r)),n=g(Math.ceil(n),i-1);return this._points.slice(r,n+1)}return this._points}}class Bs extends Ms{getLabel(t){return this.zValue}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return h(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=e.length>2?1:0;s>0&&(this.x=e[w(t.xField,0)]),this.y=e[w(t.yField,0+s)],this.z=e[w(t.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=x(t._zFielder(e),e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.zValue=parseFloat(this.z),this.isNull||(this.isNull=isNaN(this.zValue))}}class $s extends Ms{get highValue(){return this.yValue}labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,lowValue:this.lowValue,highValue:this.yValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[w(t.lowField,0+s)],this.y=e[w(t.yField,1+s)],s>0&&(this.x=e[w(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=x(e[t.lowField],e.low),this.y=b(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}}var Is,Fs,zs;!function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}(Is||(Is={}));class Hs extends je{constructor(){super(...arguments),this.step=1}getPosition(){return this.position===Is.POINT||this.position===Is.EDGE?this.position:this.axis._isX?Is.POINT:Is.EDGE}}class Gs extends We{getTick(t,e){return null!=e?this._getText(e,e,!1):""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}class js extends Ie{getPoints(){const t=this.axis._pts,e=this.axis._ticks.length,s=[];if(e>0)for(let i=0;i<=e;i++)s.push(t[i+1]);return s}}class Ws extends Ze{constructor(t,e,s){super(t,e,s),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1,this.startOffset=0}getCategories(){return this._cats}getCategory(t){return this._cats[t]}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return(this._zoom?this._zoom.start:this._catMin)+e-2;return-1}getWdith(t,e){return 0}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_createGrid(){return new js(this)}_createTickModel(){return new Hs(this)}_createLabel(){return new Gs(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=ht.makeIntArray(0,this._categories.length)}getStartAngle(){let t=super.getStartAngle(),e=+this.startOffset;return e>0&&(t-=g(e,1)*this._categories[0].w*T/this._len),t}_doPrepareRender(){this._cats=[],this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=f(this.minPadding,this.padding,0),this._maxPad=f(this.maxPadding,this.padding,0),this._catPad=w(this.categoryPadding,0))}_doBuildTicks(t,e,s){const i=this.label;let r=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[],o=t,l=e;t=this._catMin=Math.floor(t+.5);let c=(e=this._catMax=Math.ceil(e-.5))-t+1;for(let e=-1;e>=t;e--)r.unshift(String(e)),n.unshift(1);for(;r.length<c;)r.push(String(r.length+t)),n.push(1);if(r=this._cats=r.slice(0,c),n=n.slice(0,c),c=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0),c>0){const s=this._pts=[0];let o=this._minPad;for(let i=t;i<=e;i++)s.push(o/c),o+=n[i-t];s.push(o/c),s.push((o+this._maxPad)/c);for(let e=1;e<s.length-2;e+=a){const s=t+e-1,n=this._categories[t+e-1];h.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,n?n.t:r[e-1])})}}else this._pts=[];return this._setMinMax(o,l),h}calcPoints(t,e){super.calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(this._isPolar){if(e>0){const e=this.totalAngle*R;this._pts=s.map((s=>s/t*e))}}else{let t;t=this.tick.getPosition()===Is.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1]+(s[i+2]-s[i+1])*(e-Math.floor(e+.5)+.5);return this.reversed?t-r:r}valueAt(t,e){this.reversed&&(e=t-e);for(let t=1;t<this._pts.length-1;t++)if(e>=this._pts[t]&&e<this._pts[t+1])return this._catMin+t-.5}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);return this._pts[s+2]-this._pts[s+1]}getValue(t){return a(t)?t:this._map[t]}getXValue(t){return this._cats[t-this._catMin]||t}$_collectCategories(t){const i=this.categories,r=this._categories=[];if(s(i)&&i.length>0)this._len=0,i.forEach((t=>{const s=null==t?1:w(t.weight,1),i=t&&t.icon;let n,a;null==t?a=n=null:e(t)?(n=x(t.name,t.label),a=x(t.label,t.name)):a=n=String(t),this._len+=s,r.push({c:n,t:a,w:s,i:i})}));else if(s(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)r.find((t=>t.c===e))||r.push({c:e,w:1,t:e})}this._map={},r.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}!function(t){t.AUTO="auto",t.INSIDE="inside",t.OUTSIDE="outside",t.HEAD="head",t.FOOT="foot",t.INSIDE_FIRST="insideFirst",t.OUTSIDE_FIRST="outsideFirst"}(Fs||(Fs={}));class Ys extends ke{constructor(t){super(t,E),this._domain={callback:(t,e)=>this._point[e]||this._point.source[e]},this.position=Fs.AUTO,this.textAlign=J.CENTER,this.distance=25,this.visible=E}getTextDomain(t){return this._point=t,this._domain}getText(t){return ht.isValidNumber(t)?this._getText(null,t,m(t)>1e3,!0):t}getOffset(){const t=+this.offset;return isNaN(t)?this.position===Fs.INSIDE?0:Ys.OFFSET:t}getDefaultIconPos(){return fe.TOP}_doLoadSimple(t){return r(t)?(this.visibleCallback=t,this.visible=!0):super._doLoadSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Ys.OFFSET=4,function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(zs||(zs={}));class Xs extends pe{constructor(t){super(t.chart,!1),this.series=t,this.type=zs.LINEAR,this.resolution=5,this.movingInterval=2}_doPrepareRender(t){const e=this.series,s=this._res=(e._runPoints.length-1)*Math.max(1,this.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._runPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r})));(this["$_"+this.type]||this.$_linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){return!0===this.curved||null==this.curved&&(this.type===zs.EXPONENTIAL||this.type===zs.LOGARITHMIC||this.type===zs.POWER)}$_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const a=e*n-s*s,h=0===a?0:(e*r-s*i)/a;return{m:h,a:(i-h*s)/e}}$_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this.$_calcLine(t);e.push({x:t[0].x,y:i*t[0].x+r}),e.push({x:t[s-1].x,y:i*t[s-1].x+r})}}$_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:w(t.y,0)}))),{m:r,a:n}=this.$_calcLine(i),a=t[0].x,h=t[s-1].x,o=(h-a)/this._res;for(let t=a;t<=h;t+=o){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}$_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this.$_calcLine(i),a=Math.exp(n),h=t[0].x,o=t[s-1].x,l=(o-h)/this._res;for(let t=h;t<=o;t+=l){const s=a*Math.pow(t,r);e.push({x:t,y:s})}}}$_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,a=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),a+=t.x*t.y}));const h=s*i-a*a,o=Math.exp((i*r-a*n)/h);return{m:(s*n-a*r)/h,a:o}}$_exponential(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this.$_calcLine2(i),a=n,h=t[0].x,o=t[s-1].x,l=(o-h)/this._res;for(let t=h;t<=o;t+=l){const s=a*Math.exp(r*t);e.push({x:t,y:s})}}}$_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,a=0;const h=2+1;for(let e=0;e<h;e++){for(let i=0;i<s;i++)n+=Math.pow(t[i].x,e)*t[i].y;i.push(n),n=0;const o=[];for(let i=0;i<h;i++){for(let r=0;r<s;r++)a+=Math.pow(t[r].x,e+i);o.push(a),a=0}r.push(o)}r.push(i);const o=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)m(s[t][r])>m(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,h),l=t[0].x,c=t[s-1].x,_=(c-l)/this._res;for(let t=l;t<=c;t+=_){const s=o.reduce(((e,s,i)=>e+s*Math.pow(t,i)),0);e.push({x:t,y:s})}}}$_movingAverage(t,e){const s=t.length,i=p(1,g(s-1,this.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+w(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}const Us={x:"xValue",y:"yValue",z:"zValue"};class Zs extends Vs{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point.ani,this.point.cleanValue()}}_doUpdate(t){return this.point.y=this.point.yPrev+(this.point.yNew-this.point.yPrev)*t,this.series._changed(),!0}}class Ks extends pe{static _loadSeries(t,e,s){return new(t._getSeriesType(e.type)||t._getSeriesType(s||t.type))(t,e.name).load(e)}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return t._xAxisObj.getXValue(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getTooltip(s)}}constructor(t,e){super(t,!0),this._row=0,this._col=0,this.index=-1,this._simpleMode=!1,this.zOrder=0,this.visibleInLegend=!0,this.visibleInNavigator=!1,this.tooltipText="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.name=e,this.pointLabel=this._createLabel(t),this.trendline=new Xs(this),this._points=new Ds(this),this._pointArgs=this._createPointArgs(),this._initProps()}_initProps(){}_createLabel(t){return new Ys(t)}onDataValueChanged(t,e,s,i,r){if(ht.log("onDataValueChanged",e,s,i,r),s===(this.yField||"y")){const t=this._runPoints[e];t&&this.setValueAt(t,i,!0)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){ht.log("onDataRowAdded",e),this.addPoint(t.getRow(e),!0)}onDataRowDeleted(t,e){ht.log("onDataRowDeleted",e)}onDataChanged(t){ht.log("onDataChanged")}getTooltipText(t,e){return this.tooltipText}getTooltipParam(t,e,s){return Ks.getPointTooltipParam(t,e,s)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._dataDirty=!0)}contains(t){return this._points.contains(t)}getPoints(){return this._points}getLabeledPoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}getVisiblePoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,+e||ns.MARKER_SIZE)),this._legendMarker}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s}hasMarker(){return!1}setShape(t){}seriesChanged(){return!1}getVisibleSeries(){return[this]}needClip(t){const e=this.group?this.group.noClip:this.noClip;return t?!1===e:!0!==e}setCol(t){this._col=t}setRow(t){this._row=t}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(){let t=this._xAxisObj.getValue(this.xStart);const e=isNaN(t)?this._xAxisObj.getValue(this.chart.options.xStart):t;return this._xAxisObj._zoom?Math.floor(this._xAxisObj._zoom.start):e}getXStep(){return x(this.xStep,this.chart.options.xStep)}prepareRender(){if(this._xAxisObj=this.group?this.group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this.group?this.group._yAxisObj:this.chart._connectSeries(this,!1),this._calcedColor=void 0,this._dataDirty){const t=this._doLoadData(this._data);this._loadPoints(t),this._dataDirty=!1}this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.pointLabel.prepareRender(),super.prepareRender()}prepareAfter(){}collectCategories(t){if(t instanceof Ws){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart()||0,i=this.getXStep()||1;n(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)&&(i=t.getValue(s.y)),isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectRanges(t){const e=this._visPoints,s=e.length;if(s>0){const t=this._pointArgs;let i=e[0],r=i.xValue,n=r,a=i.yValue,h=a,o=i.zValue,l=o;const c=this.hasZ();i.vindex=0;for(let t=1;t<s;t++)i=e[t],i.vindex=t,isNaN(h)&&!isNaN(i.yValue)?a=h=i.yValue:i.yValue>h?h=i.yValue:i.yValue<a&&(a=i.yValue),isNaN(n)&&!isNaN(i.xValue)?r=n=i.xValue:i.xValue>n?n=i.xValue:i.xValue<r&&(r=i.xValue);if(c)for(let t=1;t<s;t++){const s=e[t].zValue;isNaN(l)&&!isNaN(s)?o=l=s:s>l?l=s:s<o&&(o=s)}if(this._minY=a,this._maxY=h,this._minX=r,this._maxX=n,this.trendline.visible){this.trendline.prepareRender();const t=this.trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,c&&(t.zMin=this._minZ=o,t.zMax=this._maxZ=l)}this.$_prepareViewRanges(e),isNaN(this._minY)||t.push(this._minY,this._maxY)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=it(this.viewRanges,s,i,!1,!1,!0,this.color))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=E}))}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t))),this._visPoints=this._runPoints.filter((t=>t.visible))}reference(t,e){}isVisible(t){return this._xAxisObj.contains(t.x)&&this._yAxisObj.contains(t.y)}getLegendSources(t){!1!==this.visibleInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_createPointArgs(){return{}}_preparePointArgs(t){var e;this._pointLabelCallback=this.pointLabel.textCallback,this._argsPoint=null,t.series=null===(e=this.chart._proxy)||void 0===e?void 0:e.getChartObject(this),t.count=this._points.count}_getPointCallbackArgs(t,e){e!==this._argsPoint&&(this._argsPoint=e).assignTo(t)}getPointText(t,e){if(this._pointLabelCallback){this._getPointCallbackArgs(this._pointArgs,t);const e=this._pointLabelCallback(this._pointArgs);if(null!=e)return e}return e}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(this.pointLabel.styleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointLabel.styleCallback(this._pointArgs)}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}getViewRangeAxis(){return this.viewRangeValue||this._defViewRangeValue()}isPointLabelsVisible(){return this.pointLabel.visible||r(this.pointLabel.visibleCallback)}isPointLabelVisible(t){const e=this.pointLabel;return!1!==e.visible&&(e.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}setValueAt(t,e,s){if(t&&(t.ani&&t.yNew!==e||!t.ani&&t.yValue!==e)){const i=s?new Zs(this,t):E;return t.ani instanceof Zs&&t.ani.stop(),t.updateValue(e,i),this.chart.dataChanged(),i.start(),this._changed(),!0}}findPoint(t){}updateData(t){this._points.load(t),this.chart.dataChanged(),this._changed()}addPoint(t,e){const s=this._doAddPoint(t);return s&&(this._points.add(s),this.chart.dataChanged(),this._changed()),s}removePoint(t){if(t&&this._points.remove(t))return this.chart.dataChanged(),this._doPointRemoved(t),this._changed(),!0}_createPoint(t){return new Ms(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_createFielder(t){return r(t)?e=>t(e):n(t)?e=>e[t]:t=>E}_createFielders(){this._xFielder=this._createFielder(this.xField),this._yFielder=this._createFielder(this.yField),this._zFielder=this._createFielder(this.zField),this._colorFielder=this._createFielder(this.colorField)}_doLoad(t){super._doLoad(t),this._createFielders()}_doLoadData(t){if(s(t))return t;if(t){let e;if(t.$_p instanceof Ns?e=t.$_p:t instanceof Ns?e=t:n(t)&&(e=this.chart.data.get(t)),e)return e!==this._cdata&&(this._cdata&&this._cdata.removeListener(this),this._cdata=e,this._cdata&&this._cdata.addListener(this)),e._internalValues()}}_loadPoints(t){this._doLoadPoints(t)}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this.color;let e,i;s(this.pointColors)?e=this.pointColors:n(this.pointColors)?i=this.chart.assets.get(this.pointColors):this._colorByPoint()&&(e=this.chart.colors),i instanceof _e?(i.prepare(),this._runPoints.forEach(((e,s)=>{e.color=e.color||i.getNext()||t}))):e?this._runPoints.forEach(((s,i)=>{s.color=s.color||e[i%e.length]||t})):this._runPoints.forEach(((e,s)=>{e.color=e.color||t})),this._preparePointArgs(this._pointArgs)}_setViewRange(t,e){const s=t[Us[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=E}_defViewRangeValue(){return"y"}}Ks.LEGEND_MARKER="rct-legend-item-marker";class qs{constructor(t){this._map={},this._items=[],this._visibles=[],this._series=[],this._visibleSeries=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(){return!this._items.find((t=>!t.isEmpty()))}items(){return this._items.slice(0)}internalItems(){return this._items}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s._row&&e===s._col))}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const i=this.chart,r=this._items=[],n=this._series=[];s(t)?t.forEach(((t,e)=>{r.push(this.$_loadItem(i,t,e))})):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach((t=>{t instanceof li?n.push(...t.series):t instanceof Ks&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t)))}$_add(t){!this._widget||t instanceof ti||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}add(t){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof Ks?e=t:n(t)&&(e=this._map[t]),e){if(!e.group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),e.name&&delete this._map[e.name],e;if(e.group.remove(e))return e}}updateData(t){}prepareRender(){const t=[];let e=0;this._visibles=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.zOrder||0)-(+e.zOrder||0))),this._series.forEach((s=>{s.visible&&t.push(s),s.hasMarker()&&s.setShape(Ps[e++%Ps.length])})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=this._visibleSeries.filter((t=>t.clusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof si&&(t._single=1===s)})),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,i){let r=s(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const s=new r(t);return s.load(e),s.index=i,s}if(r=t._getSeriesType(e.type||t.type),!r)throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t,e.name||`Series ${i+1}`);return n.load(e),n.index=i,n}}class Qs extends pe{constructor(t){super(t.chart,!0),this.series=t,this.radius=3}}class Js extends Ms{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return x(this.x,this.y)}}class ti extends Ks{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:W(this._centerXDim,t),y:W(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===Fs.AUTO?Fs.INSIDE:t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this.legendByPoint?!1!==this.visibleInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_doLoad(t){super._doLoad(t),this._centerXDim=G(b(this.centerX,this.center,ti.CENTER),!0),this._centerYDim=G(b(this.centerY,this.center,ti.CENTER),!0)}}ti.CENTER="50%";class ei extends ti{constructor(){super(...arguments),this.radius=ei.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return W(this._radiusDim,g(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=G(x(this.radius,ei.DEF_RADIUS),!0)}}ei.DEF_RADIUS="40%";class si extends Ks{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this.pointWidth=1}get groupWidth(){return this.pointWidth}getPointWidth(t){const e=this.group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,s}getPointPos(t){const e=this.group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.groupPadding,s-=s*e.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return t===Fs.AUTO?Fs.OUTSIDE_FIRST:t}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this.pointPadding)?this._single?.25:this.group?.1:.2:this.pointPadding}}class ii extends si{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=w(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}isBased(t){return t===this._yAxisObj}}class ri extends si{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}class ni extends ri{}var ai,hi,oi;!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(ai||(ai={}));class li extends pe{static collectTooltipText(t,e,s){let i=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,r)=>{s.vindex>=e._visPoints.length||(i&&(i+="<br>"),i+=t.tooltipRow.replace("series","series."+r).replace(/\$\{/g,"${"+r+"."))})),i+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",i}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=+i.substring(0,r);return isNaN(n)||(s=(e=t[n])._visPoints[s.vindex],i=i.substring(r+1)),i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ks.getPointTooltipParam(e,s,i)}constructor(t){super(t,!0),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1,this.layout=ai.DEFAULT,this.visibleInLegend=!0,this.zOrder=0,this.tooltipHeader="<b>${name}</b>",this.tooltipRow="${series}:<b> ${yValue}</b>",this.layoutMax=100}getTooltipText(t,e){return li.collectTooltipText(this,this._visibles,e)}getTooltipParam(t,e,s){return li.inflateTooltipParam(this._visibles,t,e,s)}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(){return this._series.length<1}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}setCol(t){this._col=t,this._series.forEach((e=>e.setCol(t)))}setRow(t){this._row=t,this._series.forEach((e=>e.setRow(t)))}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case ai.STACK:this.$_collectStack(t,e);break;case ai.FILL:this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t){this._visibles.forEach((e=>{e.collectRanges(t)}))}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){!1!==this.visibleInLegend&&this._series.forEach((e=>e.getLegendSources(t)))}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return(isNaN(s)||e>s||!this.isBased(t))&&this.layout!==ai.FILL}getVisPoints(t){return this._visibles.map((e=>e._visPoints[t.vindex]))}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),!0}getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e.getVisiblePoints()))),t}_doLoadProp(t,e){if("children"===t)return this.$_loadSeries(this.chart,e),!0}prepareRender(){const t=this._visibles;this._stacked=this.layout===ai.STACK||this.layout===ai.FILL,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.zOrder||0)-(+e.zOrder||0))),this._seriesChanged=!ht.equalArrays(t,this._visibles),super.prepareRender()}_doPrepareRender(t){this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),this._visibles.length>0&&(this._visibles.forEach((t=>t.prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,i){const r=this._seriesType();s(i)?i.forEach(((e,s)=>this.$_add(Ks._loadSeries(t,e,r)))):e(i)&&this.$_add(Ks._loadSeries(t,i,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t.group=this,t.index=this._series.length-1}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(m(e.yValue)||0)),0);let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}class ci extends li{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class _i extends li{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this.groupWidth=1,this.groupPadding=.1}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}class ui extends Ks{}class di extends pe{constructor(t){super(t,!0),this.text="Title",this.alignBase=st.BODY,this.align=J.CENTER,this.verticalAlign=tt.MIDDLE,this.gap=10}isVisible(){return this.visible&&!I(this.text)}_doLoadSimple(t){return n(t)?(this.text=t,!0):super._doLoadSimple(t)}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(hi||(hi={}));class gi extends di{constructor(){super(...arguments),this.verticalAlign=tt.BOTTOM,this.position=hi.BOTTOM,this.text="",this.titleGap=2}}class pi extends Ie{getPoints(t){const e=this.axis;return e.hasBreak()?e._ticks.filter((t=>!e.isBreak(t.value))).map((s=>e.getPos(t,s.value))):e._ticks.map((s=>e.getPos(t,s.value)))}}class mi extends je{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1,this.stepPixels=72,this.baseRange=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,i,r=!1){var n,a;let h;return this._strictTicks=this._strictEnds=!1,this._step=NaN,r?h=this._getStepsByPixels(t,w(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?(h=this.steps.slice(0),h.length>0&&isNaN(h[0])&&(h[0]=s),h.length>1&&isNaN(h[h.length-1])&&(h[h.length-1]=i),this._strictTicks=this._strictEnds=!0):h=this._baseAxis instanceof bi?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i,!0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i,!1):this._isValidInterval(this.stepInterval)?this._getStepsByInterval(this.stepInterval,e,s,i):this.stepPixels>0?this._getStepsByPixels(t,((null===(n=this.axis)||void 0===n?void 0:n._isPolar)&&!(null===(a=this.axis)||void 0===a?void 0:a._isX)?.5:1)*this.stepPixels,e,s,i):s!==i?[s,i]:[s],h}getNextStep(t,e){return t+e*this._step}_findBaseAxis(){if(null!=this.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.baseAxis);e!==t&&e instanceof bi&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>o(t/e)*e?t=o(t/e)*e:t<l(t/e)*e&&(t=l(t/e)*e),D(t)}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,a=i-s;let h=a/(t-1);const c=Math.pow(10,Math.floor(Math.log10(h))),_=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&h/c==2.5&&o(t*a/h)==t*a/h?this._step=h:h=this._step=l(h/c)*c:h=a/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,c);else{for(K(s<e&&i>e,"base error"),t=p(3,t);;){if(!(l((e-s)/h)+l((i-e)/h)+1>t))break;h+=c}s=e-l((e-s)/h)*h}else s=n._fixedMin;_.push(s);for(let e=1;e<t;e++)_.push(D(_[e-1]+h));return _}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=this.$_normalizeMin(s,t),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let h=p(1,o(t/e))+1,c=n/(h-1);const _=Math.pow(10,Math.floor(d(c))),u=this._getStepMultiples(_);let g,m=0;if(c/=_,u)if(c>u[m]){for(;m<u.length-1;m++)if(c>u[m]&&c<u[m+1]){c=u[++m];break}}else c=u[m];if(c*=_,isNaN(s))i=this.$_normalizeMin(i,c);else{for(K(i<=s&&r>=s,"base error"),h=p(3,h);m<u.length;){if(!(l((s-i)/c)+l((r-s)/c)+1>h))break;c=m<u.length-1?u[m+1]*_:2*c,m++}i=s-l((s-i)/c)*c}for(this._step=c,a.push(D(g=i));g<r;)a.push(D(g+=c));return a}}class wi extends We{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100)}}class fi extends Me{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16,this.gridVisible=!0}getSize(t){return W(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=w(this.space,0),this._sizeDim=G(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}(oi||(oi={}));class xi extends De{}class bi extends Ze{constructor(t,e,s){super(t,e,s),this.nullable=!0,this.padding=.04,this.startFit=oi.DEFAULT,this.endFit=oi.DEFAULT,this.breaks=[],this.baseLine=new xi(this,!1),this.label.numberFormat="0.##"}getBaseValue(){return this.baseValue}hasBreak(){return null!=this._runBreaks}runBreaks(){return this._runBreaks&&this._runBreaks.slice(0,1)}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.gridVisible&&(t===e.from||t===e.to)}}getStartFit(){return this.startFit===oi.DEFAULT?this._isX?oi.VALUE:oi.TICK:this.startFit}getEndFit(){return this.endFit===oi.DEFAULT?this._isX?oi.VALUE:oi.TICK:this.endFit}continuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createGrid(){return new pi(this)}_createTickModel(){return new mi(this)}_createLabel(){return new wi(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._baseVal=parseFloat(this.baseValue),this._unitLen=NaN,this.tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this.tick,r=i._baseAxis instanceof bi;let{min:n,max:a}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),h=this._baseVal;isNaN(h)&&n<0&&a>0&&(h=0),r&&i.baseRange&&(n=i._baseAxis.axisMin(),a=i._baseAxis.axisMax());let o=i.buildSteps(s,h,n,a,!1);const l=[];if(i._strictTicks||(o=i._normalizeSteps(o,n,a)),!isNaN(this._fixedMin)||!i._strictEnds&&this.getStartFit()!==oi.TICK)for(;o.length>1&&n>o[0];)o.shift();else{if(!i._strictEnds&&!r){for(;o.length>2&&o[1]<=n;)o.shift();if(!isNaN(i._step))for(;o[0]>n;)o.unshift(i.getNextStep(o[0],-1))}n=o[0]}if(!isNaN(this.strictMax)||!i._strictEnds&&this.getEndFit()!==oi.TICK)for(;a<o[o.length-1]&&o.length>1;)o.pop();else{if(!i._strictEnds&&!r){for(;o.length>2&&o[o.length-2]>=a;)o.pop();if(!isNaN(i._step))for(;o[o.length-1]<a;)o.push(i.getNextStep(o[o.length-1],1))}a=o[o.length-1]}this._setMinMax(n,a),this._runBreaks&&(o=this.$_getBrokenSteps(this._runBreaks,s,n,a));for(let t=0;t<o.length;t++){const e=this._createTick(s,t,o[t]);l.push(e)}return l}_createTick(t,e,s){return{index:e,pos:NaN,value:D(s),label:this.label.getTick(e,s)||String(s)}}calcPoints(t,e){super.calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this.tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],h=this._sects=[];e-=t.reduce(((t,e)=>t+e.space),0),t.forEach((t=>{const s=t.getSize(e),i={from:n,to:t.from,pos:r,len:s};r+=s,h.push(i,t._sect={from:t.from,to:t.to,pos:r,len:t.space}),r+=t.space;this.$_buildBrokenSteps(i).forEach((t=>{t>i.from&&t<=i.to&&a.push(t)})),t.space>0&&a.push(t.to)}));const o=t[t.length-1];if(i>o.to){const t={from:o.to,to:i,pos:r,len:this._vlen-r};h.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=h[h.length-1],a}getPos(t,e){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this.reversed?t-i-s.pos:i+s.pos}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this.reversed?t-s:s}}valueAt(t,e){if(this._isHorz?this.reversed&&(e=t-e):this.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return isNaN(this._unitLen)&&(this._unitLen=this.$_calcUnitLength(t)),this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_adjustMinMax(t,e){let s=this.isZoomed(),i=this.isZoomed(),r=!0,n=!0,a=NaN,h=NaN;this._series.forEach((o=>{const l=o.getBaseValue(this);isNaN(l)||(isNaN(this.minValue)&&l<=t?o.isBased(this)?t=l:a=w(g(a,l),l):isNaN(this.maxValue)&&l>=e&&(o.isBased(this)?e=l:h=w(p(h,l),l))),!s&&r&&o.canMinPadding(this,t)&&(r=!1),!i&&n&&o.canMaxPadding(this,e)&&(n=!1)})),s||(s=r),i||(i=n),this._fixedMin=this._fixedMax=NaN;let o=0,l=0;isNaN(this.strictMin)?this.minValue<t?t=this.minValue:s?this._fixedMin=t:o=f(this.minPadding,this.padding,0):this._fixedMin=t=this.strictMin,isNaN(this.strictMax)?this.maxValue>e?e=this.maxValue:i?this._fixedMax=e:l=f(this.maxPadding,this.padding,0):this._fixedMax=e=this.strictMax;let c=p(0,e-t),_=t-c*(this._minPad=o),u=e+c*(this._maxPad=l);return!isNaN(a)&&a<=t&&_<a&&(_=this._fixedMin=a),!isNaN(h)&&h>=e&&u>h&&(u=this._fixedMax=h),{min:_,max:u}}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&e.push(...t.getVisiblePoints())}));const s=this._isX;let i=e.map((t=>s?t.xValue:t.yValue)).sort(((t,e)=>t-e));for(let t=i.length-1;t>0;t--)i[t]===i[t-1]&&i.splice(t,1);let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=g(r,i[t]-i[t-1]);return t*=r/(this._max-this._min),w(t,1)}$_loadBreak(t){if(e(t)&&"from"in t&&"to"in t)return new fi(this).load(t)}$_loadBreaks(t){if(s(t))for(let e of t){const t=this.$_loadBreak(e);t&&this.breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this.breaks.push(e)}this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.to=e.to}const e=this.breaks.sort(((t,e)=>t.from-e.from)).filter((t=>t.to>t.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(h(new fi(this),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],a=e[r];s=n,a.from<s.to?t(n,a):i.push(h(new fi(this),a))}}var s}}class yi extends bi{_type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return!this._isX&&1===i.length&&i[0]instanceof li&&i[0].layout===ai.FILL&&(s.max=i[0].layoutMax),s}}class vi extends mi{constructor(){super(...arguments),this.arrangeDecimals=!0}_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}_normalizeSteps(t,e,s){if(!this.arrangeDecimals)return t;for(let e=0;e<t.length;e++){let i=t[e],r=o(i);if(i>0&&i>r)if(i=r+d(10*(i-r)),i<=s)t[e]=i;else if(e>0){if(t[e-1]>=s)break;{const r=u(o(d(t[e]-t[e-1]))),n=t[e],a=n-o(n);if(r<1)for(let t=1;t<10;t++)if(a>d(t)&&a<d(t+1)){const e=o(n)+d(t);if(e>=s){i=e;break}}t[e]=i}}}return t}}const Vi=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Si=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],Pi={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Ci extends mi{constructor(){super(...arguments),this["@config stepInerval"]=void 0}getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this.scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_isValidInterval(t){return isNaN(t)?n(t)&&Pi.hasOwnProperty(t.charAt(t.length-1))?(t=parseFloat(t),!isNaN(t)&&(t<=-1||t>=1)):void 0:0!=+t}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Vi[e]&&t<Vi[e+1]/2)return this.scale=e,Si[e];this.scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const h=this.axis,o=new Date(h._calcedMin);let l=Math.floor(t/this.stepPixels)+1,c=p(1,Math.floor(a/(l-1)));const _=this._getStepMultiples(c),u=Vi[this.scale];if(c/=u,_)if(c>_[0]){let t=0;for(;t<_.length-1;t++)if(c>_[t]&&c<_[t+1]){c=_[t+1];break}}else c=_[0];const d=h.date(i),g=h.date(r);let m,w=d;if(7===this.scale){const t=o.getFullYear();let e=w.getFullYear();this._step=c=Math.ceil(c),w=new Date(e,0),e<t&&e+c>t&&(e=t,w=new Date(e,0));do{n.push(+w),e+=c,w=new Date(e,0)}while(w<=g)}else if(6===this.scale){let t=w.getFullYear(),e=w.getMonth();this._step=c=Math.ceil(c),w=new Date(t,e),w<o&&new Date(t,e+c)>o&&(w=new Date(o.getFullYear(),o.getMonth()));do{n.push(+w),e+=c,w=new Date(t,e)}while(w<=g)}else if(4===this.scale||5===this.scale){let t=w.getFullYear(),e=w.getMonth(),s=w.getDate();const i=5===this.scale?7:1;this._step=c=Math.ceil(c),w=new Date(t,e,s),w<o&&new Date(t,e,s+i*c)>o&&(w=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+w),s+=c*i,w=new Date(t,e,s)}while(w<=g)}else{switch(this._step=c,c*=u,this.scale){case 3:w.setMinutes(0);case 2:w.setSeconds(0);case 1:w.setMilliseconds(0)}m=w.getTime();const t=o.getTime();m<t&&m+c>t&&(m=t);do{n.push(m),m+=c}while(m<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=[],n=t.charAt(t.length-1);let a;if(this._step=parseFloat(t),this.scale=Pi[n],t=Vi[this.scale],s+=this.axis._offset,isNaN(e))for(r.push(a=s);a<i;)r.push(a=this.getNextStep(a,1));else{for(r.push(a=e);a>s;)r.unshift(a=this.getNextStep(a,-1));for(a=e;a<i;)r.push(a=this.getNextStep(a,1))}return this._step=t,r}return super._getStepsByInterval(t,e,s,i)}}const Ai=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd"},{format:"MM-dd",beginningFormat:"yyyy-MM"},{format:"W주 w",beginningFormat:"yyyy-MM"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy"}];class ki extends We{constructor(){super(...arguments),this.useBeginningFormat=!0}_doLoad(t){super._doLoad(t);const i=n(this.timeFormat)?this.timeFormat:void 0,r=n(this.beginningFormat)?this.beginningFormat:void 0,a=this.timeFormats,o=this.useBeginningFormat;if(this._formatter=i?Wt.getFormatter(i):void 0,this._formats=Ai.map((t=>h(t))),s(a))for(let t=0;t<a.length;t++){const s=this._formats[t];if(i)s.format=i,s.beginningFormat=r||i;else{const i=a[t];n(i)?(s.format=i,o||(s.beginningFormat=i)):e(i)&&(n(i.format)&&(s.format=i.format),n(i.beginningFormat)?s.beginningFormat=i.beginningFormat:o||(s.beginningFormat=s.format))}}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,a=i.tick.scale;switch(a){case 7:return Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?Wt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):Wt.getFormatter(n[a].format).toStr(r,s.startOfWeek)}}}class Ei extends bi{constructor(t,e,s){super(t,e,s),this.baseValue=NaN}_type(){return"time"}_createTickModel(){return new Ci(this)}_createLabel(){return new ki(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*w(this.chart.timeOffset,0)*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}getValue(t){return a(t)?t+this._offset:t instanceof Date?t.getTime():n(t)?new Date(t).getTime():void 0}incStep(t,e){if(!n(e))return t+e;{const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}}}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?NaN:new Date(t)}getXValue(t){return isNaN(t)?NaN:new Date(t)}}class Li extends rs{constructor(t){super(t,!0),this.row=0,this.col=0,this.index=-1,this.size="100%"}get left(){return this._left}set left(t){t!==this._left&&(this._leftDim=G(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=G(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=G(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=G(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=G(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=G(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=G(this._size=t,!0))}getSize(t,e){return{width:W(this._widthDim||this._sizeDim,t,t),height:W(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return W(this._leftDim,t)}getRight(t){return W(this._rightDim,t)}getTop(t){return W(this._topDim,t)}getBottom(t){return W(this._bottomDim,t)}}class Ti extends Li{constructor(){super(...arguments),this.gindex=-1,this.duration=500}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t,e.name);return r.load(e),r}setGroup(t,e){this.group=t,this.gindex=e}}class Ni extends Li{constructor(){super(...arguments),this._gauges=[],this._visibles=[],this.minValue=0}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this.minValue,max:this.maxValue}}_doLoadProp(t,e){if("children"===t)return this.$_loadGauges(this.chart,e),!0}prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super.prepareRender(),this._prepareChildren(this._visibles)}_prepareChildren(t){t.forEach(((t,e)=>{this._setGroup(t,e),t.prepareRender()}))}$_loadGauges(t,i){const r=this._gaugesType();s(i)?i.forEach(((e,s)=>this.$_add(Ti._loadGauge(t,e,r)))):e(i)&&this.$_add(Ti._loadGauge(t,i,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}class Ri{constructor(t){this._map={},this._items=[],this._visibles=[],this._gauges=[],this.chart=t}get count(){return this._items.length}get firstGauge(){return this._gauges[0]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof Ti)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const i=this.chart,r=this._items=[],n=this._map={};s(t)?t.forEach(((t,e)=>{r.push(this.$_loadItem(i,t,e))})):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof Ni)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,i){let r=s(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r){const s=new r(t);return s.load(e),s.index=i,s}if(r=t._getGaugeType(e.type||t.gaugeType),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t,e.name||`Gauge ${i+1}`);return n.load(e),n.index=i,n}}class Oi extends Ti{constructor(){super(...arguments),this.minValue=0,this.maxValue=100,this.value=0,this.animatable=!0}updateValue(t,e){t!==this.value&&(this.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.text||(t.prefix||"")+"${value}"+(t.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this.minValue;case"max":return this.maxValue}}calcedMinMax(){return{min:this.minValue,max:this.maxValue}}}class Mi extends pe{constructor(t){super(t.chart,!0),this.scale=t,this.reversed=!1,this.length=7}}class Di extends ke{getText(t){return ht.isValidNumber(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return fe.LEFT}}class Bi extends pe{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=$i.DEFAULT,this.stepPixels=48,this.line=new pe(t.chart,!0),this.tick=new Mi(this),this.label=new Di(t.chart,!0)}get gap(){return this._gap}set gap(t){this._gap=w(t,0)}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=w(s,e);const{min:i,max:r}=this._adjustMinMax(g(e,s),p(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(p(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return isNaN(s.minValue)||(t=s.minValue),isNaN(s.maxValue)||(e=s.maxValue),this._min=g(t,e),this._max=p(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.minValue,i=e.maxValue;return isNaN(s)&&(s=g(...t)),isNaN(i)&&(i=p(...t)),this._min=g(s,i),this._max=p(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){let i;return i=Array.isArray(this.steps)?this.steps.slice(0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s):[e,s],this._min=i[0],this._max=i[i.length-1],i}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(D(e));for(let e=1;e<t;e++)n.push(D(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let a=n/(Math.floor(t/e)+1-1);const h=Math.pow(10,Math.floor(Math.log10(a))),o=this._getStepMultiples(h);let l,c=0;if(a/=h,o)if(a>o[c]){for(;c<o.length-1;c++)if(a>o[c]&&a<o[c+1]){a=o[++c];break}}else a=o[c];for(a*=h,this._step=a,r.push(D(l=s));;){if(l+=a,l>=i){r.push(D(i));break}r.push(D(l))}return r}}var $i,Ii,Fi;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}($i||($i={}));class zi extends pe{}class Hi extends pe{constructor(t,e=!1){super(t.chart,e),this.gauge=t,this.position=$i.DEFAULT,this.gap=5,this.itemGap=0,this.rangeLabel=new zi(t.chart,!1),this.tickLabel=new pe(t.chart,!0)}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickDim=G(this._thickness=t,!0))}get ranges(){return this.$_internalRanges().slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}getThickness(t){return this._thickDim?W(this._thickDim,t,0):this.position===$i.INSIDE?t:Hi.DEF_THICKNESS}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=it(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Hi.DEF_THICKNESS=7;class Gi extends Ae{constructor(t){super(t,!0),this._domain={callback:(t,e)=>t.getParam(e)},this.animatable=!0}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}class ji extends Bi{}class Wi extends Gi{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=G(this.offsetX,!0),this._offsetYDim=G(this.offsetY,!0),this}}class Yi{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Xi.DEF_CENTER),this.setCenterY(Xi.DEF_CENTER),this.setRadius(Xi.DEF_RADIUS),this.setInnerRadius(Xi.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=G(x(t,Xi.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=G(x(t,Xi.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=G(x(t,Xi.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=G(x(t,Xi.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=G(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=g(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=w(t%360,0),i=p(0,g(360,w(e,360)));this._startRad=N+R*s,this._handRad=R*s,this._sweepRad=R*i}}class Xi extends Oi{constructor(t){super(t),this.props=new Yi,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new Wi(t)}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getProps(){return this.childProps||this.props}getCenter(t,e){return this.group?this.childProps.getCenter(t,e):this.props.getCenter(t,e)}getExtents(t){return this.group?this.childProps.getExtents(t):this.props.getExtents(t)}labelVisible(){return this.label.visible}setGroup(t,e){super.setGroup(t,e),t&&!this.childProps&&(this.childProps=new Yi)}_doPrepareRender(t){super._doPrepareRender(t),this.label.prepareRender();const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}Xi.DEF_CENTER="50%",Xi.DEF_RADIUS="40%",Xi.DEF_INNER="80%";class Ui extends Ni{constructor(){super(...arguments),this.props=new Yi,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.itemGap=4,this.labelGap=10}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getCenter(t,e){return this.props.getCenter(t,e)}getExtents(t){return this.props.getExtents(t)}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t.childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}}class Zi extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this.rangeInclusive=!0}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}isRanged(){const t=this.$_internalRanges();return t&&t.length>0}rangeCount(){const t=this.$_internalRanges();return t?t.length:0}getRange(t){const e=this.$_internalRanges();if(e)for(const s of e)if(t>=s.fromValue&&t<s.toValue)return s}$_internalRanges(){return this._runRanges||(this._runRanges=it(this._ranges,this.gauge.minValue,this.gauge.maxValue,this.rangeInclusive)),this._runRanges}}class Ki extends Zi{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=G(this.segmentThickness,!0))}getSegmentThickness(t){return W(this._thickDim,t,t)}}class qi extends Zi{constructor(t){super(t),this.stroked=!1,this.thickness="100%"}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=G(this.thickness,!0))}getThickness(t){return W(this._thickDim,t,t)}}class Qi extends pe{constructor(t){super(t.chart,!1)}}class Ji extends pe{constructor(t){super(t.chart,!1),this.radius=3,this.length="100%",this.offset=0}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=G(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=G(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=G(t,!0))}getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}}class tr extends pe{constructor(t){super(t.chart,!1),this.radius=5}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=G(t,!0))}getRadius(t){return W(this._radiusDim,t,0)}}class er extends Bi{constructor(){super(...arguments),this.stepPixels=72}_getStepMultiples(t){return[1,2,2.5,5,10]}}class sr extends Ui{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class ir extends pe{constructor(t){super(t.chart,!0),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=G(this.thickness,!0))}getThickness(t){return W(this._thickDim,t,t)}}class rr extends pe{constructor(t,e,s){super(t.chart,!0),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=G(t,!0))}getLength(t){return W(this._lengthDim,t,t)}}class nr extends rr{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class ar extends pe{constructor(t,e){super(t.chart,!0),this.length=e}}class hr extends pe{constructor(t){super(t.chart,!0),this.step=1,this.offset=1}}class or extends pe{constructor(t,e){super(t.chart,!0),this.raidus=e}}class lr extends Ae{constructor(t){super(t.chart,!0),this.position="top",this.text="RealChart Clock<br>ver1.0"}}class cr extends Ms{}class _r extends ii{constructor(){super(...arguments),this.colorByPoint=!1}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new cr(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class ur extends _r{_type(){return"bar"}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,2)}}class dr extends _i{constructor(){super(...arguments),this.baseValue=0}canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:w(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===ai.DEFAULT){const e=t.length>1?t.map((t=>t.pointWidth)).reduce(((t,e)=>t+e),0):t[0].pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this.layout,ai.STACK}}class gr extends dr{_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof ur}}class pr extends gt{constructor(t,e){super(t,Ks.LEGEND_MARKER),this._size=e,this.add(this._marker=new xt(t)),this.setShape(Ss.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){ks.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class mr extends pr{constructor(t,e){super(t,e),this.insertFirst(this._line=new xt(t)),this.insertFirst(this._area=new xt(t))}_renderShape(t){super._renderShape(t);const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._area.setPath(s.join(" ")))}_markerOffset(t){return t/2}}class wr extends xt{constructor(t,e=E,s=E){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){ht.isNumber(t)?this.setPath(ks.line(t,e,s,i)):t&&this.setPath(ks.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(ks.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(ks.line(t,e,t,s))}setHLine(t,e,s){this.setPath(ks.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(ks.line(e,t,s,t))}}class fr extends xt{constructor(t,e){super(t,e),this.setFill("none")}setPoints(...t){this.setPath(ks.lines(...t))}resetStyles(t){const e=super.resetStyles(t);return this.setFill("none"),e}}class xr extends pr{constructor(t,e){super(t,e),this.insertFirst(this._line=new wr(t))}_renderShape(t){super._renderShape(t),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&this._line.setHLine(t/2,0,2*t)}_markerOffset(t){return t/2}}class br extends Ms{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class yr extends Qs{constructor(){super(...arguments),this.radius=4}}class vr extends Ys{constructor(){super(...arguments),this.position=Fs.HEAD,this.align=J.CENTER}getAlignOffset(){const t=+this.alignOffset;return isNaN(t)?this.align===J.LEFT||this.align===J.RIGHT?vr.ALIGN_GAP:0:t}}vr.ALIGN_GAP=4;class Vr extends Ks{constructor(){super(...arguments),this.marker=new yr(this),this.nullAsBase=!1}getShape(t){return this.marker.visible?t&&t.shape||this.marker.shape||this._shape:null}getRadius(t){return w(t.radius,this.marker.radius)}prepareLines(t){this._lines=this._doPrepareLines(t)}_createLabel(t){return new vr(t)}_createPoint(t){return new br(t)}hasMarker(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new xr(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),g(+e||ns.MARKER_SIZE,2*this.marker.radius)),s}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull){let i=0;for(;i<e;){const r=[];for(;t[i].isNull&&i<e;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ii||(Ii={}));class Sr extends ke{constructor(t){super(t.chart,!1),this.series=t,this.offset=8}label(){return this.text||this.series.displayName()}getDefaultIconPos(){return fe.LEFT}}class Pr extends Vr{constructor(t,e){super(t,e),this.lineType=ne.DEFAULT,this.stepDir=Ii.FORWARD,this.baseValue=0,this.connectNullPoints=!1,this.flag=new Sr(this)}backDir(){return this.stepDir===Ii.BACKWARD?Ii.FORWARD:Ii.BACKWARD}_type(){return"line"}getLineType(){return this.group instanceof Er||this.group instanceof Lr?this.group.lineType:this.lineType}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){super._doPrepareRender(),this._base=w(this.baseValue,this._yAxisObj.getBaseValue())}}class Cr extends br{}class Ar extends Pr{constructor(t,e){super(t,e),this.marker.visible=t&&t.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>0){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=w(t[0].yLow,t[0].py),e.push(s)}return e}const e=this.group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_type(){return"area"}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return new mr(t,e)}_createPoint(t){return new Cr(t)}_doPrepareLines(t){if(this._containsNull&&this.group&&this.group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doPrepareLines(t)}}class kr extends Cr{get highValue(){return this.yValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,lowValue:this.lowValue,highValue:this.yValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[w(t.lowField,0+s)],this.y=e[w(t.yField,1+s)],s>0&&(this.x=e[w(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=x(e[t.lowField],e.low),this.y=b(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}getTooltipPos(){return{x:this.xPos,y:this.yLow}}}class Er extends li{constructor(){super(...arguments),this.lineType=ne.DEFAULT,this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof Pr}getBaseValue(t){return t===this._yAxisObj?w(this.baseValue,t.getBaseValue()):NaN}}class Lr extends li{constructor(){super(...arguments),this.lineType=ne.DEFAULT,this.baseValue=0}prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this.layout,ai.STACK}}}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof Ar}getBaseValue(t){return t===this._yAxisObj?w(this.baseValue,t.getBaseValue()):NaN}}class Tr extends Cr{}class Nr extends Ms{get maxValue(){return this.yValue}labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return h(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=e.length>5?1:0;s>0&&(this.x=e[w(t.xField,0)]),this.min=e[w(t.minField,0+s)],this.low=e[w(t.lowField,1+s)],this.mid=e[w(t.midField,2+s)],this.high=e[w(t.highField,3+s)],this.y=e[f(t.maxField,t.yField,4+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.min=x(e[t.minField],e.min),this.low=x(e[t.lowField],e.low),this.mid=x(e[t.midField],e.mid),this.y=b(e[t.highField],e.high,this.y))}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.max=this.y,this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}}class Rr extends Bs{}!function(t){t.WIDTH="width",t.AREA="area"}(Fi||(Fi={}));const Or=function(t){return isNaN(t)?0:t};class Mr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return a(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return a(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return a(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return a(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Or(t[e]),Or(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Or(t[e].x),Or(t[e].y));return this}polygon(...t){return a(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}}class Dr extends Ms{get highValue(){return this.yValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=e.length>4?1:0;s>0&&(this.x=e[w(t.xField,0)]),this.low=e[w(t.lowField,0+s)],this.close=e[w(t.closeField,1+s)],this.open=e[w(t.openField,2+s)],this.y=e[f(t.highField,t.yField,3+s)]}}_readObject(t,e){super._readObject(t,e),this.low=x(e[t.lowField],e.low),this.open=x(e[t.openField],e.open),this.close=x(e[t.closeField],e.close),this.y=b(e[t.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.high=this.y,this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}}class Br extends ni{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"}_type(){return"candlestick"}canCategorized(){return!0}_createPoint(t){return new Dr(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Mr;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new xt(t,Ks.LEGEND_MARKER,s.end())}}class $r extends Qs{constructor(){super(...arguments),this.radius=4,this.shape=Ss.CIRCLE}}class Ir extends Ms{labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.lowValue}_assignTo(t){return h(super._assignTo(t),{low:this.low,lowValue:this.lowValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[w(t.lowField,0+s)],this.y=e[w(t.yField,1+s)],s>0&&(this.x=e[w(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.low=x(e[t.lowField],e.low),this.y=b(t._yFielder(e),e.y,e.value)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low)}}class Fr extends Ms{}class zr extends Js{}class Hr extends ti{constructor(t,e){super(t,e),this.width=Hr.DEF_WIDTH,this.height=Hr.DEF_HEIGHT,this.neckWidth=Hr.DEF_NECK_WIDTH,this.neckHeight=Hr.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:p(.1*t,W(this._widthDim,t)),height:p(.1*e,W(this._heightDim,e))}}getNeckSize(t,e){return{width:ht.clamp(W(this._neckWidthDim,t),.1*t,t),height:ht.clamp(W(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}_createPoint(t){return new zr(t)}load(t){return super.load(t),this._widthDim=j(this.width,Hr.DEF_WIDTH),this._heightDim=j(this.height,Hr.DEF_HEIGHT),this._neckWidthDim=j(this.neckWidth,Hr.DEF_NECK_WIDTH),this._neckHeightDim=j(this.neckHeight,Hr.DEF_NECK_HEIGHT),this}}Hr.DEF_WIDTH="85%",Hr.DEF_HEIGHT="90%",Hr.DEF_NECK_WIDTH="30%",Hr.DEF_NECK_HEIGHT="30%";class Gr extends Bs{}class jr extends Ms{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return h(super._assignTo(t),{min:this.min,max:this.max})}}var Wr;!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(Wr||(Wr={}));const Yr={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class Xr extends Qs{constructor(){super(...arguments),this.radius=4,this.shape=Ss.CIRCLE}}class Ur extends Ms{}class Zr extends Dr{}class Kr extends Ms{}class qr extends Js{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=G(t,!0))}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return h(super._assignTo(t),{sliced:this.sliced})}}class Qr extends ke{constructor(){super(null,!0)}getDefaultIconPos(){return fe.LEFT}}class Jr extends Ys{}class tn extends ei{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new Qr}hasInner(){return this._innerDim&&this._innerDim.size>0}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return this._sliceDim?W(this._sliceDim,t):0}_type(){return"pie"}_createLabel(t){return new Jr(t)}_createPoint(t){return new qr(t)}_doLoad(t){super._doLoad(t),this._innerDim=G(this.innerRadius,!0),this._sliceDim=G(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=w(this.startAngle%360,0),e=p(0,g(360,w(this.totalAngle,360)));this._startRad=N+R*t,this._totalRad=R*e,this._groupPos=NaN}}class en extends li{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return W(this._polarDim,g(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_type(){return"piegroup"}_seriesType(){return"pie"}needAxes(){return!1}_canContain(t){return t instanceof tn}_doLoad(t){super._doLoad(t),this._polarDim=G(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=G(this.innerSize,!0)}_doPrepareSeries(t){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+w(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=w(t.groupSize,1)/e}))}}class sn extends Ms{}class rn extends Ms{_assignTo(t){return h(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){super._readArray(t,e),this.id=B(e[parseInt(t.idField)]),this.group=B(e[parseInt(t.groupField)])}_readObject(t,e){super._readObject(t,e),this.id=B(e[t.idField]),this.group=B(e[t.groupField])}}class nn extends pe{constructor(t){super(t.chart,!1),this.level=t,this.floating=!0}}class an extends pe{constructor(t,e){super(t.chart,!0),this.series=t,this.level=e,this.head=new nn(this)}}class hn{constructor(t){this.series=t,this._levels=[]}load(t){const i=this._levels=[];e(t)&&(t=[t]),s(t)&&t.forEach((t=>{e(t)&&t.level>=0&&(i[t.level]=this.$_loadLevel(t))}))}getLevel(t){return this._levels[t]}$_loadLevel(t){const e=new an(this.series,t.level);return e.load(t),e}}class on{constructor(t){this.point=t}level(){return this.parent?this.parent.level()+1:0}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}var ln,cn,_n,un;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(ln||(ln={}));class dn extends Ms{_assignTo(t){return h(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_readArray(t,e){const s=e.length>3?1:0;this.y=e[w(t.yField,0+s)],this.length=e[w(t.lengthField,1+s)],this.angle=e[w(t.angleField,2+s)],s>0&&(this.x=e[w(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.length=x(e[t.lengthField],e.length),this.angle=x(e[t.angleField],e.angle),this.y=b(t._yFielder(e),e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}}!function(t){t.CENTER="center",t.START="start",t.END="end"}(cn||(cn={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(_n||(_n={}));class gn extends Ms{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class pn extends Gi{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap=10}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=G(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=G(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=G(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=G(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=G(t,!0))}getWidth(t){return W(this._widthDim,t)}getHeight(t){return W(this._heightDim,t)}getMaxWidth(t){return W(this._maxWidthDim,t)}getMaxHeight(t){return W(this._maxHeightDim,t)}getGap(t){return W(this._gapDim,t,0)}}class mn extends Oi{constructor(t){super(t),this.reversed=!1,this.scale=new ji(this),this.label=new pn(this.chart)}isVertical(){return this.group?this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}calcedMinMax(){return this.scale.range()}_doPrepareRender(t){super._doPrepareRender(t),this.label.prepareRender()}}!function(t){t.BAR="bar",t.NEEDLE="needle"}(un||(un={}));class wn extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this._args={gauge:null,value:NaN}}getStyle(t){if(this.styleCallback){this._args.gauge=this.chart._proxy.getChartObject(this.gauge),this._args.value=t;return this.styleCallback(this._args)}}}class fn extends mn{constructor(t){super(t),this.valueBar=new wn(this),this.band=new Hi(this)}_type(){return"linear"}}class xn extends pe{constructor(){super(...arguments),this.opposite=!1,this.gap=10}}class bn extends Ni{constructor(t){super(t),this.vertical=!1,this.itemLabel=new xn(this.chart,!0),this.scale=new ji(this),this.itemGap=10,this.label=new pn(t),this.label.gap=10}calcedMinMax(){return this.scale.range()}}class yn extends bn{constructor(){super(...arguments),this.band=new Hi(this,!1)}_type(){return"lineargroup"}_gaugesType(){return"linear"}}class vn extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this.vertical=!1,this.rangeInclusive=!0}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=G(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=G(t,!0))}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}$_internalRanges(){return this._runRanges||(this._runRanges=it(this._ranges,this.gauge.minValue,this.gauge.maxValue,this.rangeInclusive)),this._runRanges}}class Vn extends pe{constructor(t){super(t.chart,!0)}}class Sn extends wn{}class Pn extends bn{constructor(){super(...arguments),this.rangeInclusive=!0}getRanges(t,e,s){return it(this.ranges,t,e,x(s,this.rangeInclusive))}_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}class Cn extends pe{}class An extends pe{}const kn={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},En={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Ln={minPadding:0,maxPadding:0};class Tn extends pe{constructor(t){super(t,!1),this._thickness=45,this._gap=8,this._gapFar=3,this._dataChanged=!0,this.liveScroll=!0,this.minSize=.05,this.handle=new Cn(t,!0),this.mask=new An(t,!0),this.borderLine=new pe(t,!0)}get thickness(){return this._thickness}set thickness(t){this._thickness=+t||this._thickness}get gap(){return this._gap}set gap(t){this._gap=+t||this._gap}get gapFar(){return this._gapFar}set gapFar(t){this._gapFar=+t||this._gapFar}isVisible(){return this.visible}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t){super._doLoad(t);const s={};if(e(t.series)){let e=t.series.type;"area"!==e&&"line"!==e&&"bar"!==e&&(e="area"),s.series=h({},t.series,kn[e]())}else s.series=kn.area();e(t.xAxis)?s.xAxis=h({},t.xAxis,(En[t.xAxis.type]||En.linear)(),Ln):s.xAxis=h(En.linear(),Ln),e(t.yAxis)?s.yAxis=h({},t.yAxis,(En[t.yAxis.type]||En.linear)(),Ln):s.yAxis=h(En.linear(),Ln),this._naviChart=this.chart._createChart(s)}_doPrepareRender(t){(this._source=t._getSeries().getSeries(this.source)||t.firstSeries)&&this._naviChart.firstSeries._loadPoints(this._source.getPoints().getProxies()),this._vertical=!1,this._naviChart.prepareRender()}}class Nn extends is{constructor(t){super(t.chart),this.pane=t,this.radius=E,this.centerX=E,this.centerY=E}}class Rn extends pe{constructor(t,e,s){super(t,!0),this.row=e,this.col=s,this.body=new Nn(this)}prepareRender(){this.body.prepareRender()}}class On extends pe{constructor(t){super(t,!1),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[],this.gap=0}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(t,e){return this._vpanes[t][e]}getRow(t){return this._vpanes[t]}getColumn(t){return this._vpanes.map((e=>e[t]))}_doLoadSimple(t){return s(t)&&t.length>0?(this.rows=p(1,+t[0]),this.cols=p(1,w(+t[1],this.rows)),this.rows>0&&this.cols>0&&(this.$_parsePanes(this.rows,this.cols),this.visible=!0),!0):super._doLoadSimple(t)}_doLoadProp(t,e){if(["panes","cols","rows"].indexOf(t)>=0)return!0}load(t){return super.load(t),e(t)&&(this.$_parsePanes(this.rows=t.rows,this.cols=t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._xAxes=t._xPaneAxes,this._yAxes=t._yPaneAxes,this._vpanes=this.$_collectPanes(t),this._vpanes.forEach((t=>t.forEach((t=>t.prepareRender()))))}getXLens(t){return new Array(this._vcols).fill(t/this._vcols)}getYLens(t){return new Array(this._vrows).fill(t/this._vrows)}layoutAxes(t,e,s,i){const r=this.getXLens(s?e:t);this._xAxes.buildTicks(r);const n=this.getYLens(s?t:e);this._yAxes.buildTicks(n),this.$_calcAxesPoints(r,n,0)}$_calcAxesPoints(t,e,s){this._xAxes.calcPoints(t,s),this._yAxes.calcPoints(e,s)}calcAxesPoints(t,e){this.$_calcAxesPoints(t,e,1)}calcSizes(t,e){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(e,this._heights)}getAnnotation(t){for(const e in this._panes){const s=this._panes[e].body.getAnnotation(t);if(s)return s}}$_parseSizes(t){let e;return e=s(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(n(t)){const e=t.trim();return{size:"*"===e?1:parseFloat(e)}}return+t||{size:1}}))}$_parsePanes(t,e){this._widths=this.$_parseSizes(e),this._heights=this.$_parseSizes(t),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const i={};return t=s(t)?t:e(t)?[t]:null,s(t)&&t.forEach((t=>{const e=+t.row||0,s=+t.col||0;if(s>=0&&s<this._cols&&e>=0&&e<this._rows){const r=new Rn(this.chart,e,s);r.load(t),i[e+","+s]=r}})),i}$_collectPanes(t){const e=t._getXAxes().internalItems(),s=t._getYAxes().internalItems(),i=[],r=[],n=[];e.concat(s).forEach((t=>{const e=t.row||0,s=t.col||0;t._row=e,t._col=s,s>=0&&s<this._cols&&i.indexOf(s)<0&&i.push(s),e>=0&&e<this._rows&&r.indexOf(e)<0&&r.push(e)})),i.sort(),r.sort();for(let e=0;e<r.length;e++){const s=[];for(let r=0;r<i.length;r++){const i=this._panes[e+","+r]||new Rn(t,e,r);s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}class Mn extends _r{_type(){return"circlebar"}_initProps(){super._initProps(),this.pointLabel.position=Fs.INSIDE}}var Dn;!function(t){t.AUTO="auto",t.SERIES="series",t.GROUP="group",t.AXIS="axis"}(Dn||(Dn={}));class Bn extends pe{constructor(t){super(t.chart,!0),this.owner=t,this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)},this.level=Dn.AUTO,this.offset=8,this.hideDelay=Bn.HIDE_DELAY,this.minWidth=100,this.minHeight=40,this.numberFormat=",#.##",this.timeFormat="yyyy-MM-dd"}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._domain.numberFormatter=t?kt.getFormatter(t):E)}get timeFormat(){return this._timeFormat}set timeFormat(t){t!==this._timeFormat&&(this._timeFormat=t,this._domain.timeFormatter=t?Wt.getFormatter(t):E)}setTarget(t,e){return this._ctx=this.visible&&this.owner.getTooltipContext(this.level,this._series=t,this._point=e)}getTextDomain(){return this._domain}_doLoadSimple(t){return n(t)?(this.text=t,!0):super._doLoadSimple(t)}}Bn.HIDE_DELAY=700;const $n={bar:gr,circlebar:class extends dr{_type(){return"circlebargroup"}_seriesType(){return"circlebar"}_canContain(t){return t instanceof Mn}},line:Er,area:Lr,pie:en,bargroup:gr,circlebargroup:gr,linegroup:Er,areagroup:Lr,piegroup:en,bump:class extends ci{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof Pr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue;let i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e){const s=e[t].sort(((t,e)=>t.yValue-e.yValue));for(let t=s.length-1;t>=0;t--)s[t].label=s[t].yValue,s[t].yValue=s[t].yGroup=t}return ht.makeIntArray(0,t.length)}}},In={area:Ar,arearange:class extends Vr{constructor(){super(...arguments),this.curved=!1,this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"arearange"}_createPoint(t){return new kr(t)}getLineType(){return this.curved?ne.SPLINE:ne.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doPrepareLines(t){const e=super._doPrepareLines(t),s=[];return e.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}s.push(t,e)})),s}},bar:ur,barrange:class extends ni{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"barrange"}pointLabelCount(){return 2}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,2)}_createFielders(){super._createFielders(),this._lowFielder=this._createFielder(this.lowField)}_createPoint(t){return new $s(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends Ar{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!0}_type(){return"bellcurve"}getLineType(){return this.curved?ne.SPLINE:ne.DEFAULT}_createPoint(t){return new Tr(t)}_doLoadData(t){const e=super._doLoadData(t);if(s(e))return this.$_loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.name===this.source||t.index===this.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this.$_loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}$_loadTable(t){const e=t.length;if(e<1)return;const s=t.reduce(((t,e)=>t+e),0)/e,i=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-s,2)))/(e-1)),r=i/this.pointsInSigma,n=s-this.sigmas*i,a=s+this.sigmas*i;let h=s;const o=[];for(o.push(this.$_getDenstiy(s,i,h));h>n;)h-=r,o.unshift(this.$_getDenstiy(s,i,h));for(h=s;h<a;)h+=r,o.push(this.$_getDenstiy(s,i,h));return o}$_getDenstiy(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}}},boxplot:class extends ni{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"}_type(){return"boxplot"}pointLabelCount(){return 2}_createFielders(){super._createFielders(),this._minFielder=this._createFielder(this.minField),this._lowFielder=this._createFielder(this.lowField),this._midFielder=this._createFielder(this.midField),this._highFielder=this._createFielder(this.highField)}_createPoint(t){return new Nr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,2)}},bubble:class extends ui{constructor(){super(...arguments),this.sizeMode=Fi.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1,this.tooltipText="x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"}getPixelMinMax(t){return{min:W(this._minDim,t),max:W(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==Fi.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}_createPoint(t){return new Rr(t)}hasZ(){return!0}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=G(this.minSize,!0),this._maxDim=G(this.maxSize,!0),this}_doPrepareRender(){super._doPrepareRender(),this._zMin=Number.MAX_VALUE,this._zMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{t.isNull||isNaN(t.zValue)||(this._zMin=g(this._zMin,t.zValue),this._zMax=p(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}},candlestick:Br,circlebar:Mn,dumbbell:class extends si{constructor(){super(...arguments),this.marker=new $r(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+p(0,this.marker.radius)}_createPoint(t){return new Ir(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=t.lowValue;!isNaN(s)&&e.push(s)}))}},equalizer:class extends ii{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1}getSegmentSize(t){return W(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Fr(t)}_doLoad(t){super._doLoad(t),this._segmentDim=G(this.segmentSize,!1)}_createLegendMarker(t,e){const s=new Mr;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new xt(t,Ks.LEGEND_MARKER,s.end())}},errorbar:class extends ni{constructor(){super(...arguments),this.pointPadding=.3,this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"errorbar"}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new $s(t)}_getBottomValue(t){return t.lowValue}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=new Mr;s.vline(e/2,.1,.8*e),s.hline(.1,0,e),s.hline(.9*e,0,e);const i=new xt(t,Ks.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}},funnel:Hr,heatmap:class extends Ks{constructor(){super(...arguments),this.tooltipText="x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"}getColor(t){}_type(){return"heatmap"}canMixWith(t){return!1}canCategorized(){return!0}hasZ(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new Gr(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.zValue)||(this._heatMin=g(this._heatMin,t.zValue),this._heatMax=p(this._heatMax,t.zValue))}))}},histogram:class extends Ks{constructor(){super(...arguments),this.binsNumber=Wr.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=w(this.binWidth,0);if(e>0)return t/e;return w(this.binsNumber,0)<1?Yr[this.binsNumber||Wr.SQURE_ROOT](t):void 0}_type(){return"histogram"}_createPoint(t){return new jr(t)}_doLoadPoints(t){function i(t){let i;return i=s(t)?t[w(this.yField,0)]:e(t)?b(t[this.yField],t.y,t.value):t,parseFloat(i)}const r=[];let n=[];for(let e=0;e<t.length;e++){const s=i(t[e]);isNaN(s)||n.push(s)}if(n.length>0){n=n.sort(((t,e)=>t-e)),this.minValue<n[0]&&n.unshift(this.minValue),this.maxValue>n[n.length-1]&&n.push(this.maxValue);const t=n.length,e=n[0],s=n[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,o=e,l=o+a;for(let e=0;e<i;e++){let c=0;if(e==i-1)c=t-h;else for(;h<t&&n[h]<l;)c++,h++;r.push({x:o,y:c,min:o,max:e===i-1?s:l}),o=l,l=o+a}}super._doLoadPoints(r)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=w(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,2)}},line:Pr,lollipop:class extends ii{constructor(){super(...arguments),this.marker=new Xr(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.radius}_createPoint(t){return new Ur(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}},ohlc:class extends Br{_type(){return"ohlc"}_createPoint(t){return new Zr(t)}_createLegendMarker(t,e){const s=new Mr;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new xt(t,Ks.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}},pareto:class extends Vr{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?ne.SPLINE:ne.DEFAULT}_createPoint(t){return new Kr(t)}_referOtherSeries(t){if(t.name===this.source||t.index===this.source)return t.referBy(this),!0}reference(t,e){e._isX||(this.$_loadPoints(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values))}$_loadPoints(t){const e=[],s=t.reduce(((t,e)=>t+w(e.yValue,0)),0);let i=0;t.forEach((t=>{t.isNull||e.push({x:t.xValue,y:i+=100*t.yValue/s})})),this._doLoadPoints(e),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj)}},pie:tn,scatter:class extends ui{constructor(){super(...arguments),this.jitterX=0,this.jitterY=0,this.radius=5}_type(){return"scatter"}_createPoint(t){return new sn(t)}_createLegendMarker(t,e){return new pr(t,e)}setShape(t){this._defShape=t}getShape(t){return this.shape||this._defShape}hasMarker(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),g(+e||ns.MARKER_SIZE,2*this.radius)),s}},treemap:class extends Ks{constructor(){super(...arguments),this._map={},this._levels=1,this.idField="id",this.groupField="group",this.algorithm=ln.SQUARIFY,this.alternate=!0,this.groupMode=!0,this.groupLevels=new hn(this)}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e})),n=p(n,t.level()+1+1)}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];let n=1;return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._levels=n,{roots:this._roots,leafs:this._leafs}}_type(){return"treemap"}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new rn(t)}getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new on(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let h=e.x,o=e.y,l=Number.MAX_VALUE,c=0;const _=[];if(2===t.length){return(1===s?n>a:n>=a)?t.forEach((t=>{t.setArea(h,o,n*t.value/i,a),h+=t.width})):t.forEach((t=>{t.setArea(h,o,n,a*t.value/i),o+=t.height})),0}for(;t.length>0;){let u,d,g,m,w;if(u=t.shift(),c+=u.value,m=c*r/i,1===s?(d=m/a,g=a*u.value/c):(g=m/n,d=n*u.value/c),w=p(d/g,g/d),t.length>0&&w>l)return t.unshift(u),c-=u.value,m=r*c/i,1===s?(g=a,d=m/g):(d=n,g=m/d),_.forEach((t=>{1===s?(t.setArea(h,o,d,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),1===s?(e.x+=d,e.width-=d):(e.y+=g,e.height-=g),i-c;if(0===t.length)return m=r*c/i,1===s?(g=a,d=m/g):(d=n,g=m/d),_.push(u),_.forEach((t=>{1===s?(t.setArea(h,o,d,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,g),h+=t.width)})),0;l=w,_.push(u)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}},vector:class extends Ks{constructor(){super(...arguments),this.origin=cn.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=_n.CLOSE}_type(){return"vector"}_createPoint(t){return new dn(t)}_doLoad(t){super._doLoad(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this.maxLength,s=this.origin,i=t.map((t=>t.length)).reduce(((t,e)=>p(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case cn.START:case cn.END:t._off=t._len/2;break;default:t._off=0}}))}}_createLegendMarker(t,e){const s=.3,i=.7*e,r=[0,-s*e,-.2*e,-s*e,0,-.6*e,.2*e,-s*e,0,-s*e,0,.6*e],n=["M",r[0],r[1]+i];for(let t=2;t<r.length;t+=2)n.push("L",r[t],r[t+1]+i);const a=new xt(t,Ks.LEGEND_MARKER,n);return a.setStyle("strokeWidth","2px"),a.rotation=30,a}},waterfall:class extends ri{constructor(t,e){super(t,e)}_type(){return"waterfall"}canCategorized(){return!0}_createPoint(t){return new gn(t)}_createLegendMarker(t,e){return Es.create(t,Ks.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,h=r,o=0;for(let l=1,c=t.length;l<c;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<c-1&&!1!==i._intermediate,n=i.save=i.y=r?h:a;i.yGroup=i.yValue=i.y,r?h<0?(o=e.low,s=o-n):(s=e.y,o=s-n):(o=t[0].low,s=o+n),h=0}else e=i.y,e<0?n<0?(s=r+n,o=s+e):(s=r,o=s+e):(o=r,s=o+e),h+=e,a+=e;n=i.y,i.y=r=s,i.low=o}}_getBottomValue(t){return t.y=t.save,NaN}}},Fn={category:Ws,linear:yi,time:Ei,date:Ei,log:class extends bi{_type(){return"log"}_createTickModel(){return new vi(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?d(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=d(e.min),e.max=d(e.max),e}_createTick(t,e,s){return super._createTick(t,e,D(u(s)))}}},zn={circle:class extends Xi{constructor(){super(...arguments),this.band=new Hi(this),this.scale=new er(this,!1),this.rim=new Ki(this),this.valueRim=new qi(this),this.marker=new Qi(this),this.hand=new Ji(this),this.pin=new tr(this)}_type(){return"circle"}getExtents(t){const e=super.getExtents(t),s=this.scale,i=this.band;let r=e.radius;const n=r-e.inner;if(i.visible)switch(e.bandThick=i.getThickness(n),i.position){case $i.INSIDE:e.band=r-(n-e.bandThick)/2;break;case $i.OPPOSITE:e.band=e.inner-i.gap,e.inner=e.band-e.bandThick;break;default:e.band=r+=e.bandThick+i.gap}switch(e.scaleTick=p(1,s.tick.length||0),e.scaleLabel=16,s.position){case $i.OPPOSITE:e.scale=e.inner-s.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;break;case $i.INSIDE:default:e.scale=r+s.gap}return e}},linear:fn,bullet:class extends mn{constructor(t){super(t),this.band=new vn(this),this.targetBar=new Vn(this),this.valueBar=new Sn(this),this.rangeInclusive=!0}getRanges(t,e,s){return it(this.ranges,t,e,x(s,this.rangeInclusive))}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends Ti{constructor(t){super(t),this._active=!0,this.centerX=Xi.DEF_CENTER,this.centerY=Xi.DEF_CENTER,this.radius=Xi.DEF_RADIUS,this.rim=new ir(this),this.hourHand=new rr(this,7,"60%"),this.minuteHand=new rr(this,5,"85%"),this.secondHand=new nr(this,2,"95%"),this.tick=new ar(this,10),this.minorTick=new ar(this,5),this.tickLabel=new hr(this),this.pin=new or(this,5),this.label=new lr(this)}get active(){return this._active}set active(t){t!==this._active&&(this._active=t,this._changed())}getTime(){return this.time instanceof Date?this.time:n(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=g(t,e);return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=G(x(this.centerX,Xi.DEF_CENTER),!0),this._centerYDim=G(x(this.centerY,Xi.DEF_CENTER),!0),this._radiusDim=G(x(this.radius,Xi.DEF_RADIUS),!0)}}},Hn={circle:sr,linear:yn,bullet:Pn,circlegroup:sr,lineargroup:yn,bulletgroup:Pn},Gn={text:class extends Le{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)},this.text="Text"}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._domain.numberFormatter=t?kt.getFormatter(t):E)}get timeFormat(){return this._timeFormat}set timeFormat(t){t!==this._timeFormat&&(this._timeFormat=t,this._domain.timeFormatter=t?Wt.getFormatter(t):E)}isVisible(){return this.visible&&!I(this.text)}_type(){return"text"}_doLoadSimple(t){return n(t)?(this.text=t,!0):super._doLoadSimple(t)}},image:class extends Ne{isVisible(){return this.visible&&!I(this.imageUrl)}_type(){return"image"}_doLoadSimple(t){return n(t)?(this.imageUrl=t,!0):super._doLoadSimple(t)}},shape:class extends Ne{constructor(t){super(t),this["@config width"]=64,this["@config height"]=64,this.shape=Ss.SQUARE,this.width=this.height=64}getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}_type(){return"shape"}_doLoadSimple(t){return n(t)?(this.shape=t,!0):super._doLoadSimple(t)}_doLoad(t){super._doLoad(t),!i(t.xRange,2)||isNaN(+t.xRange[0])||isNaN(+t.xRange[1])||!i(t.yRange,2)||isNaN(+t.yRange[0])||isNaN(+t.yRange[1])||(this._xRange=[+t.xRange[0],+t.xRange[1]],this._yRange=[+t.yRange[0],+t.yRange[1]])}getSize(t,e){const s=this.getSeries();if(s){const i=this._series=s.series,r=i._xAxisObj,n=i._yAxisObj,a=r.getPos(t,this._xRange[0]),h=r.getPos(t,this._xRange[1]),o=n.getPos(e,this._yRange[0]),l=n.getPos(e,this._yRange[1]);return this._x=g(a,h),this._y=p(o,l),{width:m(a-h),height:m(o-l)}}return super.getSize(t,e)}getPosition(t,e,s,i,r,n,a){return this.getSeries()?t?{x:i-this._y,y:this._x}:{x:this._x,y:r-this._y}:super.getPosition(t,e,s,i,r,n,a)}}};class jn extends pe{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=J.RIGHT,this.verticalAlign=tt.BOTTOM,this.offsetX=2,this.offsetY=1,this.gap=4}isFloating(){return this.floating||this.verticalAlign===tt.MIDDLE}}class Wn extends pe{constructor(){super(...arguments),this.paletteMode=re.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new jn(null,!0),this.seriesHovering=!1}}var Yn;!function(t){t.PNG="png",t.JPEG="jpeg",t.SVG="svg",t.PDF="pdf",t.PRINT="print"}(Yn||(Yn={}));class Xn extends S{constructor(t){super(),this._data=new Rs,this._exportOptions={visible:!0,menus:[Yn.PNG,Yn.JPEG],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1},this._params={},this._loadAnimatable=!0,this._dataChanged=!1,this.type="bar",this.gaugeType="circle",this.polar=!1,this.timeOffset=(new Date).getTimezoneOffset(),this.startOfWeek=0,this._assets=new de,this._options=new Wn(this,!0),this._title=new di(this),this._subtitle=new gi(this),this._legend=new ls(this),this._tooltip=new Bn(this),this._split=new On(this),this._series=new qs(this),this._xAxes=new Ke(this,!0),this._yAxes=new Ke(this,!1),this._xPaneAxes=new Je(this),this._yPaneAxes=new ts(this),this._gauges=new Ri(this),this._body=new is(this),this._annotations=new Te(this),this._navigator=new Tn(this),t&&this.load(t)}_createChart(t){return new Xn(t)}animatable(){return!1!==this._options.animatable}loadAnimatable(){return this._loadAnimatable}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries()}getTooltipText(t,e){return li.collectTooltipText(this.axis,this.series,e)}getTooltipParam(t,e,s){return li.inflateTooltipParam(this.series,t,e,s)}}if(t===Dn.AUTO){const s=e.group;!s||s.layout!==ai.OVERLAP&&s.layout!==ai.STACK&&s.layout!==ai.FILL||(t=Dn.GROUP)}switch(t){case Dn.AXIS:return new i(e._xAxisObj);case Dn.GROUP:return e.group;default:return e}}get chart(){return this}get data(){return this._data}get assets(){return this._assets}get options(){return this._options}get exportOptions(){return this._exportOptions}get title(){return this._title}get subtitle(){return this._subtitle}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get legend(){return this._legend}get tooltip(){return this._tooltip}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}get body(){return this._body}get split(){return this._split}get xPaneAxes(){return this._xPaneAxes}get yPaneAxes(){return this._yPaneAxes}get seriesNavigator(){return this._navigator}get config(){return this._config}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._annotations.getVisibles()}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.seriesCount()>0}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(){return this._series.isEmpty()&&0===this._gauges.count}seriesByName(t){return this._series.getSeries(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items,i=this._yAxes.items;let r;if(this.isInverted())switch(t){case et.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case et.RIGHT:r=s.filter((t=>t._isOpposite));break;case et.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case et.TOP:r=i.filter((t=>t._isOpposite));break;case et.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case et.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case et.RIGHT:r=i.filter((t=>t._isOpposite));break;case et.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case et.TOP:r=s.filter((t=>t._isOpposite));break;case et.MIDDLE:r=s.filter((t=>t._isBetween))}return r?e?r.filter((t=>t.visible)):r:[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){const e=t.template;if(n(e)){let s=this._templates[e];if(s)return y(s,t)}else s(e)&&e.forEach((e=>{let s=this._templates[e];return s&&(s=y(s,t)),s}));return t}load(t){const e="load chart "+1e6*Math.random();ht.LOGGING&&console.time(e),this._config=t,this._data.load(t.data),this.$_loadTemplates(t.templates),["type","gaugeType","polar","inverted"].forEach((e=>{e in t&&(this[e]=t[e])})),this._polar=!0===this.polar,this.type=this.type||"bar",this.gaugeType=this.gaugeType||"circle",this._assets.load(t.assets||t.asset),this._options.load(t.options),Object.assign(this._exportOptions,t.exportOptions),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),this._tooltip.load(t.tooltip),this._split.load(t.split),this._series.load(t.series),this._gauges.load(t.gauges||t.gauge),this._gaugeOnly=0==this._series.count&&this._gauges.count>0,this._gaugeOnly||(this._xAxes.load(b(t.xAxes,t.xAxis,{})),this._yAxes.load(b(t.yAxes,t.yAxis,{}))),this._body.load(t.body||t.plot),this._annotations.load(t.annotations||t.annotation),this._navigator.load(t.seriesNavigator),ht.log("chart-items:",ge),ht.LOGGING&&console.timeEnd(e)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}dataChanged(){this._dataChanged=!0}isDataChanged(){return this._dataChanged}prepareRender(){const t=this._xAxes,e=this._yAxes,s=this._split;[t,e].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=s.visible,t.disconnect(),e.disconnect(),this._series.prepareRender(),t.collectValues(),e.collectValues(),t.collectReferentsValues(),e.collectReferentsValues(),e.collectRanges(),t.prepareRender(),e.prepareRender(),this._splitted&&!this._gaugeOnly&&(s.prepareRender(),this._xPaneAxes.prepare(t,s._vrows,s._vcols),this._yPaneAxes.prepare(e,s._vrows,s._vcols)),this._series.prepareAfter(),this._legend.prepareRender(),this._gauges.prepareRender(),this._body.prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator.prepareRender()}afterRender(){this._dataChanged=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes.$_buildTicks(s?e:t),this._yAxes.$_buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t.calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t.calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,1)}update(){}getParam(t,e){return this._params[e]}setParam(t,e,s){s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e}addSeries(t,e){const s=this._series.add(t);return s&&(this.dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this.dataChanged(),this._modelChanged(null),s}$_loadTemplates(t){if(e(t)){const s=this._templates={};for(const i in t){const r=t[i];e(r)&&(s[i]=h({},r))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&$n[t.toLowerCase()]}_getSeriesType(t){return n(t)&&In[t.toLowerCase()]}_getAxisType(t){return n(t)&&Fn[t.toLowerCase()]}_getGaugeType(t){return n(t)&&zn[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&Hn[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Gn[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}class Un extends V{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this.freeAll(),this._owner=null,this._creator=null,super._doDestory()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),this._owner.add(i),i}prepare(t,e,s){const i=this._owner.doc,r=this._pool,n=this._views;for(;n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(i);n.push(e),null==s||s(e,n.length-1,t)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const Zn=Object.freeze({x:0,y:0,width:0,height:0}),Kn=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function qn(t){return{width:t.width,height:t.height}}function Qn(t){return t.width<=0||t.height<=0}class Jn{static empty(){return new Jn}static create(t=0,e=0){return new Jn(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new Jn(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}Jn.EMPTY=new Jn;class ta extends gt{constructor(t,e=E){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return ta.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ta.IGNORE_ATTRS={width:"",height:""};class ea extends gt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=Zn,e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s),!0)}getBBox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}class sa extends ta{constructor(t,e=E){super(t),this.add(this._text=new Kt(t,e)),this._text.anchor=Xt.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),r===me.BACKGROUND?(this._outline&&this._outline.remove(),this._back||(this._back=new Es(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):r===me.OUTLINE?(this._back&&this._back.remove(),this._outline||(this._outline=new Kt(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new ea(t,!1)),this._icon.url=s,this._icon.width=e.width,this._icon.height=e.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.autoContrast&&this._text.setContrast(t,this._model.darkStyle||"rct-label-dark",this._model.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Yt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._icon;let s=0;const i=this._text.getBBox(),r=i.width,n=i.height;let a=r,h=n,o=0,l=0,c=0,_=0;if(e){const t=e.getBBox();switch(s=w(this._model.iconGap,0),o=t.width,l=t.height,this._model.getIconPos()){case fe.LEFT:case fe.RIGHT:a+=s+o,h=Math.max(l,n);break;default:h+=s+l,a=Math.max(o,r)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);c=parseFloat(t.paddingLeft)||0,_=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+c+(parseFloat(t.paddingRight)||0),h+_+(parseFloat(t.paddingBottom)||0),t.rx),this._back.setStyle("fill","lightgray")}if(e)switch(this._model.getIconPos()){case fe.LEFT:e.trans(c,(h-l)/2),c+=o+s,a-=o+s;break;case fe.RIGHT:e.trans(c+a-o,(h-l)/2),a-=o+s;break;case fe.TOP:e.transX((a-o)/2),_+=l+s;break;case fe.BOTTOM:e.trans((a-o)/2,_+n+s)}switch(t){case J.CENTER:c+=a/2,this._text.anchor=Xt.MIDDLE;break;case J.RIGHT:c+=a,this._text.anchor=Xt.END;break;default:this._text.anchor=Xt.START}return this._text.trans(c,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,_)),this}}class ia{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new ia(t,t,t,t):new ia(t,t,e,e):new ia(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new ia(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=w(t.paddingLeft,0),this.right=w(t.paddingRight,0),this.top=w(t.paddingTop,0),this.bottom=w(t.paddingBottom,0),this}applyMargin(t){return this.left=w(t.marginLeft,0),this.right=w(t.marginRight,0),this.top=w(t.marginTop,0),this.bottom=w(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}ia.Empty=Object.freeze(new ia),ia.Temp=new ia;class ra extends gt{constructor(t,e=E){super(t,e,"g"),gt.DEBUGGING&&(this.add(this._debugRect=new Es(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}setModel(t){t!==this.model&&(this.model=t,this._doModelChanged())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),gt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Es(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}_doModelChanged(){}}class na extends ra{constructor(t,e,s){super(t,e),this._margins=new ia,this._paddings=new ia,this.add(this._background=new Es(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background);const n=this._doMeasure(t,e,s,i,r);let a=getComputedStyle(this._background.dom);const h=this._paddings;if(h.applyPadding(a),n.width+=h.left+h.right,n.height+=h.top+h.bottom,this._marginable()){const t=this._margins;a=getComputedStyle(this.dom),t.applyMargin(a),this.mw=n.width+=t.left+t.right,this.mh=n.height+=t.top+t.bottom}return this.mw=n.width,this.mh=n.height,n}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_getBackOffset(){return 0}}class aa extends ta{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class ha extends ra{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class oa extends Vs{constructor(t,e,s,i){super(),this._axis=t,this._prevMin=e,this._prevMax=s,this.endHandler=i,this.start()}_doUpdate(t){if(this._axis.parent){const e=this._prevMax-this._prevMin,s=(this._axis.model.axisMax()-this._axis.model.axisMin())/e;return t=s+(1-s)*t,this._axis.model.setPrevRate(t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(NaN),this._axis=null}}class la extends na{constructor(t){super(t,la.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Kt(t)),this._richText=new ie}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation(e.axis),this._richText.setFormat(e.text),this._richText.build(this._textView,s,i,null,null);const n=qn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=n.width;n.width=n.height,n.height=t}return n}_doLayout(t){this._textView.transY(this._margins.top+this._paddings.top),t?this.rotation=0:this.setRotation(0,this.height/2,this._angle)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}la.TITLE_CLASS="rct-axis-title";class ca extends ra{constructor(t){super(t,pa.TICK_CLASS),this.add(this._lineView=new wr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLineC(0,0,this.height):this._lineView.setHLineC(0,0,this.width)}}class _a extends sa{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}setLabel(t,e,s,i,r){if(s){this._richText?this._richText._format!==s&&this._richText.setFormat(s):this._richText=new ie(s);const n=t.getIcon(e);this.setModel(this.doc,t,n&&t.getUrl(n),null),this._richText.build(this._text,i,r,t,t._domain),this._outline&&this._richText.build(this._outline,i,r,t,t._domain)}else this._richText&&(this._richText=null,this._text.text="")}rotatedHeight(){const t=this.rotation*R,e=this.getBBox();return m(c(t)*e.height)+m(_(t)*e.width)}}class ua extends gt{constructor(t){super(t,void 0),this.add(this._back=new xt(t,"rct-crosshair-flag")),this.add(this._text=new Kt(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){this._text.text=e;const s=this._text.getBBox(),i=new Mr,r=p(t.flag.minWidth||0,s.width+8);i.rect(0,0,r,s.height+4),this._back.setPath(i.end()),this._text.trans(r/2,2)}}}class da extends ra{static isThumb(t){return t.classList.contains(da.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Es(t,da.TRACK_CLASS)),this.add(this._thumbView=new Es(t,da.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=p(0,e),this._page=g(s,e),this._pos=g(t.min+e-s,p(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.reversed,(t=p(0,g(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e.style),(this._vertical=!e.axis._isHorz)?{width:e.thickness+e.gap+e.gapFar,height:i}:{width:s,height:e.thickness+e.gap+e.gapFar}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=w(e.minThumbSize,32),r=this._len,n=0===this._len,a=this._page,h=n?0:this._pos-s.min;let o=this.width,l=this.height;if(this._vertical){o-=e.gap+e.gapFar,this._trackView.setBounds(e.gap,0,o,l),l-=i;const t=(n||a===r?l:l*a/r)+i;this._reversed,this._thumbView.setBounds(e.gap+1,n?0:this.height-l*h/r-t,o-2,t)}else{l-=e.gap+e.gapFar,this._trackView.setBounds(0,e.gap,o,l),o-=i;const t=(n||a===r?o:o*a/r)+i;this._reversed,this._thumbView.setBounds(n?0:o*h/r,e.gap+1,t,l-2)}}}da.CLASS_NAME="rct-axis-scrollbar",da.TRACK_CLASS="rct-axis-scrollbar-track",da.THUMB_CLASS="rct-axis-scrollbar-thumb";const ga=/\${label}.*?/g;class pa extends ra{constructor(t){super(t,pa.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new wr(t,pa.LINE_CLASS)),this.add(this._titleView=new la(t)),this.add(this._markContainer=new gt(t,"rct-axis-ticks")),this.add(this._labelContainer=new gt(t,"rct-axis-labels")),this._labelViews=new Un(this._labelContainer,_a,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new da(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s]):(this._scrollView&&this._scrollView.setVis(!1),0)}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(i)&&(r+=this.$_measureLabelsHorz(i,e)),this._titleView.setVis(i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),r}checkWidth(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(i)&&(r+=this.$_measureLabelsVert(i,e)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).width,r+=i.title.gap),r+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),r}prepareGuides(t,e,s,i,r){let n=this.model.guides.filter((t=>!t.front&&t.canConstainedTo(e,s)));i.addAll(t,n,!1),n=this.model.guides.filter((t=>t.front&&t.canConstainedTo(e,s))),r.addAll(t,n,!1)}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new ua(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick.length):(i=s._runPos===Se.OPPOSITE?g(0,this.width-n.width):p(0,this.width-s.tick.length-n.width),r.trans(i,t-n.height/2))}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}checkExtents(){const t=this._prevModel,e=this._prevModel=this.model;if((!t||t===e)&&this.control.loaded){const t=this._prevMin,s=this._prevMax;this._prevMin=e.axisMin(),this._prevMax=e.axisMax(),(!isNaN(s)&&this._prevMax!==s||!isNaN(t)&&this._prevMin!==t)&&e.chart.isDataChanged()&&e.animatable&&new oa(this,t,s,(()=>{this.invalidate()}))}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const a=e._isHorz,h=e._isBetween,o=this._titleView;let l=0;return(this._lineView.visible=e.line.visible)?(this._lineView.setStyleOrClass(e.line.style),h&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new wr(t,pa.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(e.line.style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=e.tick.length||0,this._markLen>0&&(l+=e.tick.gap||0),l+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),h&&(l*=2),this.$_prepareLabels(e)?l+=this._labelSize=a?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i):this._labelSize=0,this._simpleMode?o.setVis(!1):(o.visible&&(l+=a?o.mh:o.mw,l+=+e.title.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(l+=a?this._scrollView.mh:this._scrollView.mw)),Jn.create(a?s:l,a?l:i)}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t._ticks,n=t._markPoints,a=this._labelViews,h=this._markLen,o=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLineC(s?l:0,0,o):this._lineView.setVLineC(s?0:o,0,l),this._lineView2&&(e?this._lineView2.setHLineC(l,0,o):this._lineView2.setVLineC(0,0,l))),this._markContainer.visible&&(e?this._markViews.forEach(((t,e)=>{t.resize(1,h),t.layout().trans(n[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().trans(s?0:o-h,l-n[e])})));const c=h+(t.tick.gap||0);if(this._labelContainer.visible&&(e?this.$_layoutLabelsHorz(a,r,i,s,o,l,c):this.$_layoutLabelsVert(a,r,i,s,o,l,c)),!this._simpleMode){const i=this._titleView,r=this._scrollView,n=this._labelSize;let a=0,h=0;if(i.visible){const r=+t.title.offset||0,_=+t.title.gap||0;if(i.resizeByMeasured().layout(e),e){if(h+=s?0:c+n+_,t.reversed)switch(t.title.align){case ye.START:a=o-i.width/2-r;break;case ye.END:a=i.width/2+r;break;case ye.MIDDLE:default:a=o/2-r}else switch(t.title.align){case ye.START:a=i.width/2+r;break;case ye.END:a=o-i.width/2-r;break;case ye.MIDDLE:default:a=o/2+r}i.trans(a,h),h+=i.height}else{const e=0===i._angle?i.width:i.height;if(a=s?c+n+_+e/2:o-c-n-_-e/2,t.reversed)if(0===i._angle)switch(t.title.align){case ye.START:h=0+r;break;case ye.END:h=l-i.height-r;break;case ye.MIDDLE:default:h=(l-i.height)/2+r}else switch(t.title.align){case ye.START:h=i.width/2-i.height/2+r;break;case ye.END:h=l-i.width/2-i.height/2-r;break;case ye.MIDDLE:default:h=(l-i.height)/2+r}else if(0===i._angle)switch(t.title.align){case ye.START:h=l-i.height-r;break;case ye.END:h=0+r;break;case ye.MIDDLE:default:h=(l-i.height)/2-r}else switch(t.title.align){case ye.START:h=l-i.width/2-i.height/2-r;break;case ye.END:h=i.width/2-i.height/2+r;break;case ye.MIDDLE:default:h=(l-i.height)/2-r}i.trans(a,h)}}else h+=s?0:c+n;(null==r?void 0:r.visible)&&(e?(r.trans(0,h).resize(this.width,r.mh),r.setScroll(t._zoom,t.reversed)):(r.trans(0,0).resize(r.mw,this.height),r.setScroll(t._zoom,t.reversed)),r.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new ca(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s.style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(ga)?t.setLabel(s,e,r.replace(ga,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,t.setModel(this.doc,s,null,null),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t){const e=t.label;if(this._labelContainer.setVis(e.visible)){const s=t._ticks;return this._labelContainer.setStyleOrClass(e.style),this._labelViews.prepare(s.length,((t,i,r)=>{t.setVis(!0),this._prepareLabel(t,s[i],e,r)})).count}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz(t,e,s,i,r,n){const a=e.length,h=p(1,i)*p(1,r),o=n||0,l=m(o)*R,_=l<35*R;let u=!1;e.forEach((t=>t.rotation=o));for(let i=0;i<a-1;i+=h){let r=0,n=i;for(;n<i+h&&n<a-1;n++)r+=t.getLabelLength(s,e[i].value);if(n===i+h){if(0===o&&e[i].getBBox().width>=r){u=!0;break}if(_&&e[i].getBBox().width*c(l)>=r){u=!0;break}if(0!==o&&e[i].getBBox().height>=r){u=!0;break}}}return u}$_applyStep(t,e,s){const i=t.label,r=p(0,i.startStep||0);e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e){const s=t.label;let i,r=this._labelViews._internalItems(),n=+s.step>>0,a=+s.rows>>0,h=+s.rotation%360,o=this.$_checkOverlappedHorz(t,r,e,n,a,h);if(r.forEach((t=>t.row=0)),this._labelRowPts=[0],o)if(s.autoArrange===Ve.NONE)r=this.$_applyStep(t,r,1);else{switch(n=a=h=0,s.autoArrange){case Ve.ROWS:a=this.$_getRows(r);break;case Ve.STEP:n=this.$_getStep(r);break;default:h=-45}if(n>1){const s=r.slice(0);for(;s.length>1&&(r=this.$_applyStep(t,s,n),this.$_checkOverlappedHorz(t,s,e,n,1,0));)n++}else if(a>1){for(;r.length>a&&(r.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz(t,r,e,1,a,0));)a++;this._labelRowPts=[]}else h=-45,r.forEach(((t,e)=>{t.rotation=h,t.index=e})),this.$_checkOverlappedHorz(t,r,e,n,a,h)&&(this.$_checkOverlappedHorz(t,r,e,n,a,h),n=p(2,n++),r=this.$_applyStep(t,r,n),this.$_checkOverlappedHorz(t,r,e,n,a,0)&&r.forEach(((t,e)=>{t.rotation=h})))}else r=this.$_applyStep(t,r,n||1);if(a>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;a>1&&r.forEach(((t,e)=>t.row=e%a));for(let t=0;t<a;t++)e.push(0);r.forEach((s=>{e[s.row]=p(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(h)||0==h){i=r[0].getBBox().height;for(let t=1;t<r.length;t++)i=p(i,r[t].getBBox().height)}else{i=r[0].rotatedHeight();for(let t=1;t<r.length;t++)i=p(i,r[t].rotatedHeight())}return i}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=p(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let a=0;for(let h=i;h<i+n&&h<r-1;h++)a+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=a)return!0}}$_measureLabelsVert(t,e){const s=t.label;let i=this._labelViews._internalItems(),r=p(1,+s.step>>0);if(this.$_checkOverlappedVert(t,i,e,r)){const s=i.slice(0);for(;s.length>1&&r<s.length/2&&(i=this.$_applyStep(t,s,++r),this.$_checkOverlappedHorz(t,s,e,r,1,0)););}else i=this.$_applyStep(t,i,r);let n=i[0].getBBox().width;for(let t=1;t<i.length;t++)n=p(n,i[t].getBBox().width);return n}$_layoutLabelsHorz(t,e,s,i,r,n,a){const h=this.model,o=J.CENTER,l=this._labelRowPts;t.forEach((t=>{if(t.visible){const s=t.rotation,r=s*R,c=t.getBBox();let u=h.prev(e[t.index].pos),d=i?n-a-c.height-l[t.row]:a+l[t.row];s<-15&&s>=-90?i?(u-=c.width,d-=_(r)*c.height/2,t.setRotation(c.width,c.height/2,-s)):(u-=c.width,d+=_(r)*c.height/2,t.setRotation(c.width,c.height/2,s)):s>15&&s<=90?i?(d+=_(r)*c.height/2,t.setRotation(0,c.height/2,-s)):(d-=_(r)*c.height/2,t.setRotation(0,c.height/2,s)):(u-=c.width/2,t.setRotation(c.width/2,0,i?-s:s)),t.setContrast(null).layout(o).trans(u,d)}}))}$_layoutLabelsVert(t,e,s,i,r,n,a){const h=this.model,o=i?J.LEFT:s?J.CENTER:J.RIGHT,l=i?a:r-a;t.forEach(((t,a)=>{if(t.visible){const c=t.getBBox(),_=i?l:s?(r-c.width)/2:l-c.width;t.setContrast(null).layout(o).trans(_,n-h.prev(e[a].pos)-c.height/2)}}))}}pa.AXIS_CLASS="rct-axis",pa.LINE_CLASS="rct-axis-line",pa.TICK_CLASS="rct-axis-tick";class ma{static reveal(t,e){new fa(t,e)}static grow(t,e){new ba(t,e)}static spread(t,e){new ya(t,e)}static fadeIn(t){new wa(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class wa extends ma{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:Vs.DURATION,fill:"none"})}}class fa extends ma{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Vs.DURATION,fill:"none"}}$_clipRect(t){let e;if(t.model.needClip(!1))e=t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else{const s=t.control;e=t.model.chart.isInverted()?t.clipRect(-s.width(),.1*-t.height,2*s.width(),1.2*t.height):t.clipRect(.1*-t.width,-s.height(),1.2*t.width,2*s.height())}return e}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:$(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:$(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class xa extends Vs{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof gt}_stop(){super._stop(),this._series=null}}class ba extends xa{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class ya extends xa{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class va extends xa{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}class Va extends sa{constructor(t){super(t,"rct-point-label")}}class Sa extends pt{constructor(t){super(t,"rct-point-labels"),this._labels=[new Un(this,Va),new Un(this,Va)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r,n){const a=r.getPointText(i,n.text),h=n.style;e.point=i,e.setModel(t,n,null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(h),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),a?(n.prepareRich(a),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(i.getLabel(s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isPointLabelsVisible()){const r=s.pointLabelCount(),n=this._labels,a=s.getLabeledPoints(),h=this._maps,o=i.style;n[0].prepare(a.length),h[0]={},n[1].prepare(r>1?a.length:0),h[1]={},a.forEach(((r,a)=>{for(let o=0;o<r.labelCount();o++){const l=n[o].get(a);l.setVis(e.isPointVisible(r))&&(this.prepareLabel(t,l,o,r,s,i),h[o][r.pid]=l)}})),this.setStyleOrClass(o)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class Pa extends ta{constructor(t){super(t),this.add(this._line=new xt(t))}setLine(t){this._line.setPath(t)}}class Ca extends ta{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Un(this,Pa)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Aa extends pt{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}class ka extends ha{constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._valueRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this.add(this._pointContainer=new Aa(t,"rct-series-points")),this._labelContainer=new Sa(t)}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setValueRate(t){}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e)}_doPointClicked(t){}prepareSeries(t,e){this.setModel(e),this.setData("index",e.index%12),this.setData("pointcolors",e._colorByPoint()?"a":E),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&this._setModelColor(e.color),e._calcedColor=getComputedStyle(this.dom)[this._legendColorProp()],this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setFocusPoint(t,e){const s=!!e;t.setBoolData(ka.DATA_FOUCS,s),this._needFocusOrder()&&(s?this._getPointPool().front(t):this._getPointPool().back(t))}_needFocusOrder(){return!0}_doAttached(t){this.control.loaded&&vs(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new xt(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),Jn.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new va(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),e.pointStyle&&t.internalSetStyleOrClass(e.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.isPointLabelsVisible()&&!this._animating()),this._labelContainer.visible?this._labelContainer:E}_getGrowRate(){return w(this._growRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===m(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py},c={x:0,y:0},_={x:0,y:0},u={x:0,y:0};let d={x:0,y:0},g=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=g,l.y/=g;let p=t[r+1].px-t[r].px,w=t[r].px,f=t[r].py;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(d.x=o.x-l.x,d.y=o.y-l.y):(d.x=l.x-o.x,d.y=l.y-o.y);const s=Math.sqrt(d.x*d.x+d.y*d.y);d.x/=s,d.y/=s,o.y*l.y>=0&&(d={x:1,y:0}),a.x=-d.x*p*n,a.y=-d.y*p*n,r===e+1?i.quad(t[r].px+a.x,t[r].py+a.y,t[r].px,t[r].py):(c.x=w+h.x,c.y=f+h.y,_.x=t[r].px+a.x,_.y=t[r].py+a.y,u.x=(c.x+_.x)/2,u.y=(c.y+_.y)/2,i.quad(c.x,c.y,u.x,u.y),i.quad(_.x,_.y,t[r].px,t[r].py)),p=t[r+1].px-t[r].px,h.x=d.x*p*n,h.y=d.y*p*n,w=t[r].px,f=t[r].py}i.quad(w+h.x,f+h.y,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model,s=e._xAxisObj,i=e._yAxisObj,r=i._vlen,n=s._vlen,a=e.trendline._points.map((e=>{let a,h;return t?(h=n-s.getPos(n,e.x),a=i.getPos(r,e.y)):(a=s.getPos(n,e.x),h=r-i.getPos(r,e.y)),{x:a,y:h}}));if(this._trendLineView.setVis(a.length>1)){const t=new Mr;t.move(a[0].x,a[0].y),this.model.trendline.isCurved()?this._drawSpline(a.map((t=>({px:t.x,py:t.y}))),0,-1,t):t.lines(...a),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:a,labelView:h,labelOff:o}=t;if(!h.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;const l=t.reversed?a<=0:a<0,c=h.getBBox();let _=!0;switch(i?n-=c.height/2:r-=c.width/2,t.labelPos){case Fs.INSIDE:i?r-=(a+c.width)/2+(t.reversed?o:-o):n+=(a-c.height)/2+(t.reversed?o:-o);break;case Fs.HEAD:i?l?r+=c.width-o:r-=c.width+o:l?n-=c.height+o:n+=o;break;case Fs.FOOT:i?r-=l?a+c.width+o:a-o:n+=l?a+o:a-c.height-o;break;case Fs.OUTSIDE:default:i?l?r-=c.width+o:r+=o:l?n+=o:n-=c.height+o,_=!1}h.setContrast(_&&t.pointView.dom),h.layout(h.textAlign()).trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const a="x"===s,h=a?this.model._xAxisObj:this.model._yAxisObj,o=h.reversed,l=h.getPos(a?t:e,p(h.axisMin(),i.fromValue)),c=h.getPos(a?t:e,g(h.axisMax(),i.toValue));n?a?o?r.setBounds(c,-e,m(c-l),e):r.setBounds(l,-e,m(c-l),e):r.setBounds(0,-p(l,c),t,m(c-l)):a?o?r.setBounds(c,0,m(c-l),e):r.setBounds(l,0,m(c-l),e):r.setBounds(0,e-p(l,c),t,m(c-l))}_setFill(t,s){e(s)&&s[Y]?t.internalSetStyle(Y,s[Y]):n(s)&&t.dom.classList.add(s)}_savePrevs(){}}ka.POINT_CLASS="rct-point",ka.DATA_FOUCS="focus",ka.LEGEND_MARKER="rct-legend-item-marker";class Ea extends xt{constructor(t){super(t,ka.POINT_CLASS)}savePrevs(){}}class La extends Ea{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){super.savePrevs(),this.wSave=this.wPoint,this.xSave=this.x}}let Ta=class extends La{layout(t,e,s,i){this.x=t,this.setPath(ks.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Na extends ta{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Ra extends ka{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePointViews(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPointViews(t,e)}_runShowEffect(t){t&&ma.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}}class Oa extends Ra{_doPrevRateChanged(t){0==t&&this._layoutPointViews(this.width,this.height),this.invalidate()}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,_=2*l.unitPad(),u=c.prev(i?t:e),d=l.prev(i?e:t),g=i?0:e,m=c.axisMin(),f=c.getPos(u,m),x=s.getBaseValue(c),b=w(c.getPos(u,p(m,x)),f),y=!isNaN(x),v=o&&h(this._labelInfo,{inverted:i,reversed:c.reversed,labelPos:s.getLabelPosition(a.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,h)=>{const p=a.point;if(a.setVis(!p.isNull)){const m=l.getUnitLen(d,p.xValue)*(1-_);isNaN(m)&&console.log(l.getUnitLen(d,p.xValue)*(1-_));let w=s.getPointWidth(m);const f=c.getPos(u,p.yValue)-b,x=(c.getPos(u,p.yGroup)-b-f)*r,V=f*r;let S=l.getPos(d,p.xValue)-m/2,P=g-c.getPos(u,p.yGroup)*r;isNaN(n+a.wSave)||(w=a.wSave+(w-a.wSave)*n),S+=s.getPointPos(m)+w/2,isNaN(n+a.xSave)||(S=a.xSave+(S-a.xSave)*n),p.xPos=S,p.yPos=P,this._layoutPointView(a,h,S,g-b-x,w,V),i&&(P=d-l.getPos(d,p.xValue)+m/2,S=g,p.yPos=P-=s.getPointPos(m)+w/2,p.xPos=S+=y?c.getPos(u,p.yGroup)*r:c.getPos(u,p.yGroup*r)),v&&(v.labelView=o.get(p,0))&&(v.pointView=a,v.x=S,v.y=P,v.wPoint=w,v.hPoint=V,this._layoutLabel(v,t,e))}}))}}class Ma extends Ra{_doPrevRateChanged(t){0==t&&this._layoutPointViews(this.width,this.height),this.invalidate()}_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,_=2*l.unitPad(),u=i?t:e,d=i?e:t,g=i?0:e,p=o&&h(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(a.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,h)=>{const m=a.point;if(a.setVis(!m.isNull)){const w=l.getUnitLen(d,m.xValue)*(1-_);let f=s.getPointWidth(w);const x=(c.getPos(u,m.yValue)-c.getPos(u,this._getLowValue(m)))*r;let b=l.getPos(d,m.xValue)-w/2,y=g-c.getPos(u,m.yGroup)*r;isNaN(n+a.wSave)||(f=a.wSave+(f-a.wSave)*n),b+=s.getPointPos(w)+f/2,isNaN(n+a.xSave)||(b=a.xSave+(b-a.xSave)*n),m.xPos=b,m.yPos=y,this._layoutPointView(a,h,b,y,f,x),i&&(y=d-l.getPos(d,m.xValue)+w/2,b=g,m.yPos=y-=s.getPointPos(w)+f/2,m.xPos=b+=c.getPos(u,m.yGroup)*r),o&&(p.pointView=a,p.hPoint=x,p.x=b,p.y=y,(p.labelView=o.get(m,0))&&(p.hPoint=x,this._layoutLabel(p,t,e)),(p.labelView=o.get(m,1))&&(i?p.x-=x:p.y+=x,p.hPoint=-x,this._layoutLabel(p,t,e)))}}))}}class Da extends xt{constructor(t){super(t,ka.POINT_CLASS)}}class Ba extends ka{constructor(t,e){super(t,e),this._markers=new Un(this._pointContainer,Da)}_getPointPool(){return this._markers}clipInvertable(){return!1}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBox();e===Fs.AUTO&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVis(null!=e)&&(r-=a.width/2,e===Fs.INSIDE?t.trans(r,n-a.height/2):e&&t.trans(r,n-i-a.height-s))}}class $a extends Vs{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.invalidate(),this.series=null)}}class Ia extends ka{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new $a(this),this._zombieAni.start()),this.setData("pointcolors","f")}_createPointLegendMarker(t,e,s){return Es.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,ns.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class Fa extends gt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class za extends xt{setArc(t,e,s,i,r,n){this.setPath(ks.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Ha extends za{setPolyline(t){this.setPath(ks.lines(...t))}}class Ga extends xt{static create(t,e,s,i,r,n,a,h,o=!0){return new Ga(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:h,clockwise:o})}static createInner(t,e="",s,i,r,n,a,h,o,l=!0){return new Ga(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=E,s=E){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return ks.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return ks.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}class ja extends ha{constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Es(t,ja.PANE_CLASS)),this.add(this._contentContainer=new pt(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return ja.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.paneStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=h(nt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Qa)return t;t=t.parent}}}ja.GAUGE_CLASS="rct-gauge",ja.PANE_CLASS="rct-gauge-pane";class Wa extends Vs{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class Ya extends ja{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return a(i)?kt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t.style)}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_getValue(t){return p(t.minValue,g(t.maxValue,w(this._runValue,t.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new Wa(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class Xa extends sa{}class Ua extends ra{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new pt(t,"rct-gauge-scale-ticks")),this._ticks=new Un(this._tickContainer,wr),this.add(this._labelContainer=new pt(t,"rct-gauge-scale-tick-labels")),this._labels=new Un(this._labelContainer,Xa)}}class Za extends Ua{_createLine(t,e){return new wr(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e.label,o=e._steps,l=o.length;let c=a?e.gap:s,_=a?i:e.gap;if(this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(l)),a?c+=e.tick.length:_+=e.tick.length,this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.setStyleOrClass(e.label.style),this._labels.prepare(l,(e=>{e.setModel(t,h,null,null)})),l>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.setText(h.getText(o[n?s:l-1-s])),t=p(e.getBBox().width)})),c+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.setText(h.getText(o[n?l-1-s:s])),t=p(e.getBBox().height)})),_+=t}return{width:c,height:_}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=this._line,r=t.tick,n=t._steps;n.length;const a=t.position===$i.OPPOSITE,h=a?-r.length:r.length;let o,l=a?s-t.gap:t.gap;if(i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLineC(l,0,e)),this._tickContainer.setVis(r.visible)&&this._ticks.forEach(((s,i)=>{o=t.getRate(n[i])*e,s.setVLine(o,l,l+h)})),this._labelContainer.visible){let s=Number.MIN_SAFE_INTEGER;l=a?0:l+h,this._labels.forEach(((i,r)=>{const a=i.getBBox();o=t.getRate(n[r])*e,i.setVis(o-a.width/2>s)&&(i.layout(J.CENTER).trans(o-a.width/2,l),s=o+a.width/2)}))}}$_layoutVert(t,e,s){const i=this._line,r=t.tick,n=t._steps;this.height,n.length;const a=t.position===$i.OPPOSITE,h=a?r.length:-r.length;let o,l=a?t.gap:e-t.gap;if(i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLineC(l,0,s)),this._tickContainer.setVis(r.visible)&&this._ticks.forEach(((e,i)=>{o=t.getRate(n[i])*s,e.setHLine(o,l,l+h)})),this._labelContainer.visible){a?Xt.START:Xt.END;const i=a?J.LEFT:J.RIGHT;l=a?l+h:e-t.gap+h,this._labels.forEach(((e,r)=>{const h=e.getBBox(),c=a?l:l-h.width;o=t.getRate(n[r])*s,e.layout(i).trans(c,o-h.height/2)}))}}}class Ka extends Ya{measureLabelSize(t,e,s){const i=t.label,r=this.labelView();return i.setText(t.getLabel(i,t.value)),r.text=i.text,i.buildSvg(r,null,e,s,t,i._domain),qn(r.getBBox())}_renderGauge(t,e){const s=this.model,i=w(this._runValue,s.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=w(this._runValue,t.value),n=h({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(t,n,r),"top"!==e._runPos&&"bottom"!==e._runPos||(this._rLabel.height=n.height),this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===$i.OPPOSITE){const t=i.getBBox();i.ty+t.height>this.height&&i.transY(p(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=Kn(0,0,n,a);if(this._vertical=t.group instanceof bn?t.group.vertical:r,e.visible){const r=e._runPos=x(e.position,this._vertical?"top":"left"),o=e._runVert="top"===r||"bottom"===r,l=t.group?t.group.itemLabel.gap:e._runGap=e.getGap(o?a:n);let c=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const u=o?n:e.getMaxWidth(n),d=o?e.getMaxHeight(a):a,g=this._rLabel=Kn(0,0,n,a);s.setStyleOrClass(e.style),e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,null,w(c,u),w(_,d),t,e._domain);const m=s.getBBox();switch(o?(g.height=w(_,m.height),h.height=p(0,h.height-(g.height+l))):(g.width=w(c,m.width),this._wLabel=t.group?t.group._labelWidth:g.width,h.width=p(0,h.width-(this._wLabel+l))),r){case"top":h.y=g.height+l;break;case"bottom":g.y=h.height+l;break;case"right":g.x=h.width+l;break;default:h.x=this._wLabel+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBox();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Xt.START,n+=p(0,(t.height-i.height)/2);break;default:s.anchor=Xt.END,r+=this._wLabel,n+=p(0,(t.height-i.height)/2)}s.trans(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=this._vertical?t.height:t.width;let a,h;if(i._vertical=this._vertical,i._reversed=e.reversed,isNaN(this._runValue)&&i.buildSteps(n,e.value),r.setVis(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,h=t.y,t.width=p(0,t.width-e.width),i.position===$i.OPPOSITE?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=p(0,t.height-e.height),i.position===$i.OPPOSITE?s._runVert?(h=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,h=t.y-e.height):h=t.y+t.height),r.resizeByMeasured().layout().trans(a,h)}}}class qa extends Ya{}class Qa extends ja{_defaultCalss(){return Qa.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new pt(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}Qa.GAUGE_GROUP_CLASS="rct-gauge-group";class Ja extends Ua{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new za(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.sweepAngle?1:0);return this._line.setVis(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label.style),this._labels.prepare(n,(t=>{}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=e.position===$i.OPPOSITE?-1:1,n=i.props,a=this._center.x,h=this._center.y,o=this._exts.scale,l=o+this.model.tick.length*r,u=n._sweepRad,d=n._startRad,g=i.maxValue-i.minValue;let p,m,w,f;if(this._line.visible&&this._line.setArc(a,h,o,d,u,!0),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*u+d;p=a+c(n)*o,m=h+_(n)*o,w=a+c(n)*l,f=h+_(n)*l,t.setLine(p,m,w,f)})),this._labelContainer.visible){this._labels.get(0).setText(String(i.maxValue));const t=l+.2*this._labels.get(0).getBBox().height*r;this._labels.forEach(((n,o,l)=>{const p=e.getRate(s[o])*u+d;n.setText(String(D(i.minValue+e.getRate(s[o])*g)));const m=n.getBBox();w=a+c(p)*(t+m.width/2*r)-m.width/2,f=h+_(p)*(t+m.height/2*r)-m.height/2,n.trans(w,f)}))}}}let th=class extends ra{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new Un(this,Ga),this.add(this._labelContainer=new pt(t,"rct-circle-gauge-band-tick-labels")),this._labels=new Un(this._labelContainer,Kt)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=s.props,n=this._center.x,a=this._center.y,h=this._exts.band,o=s.clockwise,l=1-this._exts.bandThick/h,c=e.ranges,_=r._sweepRad;s.maxValue,s.minValue;let u=r._startRad;this._sectorViews.prepare(c.length).forEach(((t,e)=>{const s=i.getRate(c[e].toValue-c[e].fromValue)*_;t.setSector({cx:n,cy:a,rx:h,ry:h,innerRadius:l,start:u,angle:s,clockwise:o}),t.internalClearStyleAndClass(),t.setFill(c[e].color),c[e].style&&t.addStyleOrClass(c[e].style),u+=s}))}};class eh extends xt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Mr).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class sh extends xt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Mr;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t.style),this}}class ih extends qa{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new Ga(t,"rct-circle-gauge-rim")),e.add(this._valueView=new Ga(t,"rct-circle-gauge-value")),e.add(this._innerView=new Ga(t,"rct-circle-gauge-inner")),e.add(this._textView=new Kt(t,"rct-circle-gauge-label")),e.add(this._handContainer=new pt(t,void 0)),e.add(this._scaleView=new Ja(t)),e.add(this._bandView=new th(t))}_backgroundView(){return this._rimView}_prepareGauge(t,e){this._rimView.setVis(e.rim.visible),this._scaleView.setVis(e.scale.visible),this._bandView.setVis(e.band.visible),this._valueView.setVis(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new sh(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new eh(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(g(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.scale,s=t.getProps(),i=this._getValue(t),r=e.getRate(w(i,0)),n=this._center,a=this._exts,h=t.valueRim.getThickness(a.radiusThick),o=this._textView;if(this._valueView.visible){const e=t.valueRim,o=e.getRange(i),l=a.value+(e.stroked?0:h/2),c=this._valueView;c.setStyleOrClass(e.style),o&&(c.setStyle(e.stroked?"stroke":"fill",o.color),o.style&&c.addStyleOrClass(o.style)),e.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",$(h))),c.setBoolData("stroked",e.stroked),c.setSectorEx({cx:n.x,cy:n.y,rx:l,ry:l,innerRadius:(l-h)/l,start:s._startRad,angle:s._sweepRad*r,clockwise:t.clockwise},t.valueRim.stroked)}if(this._handView){const e=(s._handRad+s._sweepRad*r)*O;this._handView.render(t.hand,a.radius).transp(n).rotate(t.clockwise?e:-e)}if(o.visible)if(t.label.setText(t.getLabel(t.label,t.label.animatable?i:t.value)),o.text=t.label.text,t.label.buildSvg(o,null,NaN,NaN,t,t.label._domain),o.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,o,a);else{const e=o.getBBox(),s=t.label.getOffset(this.width,this.height);o.trans(n.x+s.x,n.y-e.height/2+s.y)}}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,t.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:r,angle:i._sweepRad,clockwise:t.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(t.scale.style),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(t.band.style),this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.setStyleOrClass(t.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),h=parseFloat(a.strokeWidth);h>1&&(n-=h/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).trans(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBox(),r=this._rimView.getBBox(),n=+t.group.labelGap||0;e.anchor=Xt.END,e.trans(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class rh extends Vs{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class nh extends Ea{}class ah extends Aa{}class hh extends ka{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new ah(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new xt(t,"rct-line-series-line")),this._markers=new Un(this._pointContainer,nh)}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom);t._marker._line.setStyle("strokeWidth",e.strokeWidth),t._marker._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e){e instanceof Pr&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.prepareLines(this._visPoints)}_doAfterLayout(){this._layoutLines()}_runShowEffect(t){this._polar?t&&ma.grow(this):t&&ma.reveal(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines()}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow=t.belowStyle&&t._minY<t.getBaseValue(t._yAxisObj),this._needBelow)return r||(this._lineContainer.insertChild(r=this._lowLine=new xt(this.doc,"rct-line-series-line rct-line-series-line-below"),this._line),this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds(),this._upperClip.setAttr(gt.ASSET_KEY,"1"),this._lowerClip.setAttr(gt.ASSET_KEY,"1")),this._line.setClip(this._upperClip),r.setClip(this._lowerClip),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Un(this._lineContainer,xt)),i.prepare(e.length);s.length<e.length;){const t=new ft(this.doc);t.setAttr(gt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,-s,e,t):n.setBounds(0,-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,-t,e,t):n.setBounds(0,-s,e,t-s):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof Pr&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker.style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),a=e.length;this._markers.prepare(a*n,((n,h)=>{const o=e[h%a];o.isNull||(n.point=o,r[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(n,t,o,r))}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,a=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),ks.setShape(t,r.getShape(n),a,a),t.setPos(s,i),t.trans(s-=a,i-=a)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r.style,a=this._inverted,h=i.needClip(!1),o=this._getGrowRate(),l=r.visible,u=i.pointLabel,d=u.position,g=u.align,p=u.getAlignOffset(),m=u.textAlign,w=u.getOffset(),f=this._labelViews(),x=i._xAxisObj,b=i._yAxisObj,y=this._polar=i.chart.body.getPolar(x),v=!!y,V=b.prev(a?e:s),S=x.prev(y?y.rd*T:a?s:e),P=a?0:s,C=t.length;t.forEach(((t,i)=>{let u,A;if(y){const e=y.start+x.getPos(S,t.xValue),s=b.getPos(y.rd,t.yGroup)*o;u=t.px=y.cx+s*c(e),A=t.py=y.cy+s*_(e)}else u=t.px=x.getPos(S,t.xValue),A=t.py=P-b.getPos(V,t.yGroup),a&&(u=b.getPos(V,t.yGroup),A=s-x.getPos(S,t.xValue));t.xPos=u,t.yPos=A;const k=this._markers.get(i),E=f&&f.get(t,0);if(k&&k.setVis(!t.isNull&&(v||!h||u>=0&&u<=e&&A>=0&&A<=s))){if(this._layoutMarker(k,n,u,A),k.setStyle("opacity",l||0==i&&!0===r.firstVisible||i===C-1&&!0===r.lastVisible?"1":"0"),E){const t=E.getBBox();switch(E.visible=!0,E.setContrast(null),d){case Fs.INSIDE:A-=t.height/2+w;break;case Fs.FOOT:A+=w+(l?k._radius:0);break;default:A-=t.height+w+(l?k._radius:0)}switch(g){case J.LEFT:u-=t.width+(l?k._radius:0)+p;break;case J.RIGHT:u+=(l?k._radius:0)+p;break;default:u-=t.width/2+p}E.layout(m).trans(u,A)}}else E&&E.setVis(!1)}))}_layoutLines(){const t=this.model;if(!this._lineContainer.setVis(t._lines.length>0))return;const e=this.width,s=this.height,i=this._inverted,r=t instanceof Pr&&this._needBelow,n=this._buildLines2(t._lines,this._polar);if(t._runRanges)this._rangeLines.forEach(((r,a)=>{const h=t._runRanges[a];r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",h.color),r.internalSetStyleOrClass(h.style),nt.setImportantStyle(r.dom.style,Y,"none"),r.setClip(this._rangeClips[a]),this._clipRange(e,s,t._runRangeValue,h,this._rangeClips[a],i)}));else{const e=this._line;e.setPath(n),e.internalClearStyleAndClass(),e.internalSetStyle("stroke",t.color),e.internalSetStyleOrClass(t.style),nt.setImportantStyle(e.dom.style,Y,"none")}if(r){const r=this._lowLine,a=t._yAxisObj,h=t.getBaseValue(a);i?this.$_resetClips(e,s,a.getPos(e,h),!0):this.$_resetClips(e,s,s-a.getPos(s,h),!1),r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",t.color),r.internalSetStyleOrClass(t.style),r.internalSetStyleOrClass(t.belowStyle),nt.setImportantStyle(r.dom.style,Y,"none")}}_buildLine2(t,e,s,i){const r=this.model;e===ne.SPLINE?this._drawCurve2(t,s,i):r instanceof Pr&&e===ne.STEP?this._drawStep2(t,s,i,s?r.backDir():r.stepDir):this._drawLine2(t,s,i)}_buildLines2(t,e){const s=this.model,i=s.getLineType(),r=new Mr;return i===ne.SPLINE?this._drawCurves(t,r):s instanceof Pr&&i===ne.STEP?this._drawSteps(t,r,s.stepDir):this._drawLines(t,r),r.end(e)}_drawLine2(t,e,s){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this._drawLine2(t,!1,e)))}_drawStep2(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)i===Ii.BACKWARD?(s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py)):(s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py))}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep2(t,!1,e,s)))}_drawCurve2(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),this._drawSpline(t,0,t.length-1,s))}_drawCurves(t,e){t.forEach((t=>this._drawCurve2(t,!1,e)))}_drawCurve(t,e,s){const i=t.length;let r;if(t&&t.length>1){let n=e;for(r=e;r<i;)if(t[r].isNull){r-1>n&&this._drawSpline(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].px,t[r].py),r++)}else r++;r-1>n&&this._drawSpline(t,n,r-1,s)}}_buildAreas(t,e,s){const i=new Mr;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(a,s,!0,i)}return i.end(!0)}}class oh extends hh{constructor(t){super(t,oh.CLASS),this._flagView=new sa(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){super._doLayout();const t=this.model,e=t.flag,s=this._flagView;let i;if(s.setVis(e.visible&&!!(i=e.label()))){s.setText(i),s.setModel(this.doc,e,null,null),s.layout(J.LEFT),t._xAxisObj,t._yAxisObj;const r=s.getBBox();let n,a;n=this._markers.last.x,a=this._markers.last.y,this._inverted?(t._xAxisObj.reversed?a+=e.offset:a-=e.offset+r.height,n-=r.width/2):(t._xAxisObj.reversed?n-=e.offset+r.width:n+=e.offset,a-=r.height/2),s.trans(n,a)}}}oh.CLASS="rct-line-series";class lh extends hh{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new ah(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new xt(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._areaContainer.add(e=this._lowArea=new xt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);let s=this._rangeAreas,i=this._rangeAreaClips;if(e){for(s||(s=this._rangeAreas=new Un(this._areaContainer,xt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new ft(this.doc);t.setAttr(gt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,a=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=a-r.getPos(n,s.yGroup-s.yValue)}}_doAfterLayout(){var t;null===(t=this.model.group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar?this._layoutPolar(this._area,this._visPoints):this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model;if(!this._areaContainer.setVis(e._areas.length>0))return;const s=this.width,i=this.height,r=e.chart.isInverted(),n=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,n)=>{const h=e._runRanges[n];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(h.color),this._setFill(t,h.style),h.areaStyle&&t.internalSetStyleOrClass(h.areaStyle),t.setClip(this._rangeAreaClips[n]),this._clipRange(s,i,e._runRangeValue,h,this._rangeAreaClips[n],r)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e.color&&t.internalSetStyle(Y,e.color),this._setFill(t,e.style),e.areaStyle&&t.internalSetStyleOrClass(e.areaStyle)),n&&(n.setBoolData("simple",this._simpleMode),n.setPath(a),n.internalClearStyleAndClass(),e.color&&n.internalSetStyle(Y,e.color),e.areaStyle&&n.internalSetStyleOrClass(e.areaStyle),this._setFill(n,e.belowStyle),e.belowAreaStyle&&n.internalSetStyleOrClass(e.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof yi?s.getBaseValue(r):NaN,a=this.height;r.getPos(a,ht.isNotEmpty(n)?n:r.axisMax());const h=new Mr;if(!i||i.layout!==ai.STACK&&i.layout!==ai.FILL){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);t.setPath(h.end())}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s.color),t.addStyleOrClass(s.style)}}class ch extends Ga{constructor(t){super(t,ka.POINT_CLASS)}}class _h extends Oa{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePointViews(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.baseValue&&e.belowStyle&&t.addStyleOrClass(e.belowStyle)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars||(this._bars=this._createBarPool(this._pointContainer)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new Un(this._pointContainer,ch)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,a=t._yAxisObj,o=r.getPolar(n),l=n.getTotalAngle(),u=i&&h(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.getOffset())});this._sectors.forEach(((s,r)=>{const h=s.point,d=a.getPos(o.rd,h.yValue)*e;let g=a.getPos(o.rd,h.yGroup)*e;const p=n.getUnitLen(l,h.xValue),m=t.getPointWidth(p);let w=o.start+n.getPos(l,h.xValue);s.setSector({cx:o.cx,cy:o.cy,rx:g,ry:g,innerRadius:(g-d)/g,start:w-m/2,angle:m,clockwise:!0});const f=h.xPos=s.cx+.7*s.rx*c(w);if(w=s.start+s.angle/2,g=h.yPos=s.cy+.7*s.ry*_(w),i&&(u.labelView=i.get(h,0))){const t=u.labelView.getBBox();u.labelView.layout(J.CENTER).trans(f-t.width/2,g-t.height/2)}}))}}class uh extends Na{constructor(t){super(t,ka.POINT_CLASS+" rct-boxplot-point")}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.minValue,r=e/2;const n=0+s-s*(t.lowValue-t.minValue)/i,a=0+s-s*(t.highValue-t.minValue)/i,h=s*(t.highValue-t.lowValue)/i;t.color&&this._box.setFill(t.color),this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,s),this._min.setHLine(0,e/4,3*e/4),this._max.setHLine(0+s,e/4,3*e/4),this._box.setBox(0,a,e,h),this._mid.setHLine(0+s-s*(t.midValue-t.minValue)/i,0,e)}_doInitChildren(t){this.add(this._stemUp=new wr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new wr(t,"rct-boxplot-point-stem")),this.add(this._box=new Es(t,"rct-boxplot-point-box")),this.add(this._mid=new wr(t,"rct-boxplot-point-mid")),this.add(this._min=new wr(t,"rct-boxplot-point-min")),this.add(this._max=new wr(t,"rct-boxplot-point-max"))}}let dh=class extends Na{constructor(t){super(t,ka.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.lowValue;const r=0+s-s*(g(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(p(t.openValue,t.closeValue)-t.lowValue)/i,a=g(n,r),h=p(1,m(r-n)),o=t.close<t.open;this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this.setBoolData("decline",o)}_doInitChildren(t){this.add(this._wickUpper=new wr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new wr(t,"rct-candlestick-point-wick")),this.add(this._body=new Es(t))}};let gh=class extends Na{constructor(t){super(t,ka.POINT_CLASS),this.add(this._line=new wr(t)),this.add(this._hmarker=new xt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new xt(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=t.radius,r=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setFill(t.color),this._lmarker.setFill(t.color)),this._line.setVLineC(r,0,s),ks.setShape(this._hmarker,t.shape,i,i),ks.setShape(this._lmarker,t.shape,i,i),this._hmarker.trans(r-i,0-i),this._lmarker.trans(r-i,s-i)}};let ph=class extends ta{constructor(t){super(t,ka.POINT_CLASS),this._segments=new Un(this,xt),this._decimal=0,this.add(this._back=new Es(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setBounds(e,s-r,i,r),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(ks.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(ks.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let mh=class extends Na{constructor(t){super(t,ka.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new wr(t)),this.add(this._whiskerUp=new wr(t)),this.add(this._whiskerDown=new wr(t)),this.add(this._back=new Es(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(){const t=this.width,e=this.height,s=t/2;this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class wh extends Ea{}class fh extends Es{constructor(t){super(t,ka.POINT_CLASS)}}let xh=class extends La{layout(t,e){this.setPath(ks.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class bh extends ta{constructor(t){super(t,ka.POINT_CLASS),this.add(this._line=new wr(t)),this.add(this._marker=new xt(t,"rct-lollipop-point-marker"))}layout(){const t=this.point.radius;this._line.setVLineC(0,0,this.height),ks.setShape(this._marker,this.point.shape,t,t),this._marker.trans(-t,-t)}savePrevs(){this.xSave=this.tx}}class yh extends Na{constructor(t){super(t,ka.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.lowValue,r=-e/2;const n=0+s-s*(g(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(p(t.openValue,t.closeValue)-t.lowValue)/i,h=t.close<t.open;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,e/2),this._bar.setVLine(0,0,0+s),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._tickOpen=new wr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new wr(t,"rct-ohlc-point-tick")),this.add(this._bar=new wr(t)),this.add(this._back=new Es(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class vh extends Ga{constructor(t){super(t,ka.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class Vh extends Es{constructor(t){super(t,ka.POINT_CLASS)}get point(){return this.node.point}render(t){if(1!==t){const e=Object.assign({},this.node);e.width*=t,e.height*=t,e.x+=(this.node.width-e.width)/2,e.y+=(this.node.height-e.height)/2,this.setRect(e)}else this.setRect(this.node)}}class Sh extends Ea{layout(t,e,s){const i=this.point._len,r=this.point._off,n=.5;let a;switch(t){case _n.NONE:a=[0,-.5*i,0,n*i];break;case _n.OPEN:const t=.15,e=.45,s=.2;a=[0,-e*i,-t*i,-s*i,0,-.5*i,t*i,-s*i,0,-e*i,0,n*i];break;default:const r=.1,h=.3;a=[0,-h*i,-r*i,-h*i,0,-.5*i,r*i,-h*i,0,-h*i,0,n*i]}const h=["M",a[0],a[1]+r];for(let t=2;t<a.length;t+=2)h.push("L",a[t],a[t+1]+r);this.rotation=e,this.setPath(h)}}class Ph extends ra{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new Un(this,Es),this.add(this._labelContainer=new pt(t,"rct-linear-gauge-band-tick-labels")),this._labels=new Un(this._labelContainer,Kt)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof fn?n.isVertical():n.vertical,h=e.position,o=this._thick=e.getThickness(a?s:i)+(h===$i.INSIDE?0:this._gap=w(e.gap,0));let l=a?o:s,c=a?i:o;const _=this._ranges=e.ranges;if(this._labelContainer.setVis(e.tickLabel.visible&&_.length>0)){const t=[_[0].fromValue].concat(_.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(_.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=p(s.getBBox().width)})),l+=e+this._labelGap}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=p(s.getBBox().height)})),c+=e}}return{width:l,height:c}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&e.position!==$i.INSIDE)&&this.$_layoutLabels(s,r,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&e>0){const t=this._vertical,i=this.model.position===$i.INSIDE,r=this.model.position===$i.OPPOSITE,n=this.width,a=this.height,h=t?a:n,o=this._thick;let l=0;return this._barViews.prepare(s.length).forEach(((c,_)=>{const u=s[_],d=h*(u.toValue-u.fromValue)/e;if(t){const t=i||r?0:n-o;c.setBounds(t,a-l-d,o,d)}else{const t=r?a-o:0;c.setBounds(l,t,d,this._thick)}c.internalClearStyleAndClass(),c.setFill(u.color),u.style&&c.addStyleOrClass(u.style),l+=d})),!0}}$_layoutLabels(t,e,s){const i=this.model.position===$i.OPPOSITE;if(this._vertical){const t=this.height,r=i?Xt.START:Xt.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let a=this._labels.get(0);a.anchor=r,a.trans(n,t-a.getBBox().height/2);for(let i=1;i<=s.length;i++){const h=t-t*s[i-1].toValue/e;a=this._labels.get(i),a.anchor=r,a.trans(n,h-a.getBBox().height/2)}}else{const t=this.width,r=i?0:this._thick;this._labels.get(0).trans(0,r);for(let i=1;i<=s.length;i++){const n=t*s[i-1].toValue/e;this._labels.get(i).trans(n,r)}}}}class Ch extends Ka{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new Es(t,"rct-linear-gauge-background")),e.add(this._bandView=new Ph(t)),e.add(this._scaleView=new Za(t)),e.add(this._valueView=new Es(t,"rct-linear-gauge-value")),e.add(this._labelView=new Kt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVis(e.visible)){const i=+e.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?e.position===$i.INSIDE?s.trans(t.x,t.y):e.position===$i.OPPOSITE?(s.trans(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.trans(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===$i.INSIDE?s.trans(t.x,t.y):e.position===$i.OPPOSITE?(s.trans(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.trans(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=this._valueView,r=t.reversed,n=t.valueBar,a=t.group?t.group.scale:t.scale;if(i.setVis(!Qn(e)&&n.visible&&!a.isEmpty()&&!isNaN(t.value)))if(i.setStyleOrClass(n.style),i.internalSetStyleOrClass(n.getStyle(s)),this._vertical){const t=e.height*a.getRate(s),n=r?e.y:e.y+e.height-t;i.setBounds(e.x,n,e.width,t)}else{const t=e.width*a.getRate(s),n=r?e.x+e.width-t:e.x;i.setBounds(n,e.y,t,e.height)}}}class Ah extends Qa{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new Za(t)),e.insertFirst(this._textView=new Kt(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVis(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVis(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale.style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=this._textView,a=Kn(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,null,NaN,NaN,r,null);const t=this._textView.getBBox().height+r.label.getGap(i);a.y+=t,a.height-=t,n.trans(this.width/2,0)}r._labelWidth=r._labelHeight=0,this._gaugeViews.forEach(((t,e)=>{const n=t.measureLabelSize(r.get(e),s,i);r._labelWidth=p(r._labelWidth,n.width),r._labelHeight=p(r._labelHeight,n.height)}));const o=(l=a)&&h({},l);var l;const c=r.itemLabel.gap;r.vertical?(o.height-=r._labelHeight+c,r.itemLabel.opposite||(o.y+=r._labelHeight+c)):(o.width-=r._labelWidth+c,r.itemLabel.opposite||(o.x+=r._labelWidth+c)),this._renderScale(r,a,o),r.vertical?this.$_layoutVert(this.doc,r,e,a):this.$_layoutHorz(this.doc,r,e,a)}_renderScale(t,e,s){const i=this._scaleView,r=t.scale,n=t.vertical?e.height:e.width,a=[];let h,o;if(this._gaugeViews.forEach(((e,s)=>{a.push(w(e._runValue,t.get(s).value))})),r.buildGroupSteps(n,a),r._vertical=t.vertical,i.setVis(r.visible)){const n=i.measure(this.doc,r,s.width,s.height,1);if(t.vertical){const t=n.width;s.width-=t,e.width-=t,o=s.y,r.position===$i.OPPOSITE?h=s.x+s.width:(h=s.x,s.x+=t,e.x+=t)}else{const t=n.height;s.height-=t,e.height-=t,h=s.x,r.position===$i.OPPOSITE?(o=s.y,s.y+=t,e.y+=t):o=s.y+s.height}i.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(t,e,s,i){const r=i.height,n=(i.width-e.itemGap*(s.count-1))/s.count,a=i.y;let h=i.x;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,r,0),s.resize(n,r),s.layout(),s.trans(h,a),h+=n+e.itemGap}))}$_layoutHorz(t,e,s,i){const r=i.width,n=(i.height-e.itemGap*(s.count-1))/s.count,a=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),r,n,0),s.resize(r,n),s.layout(),s.trans(a,h),h+=n+e.itemGap}))}}class kh extends Ka{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new Es(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new pt(t,void 0)),this._barViews=new Un(this._barContainer,Es),e.add(this._valueView=new Es(t,"rct-bullet-gauge-value")),e.add(this._targetView=new Es(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new Za(t)),e.add(this._labelView=new Kt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.group,r=t.reversed,n=this._vertical,a=i?i.scale:t.scale,h=this._valueView,o=this._targetView;if(this._barContainer.setVis(!Qn(e)&&!a.isEmpty())){const s=t.getRanges(a._min,a._max,!1)||(null==i?void 0:i.getRanges(a._min,a._max,!1));s&&(this._barContainer.setRect(e),this._barViews.prepare(s.length),n?this._barViews.forEach(((t,i)=>{const n=s[i],h=e.height*a.getRate(n.toValue-n.fromValue),o=e.height*a.getRate(n.fromValue);t.setBounds(0,r?o:e.height-o-h,e.width,h),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})):this._barViews.forEach(((t,i)=>{const n=s[i],h=e.width*a.getRate(n.toValue-n.fromValue),o=e.width*a.getRate(n.fromValue);t.setBounds(r?e.width-h-o:o,0,h,e.height),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})))}if(h.setVis(!a.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(t.valueBar.style),s<t.targetValue&&t.valueBar.belowStyle&&h.internalSetStyleOrClass(t.valueBar.belowStyle),h.internalSetStyleOrClass(t.valueBar.getStyle(s)),n){const t=e.height*a.getRate(s),i=r?e.y:e.y+e.height-t;h.setBounds(e.x+e.width/3,i,e.width/3,t)}else{const t=e.width*a.getRate(s),i=r?e.x+e.width-t:e.x;h.setBounds(i,e.y+e.height/3,t,e.height/3)}if(o.setVis(!a.isEmpty()&&!isNaN(t.targetValue)))if(o.setStyleOrClass(t.targetBar.style),n&&e.width>10){let s=e.height*a.getRate(t.targetValue);s=r?e.y+s:e.y+e.height-s,o.setBounds(e.x+5,s-1,e.width-10,3)}else if(!n&&e.height>10){let s=e.width*a.getRate(t.targetValue);s=r?e.x+e.width-s:e.x+s,o.setBounds(s-1,e.y+5,3,e.height-10)}}}class Eh extends gt{constructor(t,e,s){super(t,Eh.STYLE),this.add(this._back=new Es(t,Eh.BACK_STYLE)),this.add(this._textView=new Kt(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new ia).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}Eh.STYLE="rct-button",Eh.BACK_STYLE="rct-button-background";class Lh extends na{constructor(t,e){super(t,Lh.CLASS_NAME+" "+e,"rct-annotation-background")}update(t,e){this.measure(this.doc,this.model,t,e,0),this.layout()}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.backgroundStyle)}_doLayout(t){const e=this.model.rotation;isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Lh.CLASS_NAME="rct-annotation";class Th extends Lh{constructor(t){super(t,Th.CLASS_NAME),this.add(this._textView=new Kt(t)),this._textView.anchor=Xt.START,this._richText=new ie}_doMeasure(t,e,s,i,r){const n=this._textView;return this._richText.setFormat(e.text),this._richText.build(n,s,i,null,e._domain),qn(this._textView.getBBox())}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),super._doLayout(t)}}Th.CLASS_NAME="rct-text-annotation";class Nh extends Lh{constructor(t){super(t,Nh.CLASS_NAME),this.add(this._imageView=new ea(t,!1))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._imageView.url=this.model.imageUrl,this._imageView.resize(n.width,n.height),qn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Nh.CLASS_NAME="rct-image-annotation";class Rh extends Lh{constructor(t){super(t,Rh.CLASS_NAME),this.add(this._shapeView=new xt(t))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return ks.setShape(this._shapeView,e.shape,n.width/2,n.height/2),n}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Rh.CLASS_NAME="rct-shape-annotation";class Oh extends Ea{layout(t,e,s){const i=new Mr;i.circle(t,e,s),this.setPath(i.end())}}const Mh={area:lh,arearange:class extends hh{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new ah(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new xt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new xt(t,"rct-areanrange-series-line")),nt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r.style,a=r.visible,h=this._inverted,o=i._yAxisObj,l=h?e:s,c=h?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-o.getPos(l,s.lowValue)}const _=this._markers;for(let c=0,u=t.length;c<u;c++){const d=t[c],g=_.get(c+u);let p,m;h?(p=o.getPos(l,d.lowValue),m=_.get(c).ty+i.getRadius(d)):(p=d.xPos,m=d.yLow),g&&g.setVis(!d.isNull&&p>=0&&p<=e&&m>=0&&m<=s)&&(this._layoutMarker(g,n,p,m),g.setStyle("opacity",a||0==c&&!0===r.firstVisible||c===u-1&&!0===r.lastVisible?"1":"0"))}}_layoutLines(){super._layoutLines();const t=this._area,e=this.model;if(!this._areaContainer.setVis(e._lines.length>0))return;const s=this._buildAreas(e._lines,e.getLineType());t.setPath(s),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e.color&&t.setFill(e.color),this._setFill(t,e.style),e.areaStyle&&t.internalSetStyleOrClass(e.areaStyle)}},bar:class extends _h{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new Un(t,Ta)}needFronting(){var t,e;return(null===(t=this.model.group)||void 0===t?void 0:t._stacked)||(null===(e=this.model.group)||void 0===e?void 0:e.layout)==ai.OVERLAP}_prepareSeries(t,e){super._prepareSeries(t,e),this._rdTop=+e.topRadius||0,this._rdBottom=+e.bottomRadius||0}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}},barrange:class extends Ma{constructor(t){super(t,"rct-barrange-series"),this._bars=new Un(this._pointContainer,Ta)}_getPointPool(){return this._bars}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.cornerRadius||0}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n,this._rd,this._rd)}},bellcurve:class extends lh{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends Ma{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Un(this._pointContainer,uh)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePointViews(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},bubble:class extends Ba{constructor(t){super(t,"rct-bubble-series")}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ma.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){const s=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,i=e.length;t.getPixelMinMax(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];r.shape=t.shape,this._setPointStyle(s,t,r)}))}_getAutoPos(t){return t?Fs.OUTSIDE:Fs.INSIDE}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.needClip(!1),n=this._getGrowRate(),a=s.pointLabel,h=a.position,o=a.getOffset(),l=this._labelViews(),u=s._xAxisObj,d=s._yAxisObj,g=this._polar=s.chart.body.getPolar(u),p=d.prev(i?t:e),m=u.prev(i?e:t),w=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:f,max:x}=s.getPixelMinMax(w),b=e;let y;this._markers.forEach(((a,w)=>{const v=a.point,V=l&&(y=l.get(v,0));if(a.setVis(!v.isNull&&!isNaN(v.zValue))){const l=(v.radius=s.getRadius(v.zValue,f,x))*n;let w,S,P;if(g){const t=g.start+u.getPos(T,v.xValue),e=d.getPos(g.rd,v.yValue);S=g.cx+e*c(t),P=g.cy+e*_(t)}else S=u.getPos(m,v.xValue),P=b-d.getPos(p,v.yValue),i&&(S=d.getPos(p,v.yGroup),P=b-u.getPos(m,v.xValue));v.xPos=S,v.yPos=P,a.setVis(!r||S>=0&&S<=t&&P>=0&&P<=e)?(w=ks.circle(0,0,l),a.setPath(w),a.trans(S,P),V&&(y.setContrast(a.dom),y.layout(J.CENTER),this._layoutLabelView(y,h,o,l,S,P))):V&&V.setVis(!1)}else V&&V.setVis(!1)}))}},candlestick:class extends Ma{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Un(this._pointContainer,dh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.declineStyle&&t.addStyleOrClass(e.declineStyle)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},circlebar:class extends _h{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Un(t,Oh)}_layoutPointView(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}},dumbbell:class extends Ma{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Un(this._pointContainer,gh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},equalizer:class extends Oa{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Un(this._pointContainer,ph)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){const a=this._prevRate;isNaN(a+t.wSave)||(r=t.wSave+(r-t.wSave)*a),isNaN(a+t.xSave)||(s=t.xSave+(s-t.xSave)*a),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t._yAxisObj.axisMax(),i=t.segmented,r=t.segmentGap||0,n=this._pts=[];let a,h,o=0;for(h=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+r/2)),a=(e-r*(h-1))/h;n.length<2*h;)n.push(o,o+a),o+=a+r;n[n.length-1]=e;const l=n.length/2;this._bars.forEach((r=>{const h=r.point;if(r.setVis(!h.isNull)){const o=h.yValue/s;let c=-1,_=0;for(let t=0;t<l-1;t++)if(o>=n[2*t]/e&&o<n[2*(t+1)]/e){c=t+1,_=!i&&o<n[2*t+1]/e?o*e-n[2*t]:a;break}c<0&&(c=l,_=a),r.prepareSegments(l,c,_,t.backStyle)}}))}},errorbar:class extends Ma{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Un(this._pointContainer,mh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},funnel:class extends Ia{constructor(t){super(t,"rct-funnel-series"),this._segments=new Un(this._pointContainer,wh),this.add(this._lineContainer=new Ca(t))}_getPointPool(){return this._segments}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&ma.reveal(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=D(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=D(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return c?p+(y-p)*(f-t)/(f-v):p+(y-p)*(t-w)/(v-w)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===Fs.INSIDE,a=i.pointLabel,h=a.getOffset(),o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,_=i.getSize(t,e),u=i.getNeckSize(_.width,_.height),d=new Mr,g=i.getCenter(t,e),p=g.x-_.width/2,w=g.y-_.height/2,f=w+_.height,x=p+_.width/2,b=_.height-u.height,y=p+(_.width-u.width)/2,v=c?f-b:w+b;let V;this._lineContainer.setVis(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVis(!i.isNull)){const a=i.yPos*_.height,g=(i.yPos+i.height)*_.height,p=c?f-a:w+a,S=c?f-g:w+g;let P,C,A,k;if(a>=b?(P=y,C=P+u.width,d.move(P,p).lines(C,p,C,S,P,S),t.ny=t.nx1=NaN):g<b?(P=s(p),C=P+2*(x-P),A=s(S),k=A+2*(x-A),d.move(P,p).lines(C,p,k,S,A,S),t.ny=NaN,t.nx1=A-P,t.nx2=k-P):(P=s(p),C=P+2*(x-P),A=y,k=A+u.width,d.move(P,p).lines(C,p,k,v,k,S,A,S,A,v),t.ny=v-p,t.nx1=A-P,t.nx2=k-P),t.setPath(d.close(!0)),i.xPos=x,i.yPos=p+(S-p)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVis(!n)){const s=t.getBBox();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):m(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/m(t.ny)),this.$_layoutLabel(V,s,e,h,o,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBox();n+=e.width/2,s.setLine((new Mr).move(0,0).line(r,0).end()),s.trans(n,a),n+=r+i,t.trans(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBox();t.trans(e-i.width/2,s-i.height/2)}},heatmap:class extends ka{constructor(t){super(t,"rct-heatmap-series"),this._cells=new Un(this._pointContainer,fh)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&ma.grow(this)}_doViewRateChanged(t){this.$_layoutCells(this.width,this.height)}$_parepareCells(t,e){const s=new Yt(t._calcedColor),i=[{fill:E}];this._cells.prepare(e.length,((r,n)=>{const a=r.point=e[n];i[0].fill=s.brighten(1-a.zValue/t._heatMax).toString(),this._setPointStyle(r,t,a,i)}))}$_layoutCells(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=i?t:e,l=i?e:t,c=i?0:e;ht.log("LAYOUT CELLS",r),this._cells.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=a.getUnitLen(l,e.xValue)*r,_=h.getUnitLen(o,e.yValue)*r;let u,d=a.getPos(l,e.xValue)-s/2,g=c-h.getPos(o,e.yValue)-_/2;if(e.xPos=i?c+h.getPos(o,e.yValue):d+s/2,e.yPos=i?l-a.getPos(l,e.xValue)+s/2:g+_/2,t.setBounds(d,g,s,_),n&&(u=n.get(e,0))){const t=u.getBBox();i?(g=l-a.getPos(l,e.xValue)-t.height/2,d=c+h.getPos(o,e.yValue)):(d+=s/2,g+=(_-t.height)/2),d-=t.width/2,u.layout(J.CENTER).trans(d,g)}}}))}},histogram:class extends Ra{constructor(t){super(t,"rct-histogram-series"),this._bars=new Un(this._pointContainer,xh)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,a=this._labelViews(),o=s._xAxisObj,l=s._yAxisObj,c=i?t:e,_=i?e:t,u=l.getPos(c,s.getBaseValue(l)),d=i?0:e,g=a&&h(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.getOffset())});this._getPointPool().forEach(((s,n)=>{const h=s.point,p=o.getPos(_,h.min),m=o.getPos(_,h.max),w=l.getPos(c,h.yValue),f=m-p+(m>p?-1:1),x=w-u;let b=p+(m-p)/2,y=d;h.xPos=b,h.yPos=y-=w,this._layoutPointView(s,n,b,y+x,f,x*r),g&&(g.labelView=a.get(h,0))&&(i&&(y=_-b,b=d,h.yPos=y,h.xPos=b+=l.getPos(c,h.yGroup)),g.pointView=s,g.x=b,g.y=y,g.wPoint=f,g.hPoint=x,this._layoutLabel(g,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPos(t,o.min),c=s.getPos(t,o.max),_=l+(c-l)/2,u=i.getPos(e,a.point.yValue)*n,d=p(1,c-l-1);o.xPos=_,o.yPos=r-u,a.wPoint=d,a.hPoint=u,a.layout(_,r)}))}},line:oh,lollipop:class extends Oa{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i-n,0,n),t.layout()}$_parepareBars(t,e,s){const i=e.marker.style;this._bars||(this._bars=new Un(this._pointContainer,bh)),this._bars.prepare(s.length,((t,r)=>{const n=t.point=s[r];this._setPointStyle(t,e,n),i&&t._marker.setStyleOrClass(i)}))}},ohlc:class extends Ma{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Un(this._pointContainer,yh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this.$_prepareSticks(e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.declineStyle&&t.addStyleOrClass(e.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},pareto:class extends hh{constructor(t){super(t,"rct-pareto-series")}},pie:class extends Ia{constructor(t){super(t,"rct-pie-series"),this._sectors=new Un(this._pointContainer,vh,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Fa(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new sa(t,"rct-pie-series-inner")),this._textView._text.anchor=Xt.MIDDLE,this.add(this._lineContainer=new Ca(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null,null),e.innerText.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s.group,r=Math.floor(i?i.getPolarSize(t,e)/2:s.getRadius(t,e)),n=i?i.getInnerRadius(r)*r:s.getInnerRadius(r),a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&ma.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof vh){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0),!this.model.autoSlice&&this.invalidate()}}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}getClipContainer(){return null}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getGrowRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=D(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.clockwise,n=this._getGrowRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,l=this._rd,u=this._rdInner,d=i.pointLabel,g=this._labelViews(),p=i.getLabelPosition()===Fs.INSIDE,w=d.getOffset(),f=d.distance||0,x=this._lineContainer,b=this._slicedOff=i.getSliceOffset(l)*n;let y;if(this._textView.visible){const t=this._textView.getBBox();this._textView.trans(h,o-t.height/2)}(this._circle.visible=this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const a=t.point;if(a.isNull)t.setVis(!1),g&&(y=g.get(a,0))&&y.setVis(!1),null===(s=x.get(a))||void 0===s||s.setVis(!1);else{const s=a.startAngle;let d=0,v=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;d+=c(t)*b,v+=_(t)*b}t.trans(d,v).setVis(!0);const V=a.startAngle+a.angle/2;if(a.xPos=h+c(V)*(b+.7*l),a.yPos=o+_(V)*(b+.7*l),t.setPieSector(g,null,{cx:h,cy:o,rx:l,ry:l,innerRadius:u,start:s,angle:m(a.angle),clockwise:i.clockwise}),g&&(y=g.get(a,0))){const e=x.get(a);e.setVis(!p)?this.$_layoutLabel(a,y,e,w,f,a.sliced?b:0,r):(e.visible=!1,this.$_layoutLabelInside(a,y,w,0,a.sliced?b:0)),y.setContrast(p&&t.dom).setVis(!0)}else null===(e=x.get(a))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBox(),o=t.startAngle+t.angle/2;let l=this._cx,u=this._cy,d=this._rd+.8*r,g=c(o)*n,p=_(o)*n,m=l+c(o)*this._rd,w=u+_(o)*this._rd,f=l+c(o)*d,x=u+_(o)*d;const b=f<l;let y;y=b?f-.2*r:f+.2*r,s&&s.setVis(d>0)&&(s.setLine((new Mr).move(0,0).quad(f-m,x-w,y-m,x-w).end()),s.setPos(m,w),!e.isDomAnimating()&&s.trans(m+g,w+p)),b?(y-=h.width+i,x-=h.height/2):(y+=i,x-=h.height/2),e.setPos(y,x),!e.isDomAnimating()&&e.layout(J.CENTER).trans(y+g,x+p)}$_layoutLabelInside(t,e,s,i,r){const n=e.getBBox(),a=this._rd*this._rdInner,h=(a>0?a+(this._rd-a)/2:.7*this._rd)+s,o=t.startAngle+t.angle/2;let l=this._cx+c(o)*h,u=this._cy+_(o)*h;e.move(l-n.width/2,u-n.height/2),l=this._cx+c(o)*(r+h),u=this._cy+_(o)*(r+h),e.layout(J.CENTER).trans(l-n.width/2,u-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.autoSlice?i.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2;(n.sliced=e)?t.transEx(c(a)*this._slicedOff,_(a)*this._slicedOff,r):t.transEx(0,0,r);const h=this._labelViews();if(h){const t=i.pointLabel,a=this._lineContainer,o=i.getLabelPosition()===Fs.INSIDE,l=h.get(n,0);if(l){const h=!o&&a.get(n);if(s&&(o?this.$_layoutLabelInside(n,l,t.getOffset(),t.distance,this._slicedOff):this.$_layoutLabel(n,l,h,t.getOffset(),t.distance,this._slicedOff,i.clockwise)),e){let t=l.tx,e=l.ty;l.trans(l.x,l.y),l.transEx(t,e,r),h&&(t=h.tx,e=h.ty,h.trans(h.x,h.y),h.transEx(t,e,r))}else l.trans(l.tx,l.ty),l.transEx(l.x,l.y,r),h&&(h.trans(h.tx,h.ty),h.transEx(h.x,h.y,r))}}}},scatter:class extends Ba{constructor(t){super(t,"rct-scatter-series")}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,ma.grow(this))}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setFill(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return Fs.OUTSIDE}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.needClip(!1),n=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart.body.getPolar(n),o=this._getGrowRate(),l=s.jitterX,u=s.jitterY,d=s.pointLabel,g=d.position,p=d.getOffset(),m=this._labelViews(),w=a.prev(i?t:e),f=n.prev(i?e:t),x=e;let b;this._markers.forEach(((d,y)=>{const v=d.point,V=m&&(b=m.get(v,0));if(d.setVis(!v.isNull)){const m=s.getShape(v),y=s.radius*o,S=ht.jitter(v.xValue,l),P=ht.jitter(v.yGroup,u);let C,A,k;if(h){const t=h.start+n.getPos(T,S),e=a.getPos(h.rd,P)*o;A=h.cx+e*c(t),k=h.cy+e*_(t)}else A=n.getPos(f,S),k=x-a.getPos(w,P),i&&(A=a.getPos(w,P),k=x-n.getPos(f,S));if(v.xPos=A,v.yPos=k,d.setVis(!!h||!r||A>=0&&A<=t&&k>=0&&k<=e)){switch(m){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":C=ks[m](0-y,0-y,2*y,2*y);break;default:C=ks.circle(0,0,y)}d.setPath(C),d.trans(A,k),V&&this._layoutLabelView(b,g,p,y,A,k)}else V&&V.setVis(!1)}else V&&V.setVis(!1)}))}},treemap:class extends ka{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new Un(this._pointContainer,Vh)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._rootView?this.$_renderGroups(t,e):this.$_renderLeafs(t,e)}_runShowEffect(t){t&&ma.grow(this)}_doViewRateChanged(t){this._rootView?this.$_renderGroups(this.width,this.height):this.$_renderLeafs(this.width,this.height)}$_renderLeafs(t,e){const s=this.model,i=s._xAxisObj,r=s._yAxisObj,n=this._inverted,a=this._getGrowRate(),h=this._labelViews(),o=n?t:e,l=n?e:t,{roots:c,leafs:_}=s.buildMap(l,o),u=new Yt(s._calcedColor);let d;null==h||h.prepare(this.doc,this),this._nodeViews.prepare(_.length,((t,e,s)=>{const c=_[e],g=c.point,p=c.parent;let m=u;p&&(!p._color&&p.point.color?m=p._color=new Yt(p.point.color):p._color&&(m=p._color)),t.node=c,t.setFill(m.brighten(c.index/s).toString()),i.reversed&&(c.x=l-c.x-c.width),r.reversed&&(c.y=o-c.y-c.height),n&&(c.y=c.y-o),t.render(a);let w=c.x+c.width/2,f=c.y+c.height/2;if(g.xPos=n?-c.y-c.height/2:w,g.yPos=n?l-c.x-c.width/2:f,h&&(d=h.get(g,0))){const e=d.getBBox();d.setVis(c.width>=e.height&&c.height>=e.height)&&(n?(w=-c.y-c.height/2-e.width/2,f=l-c.x-(c.width+e.height)/2):(w-=e.width/2,f-=e.height/2),d.setContrast(t.dom),d.layout(J.CENTER).trans(w,f))}}))}$_renderGroups(t,e){}},vector:class extends ka{constructor(t){super(t,"rct-vector-series"),this._arrows=new Un(this._pointContainer,Sh)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model,i=s.startAngle,r=s.arrowHead,n=s._xAxisObj,a=s._yAxisObj,h=this._inverted,o=h?t:e,l=h?e:t,c=this._getGrowRate(),_=h?0:e;this._pointContainer.invert(h,e),this._arrows.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=n.getUnitLen(l,e.xValue)*c,u=a.getUnitLen(o,e.yValue)*c;let d=n.getPos(l,e.xValue)-s/2,g=_-a.getPos(o,e.yValue)-u/2;e.xPos=h?_+a.getPos(o,e.yValue):d+s/2,e.yPos=h?l-n.getPos(l,e.xValue)+s/2:g+u/2,t.trans(d,g),t.layout(r,e.angleValue+i,!1)}}))}_runShowEffect(t){t&&ma.fadeIn(this)}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},waterfall:class extends Ma{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Un(this._pointContainer,Ta),this.add(this._lineContainer=new pt(t,"rct-waterfall-series-lines")),this._lines=new Un(this._lineContainer,wr)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.cornerRadius||0}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd),e>0){const t=this._lines.get(e-1),h=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPointViews(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}},Dh={circle:ih,linear:Ch,bullet:kh,clock:class extends ja{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new Fa(t,"rct-clock-gauge-face")),e.add(this._rimView=new Ga(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Kt(t,"rct-clock-gauge-label")),this._labelView.layout=Ut.MIDDLE,e.add(this._tickContainer=new pt(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new pt(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new xt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new xt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new xt(t,"rct-clock-gauge-second")),e.add(this._pinView=new Fa(t,"rct-clock-gauge-pin")),this._tickViews=new Un(this._tickContainer,wr,"rct-clock-gauge-tick"),this._minorTickViews=new Un(this._tickContainer,wr,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new Un(this._tickLabelContainer,Kt,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/p(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Ut.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtendts(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),m(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const h=n-a;let o=h-this.model.tick.length,l=N,u=T/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+c(l)*h,r+_(l)*h,i+c(l)*o,r+_(l)*o),l+=u})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,l=N,u=T/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=u,t++),e.setLine(i+c(l)*h,r+_(l)*h,i+c(l)*o,r+_(l)*o),l+=u,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=T/12*t;l=N,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBox().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.trans(i+c(l)*o,r+_(l)*o),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVis(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.label.position?s.trans(i,r+o/2):s.trans(i,r-o/2))}$_getNow(){const t=this.model.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:h,rd:o}=e,l=new Mr;let c,_,u,d;c=t.hourHand,_=this._hourView,_.setVis(c.visible)&&(d=T*(i/12+r/60/12+n/60/60/12),u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*O)),c=t.minuteHand,_=this._minuteView,_.setVis(c.visible)&&(d=T*(r/60+n/60/60),u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*O)),c=t.secondHand,_=this._secondView,_.setVis(c.visible)&&(d=this._secRate<1?T*(this._aniSec+this._secRate)/60:T*n/60,u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*O),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new rh(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends Qa{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new Un(t,ih)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(g(s,i));n.setChildExtents(h),s=i=2*h.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.trans(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends Ah{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new Ph(t),this._scaleView)}_createPool(t){return new Un(t,Ch)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVis(r.visible)){const h=+r.gap||0,o=i.measure(this.doc,r,s.width,s.height,1);if(t.vertical){const t=o.width+h;s.width-=t,e.width-=t,a=s.y,r.position===$i.OPPOSITE?n=s.x+s.width+h:(n=s.x,s.x+=t,e.x+=t)}else{const t=o.height+h;s.height-=t,e.height-=t,n=s.x,r.position===$i.OPPOSITE?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+h}i.resizeByMeasured().layout().trans(n,a)}}},bulletgroup:class extends Ah{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new Un(t,kh)}}},Bh={text:Th,image:Nh,shape:Rh};function $h(t,e){return new(Bh[e._type()])(t)}function Ih(t,e){return new(Mh[e._type()])(t)}class Fh extends ra{constructor(t){super(t,"rct-axis-grid"),this._lines=new Un(this,wr)}_doMeasure(t,e,s,i,r){return Jn.create(s,i)}_doLayout(){const t=this.model,e=t.axis,s=e.reversed,i=this.width,r=this.height,n=t.getPoints(e._isHorz?i:r),a=this._lines.prepare(n.length,(t=>{t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e.grid.style),t.setClass("rct-axis-grid-line")})),h=a.count-1;let o,l;a.forEach(((t,s)=>{t.setBoolData("first",0===s),t.setBoolData("last",n[s]===(e._isHorz?i:r))})),e._isHorz?a.forEach(((a,o)=>{l=0===o?t.firstVisible||!s&&n[o]>0||s&&n[o]<i:o!==h||(t.lastVisible||!s&&n[o]<i||s&&n[o]>0),a.setVis(!0)&&a.setVLine(e.prev(n[o]),0,r)})):a.forEach(((a,c)=>{o=r-n[c],l=0===c?t.firstVisible||!s&&o<r||s&&o>0:c!==h||(t.lastVisible||!s&&o>0||s&&o<r),a.setVis(l)&&a.setHLine(r-e.prev(n[c]),0,i)}))}}class zh extends gt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new xt(t)),this._mask.setStroke("none"),this.add(this._upLine=new xt(t)),this._upLine.setFill("none"),this.add(this._downLine=new xt(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this._clip?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new Mr;if(s){let t=0,s=0,n=i/2,a=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class Hh extends gt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new sa(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.text)&&(this._labelView.setModel(t,e.label,null,null),this._labelView.setStyles(e.label.style))}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,null,null),this._labelView.layout(J.CENTER)),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class Gh extends Hh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Ha:wr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this._line.setStyles(e.style)}_doLayout(t,e){const s=this.model,i=s.label,r=this._line,n=this._labelView.setVis(i.visible)&&this._labelView,a=n.getBBox(),h=w(i.offsetX,0),o=w(i.offsetY,0);let l,c;if(this.vertical()){const _=s.axis.getPos(t,s.value);if(n.setVis(r.setVis(!isNaN(_)))&&(r.setVLineC(_,0,e),n)){switch(i.align){case J.CENTER:l=_-a.width/2+h;break;case J.RIGHT:l=_+h;break;default:l=_-a.width-h}switch(i.verticalAlign){case tt.BOTTOM:c=e-a.height-o;break;case tt.MIDDLE:c=(e-a.height)/2-o;break;default:c=o}}}else{const _=e-s.axis.getPos(e,s.value);if(n.setVis(r.setVis(!isNaN(_)))&&(r.setHLineC(_,0,t),n)){switch(i.align){case J.CENTER:l=(t-a.width)/2-h;break;case J.RIGHT:l=t-a.width-h;break;default:l=h}switch(i.verticalAlign){case tt.BOTTOM:c=_+o;break;case tt.MIDDLE:c=_-a.height/2-o;break;default:c=_-a.height-o}}}n&&n.trans(l,c)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),h=i.axis.getPos(s.rd,i.value);r.setArc(s.cx,s.cy,h,a,i.axis.getTotalAngle(),!1),r.setStyle(Y,"none"),n&&n.trans(s.cx+h*c(s.start),s.cy+h*_(s.start))}}class jh extends Hh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Ga:Ls)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e),this._box.setStyleOrClass(e.style)}_doLayout(t,e){const s=this.model,i=s.label,r=this._box,n=g(s.startValue,s.endValue),a=p(s.startValue,s.endValue),h=this._labelView.setVis(i.visible)&&this._labelView,o=h.getBBox(),l=w(i.offsetX,0),c=w(i.offsetY,0);if(this.vertical()){const _=s.axis.getPos(t,n),u=s.axis.getPos(t,a);if(!isNaN(_)&&!isNaN(u)&&h.setVis(r.setVis(u!==_))){let s,n;switch(i.align){case J.CENTER:s=_+(u-_-o.width)/2+l;break;case J.RIGHT:s=u-o.width-l;break;default:s=_+l}switch(i.verticalAlign){case tt.BOTTOM:n=e-o.height-c;break;case tt.MIDDLE:n=(e-o.height)/2-c;break;default:n=c}r.setBox(_,0,u,e),h&&h.trans(p(0,g(t,s)),n)}}else{const _=e-s.axis.getPos(e,n),u=e-s.axis.getPos(e,a);if(!isNaN(_)&&!isNaN(u)&&h.setVis(r.setVis(_!==u))){let e,s;switch(i.align){case J.CENTER:e=(t-o.width)/2-l;break;case J.RIGHT:e=t-o.width-l;break;default:e=l}switch(i.verticalAlign){case tt.BOTTOM:s=_-o.height-c;break;case tt.MIDDLE:s=u+(_-u-o.height)/2-c;break;default:s=u+c}h&&h.trans(e,s),r.setBox(0,u,t,_)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),h=i.axis.getPos(s.rd,i.startValue),o=i.axis.getPos(s.rd,i.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:o,ry:o,innerRadius:h/o,start:a,angle:T,clockwise:!0}),n){const t=h+(o-h)/2;n.trans(s.cx+t*c(s.start),s.cy+t*_(s.start))}}}class Wh extends pt{constructor(){super(...arguments),this._views=new Un(this,xt)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e,s){const i=this._rows;this._views.prepare(i.length),this._views.forEach(((s,r)=>{const n=i[r];if(n.axis._isHorz){const i=n.axis.getPos(t,n.from),r=n.axis.getPos(t,n.to);s.setPath(ks.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(ks.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class Yh extends pt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof jh?this._rangePool.push(e):this._linePool.push(e)}}addAll(t,e,s){e.forEach((e=>{let i;e instanceof Ge?i=this._rangePool.pop()||new jh(t,s):e instanceof He&&(i=this._linePool.pop()||new Gh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Xh extends xt{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,a=n._isHorz,h=new Mr;if(this._bar){const o=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.showAlways&&(l=n.reversed?n.xValueAt(a?i-e:s):n.xValueAt(a?e:r-s)),!isNaN(l)){const t=n.getPos(o,l);let e=n.getUnitLen(o,l);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,i,e)}}else(t||this.model.showAlways)&&(a?h.vline(e,0,r):h.hline(s,0,i));this.setPath(h.end())}}class Uh extends Eh{constructor(t){super(t,"Reset Zoom",Uh.CLASS_NAME),this.setVis(!1)}}Uh.CLASS_NAME="rct-reset-zoom";class Zh extends ra{constructor(t,e){super(t,Zh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._focused=null,this._owner=e,this.add(this._hitTester=new Es(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Es(t,"rct-body-background")),this.add(this._image=new ea(t,!0,"rct-body-image")),this.add(this._gridRowContainer=new Wh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new pt(t,"rct-axis-grids")),this.add(this._baseContainer=new pt(t,"rct-axis-bases")),this.add(this._guideContainer=new Yh(t,"rct-axis-guides")),this.add(this._annotationContainer=new pt(t,"rct-annotations")),this.add(this._seriesContainer=new pt(t,"rct-series-container")),this.add(this._axisBreakContainer=new pt(t,"rct-axis-breaks")),this.add(this._labelContainer=new pt(t,"rct-label-container")),this.add(this._frontGuideContainer=new Yh(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new pt(t,"rct-front-annotations")),this.add(this._feedbackContainer=new pt(t,"rct-feedbacks")),this.add(this._zoomButton=new Uh(t)),this._crosshairViews=new Un(this._feedbackContainer,Xh)}prepareRender(t,e){this._animatable=dt._animatable&&e.animatable(),this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),this._prepareGauges(t,e,e._getGauges().getVisibles()),this._prepareAnnotations(t,e.body.getAnnotations())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let n,a;if(e instanceof SVGElement&&(e.classList.contains(ka.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(ka.POINT_CLASS)))for(let t=this._seriesViews.length-1;t>=0;t--)if(a=this._seriesViews[t].pointByDom(e),a){n=this._seriesViews[t];break}const h=null==e?void 0:e.classList,o=(null==h?void 0:h.value)&&(h.contains("rct-contextmenu-item")||h.contains("rct-contextmenu-list"));return this._zoomRequested||this._crosshairViews.forEach((e=>{e.setVis(r&&!o)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n,a,t):this.$_setFocused(null,null,t),r}hoverSeries(t){const e=this._seriesMap.get(t);this.$_hoverSeries(e)}$_setFocused(t,e,s){if(e!=this._focused||this.model.chart.tooltip.followPointer){let i=this._focusedSeries;e!=this._focused&&(this._focused&&i.setFocusPoint(this._focused,null),e&&t.setFocusPoint(e,s)),this._focused=e,t!==i&&(i&&this.$_focusSeries(i,!1),i=this._focusedSeries=t,i&&this.$_focusSeries(i,!0),this.chart().options.seriesHovering&&this.$_hoverSeries(t)),this._focused?this._owner.showTooltip(t.model,e.point,this,s):this._owner.hideTooltip()}}$_focusSeries(t,e){e?t.model.group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model.group===t.model.group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData("unfocus",t&&e!==t),e._labelContainer.setBoolData("unfocus",t&&e!==t)}))}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===t))}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),a=r.xAxis,h=n?this.height:this.width,o=a.valueAt(h,n?h-i:t),l=a.valueAt(h,n?h-e:s);a.zoom(o,l)&&(this._zoomRequested=!0)}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=e.chart;if(this._polar=n.isPolar(),this._zoomRequested=!1,this._background.setStyleOrClass(e.style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)})),this._zoomButton.setVis(e.zoomButton.isVisible())&&this._zoomButton.layout(),Jn.create(s,i)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._hitTester.resize(t,e),this._background.resize(t,e),s.setVis(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{s.model.needClip(!1)&&this._owner.clipSeries(s.getClipContainer(),s.getClipContainer2(),0,0,t,e,s.clipInvertable()),s.resize(t,e),s.trans(0,0),s.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();for(const s of this._baseViews.values()){const i=s.tag;s.setStyleOrClass(i.baseLine.style),i._isHorz?s.setVLine(i.getPos(t,i.getBaseValue()),0,e):s.setHLine(i.getPos(e,i.getBaseValue()),0,t)}this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.trans(t-i._sect.pos,0):s.trans(i._sect.pos,0):r.reversed?s.trans(0,i._sect.pos):s.trans(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),this._guideClip?this._guideClip.resize(t,e):this._guideClip=this.control.clipBounds(0,0,t,e),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e))),s.setClip(this._guideClip)})),this._gridRowContainer.layout(t,e,!1)}this.$_prepareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().transp(s.getPosition(t,e))})),this._layoutAnnotations(this._inverted,t,e),this._zoomButton.visible&&this._zoomButton.trans(t-this._zoomButton.getBBox().width-10,10)}$_createGaugeView(t,e){return new(Dh[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,a=this._baseViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible(!1)||(r.get(t).remove(),r.delete(t));for(const t of a.keys())(!s||!e.containsAxis(t)||t instanceof bi&&!t.baseLine.visible||!t.isBaseVisible())&&(a.get(t).remove(),a.delete(t));s&&[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if(e.grid.isVisible(!1)&&!r.has(e)){const s=new Fh(t);r.set(e,s),i.add(s)}if(e instanceof bi&&e.baseLine.visible&&e.isBaseVisible()&&!a.has(e)){const s=new wr(t,"rct-axis-baseline");a.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s){const i=this._inverted=e.isInverted(),r=this._seriesMap,n=this._seriesViews;for(const t of r.keys())s.indexOf(t)<0&&r.delete(t);this._series=s,n.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),n.length=0,s.forEach((s=>{const a=r.get(s)||Ih(t,s);a._setChartOptions(i,this._animatable,e.loadAnimatable()),a.parent||(this._seriesContainer.add(a),this._labelContainer.add(a._labelContainer)),r.set(s,a),n.push(a),a.prepareSeries(t,s)})),this._seriesContainer.sort(n),n.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((s=>{const h=n.get(s)||this.$_createGaugeView(t,s);i.add(h),n.set(s,h),a.push(h),h.prepareGauge(t,s),h._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||$h(t,e);(e.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof yi&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new zh(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e])}))}_layoutAnnotations(t,e,s){this._annotationViews.forEach((i=>{i.resizeByMeasured(),i.layout().transp(i.model.getPosition(t,0,0,e,s,i.width,i.height))}))}}Zh.BODY_CLASS="rct-body";class Kh extends gt{constructor(t){super(t,qh.HANDLE_STYLE),this.add(this._back=new Es(t)),this.add(this._shape=new xt(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*g(t,e);const r=new Mr;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class qh extends ra{static isHandle(t){return t.parentElement.classList.contains(qh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(qh.MASK_STYLE)}constructor(t){super(t,qh.CLASS_NAME),this.add(this._back=new Es(t,qh.BACK_STYLE)),this.add(this._container=new pt(t,null)),this.add(this._mask=new Es(t,qh.MASK_STYLE)),this.add(this._trackView=new Es(t,qh.TRACK_CLASS)),this.add(this._thumbView=new Es(t,qh.THUMB_CLASS)),this.add(this._startHandle=new Kh(t)),this.add(this._endHandle=new Kh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let a=s,h=i;return e._vertical?a=e.thickness+e.gap+e.gapFar:h=e.thickness+e.gap+e.gapFar,e._naviChart.layoutAxes(a,h,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis.calcPoints(a,1),e._naviChart.yAxis.calcPoints(h,1),{width:a,height:h}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=this.width,r=this.height;if(this._back.resize(i,r),e._vertical);else{const t=s?(s.start-s.min)*i/s.total():0,e=s?(s.end-s.min)*i/s.total():i;this._mask.setBounds(t,0,e-t,r),this._trackView.setBounds(-2,r,i+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,r,e-t,6),this._startHandle.layout(r/3,r/3,!1),this._startHandle.trans(t,r+3),this._endHandle.layout(r/3,r/3,!1),this._endHandle.trans(e,r+3)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=Ih(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new pa(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new pa(t)),i._simpleMode=!0)}}qh.CLASS_NAME="rct-navigator",qh.BACK_STYLE="rct-navigator-back",qh.MASK_STYLE="rct-navigator-mask",qh.HANDLE_STYLE="rct-navigator-handle",qh.HANDLE_BACK_STYLE="rct-navigator-handle-back",qh.TRACK_CLASS="rct-navigator-track",qh.THUMB_CLASS="rct-navigator-thumb";class Qh extends vt{constructor(t){super(),this.chart=t}}class Jh extends Qh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._xStart=e-(a.x-n.x),this._yStart=s-(a.y-n.y),this._body.addFeedback(this._feedback=new Es(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e-=i.y-s.y,this._body.setZoom(0,g(this._yStart,e),this._body.width,p(this._yStart,e))):(t-=i.x-s.x,this._body.setZoom(g(this._xStart,t),0,p(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._vertical?(r-=a.y-n.y,this._feedback.setBounds(0,g(this._yStart,r),this._body.width,m(this._yStart-r))):(i-=a.x-n.x,this._feedback.setBounds(g(this._xStart,i),0,m(this._xStart-i),this._body.height)),!0}}class to extends Qh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,a=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y:e-a.x,this._zoomLen=n.model.axis._zoom.length(),!0}_doDrag(t,e,s,i,r){const n=this._view;let a;return n._vertical?(a=n.svgToElement(i,r).y-this._startOff,a=n.getZoomPos(n.height-a-n._thumbView.height),n.model.axis.zoom(a,a+this._zoomLen)):(a=n.svgToElement(i,r).x-this._startOff,a=n.getZoomPos(a),n.model.axis.zoom(a,a+this._zoomLen),console.log(a)),!0}}class eo extends Qh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}_doStart(t,e,s,i,r){const n=this._handleView,a=n.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y-n.height/2:e-a.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axis();a._prepareZoom();let h=n.svgToElement(i,r).x-this._startOff;const o=a._zoom.total(),l=a._zoom.min,c=n.model.minSize;return this._handleView._vertical?this._isStart:this._isStart?h>0?a.zoom(h*o/n.width+l,NaN,c):a.zoom(l,NaN,c):h>0&&h<n.width?a.zoom(NaN,h*o/n.width+l,c):h>=n.width&&a.zoom(NaN,a._zoom.max,c),!0}}class so extends Qh{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),a=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-a.y:e-a.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(a*this._totalLen/n.height):this.$_moveZoom(a*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=p(0,g(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class io{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),{x:s,y:i}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const r=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||i<0||i>=e.control.dom().offsetHeight||(r?this.$_doDrag(t,n,s,i):(!this._dragTracker&&(m(this._clickX-s)>3||m(this._clickY-i)>3)||this._dragTracker&&!r)&&this.$_startMove(t,n,s,i))}this._prevX=s,this._prevY=i,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(t.target)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=this._clickElement,i=e.getButton(s);let r,n,a;if(i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof Ms){const t=n.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof Ia&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.pageX-e.left,y:t.pageY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return da.isThumb(t)?new to(this._chart,i.getScrollView(t)):qh.isHandle(t)?new eo(this._chart,i._navigatorView,t):qh.isMask(t)&&r&&r.model.isZoomed()?new so(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Jh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}$_startDrag(t,e,s,i,r){return this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.isDragging()&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}}class ro extends pt{constructor(t){super(t,ro.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Kt(t,"rct-history-item");e.anchor=Xt.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Kt(t);e.anchor=Xt.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].transX(n),a<r-1&&(n+=e[a].width+i,s[a].transX(n),n+=s[a].width+i)}}ro.TITLE_CLASS="rct-history";class no extends ra{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Es(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Kt(t,"rct-legend-item-label")),this._label.anchor=Xt.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const n=this._marker.setVis(e.legend.markerVisible)?this._marker.getBBox():Zn,a=qn(this._label.getBBox());return this._gap=w(e.legend.markerGap,0),Jn.create(n.width+this._gap+a.width,p(n.height,a.height))}_doLayout(){const t=this._marker.visible?this._marker.getBBox():Zn;this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans(0,(this.height-t.height)/2),this._label.trans(t.width+this._gap,(this.height-this._label.getBBox().height)/2)}}class ao extends na{constructor(t){super(t,ao.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Un(this,no)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===hs.VERTICAL;return this._ipr=w(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==as.BODY?w(e.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,a=t.itemGap||0,h=this._margins,o=this._paddings,l=this._vertical,c=h.left+o.left,_=h.top+o.top;let u,d=c,g=_;this._itemViews.forEach((t=>{const e=t.model.source.legendColor();t._marker.setColor(e),s&&t.model.source.visible?t._label.setFill(e):t._label.setFill(""),t.resizeByMeasured().layout()})),e.forEach(((t,e)=>{l?(g=_,r!==os.CENTER&&r!==os.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1)+h.top+h.bottom+o.top+o.bottom,r===os.CENTER?g+=(this.height-u)/2:g+=this.height-u),t.forEach((t=>{t.trans(d,g),g+=t.height+a})),d+=i[e]+n):(d=c,r!==os.CENTER&&r!==os.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1)+h.left+h.right+o.left+o.right,r===os.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.trans(d,g),d+=t.width+a})),g+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.items(),h=this._itemViews,o=e.itemGap||0,l=e.lineGap||0,c=h.count,_=this._rowViews=[],u=this._sizes=[];let d,g,m,w;h.forEach(((s,i)=>{s.setMarker(a[i].source.legendMarker(t,e.markerSize)),s.measure(t,a[i],r,n,1)}));let f=0,x=0;if(s){for(;f<c;)w=h.get(f),x%i==0?(_.push(m=[w]),g=w.mh,x++,f++):(g+=o+w.mh,g<=n?(m.push(w),x++,f++):x=0);d=g=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{s+=t.mh,e=p(e,t.mw)})),s+=o*(t.length-1),g=p(g,s),d+=e,u.push(e)})),d+=l*(_.length-1)}else{for(;f<c;)w=h.get(f),x%i==0?(_.push(m=[w]),d=w.mw,x++,f++):(d+=o+w.mw,d<=r?(m.push(w),x++,f++):x=0);d=g=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=p(s,t.mh)})),e+=o*(t.length-1),d=p(d,e),g+=s,u.push(s)})),g+=l*(_.length-1)}return Jn.create(d,g)}}ao.LEGEND_CLASS="rct-legend";let ho=class extends aa{constructor(){super(...arguments),this.views=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views,a=[];for(this.isX=e,s&&s._axes.forEach((t=>{a.push(t)}));n.length<a.length;){const e=new pa(t);this.add(e),n.push(e)}for(;n.length>a.length;)n.pop().remove();if(n.forEach(((e,s)=>{const r=a[s];r._runPos,e.model=a[s],i.forEach((s=>{s.forEach((s=>{s.isConnected(r)&&e.prepareGuides(t,s.row,s.col,s._guideContainer,s._frontGuideContainer)}))}))})),this.axes=a,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((a,h)=>{e+=a.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((a,h)=>{e+=a.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){this.isHorz?this.views.forEach((t=>{t.resize(this.width,t.mh),t.layout()})):this.views.forEach((t=>{t.resize(t.mw,this.height),t.transX(this.width-t.mw),t.layout()}))}};class oo extends aa{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new ho(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((n,a)=>{this.isX?(n.row=i,n.col=a):(n.col=i,n.row=a),n.prepare(t,this.isX,r[a],e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):0}checkHeights(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){let n=0,a=0;return this._isHorz?this.sections.forEach((n=>{a=p(a,n.measure(t,e,s,i,r).height)})):this.sections.forEach((a=>{n=p(n,a.measure(t,e,s,i,r).width)})),{width:n,height:a}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height).trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]).trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class lo extends Zh{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(t,e){const s=this.row,i=this.col,r=e.split.getPane(s,i).body,n=e._getSeries().getPaneSeries(s,i),a=e._getGauges().getPaneVisibles(s,i);this._animatable=dt._animatable&&e.animatable(),this._prepareSeries(t,e,n),this._prepareGauges(t,e,a),this._prepareAnnotations(t,r.getAnnotations())}}class co extends pt{constructor(t,e){super(t,co.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r,n,a){const h=e.chart,o=this._inverted=e.chart.isInverted(),l=r,c=n;this.$_prepareAxes(t,s,!0),this.$_prepareAxes(t,i,!1),e.layoutAxes(r,n,o,a),o?(r-=this._xContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0),n-=this._yContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0)):(n-=this._xContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0),r-=this._yContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0)),e.layoutAxes(r,n,o,a),this._xContainers.forEach((e=>e.measure(t,h,r,n,a))),this._yContainers.forEach((e=>e.measure(t,h,r,n,a))),r=l,n=c,o?(r-=this._xContainers.reduce(((t,e)=>t+e.mw),0),n-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(n-=this._xContainers.reduce(((t,e)=>t+e.mh),0),r-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),e.layoutAxes(r,n,o,a),this._xContainers.forEach((e=>e.measure(t,h,r,n,a))),this._yContainers.forEach((e=>e.measure(t,h,r,n,a)));const _=e.getXLens(o?n:r),u=e.getYLens(o?r:n);e.calcAxesPoints(_,u)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new Es(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new pt(t,E)),this.add(this._axisContainer=new pt(t,E)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount(),r=this._bodies,n=this._bodyMap=[];for(;r.length<i;){const e=new lo(t,this._owner);this._bodyContainer.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();for(let t=0;t<e.rowCount();t++){const s=[];for(let i=0;i<e.colCount();i++){const n=r[t*e.colCount()+i];s.push(n),n.row=t,n.col=i}n.push(s)}r.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new oo(t,s);this._axisContainer.add(e),i.push(e)}for(;i.length>r;)i.pop().remove();i.forEach(((s,i)=>{s.prepare(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=new Array(2*(e+1)),n=s-t.reduce(((t,e)=>t+e[i]),0),a=new Array(e);let h=0,o=0;for(o=0;o<e;o++)a[o]=n/e;for(o=0;o<e;o++)r[2*o]=h,r[2*o+1]=h+=t[o][i],h+=a[o];return r[2*o]=h,r[2*o+1]=h+t[o][i],r}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),e,"mw"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),s,"mh")):(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),s,"mh"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),e,"mw"))}$_layoutAxes(t,e,s,i){const r=this._rowPoints,n=this._colPoints,a=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=n[1],e=n[n.length-2]-t;a.forEach(((t,s)=>{t.resize(t.mw,e).trans(r[2*s],i-n[n.length-2]),t.layout(n)}))}else{const t=r[1],e=r[r.length-2]-t;a.forEach(((s,a)=>{s.resize(e,s.mh).trans(t,i-n[2*a+1]),s.layout(r)}))}else if(e){const t=n[1];s=n[n.length-2]-t,a.forEach(((e,a)=>{e.resize(s,e.mh).trans(t,i-r[2*a+1]),e.layout(n)}))}else{const t=r[r.length-2],e=t-r[1];a.forEach(((s,a)=>{s.resize(s.mw,e).trans(n[2*a],i-t),s.layout(r)}))}}$_layoutBodies(t,e,s){t.chart.body;const i=t.rowCount(),r=t.colCount(),n=this._rowPoints,a=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const o=h[e*r+n],l=a[2*n+1],c=a[2*(n+1)];o.measure(this.doc,t.getPane(e,n).body,i-s,c-l,1),o.resize(i-s,c-l).trans(s,this.height-c),o.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],o=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],c=a[2*(n+1)-1],_=a[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,_-c,o-i,1),l.resize(_-c,o-i).trans(c,s-o),l.layout()}}}}co.STYLE_NAME="rct-panes";class _o extends gt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Fa(t))}layout(){}}class uo extends gt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new pt(t,"rct-polar-axis-markers")),this._markViews=new Un(this._markContainer,_o),this.add(this._gridContainer=new gt(t,"rct-polar-axis-grids")),this._labelViews=new Un(this._labelContainer=s,_a,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s.style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(ga)?t.setLabel(s,e,r.replace(ga,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(this._labelContainer.setVis(s.visible)){const t=e._ticks;this._labelContainer.setStyleOrClass(s.style),this._labelViews.prepare(t.length,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.front));e.addAll(t,i,!0),i=this._model.guides.filter((t=>t.front)),s.addAll(t,i,!0)}}class go extends uo{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Un(this._gridContainer,wr,go.GRID_CLASS),e.insertFirst(this._startView=new wr(t,go.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new wr(t,go.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Ha(t,go.LINE_CLASS))}_doPrepare(t,e,s){let i=this._lineView;this._gridContainer.setVis(t.grid.isVisible(!0))&&this._gridLines.prepare(e.length),i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setFill("none")),this._startView.setVis(s&&t.isArced()&&t.sectorLine.visible)?(this._startView.setStyleOrClass(t.sectorLine.style),this._endView.setVis(!0),this._endView.setStyleOrClass(t.sectorLine.style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const a=t.getStartAngle(),h=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*h/T)),this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const h=r[n].pos,o=e+c(a+h)*i,l=s+_(a+h)*i;t.setLine(e,s,o,l)})),this._labelContainer.visible){const n=this._labelViews.count,h=Math.ceil(9/(360/n)),o=i+t.tick.length,l=J.CENTER;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%h==0)){const n=r[i],h=t.getBBox(),u=a+n.pos,d=e+c(u)*(o+h.width/2)-h.width/2,g=s+_(u)*(o+h.height/2)-h.height/2;t.layout(l).trans(d,g)}})),n>2&&m(r[n-1].pos-r[n-2].pos)<T/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,a,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+c(a+n)*i,s+_(a+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+c(a)*i,s+_(a)*i),this._endView.setLine(e,s,e+c(a+h)*i,s+_(a+h)*i))}}go.LINE_CLASS="rct-polar-xaxis-line",go.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",go.GRID_CLASS="rct-polar-xaxis-grid-line";class po extends uo{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new Un(this._gridContainer,Ha,po.GRID_LINE_STYLE),e.add(this._lineView=new wr(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s,i){this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=t.line.visible)&&this._lineView.setStyleOrClass(t.line.style)}_doLayout(t,e,s,i,r,n){const a=n.getStartAngle(),h=n.getTotalAngle();if(this._gridContainer.visible){const i=this._circular;this._gridLines.forEach(((o,l)=>{const u=r[l].pos;if(i)o.setArc(e,s,u,a,h,!0),o.setFill("none");else if(o instanceof fr){const i=t.getStartAngle(),r=[];n._ticks.forEach((t=>{const n=t.pos;r.push(e+c(i+n)*u,s+_(i+n)*u)})),o.setPoints(...r)}}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const a=e+c(t)*r[n].pos-i.getBBox().width/2,h=s+_(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(a,h)}))}else this._labelViews.forEach(((t,i)=>{t.setContrast(null).trans(e+2,s-r[i].pos-t.getBBox().height/2)}));this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}po.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class mo extends Zh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this.$_prepareAxes(t,n.xAxis,n._getYAxes().items,this.model.circular,n.xAxis.isArced()),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{var r;t.model.needClip(!0)&&(this._polarClip||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(e,s,i),t.getClipContainer().setClip(this._polarClip),null===(r=t.getClipContainer2())||void 0===r||r.setClip(this._polarClip)),t.resize(2*i,2*i),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.layout(this.width,this.height,t.getPolar(e.model.axis))))})),this._layoutAnnotations(!1,this.width,this.height)}$_prepareAxes(t,e,s,i,r){this._axisContainer||(this.insertFirst(this._axisLabelContainer=new pt(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new pt(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new pt(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new po(t,this._lineContainer,this._axisLabelContainer);this._axisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisView||this._axisContainer.add(this._xAxisView=new go(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class wo extends na{constructor(t,e){super(t,e?wo.SUBTITLE_CLASS:wo.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Kt(t)),this._richText=new ie}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.text),this._richText.build(this._textView,s,i,null,null),qn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var fo;wo.TITLE_CLASS="rct-title",wo.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(fo||(fo={}));class xo extends gt{constructor(t){super(t,xo.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new xt(t,"rct-tooltip-back")),this.add(this._top=new xt(t,"rct-tooltip-top")),this.add(this._textView=new Kt(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+dt.SHADOW_FILTER+")"),this._textView.anchor=Xt.START,this._richText=new ie,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.chart.tooltip,a=n.setTarget(t,e);if(!a)return;const h=this.control.contentWidth(),o=this.control.contentHeight(),l=this._textView,c=t.chart.isInverted(),_=t._yAxisObj.reversed;this._richText.setFormat(n.text||a.getTooltipText(t,e)),this._richText.build(l,NaN,NaN,null,n.getTextDomain());const u=l.getBBox();let d=p(n.minWidth||0,u.width+16),m=p(n.minHeight||0,u.height+12)+this._topHeight;this._top.setFill(t._calcedColor);const w="visible"===this.getStyle("visibility")?300:0;let f;const x=n.offset+this._tailSize;if(c){f=i-m/2-p(0,g(i-m/2,o-m));const t=_?fo.LEFT:fo.RIGHT;this.drawTooltip(0,0,d,m,t,f),_?s-=d+x:s+=x,i-=m/2}else{f=s-d/2-p(0,g(s-d/2,h-d));const t=_?fo.BOTTOM:fo.TOP;this.drawTooltip(0,0,d,m,t,f),s-=d/2,_?i+=x:i-=m+x}s=p(0,g(s,h-d)),i=p(0,g(i,o-m)),this.transEx(s,i,w,!1),0===w&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.hideDelay:Bn.HIDE_DELAY))}$_hide(){vs(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const a=this._tailSize,h=this._radius,o=this._topHeight;let l=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];switch(r){case fo.TOP:l=l.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case fo.BOTTOM:l=l.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case fo.LEFT:l=l.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case fo.RIGHT:l=l.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c=r===fo.BOTTOM,_=c?["M",t,e+i-o,"l",s,0,"l",0,o-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,o-h,"l",-s,0,"l",0,h-o,"q",0,-h,h,-h],u=this._textView,d=u.getBBox();t+=(s-d.width)/2,e+=(i-d.height+(c?-o:o))/2,u.trans(t,e),this._top.setPath(_),this._back.setPath(l)}}xo.CLASS_NAME="rct-tooltip";class bo extends aa{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new wo(t,!1)),this.add(this.subtitleView=new wo(t,!0))}_doMeasure(t,e,s,i,r){const n=e.title,a=e.subtitle;let h,o=0,l=0,c=0,_=0,u=this.titleView,d=s,g=0,m=0;switch(u.setVis(n.isVisible())?(h=u.measure(t,n,s,i,r),l=this._hTitle=h.height,o=this._wTitle=h.width):u.setModel(n),(u=this.subtitleView).setVis(a.isVisible())?(h=u.measure(t,a,s,i,r),_=this._hSub=h.height,c=this._wSub=h.width,m=+e.subtitle.titleGap||0):u.setModel(a),a.position){case hi.LEFT:case hi.RIGHT:g=p(l,_),d=o+m+c;break;default:g=l+m+_,d=p(d,o+c)}return g>0&&(g+=this.titleView.visible?w(n.gap,0):w(a.gap,0)),{width:d,height:g}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.visible?this._wTitle>t.wPlot||i.alignBase===st.CHART?t.wChart:t.wPlot:0,a=r&&r.visible?this._wSub>t.wPlot||i.alignBase===st.CHART?t.wChart:t.wPlot:0;let h=this._wTitle>t.wPlot||i&&i.alignBase===st.CHART?0:t.xPlot,o=this._wSub>t.wPlot||r&&r.alignBase===st.CHART?0:t.xPlot;if(n>0&&a>0){const t=(t,e,s)=>{switch(t.verticalAlign){case tt.MIDDLE:return(e-s)/2;case tt.BOTTOM:return e-s;default:return 0}},l=()=>{const e=p(this._hTitle,this._hSub);d=p(d,d+t(i,e,this._hTitle)),m=p(m,m+t(r,e,this._hSub))},c=(t,e,s)=>{switch(t.align){case J.CENTER:return(e-s)/2;case J.RIGHT:return e-s;default:return 0}},_=()=>{g=p(g,g+c(i,n,this._wTitle)),f=p(f,f+c(r,a,this._wSub))},u=w(r.titleGap,0);let d=0,g=h,m=0,f=o;switch(i.align){case J.LEFT:switch(r.position){case hi.LEFT:g=f+this._wSub+u,l();break;case hi.RIGHT:switch(f=g+this._wTitle+u,r.align){case J.CENTER:f=p(f,f+(a-this._wTitle-this._wSub)/2);break;case J.RIGHT:f=p(f,o+a-this._wSub)}l();break;case hi.TOP:d=m+this._hSub+u,_();break;default:m=d+this._hTitle+u,_()}break;case J.RIGHT:switch(r.position){case hi.LEFT:switch(g+=n-this._wTitle,r.align){case J.CENTER:f+=(n-this._wTitle-this._wSub)/2;break;case J.RIGHT:f=g-u-this._wSub}l();break;case hi.RIGHT:f+=a-this._wSub,g=f-u-this._wTitle,l();break;case hi.TOP:_(),d=m+this._hSub+u;break;default:_(),m=d+this._hTitle+u}break;default:switch(r.position){case hi.LEFT:switch(g+=(n-this._wTitle)/2,r.align){case J.LEFT:break;case J.CENTER:f+=(g-f-this._wSub)/2;break;case J.RIGHT:f=g-u-this._wSub}l();break;case hi.RIGHT:switch(g+=(n-this._wTitle)/2,r.align){case J.LEFT:f=g+this._wTitle+u;break;case J.CENTER:f=g+this._wTitle+u,f+=(a-f-this._wSub)/2;break;case J.RIGHT:f+=a-u-this._wSub}l();break;case hi.TOP:_(),d=m+this._hSub+u;break;default:_(),m=d+this._hTitle+u}}e.resizeByMeasured().layout().trans(g,d),s.resizeByMeasured().layout().trans(f,m)}else if(n>0||a>0){const t=n?i:r,l=n?e:s,c=n||a,_=n?this._wTitle:this._wSub;let u=n?h:o;switch(l.resizeByMeasured().layout(),t.align){case J.LEFT:break;case J.RIGHT:u+=c-_;break;default:u+=(c-_)/2}l.trans(u,0)}}}class yo extends aa{_doInitChildren(t){this.add(this._legendView=new ao(t))}_doMeasure(t,e,s,i,r){const n=e.legend,a=this._legendView.measure(t,n,s,i,r),h=this._pos=n.getLocatiion();return h===as.LEFT||h===as.RIGHT?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case as.LEFT:s-=e;break;case as.RIGHT:s-=e,r+=e;break;case as.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).trans(r,n),t.layout()}}class vo extends aa{constructor(t,e){super(t),this.dir=e,this.views=[],this.visibles=[],this._gap=0}prepare(t,e,s,i){const r=this.views;let n,a=r.length;for(;r.length<e.length;)n=new pa(t),e[a++].visible&&this.add(n),r.push(n);for(;r.length>e.length;)n=r.pop(),n.parent&&n.remove();if(r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,NaN,NaN,s,i)})),this.setVis(r.filter((t=>t.model.visible)).length>0)){const t=r[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,a=0;return[this.views].forEach((e=>{if(e){const h=(this.isX,s),o=(this.isX,i);let l=0,c=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,h,o,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,c+=s.height}})),this.isHorz?c+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=p(n,l),a=p(a,c)}})),Jn.create(n,a)}_doLayout(t){let e=this.width,s=this.height,i=0,r=0;t=+t||0,[this.views].forEach((n=>{if(n){let a=0;n.forEach((t=>{t.visible&&(t.checkExtents(),this.isHorz?t.resize(e,t.mh):t.resize(t.mw,s),t.layout(),this.isHorz?(t.trans(i,this.dir===et.TOP?s-a-t.mh:a),a+=t.mh+this._gap):(t.trans(this.dir===et.RIGHT?a:e-a-t.mw,r),a+=t.mw+this._gap))})),this.isHorz?i+=e+t:r+=s+t}}))}}class Vo extends ra{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Kt(t)),this._textView.anchor=Xt.START}clicked(t){this.model.url&&window.open(this.model.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.text,this.setCursor(e.url?"pointer":""),this._textView.getBBox()}}class So extends pt{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new pt(t,"rct-annotations")),this.add(this._plotContainer=new pt(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Zh(t,this));for(const e in et){const s=new vo(t,et[e]);this._plotContainer.add(s),this._axisSectionMap[et[e]]=s}this.add(this._paneContainer=new co(t,this)),this.add(this._titleSectionView=new bo(t)),this.add(this._legendSectionView=new yo(t)),this.add(this._frontAnnotationContainer=new pt(t,"rct-front-annotations")),this.add(this._creditView=new Vo(t)),this.add(this._navigatorView=new qh(t)),this.add(this._historyView=new ro(t)),this.add(this._tooltipView=new xo(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend,l=n.seriesNavigator;let c,_=s,u=i;if(this._inverted=n.isInverted(),n.isSplitted()?(this._plotContainer.setVis(!1),this._paneContainer.setVis(!0),this.$_preparePanes(t,n.split)):(this._plotContainer.setVis(!0),this._paneContainer.setVis(!1),this.$_prepareBody(t,a)),this._creditView.setVis(h.visible)&&(c=this._creditView.measure(t,h,_,u,r),h.isFloating()||(u-=c.height+(+h.offsetY||0)+(+h.gap||0))),c=this._titleSectionView.measure(t,n,_,u,r),u-=c.height,this._legendSectionView.setVis(o.isVisible()))switch(c=this._legendSectionView.measure(t,n,_,u,r),o.getLocatiion()){case as.TOP:case as.BOTTOM:u-=c.height;break;case as.RIGHT:case as.LEFT:_-=c.width}this._navigatorView.setVis(l.isVisible()),this._paneContainer.visible?this._paneContainer.measure(t,n.split,n.xPaneAxes,n.yPaneAxes,_,u,1):a?this.$_measurePolar(t,n,_,u,1):this.$_measurePlot(t,n,_,u,1),this._navigatorView.visible&&(n.seriesNavigator._vertical?u=this._bodyView.mh:_=this._bodyView.mw,this._navigatorView.measure(t,l,_,u,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){const t=this.width,e=this.height;let s=t,i=e;const r=this._model,n=r.isPolar(),a=r.legend,h=r.options.credits,o=this._creditView,l=+h.offsetY||0,c=+h.gap||0;let _=0,u=0,d=0,g=0;o.visible&&(o.resizeByMeasured(),h.isFloating()||(h.verticalAlign===tt.TOP?i-=_=o.height+l+c:i-=u=o.height+l+c));const p=this._titleSectionView;let m=0;const w=g+_;p.visible&&(p.resizeByMeasured(),i-=m=p.height),g=e-u;const f=this._navigatorView;let x=0;f.visible&&(f.model._vertical||(f.resize(f.mw,f.mh-f.model.gap-f.model.gapFar),i-=x=f.mh));const b=this._legendSectionView;let y,v,V=0,S=0;if(b.visible)switch(b.resizeByMeasured().layout(),V=b.height,S=b.width,a.getLocatiion()){case as.TOP:y=m+_,i-=V;break;case as.BOTTOM:i-=V,y=g-V,g-=V;break;case as.RIGHT:s-=S,v=t-S;break;case as.LEFT:s-=S,d+=S,v=0}f.visible&&(g-=x,f.layout().transY(g+f.model.gap));let P,C=0,A=0,k=0,E=0;if(this._paneContainer.visible)this._paneContainer.resize(s,i).trans(d,w+m),this._paneContainer.layout(),k=i,E=s,P=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[et.CENTER],r=t[et.MIDDLE];let a;n||(e&&e.visible&&(C=e.mw),r&&r.visible&&(A=r.mh),[et.LEFT,et.RIGHT].forEach((e=>{(a=t[e])&&a.visible&&(s-=a.mw)})),[et.TOP,et.BOTTOM].forEach((e=>{(a=t[e])&&a.visible&&(i-=a.mh)})),(a=t[et.LEFT])&&a.visible&&(a.resize(a.mw,i),a.layout(A),d+=a.mw),(a=t[et.RIGHT])&&a.visible&&(a.resize(a.mw,i),a.layout(A)),C>0&&(e.resize(a.mw,i),e.layout()),(a=t[et.BOTTOM])&&a.visible&&(a.resize(s,a.mh),a.layout(C),g-=a.mh),(a=t[et.TOP])&&a.visible&&(a.resize(s,a.mh),a.layout(C)),A>0&&(r.resize(s,a.mh),r.layout())),f.visible&&f.layout().transX(d);const h=this._org={x:d,y:g};this._plotWidth=s,this._plotHeight=i,n||((a=t[et.LEFT])&&a.visible&&a.trans(h.x-a.mw,h.y-a.height),(a=t[et.RIGHT])&&a.visible&&a.trans(h.x+s,h.y-a.height),C>0&&e.trans(h.x+(s-C)/2,h.y-e.height),(a=t[et.BOTTOM])&&a.visible&&a.trans(h.x,h.y),(a=t[et.TOP])&&a.visible&&a.trans(h.x,h.y-i-a.height),A>0&&r.trans(h.x,h.y-(i-A)/2-A)),k=this._plotHeight-A,E=this._plotWidth-C,d=h.x,g=h.y-this._plotHeight,this._currBody.resize(E,k),this._currBody.layout().trans(d,g),P=this._currBody.getRect(),this._currBody._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(o.visible){const s=+h.offsetX||0,i=l;let r,n;switch(o.layout(),h.verticalAlign){case tt.TOP:break;case tt.MIDDLE:n=(e-o.height)/2+i;break;default:n=e-u+c}switch(h.align){case J.LEFT:r=s;break;case J.CENTER:r=(t-o.width)/2+s;break;default:r=t-o.width-s}o.trans(r,n)}if(E+=C,p.visible&&p.layout({xPlot:d,wPlot:E,wChart:t}).trans(0,w),b.visible){if(a.location===as.BODY){let t=+a.offsetX||0;switch(a.align){case J.RIGHT:d+=E-S-t;break;case J.CENTER:d+=(E-S)/2+t;break;default:d+=t}switch(t=+a.offsetY||0,a.verticalAlign){case tt.BOTTOM:g+=k-V-t;break;case tt.MIDDLE:g+=(k-V)/2+t;break;default:g+=t}}else if(isNaN(y)){const t=+a.offsetY||0;if(d=v,a.alignBase===st.CHART){switch(a.verticalAlign){case tt.TOP:g=t;break;case tt.BOTTOM:g=e-V-t;break;default:g=(e-V)/2+t}g+V>e&&(g=(e-V)/2)}else switch(a.verticalAlign){case tt.TOP:g+=t;break;case tt.BOTTOM:g=g+i-V-t;break;default:g=g+(i-V)/2+t}g+V>e&&(g=(e-V)/2),g<0&&(g=0)}else{const e=+a.offsetX||0;if(g=y,a.alignBase===st.CHART)switch(a.align){case J.LEFT:d=e;break;case J.RIGHT:d=t-S-e;break;default:d=(t-S)/2+e}else switch(a.align){case J.LEFT:d+=e;break;case J.RIGHT:d=d+s-S-e;break;default:d+=(s-S)/2+e}d+S>t&&(d=(t-S)/2),d<0&&(d=0)}b.trans(d,g)}this.$_layoutAnnotations(this._inverted,t,e,P),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:n}=e.getTooltipPos(),a=this._model.chart.tooltip.followPointer,h=a?i.x+s.tx:r+s.tx,o=a?i.y+s.ty:n+s.ty;this._tooltipView.show(t,e,h,o,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._paneContainer.visible?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}clipSeries(t,e,s,i,r,n,a){function h(t){o?l.setBounds(0,-r,n,r):l.setBounds(0,0,r,n),t.setClip(l)}const o=this._model.inverted&&a;let l=a?this._seriesClip:this._seriesClip2;t&&h(t),e&&h(e)}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){const i=s,r=this._model&&this.bodyOf(s),n=null==i?void 0:i.classList,a=(null==n?void 0:n.value)&&(n.contains("rct-contextmenu-item")||n.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,r){const n=r.controlToElement(t,e),o=r.pointerMoved(n,s);for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?r.width:r.height,i=t.model._isHorz?n.x:n.y,h=o&&e.visible&&!a&&e.flag.visible&&!e.isBar()&&e.getFlag(s,i);h?(t.showCrosshair(i,h),t.model.crosshair.moved(i,h)):t.hideCrosshiar()}));if(!this._hoverItem&&this._legendSectionView._legendView.contains(i)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(i);t&&t.legend.seriesHovering&&t.source&&r.hoverSeries(t.source)}h instanceof ns&&!(this._hoverItem instanceof ns)&&r.hoverSeries(null)}}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in et){const s=this._axisSectionMap[et[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody.width,this._currBody.height))}_doAttached(t){this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds()}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new mo(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e.needAxes(),a=this._axisSectionMap;for(const s in a){const h=a[s];n?h.prepare(t,e.getAxes(s,!1),i,r):h.visible=!1}s.prepare()}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap;if(this._navigatorView.visible){const t=e.seriesNavigator;t._vertical?s-=t.thickness+t.gap+t.gapFar:i-=t.thickness+t.gap+t.gapFar}const a=s,h=i;let o=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[et.LEFT].checkWidths(t,s,i),s-=n[et.RIGHT].checkWidths(t,s,i),i-=n[et.BOTTOM].checkHeights(t,s,i),i-=n[et.TOP].checkHeights(t,s,i),this._inverted?s-=o=n[et.CENTER].checkWidths(t,s,i):i-=l=n[et.MIDDLE].checkHeights(t,s,i),s-=o,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h,o=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===et.LEFT||t===et.RIGHT?s-=e.mw:t!==et.BOTTOM&&t!==et.TOP||(i-=e.mh),this._inverted?t===et.CENTER&&(s-=o=e.mw):t===et.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&(h.measure(t,e,s,i,r),h.prepareGridRows(t,this._bodyView._gridRowContainer))}s=a,i=h,o=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===et.LEFT||t===et.RIGHT?s-=e.mw:t!==et.BOTTOM&&t!==et.TOP||(i-=e.mh),this._inverted?t===et.CENTER&&(s-=o=e.mw):t===et.MIDDLE&&(i-=l=e.mh))}e.axesLayouted(s,i,this._inverted),this._bodyView.measure(t,e.body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e.body.calcRadius(s,i),a=2*Math.PI*n,h=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(a,h,!1,r),e.axesLayouted(a,h,!1),this._polarView.measure(t,e.body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||$h(t,e);(e.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,a,h,o;this._annotationViews.forEach((i=>{if(i.model.scope===xe.CONTAINER)n=-r.left,a=-r.top,h=e+r.left+r.right,o=s+r.top+r.bottom;else n=a=0,h=e,o=s;i.resizeByMeasured(),i.layout().transp(i.model.getPosition(t,n,a,h,o,i.width,i.height))}))}}class Po extends dt{constructor(t,e){super(t,e),this.addElement(this._chartView=new So(t)),this.setPointerHandler(new io(this))}onModelChanged(t,e,s){e instanceof Le&&s===pe.UPDATED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}get model(){return this._model}set model(t){t!==this._model&&(this._model&&(this._model.assets.unregister(this.doc(),this),this._model.removeListener(this)),this._model=t,this._model&&(this._model.addListener(this),this._model.assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.clearAssetDefs(),this.model=new Xn(t),this.model._loadAnimatable=e}refresh(t){t?this._render():this.invalidateLayout()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}_doRender(t){const e=this._model,s=this._chartView;this.clearTemporaryDefs(),e&&(this.setData("theme",e.options.theme,!0),this.setData("palette",e.options.palette),e.prepareRender()),this.loaded||s.clean(),s.measure(this.doc(),e,t.width,t.height,1),s.setRect(t),s.layout(),e&&e.afterRender()}_doRenderBackground(t,s,i,r){if(this._model){const i=this._model.options.style;if(e(i))for(const e in i)e.startsWith("padding")?s.setStyle(e,i[e]):t.style[e]=i[e]}}}class Co{constructor(t){this._doInit(this.$_p=t)}_createObjects(...t){for(const e of t)this["_"+e]=new Co(this.$_p[e])}_doInit(t){}get(t){const e=this.$_p.getProp(t);if(e instanceof pe){const e=this[t];return e instanceof Co?e:void 0}return e}set(t,e,s=!0){return this.$_p.setProp(t,e,s),this}setAll(t,e=!0){return this.$_p.setProps(t,e),this}toggle(t,e=!0){return this.$_p.setProp(t,!this.$_p.getProp(t),e),this}_changed(){this.$_p.chart._modelChanged(this.$_p)}}class Ao extends Co{_doInit(t){this._createObjects("title","line","grid","tick","label","crosshair")}get xy(){return this.$_p._isX?"x":"y"}get isX(){return this.$_p._isX}get title(){return this._title}get line(){return this._line}get grid(){return this._grid}get tick(){return this._tick}get label(){return this._label}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get isEmpty(){return this.$_p.isEmpty()}resetZoom(){this.$_p.resetZoom()}zoom(t,e){this.$_p.zoom(t,e)}}class ko extends Co{get name(){return this.$_p.name}}class Eo extends ko{_doInit(t){this._createObjects("pointLabel","trendline","tooltip")}get pointLabel(){return this._pointLabel}get trendLine(){return this._trendLine}get tooltip(){return this._tooltip}get pointCount(){return this.$_p._runPoints.length}get visiblePointCount(){return this.$_p._visPoints.length}getPointAt(t){const e=this.$_p.getPointAt(t);return e&&e.proxy()}findPoint(t){const e=this.$_p.findPoint(t);return e&&e.proxy()}getValueAt(t){const e=this.$_p.getPointAt(t);return e?e.yValue:E}setValueAt(t,e,s=!0){const i=this.$_p.getPointAt(t);return!!i&&!!this.$_p.setValueAt(i,e,s)}addPoint(t,e=!0){const s=this.$_p.addPoint(t,e);return s&&s.proxy()}removePoint(t){return!!this.$_p.removePoint(this.$_p.getPointAt(t))}addPoints(t){}removePoints(t){}updateData(t){this.$_p.updateData(t)}}class Lo extends ko{}class To extends ko{setValue(t,e=!0){this.$_p.updateValue(t,e)}}class No extends ko{}class Ro extends ko{update(){this.$_p.update()}}class Oo extends Co{}class Mo extends Co{}class Do extends Co{}class Bo extends Co{}function $o(t,e){if(e){let s=t.get(e);return s||(e instanceof Ks?s=new Eo(e):e instanceof Ze?s=new Ao(e):e instanceof Ti?s=new To(e):e instanceof Le?s=new Ro(e):e instanceof di?s=new Oo(e):e instanceof gi?s=new Mo(e):e instanceof ls?s=new Do(e):e instanceof is&&(s=new Bo(e)),t.set(e,s)),s}}class Io{constructor(t){this._objects=new Map,this._proxy={getChartObject:t=>$o(this._objects,t)},this.$_p=t}load(t,e){this.$_p.load(t,e);const s=this.$_p.model;s._proxy=this._proxy;const i=window.RealChartExporter,r=s.exportOptions.visible;i&&r&&(this._exporter=i.render(this.$_p.doc(),this.$_p.dom(),s.exportOptions)),this._objects.clear()}render(t=!1){this.$_p.refresh(t),this._exporter&&this._exporter.render(this.$_p.model.exportOptions)}get xAxis(){return $o(this._objects,this.$_p.model.xAxis)}getXAxis(t){return $o(this._objects,this.$_p.model.getXAxis(t))}get yAxis(){return $o(this._objects,this.$_p.model.yAxis)}getYAxis(t){return $o(this._objects,this.$_p.model.getYAxis(t))}get series(){return $o(this._objects,this.$_p.model.firstSeries)}getSeries(t){return $o(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return $o(this._objects,this.$_p.model.firstGauge)}getGauge(t){return $o(this._objects,this.$_p.model.gaugeByName(t))}getAnnotation(t){return $o(this._objects,this.$_p.model.annotationByName(t))}get title(){return $o(this._objects,this.$_p.model.title)}get subtitle(){return $o(this._objects,this.$_p.model.subtitle)}get legend(){return $o(this._objects,this.$_p.model.legend)}get body(){return $o(this._objects,this.$_p.model.legend)}get type(){return this.$_p.model.type}get gaugeType(){return this.$_p.model.gaugeType}get inverted(){return this.$_p.model.inverted}get polar(){return this.$_p.model.polar}scroll(t,e){this.$_p.scroll(t.$_p,e)}setParam(t,e,s){this.$_p.model.setParam(t,e,s)}addSeries(t,e=!0){const s=this.$_p.model.addSeries(t,e);return s&&$o(this._objects,s)}removeSeries(t,e=!0){const s=this.$_p.model.removeSeries(t instanceof Eo?t.$_p:t,e);if(s){return $o(this._objects,s)}}}class Fo{constructor(t){this.$_p=t}get rowCount(){return this.$_p._rows.length}getValue(t,e){return this.$_p.getValue(t,e)}setValue(t,e,s){this.$_p.setValue(t,e,s)}getValues(t,e=0,s=-1){return this.$_p.getValues(t,e,s)}getRow(t){return this.$_p.getRow(t)}addRow(t,e=-1){this.$_p.addRow(t,e)}deleteRow(t=-1){this.$_p.deleteRow(t)}}class zo{static getVersion(){return"0.9.32"}static setLocale(t,e){e&&k(t,e),(t=>{A=P[C=t],A||(A=P[C="ko"])})(t)}static registerLocale(t,e){k(t,e)}static setDebugging(t){gt.DEBUGGING=t}static setLogging(t){ht.LOGGING=t}static setAnimatable(t){dt._animatable=t}static createChart(t,e,s,i=!0){const r=new Io(new Po(t,e));return r.load(s,!0),r}static createData(t,e){return new Fo(new Ns(t||{},e))}}const Ho=zo.getVersion,Go=zo.setDebugging,jo=zo.setLogging,Wo=zo.setAnimatable,Yo=zo.createChart,Xo=zo.createData;export{Ro as RcAnnotation,Bo as RcBody,Ao as RcChartAxis,Io as RcChartControl,Fo as RcChartData,To as RcChartGauge,Co as RcChartObject,Eo as RcChartSeries,No as RcGaugeGroup,Do as RcLegend,ko as RcNamedObject,Lo as RcSeriesGroup,Mo as RcSubtitle,Oo as RcTitle,Yo as createChart,Xo as createData,Ho as getVersion,Wo as setAnimatable,Go as setDebugging,jo as setLogging};
|
|
7
|
+
const t="http://www.w3.org/2000/svg",e=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,i=function(t){return"function"==typeof t},r=function(t){return"string"==typeof t},n=function(t){return"number"==typeof t},a=Object.assign,h=Math.floor,o=Math.ceil,l=Math.cos,c=Math.sin,_=function(t){return Math.pow(10,t)},u=Math.log10,d=Math.min,g=Math.max,p=Math.abs,m=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},w=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},f=function(t,e){return void 0!==t?t:e},x=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},b=(t,s)=>{const i=a({},t);for(const r in s){const n=s[r];e(n)&&e(t[r])?i[r]=b(t[r],n):i[r]=n}return i};let y=0;class v{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(y++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroyed=!0,this.$_destroying=!0,this._doDestory()),null}_doDestory(){}get destroying(){return this.$_destroying}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class V extends v{constructor(){super(...arguments),this._listeners=[]}addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const S={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let P="ko",k=S[P];const A=(t,s)=>{if(t&&e(s)&&(k=S[t]=s,"en"!==t)){const t=S.en;for(const e in t)k[e]=k[e]||t[e]}},C=void 0,E="%".charCodeAt(0),L=2*Math.PI,T=-Math.PI/2,N=2*Math.PI/360,R=360/Math.PI/2;function M(t){return t>L?t%L:t}function O(t){return parseFloat(t.toPrecision(12))}function D(t){return null==t?null:String(t)}function B(t){return t+"px"}function $(t){return null==t||Number.isNaN(t)||""===t}function I(t){return t<10?"0"+t:String(t)}function F(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function z(t,e){const s={};return s[t]=e,s}function H(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===E?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;q(k.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function G(t,e){return H(t,!0)||H(e,!1)}function j(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const W="fill",Y={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},X=function(t){const e=Y[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Y[t]=e,e}return e};class U extends Error{}const Z=function(t,e){if(!t)throw new U(e)};var K;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(K||(K={}));const q=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))};var Q,J,tt,et;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(Q||(Q={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(J||(J={})),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(tt||(tt={})),function(t){t.CHART="chart",t.BODY="body",t.PARENT="parent"}(et||(et={}));const st=function(t,i,n,h=!0,o=!0,l=!1,c){let _,u;if(h&&(i=-Number.MAX_VALUE,n=Number.MAX_VALUE),s(t))_=[],t.forEach((t=>{if(e(t)&&r(t.color)){const e={fromValue:m(t.fromValue,u?u.toValue:i),toValue:m(t.toValue,n),color:t.color,style:t.style?a({},t.style):C};e.fromValue<e.toValue&&(_.push(e),u=e)}})),_=_.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=i&&t.fromValue<n)),o&&_.forEach((t=>{t.fromValue=g(t.fromValue,i),t.toValue=d(t.toValue,n)}));else if(e(t)&&s(t.colors)&&t.colors.length>0){const e=t.colors,r=s(t.styles)?t.styles:null;if(_=[],s(t.steps)&&t.steps.length>0){const a=s(t.steps)?t.steps:null;i<a[0]&&a.unshift(i),n>a[a.length-1]&&a.push(n);for(let t=0;t<a.length-1;t++)_.push({fromValue:a[t],toValue:a[t+1],color:e[d(t,e.length-1)],style:r?r[d(t,r.length-1)]:C})}else{let s=m(t.fromValue,i);const a=m(t.toValue,n),h=(a-s)/e.length;let o=0;for(;s<a;)_.push({fromValue:s,toValue:s+=h,color:e[d(o,e.length-1)],style:r?r[d(o,r.length-1)]:C}),o++}}if(l&&_&&_.length>0){let t=0,e=i;for(;t<_.length;)_[t].fromValue>e&&_.splice(t,0,{fromValue:e,toValue:_[t].fromValue,color:c}),e=_[t].toValue,t++;_[t-1].toValue<n&&_.push({fromValue:_[t-1].toValue,toValue:n,color:c})}return _};var it;!function(t){t.CLIP="clip",t.ELLIPSIS="ellipsis",t.WRAP="wrap"}(it||(it={}));class rt{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const nt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class at{static log(...t){this.LOGGING&&console.log(...t)}static now(){return+new Date}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,o=e+Math.ceil((a+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===o?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=t.getDate()+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!s(t))return a({},t)}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(s(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNumber(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static checkEnumValue(t,e,s){const i=Object.keys(t);for(let s=i.length-1;s>=0;s--)if(t[i[s]]===e)return e;return s}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-nt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static pickNum(...t){const e=t.length;for(let s=0;s<e;s++)if(!isNaN(t[s])&&null!==t[s])return t[s];return NaN}static included(t,...e){const s=e.length;for(let i=0;i<s;i++)if(e[i]==t)return!0;return!1}static compareTextValue(t,e,s,i){if(t===e)return!0;let r=String(t),n=null==e?void 0:String(e);return!r&&!n||!(!r||!n)&&(s||(r=r.toLowerCase(),n=n.toLowerCase()),i?n.indexOf(r)>=0:r==n)}static irandom(t,e){if(void 0!==e){const s=t>>0,i=e>>0;return Math.random()*(i-s)+s>>>0}{const e=t>>0;return Math.random()*e>>0}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[Math.random()*t.length>>0]}static iarandom(t,e,s){const i=new Array;for(let s=t;s<e;s++)i.push(s);for(;i.length>s;)i.splice(at.irandom(i.length),1);return i}static alert(t){window.alert(t)}static toInt(t,e){const s=parseInt(t,e||10);return isNaN(s)?0:s}static toFloat(t){const e=parseFloat(t);return isNaN(e)?0:e}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static equalObjects(t,e){if(t===e)return!0;if(!t&&!e)return!0;if(!t||!e)return!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(var s in e)if(e.hasOwnProperty(s)&&t[s]!==e[s])return!1;return!0}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(d(s,at.month_days[at.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static getTextLength2(t){let e=0,s=0,i=0;for(;i=t.charCodeAt(s++);e+=i>>7?2:1);return e}static getClassName(t){if(t&&t.constructor)return t.constructor.name||function(t){let e=t.toString();return e=e.substring(9),e=e.substring(0,e.indexOf("(")),e}(t.constructor)}static isInteger(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=s(t)?[]:{};for(let s of Object.keys(t))e[s]=at.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),at.log(t,+new Date-s+"ms")}static clamp(t,e,s){return g(e,d(s,t))}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=p(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}}var ht;at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],at.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(ht||(ht={}));const ot={name:"RealChart",version:"0.9.34",license:"enterprise",code:""};class lt{static decode(t){const e=lt.CHARS,s=lt.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}lt.PAD="=",lt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class ct{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let a=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return a=(a>>16^i>>16)<<16|65535&(65535&a^65535&i),(a>>16)+(s>>16)+((65535&a)+(65535&s)>>16)<<16|(65535&a)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=ct.xor,i=ct.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=ct.xor,i=ct.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=ct.kb,i=ct._encryptBlock;let r,n,a,h=0,o=0,l={left:0,right:0};const c={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)o=o*ct.POW8|e[h++%i];return(t>>16^o>>16)<<16|65535&(65535&t^65535&o)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,a=c.p.length;r<a;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,a=c["s"+r].length;n<a;)i(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const s=ct._decryptBlock;let i=ct._init(e),r=[],n=lt.decode(t),a=n.length>>3,h=0,o={left:null,right:null};for(let t=0;t<a;t++){o.left=n[h]*ct.POW24|n[h+1]*ct.POW16|n[h+2]*ct.POW8|n[h+3],o.right=n[h+4]*ct.POW24|n[h+5]*ct.POW16|n[h+6]*ct.POW8|n[h+7],s(o,i);const t=o.left,e=o.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),h+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}ct.POW2=Math.pow(2,2),ct.POW3=Math.pow(2,3),ct.POW4=Math.pow(2,4),ct.POW8=Math.pow(2,8),ct.POW16=Math.pow(2,16),ct.POW24=Math.pow(2,24),ct.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class _t{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=ct.decrypt(t,"dkdl"+this._getLDKey(ct.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}class ut extends v{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._dom.setPointerCapture(t.pointerId),this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._dom.releasePointerCapture(t.pointerId),this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=_t.decrypt(e);if("RealChart"!==i.name||"RealChart"!==ot.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(ot.license!=ht.Developer&&!_t.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(ht).includes(n))throw new Error(s);if(ot.code=i.code,ot.license=i.lic,n==ht.Evaluation||n==ht.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this.$_initControl(t||document,e,s||ut.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestory(){this._unresigterEventHandlers(this._dom),rt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}clipContainer(){return this._defs}setData(t,e,s){$(e)?(delete this._root.dom.dataset[t],s&&delete this._dom.dataset[t]):(this._root.dom.dataset[t]=e,s&&(this._dom.dataset[t]=e))}clearDefs(){rt.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children;for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(dt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(dt.TEMP_KEY)}appendDom(t){t&&this._htmlRoot.append(t)}addElement(t){t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new wt(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipRect(t){return this.clipBounds(t.x,t.y,t.width,t.height)}clipCircle(){const t=new bt(this.doc());return this._defs.appendChild(t.dom),t}clipPath(){const t=new xt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(r(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.x-i.x,y:s+r.y-i.y}}_setTesting(){this._testing=!0,dt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s){t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}$_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||q(k.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");a(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const h=this._svg=r.createElementNS(t,"svg");h.classList.add("rct-svg"),h.style.setProperty("overflow","visible","important"),h.setAttribute("width","100%"),h.setAttribute("height","100%");const o=r.createElement("desc");o.textContent="Created by RealChart v0.9.34",h.appendChild(o);const l=this._defs=r.createElementNS(t,"defs");this._initDefs(r,l),h.appendChild(l),n.appendChild(h),this._root=new pt(this),h.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),a(this._htmlRoot.style,{position:"absolute"})}_initDefs(e,s){let i=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");i.setAttribute("id",ut.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-olor","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):setTimeout((()=>{this.$_render()}),0)}updateNow(){this.$_render()}$_render(){if(+new Date<=this._toAnimation)this.$_requestRender();else{at.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;a(this._htmlRoot.style,{left:B(e.left-t.left),top:B(e.top-t.top)}),this._doRenderBackground(this._container.firstElementChild,this._root,s,i);const r=this._padding=rt.getPadding(this._root.dom);this._doRender({x:r.left,y:r.top,width:s-r.left-r.right,height:i-r.top-r.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),at.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}}ut.CLASS_NAME="rct-control",ut.SHADOW_FILTER="rr-chart-shadow-filter",ut._animatable=!0;class dt extends v{constructor(e,s,i=C){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return $(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}setAttrsEx(t){for(let e in t){const s=t[e];$(s)?this._dom.removeAttribute(e):this._dom.setAttribute(e,s)}return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}isDomAnimating(){return this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t===this._tx&&e===this._ty||(at.isValidNumber(t)&&(this._tx=t),at.isValidNumber(e)&&(this._ty=e),this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=at.isNumber(t)?t:this._tx,e=at.isNumber(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx}px,${this._ty}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()}))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&at.isValidNumber(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.isValidNumber(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width)),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height)),this}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(X(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(X(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(X(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t)this._styles[i]!==t[i]&&(s[i]=this._styles[i]=t[i],e=!0);e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){r(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){r(t)?this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){r(t)?t&&this._dom.classList.add(t):e(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){this.dom.dataset[t]=f(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVis(!1)}))}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(dt.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&this!==t[r-1]&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){this.control.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}_testing(){return dt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(at.isValidNumber(e)||at.isValidNumber(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),at.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")");const r=at.getNumber(this._scaleX,1),n=at.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}dt.DEBUGGING=!1,dt.TESTING=!1,dt.ASSET_KEY="_asset_",dt.TEMP_KEY="_temp_";class gt extends dt{constructor(t,e){super(t,e,"g")}}class pt extends dt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class mt extends dt{constructor(t){super(t,C,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class wt extends mt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,a=0){super(t);const h=this._rect=new dt(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),a>0&&this.dom.setAttribute("rx",String(a)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e),this}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class ft extends dt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=r(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class xt extends mt{constructor(t){super(t),this._path=new ft(t),this.add(this._path)}setPath(t){this._path.setPath(t)}}class bt extends mt{constructor(t){super(t),this.add(this._circle=new dt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class yt{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._doCanceled()}finally{this.end(-1,-1)}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}const vt="0".charCodeAt(0),Vt="#".charCodeAt(0),St=",".charCodeAt(0),Pt="s".charCodeAt(0),kt="a".charCodeAt(0);class At{static getFormatter(t){let e=At.Formatters[t];return e||(At.Formatters[t]=e=new At(t)),e}static get Default(){return At.getFormatter(At.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===vt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===Vt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===vt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===St){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===Pt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===kt){s.signDisplay="never";break}}return s.minimumIntegerDigits=g(1,s.minimumIntegerDigits),s.maximumFractionDigits||delete s.maximumFractionDigits,s}}}At.DEFAULT_FORMAT="",At.Formatters={};const Ct=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Et=[".","/","-",":"],Lt="Z".charCodeAt(0),Tt="z".charCodeAt(0),Nt="A".charCodeAt(0),Rt="a".charCodeAt(0),Mt="y".charCodeAt(0),Ot="M".charCodeAt(0),Dt="m".charCodeAt(0),Bt="W".charCodeAt(0),$t="w".charCodeAt(0),It="d".charCodeAt(0),Ft="H".charCodeAt(0),zt="h".charCodeAt(0),Ht="S".charCodeAt(0),Gt="s".charCodeAt(0);class jt{static getFormatter(t){let e=jt.Formatters[t];return e||(jt.Formatters[t]=e=new jt(t)),e}static get Default(){return jt.getFormatter(k.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||k.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var a=s[r],h=a.length;switch(a.charCodeAt(0)){case Mt:i+=h>2?t.getFullYear():I(t.getFullYear()%100);break;case Ot:i+=h>1?I(t.getMonth()+1):t.getMonth()+1;break;case It:i+=h>1?I(t.getDate()):t.getDate();break;case Bt:i+=h>1?I(at.weekOfYear(t,e)):at.weekOfMonth(t,e,!0);break;case $t:i+=h>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case Ft:i+=h>1?I(t.getHours()):t.getHours();break;case zt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=h>1?I(e):e}else i+=h>1?I(t.getHours()):t.getHours();break;case Dt:i+=h>1?I(t.getMinutes()):t.getMinutes();break;case Gt:i+=h>1?I(t.getSeconds()):t.getSeconds();break;case Rt:case Nt:t.getHours()<12?i+=k.am:i+=k.pm;break;case Ht:let s=t.getMilliseconds();i+=3==h?F(s):2==h?I(s):s.toString().substring(0,h);break;default:i+=a}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(Et.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),Ct.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Nt&&e<=Lt||e>=Rt&&e<=Tt)&&q(k.invalidDateFormat,t)}e.push(n)}if(r<i&&at.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&at.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||k.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}jt.Formatters={};class Wt{static isBright(t){return new Wt(t).isBright()}static getContrast(t,e,s){return new Wt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(at.startsWith(t,"rgb(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):at.startsWith(t,"rgba(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):at.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Wt(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var Yt,Xt,Ut;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Yt||(Yt={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Xt||(Xt={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Ut||(Ut={}));class Zt extends dt{constructor(t,e=C){super(t,e,"text"),this._layout=Xt.TOP,this._overflow=Ut.WRAP,this._dirty=!0,this._text="",this.anchor=Yt.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case Xt.MIDDLE:i=Math.floor(s/2);break;case Xt.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.setAttr("y",i)}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=g(0,t),(e=d(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Wt.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Kt="$_TH";class qt{get type(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;if(s&&e.callback){let i=this.text;for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?At.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?jt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}return this.text}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),a=n.indexOf(";");if(a>0){const t=n.indexOf(";",a+1);t>=a?this._literals.push(r,n.substring(0,a),n.substring(a+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,a),n.substring(a+1),C),0===this._literals[2].length&&(this._literals[2]=C)}else this._literals.push(r,n,C,C);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Qt extends qt{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf("<",r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.innerHTML=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}const Jt={t:class extends Qt{get type(){return"t"}},b:class extends Qt{get type(){return"b"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends Qt{get type(){return"i"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}}};class te{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new qt).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){const s=t[i],r=t[i+1];if("<"==s){let s;if(r in Jt){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+r+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);s=(new Jt[r]).parse(e),i+=e.length}}}if(!s){e(t.substring(i));break}this._words.push(s)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const ee=/<br.*?>|\r\n|\n/;class se{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,s,i,r){const n=t.doc,a=m(this.lineHeight,1),h=this._lines,o=h.length,l=[];let c;t.clearDom(),i=i||t;for(let e=0;e<o;e++){const s=h[e];let o=0,c=0,_=null;for(let e of s.words){const s=e.prepareSpan(t.appendElement(n,"tspan"),i,r),a=s.getBBox();o+=a.width,s.$_TW=a.width,c=g(c,s[Kt]=a.height),_||(_=s)}l.push(_),s[Kt]=c*a}if(o>0){c=h[0][Kt];for(let e=1;e<l.length;e++)if(l[e]){const s=t.insertElement(n,"tspan",l[e]);let i=Math.floor(c-t.getAscent(c))+t.getAscent(h[e][Kt]);s.setAttribute("x","0"),s.setAttribute("dy",String(i)),s.innerHTML="​",c=h[e][Kt]}t.layoutText(h[0][Kt])}}layout(t,e,s,i,r){const n=t.getBBox();let a,h=r.top+(i-r.top-r.bottom-n.height)/2;switch(e){case Q.CENTER:t.anchor=Yt.MIDDLE,a=r.left+(s-r.left-r.right)/2;break;case Q.RIGHT:t.anchor=Yt.END,a=n.width-r.right;break;default:t.anchor=Yt.START,a=r.left}t.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(ee);for(let t of s)e.push((new te).parse(t))}}}var ie,re,ne;!function(t){t.NORMAL="normal",t.SHUFFLE="shuffle",t.RANDOM="random"}(ie||(ie={})),function(t){t.DEFAULT="default",t.SPLINE="spline",t.STEP="step"}(re||(re={})),function(t){t.DEFAULT="default",t.REVEAL="reveal",t.GROW="grow",t.SPREAD="spread",t.FADEIN="fadein"}(ne||(ne={}));class ae{constructor(t){this.source=t}hasDef(){return!0}}class he extends ae{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),a=this.source.color,h=$(this.source.opacity)?1:this.source.opacity,o=s(a)?a[0]:a,l=s(a)&&a.length>1?a[1]:"white",c=s(h)?h[0]:h,_=s(h)&&h.length>1?h[1]:h;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",l),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",o),n.setAttribute("stop-opacity",_),i.appendChild(r),i.appendChild(n)}}class oe extends he{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:a,y2:h}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":a=1;break;case"right":n=1;break;case"left":r=1;break;default:h=1}return i.setAttribute("x1",r),i.setAttribute("y1",a),i.setAttribute("x2",n),i.setAttribute("y2",h),i}}oe.TYPE="lineargradient";class le extends he{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return $(s.cx)||i.setAttribute("cx",s.cx),$(s.cy)||i.setAttribute("cy",s.cy),$(s.rd)||i.setAttribute("rd",s.rd),this._setStops(e,i),i}}le.TYPE="radialgradient";class ce extends ae{getEelement(s,i){const n=s.createElementNS(t,"pattern"),h=s.createElementNS(t,"path");let o=!1;if(n.setAttribute("id",i.id),n.setAttribute("patternUnits","userSpaceOnUse"),h.classList.add("rct-pattern"),+i.pattern>=0){const t=ce.STOCK[+i.pattern%ce.STOCK.length];h.setAttribute("d",t.path),t.style&&a(h.style,t.style),o=!t.fill,n.setAttribute("width",String(t.width||20)),n.setAttribute("height",String(t.height||20))}else r(i.pattern)&&(h.setAttribute("d",i.pattern),n.setAttribute("width",String(i.width||i.height||20)),n.setAttribute("height",String(i.height||i.width||20)));return e(i.style)&&a(h.style,i.style),o&&(h.style.fill="none"),n.append(h),n}}ce.TYPE="pattern",ce.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class _e extends ae{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===ie.RANDOM?this._index=-1:(t.mode===ie.SHUFFLE&&at.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=s(e.colors)?e.colors:[]}}_e.TYPE="colors";class ue extends ae{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(r(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return r(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||ue.SIZE,height:e.height||e.width||ue.SIZE})}}ue.TYPE="images",ue.SIZE=20;class de{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(t))t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}));else if(e(t)){const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(dt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t,e){this._items.forEach((t=>{e.removeDef(t.source.id)}))}get(t){return this._map[t]}$_loadItem(t){if(e(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ce.TYPE:s(t.colors)?e=_e.TYPE:s(t.images)&&(e=ue.TYPE)),e)switch(e.toLowerCase()){case oe.TYPE:return new oe(t);case le.TYPE:return new le(t);case ce.TYPE:return new ce(t);case _e.TYPE:return new _e(t);case ue.TYPE:return new ue(t)}}}}let ge=0;class pe extends v{constructor(t,e){super(),this.INVALID={},this.chart=t,this._visible=e,ge++}get visible(){return this._visible}set visible(t){var e;t!==this._visible&&(this._visible=t,null===(e=this.chart)||void 0===e||e._visibleChanged(this))}load(t){if(void 0!==t&&!this._doLoadSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(t)}return this}save(){const t={visible:this.visible};return this._doSave(t),t}$_parseProp(t){if(t.indexOf(".")>=0){const e=t.split("."),s=e.length-1;let i=this;for(let t=0;t<s;t++)if(i=i[e[t]],!(i instanceof v))return this.INVALID;return{obj:i,prop:e[s]}}}getProp(t){if(r(t)){const e=this.$_parseProp(t);return e?e===this.INVALID?C:e.obj[e.prop]:this[t]}}setProp(t,e,s){if(r(t)){const i=this.$_parseProp(t);if(i)i.obj instanceof pe?i.obj.setProp(i.prop,e,s):i.obj instanceof v&&e!==i.obj[i.prop]&&(i.obj[i.prop]=e,s&&this._changed());else if(t in this){const i=this[t];if(i instanceof pe)return i.setProps(e,s);if(e!==i)return this[t]=e,s&&this._changed(),!0}}}setProps(t,s){let i=!1;if(e(t))for(const e in t)this.setProp(e,t[e],!1)&&(i=!0);else this._doLoadSimple(t)&&(i=!0);return i&&s&&this._changed(),i}prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoadSimple(t){if("boolean"==typeof t)return this.visible=t,!0}_doLoad(t){for(const i in t){let r=t[i];this._doLoadProp(i,r)||(this[i]instanceof pe?this[i].load(r):s(r)?this[i]=r.slice(0):r instanceof Date?this[i]=new Date(r):e(r)?this[i]=a({},r):this[i]=r)}}_doLoadProp(t,e){return!1}_doSave(t){}_doPrepareRender(t){}_loadStroke(t){if(r(t))return this.visible=!0,this.style={stroke:t},!0}}var me,we,fe,xe,be,ye,ve,Ve,Se,Pe;pe.UPDATED="updated",function(t){t.NONE="none",t.OUTLINE="outline",t.BACKGROUND="background"}(me||(me={})),function(t){t.CLIP="clip",t.ELLIPSIS="ellipsis",t.WRAP="wrap"}(we||(we={}));class ke extends pe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px",this.effect=me.NONE,this.autoContrast=!0}get outlineThickness(){return this._outlineThickness}set outlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=m(t,2)+"px")}}class Ae extends ke{constructor(t,e){super(t,e),this.numberSymbols="k,M,G,T,P,E",this.numberFormat="#,##0.#"}get numberSymbols(){return this._numberSymbols}set numberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?At.getFormatter(t):null)}get text(){return this._text}set text(t){this.setText(t)}setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this.lineHeight),this}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new se),this._richTextImpl.setFormat(t)):this._richTextImpl=null}isVisible(){return this.visible&&!!this._text}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}_doLoadSimple(t){return r(t)?(this.text=t,!0):super._doLoadSimple(t)}$_getNumberText(t,e,s){if(at.isValidNumber(t)){const i=this._numSymbols&&e&&at.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=t||this.$_getNumberText(e,s,i)||e;return this.prefix&&(r=this.prefix+r),this.suffix&&(r+=this.suffix),r}}!function(t){t.DEFAULT="default",t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"}(fe||(fe={}));class Ce extends Ae{constructor(){super(...arguments),this.iconPosition=fe.DEFAULT,this.iconGap=2}getIconPos(){return this.iconPosition===fe.DEFAULT?this.getDefaultIconPos():this.iconPosition}_doPrepareRender(t){if(this._images=null,this.imageList){const e=t.assets.get(this.imageList);e instanceof ue&&(this._images=e)}this._root=this._images?"":this.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart.assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof ue?s.getImage(i):i}return this._root+t}}}class Ee extends pe{}!function(t){t.CHART="chart",t.CONTAINER="container"}(xe||(xe={}));class Le extends pe{constructor(t,e){super(t,!0),this.inBody=e,this.front=!1,this.align=Q.LEFT,this.verticalAlign=J.TOP,this.offsetX=0,this.offsetY=0,this.scope=xe.CHART}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=H(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=H(this._height=t,!0))}getSize(t,e){const s=this.chart.isInverted(),i=+this.x1,r=+this.x2,n=+this.y1,a=+this.y2;let h,o;if(this._x=this._y=this._w=this._h=NaN,!isNaN(i)){const n=this.chart.xAxis;s?this._y=e-n.getPos(e,i):this._x=n.getPos(t,i),isNaN(r)||(s?o=this._h=e-n.getPos(e,r)-this._y:h=this._w=n.getPos(t,r)-this._x)}if(!isNaN(n)){const i=this.chart.yAxis;s?this._x=i.getPos(t,n):this._y=e-i.getPos(e,n),isNaN(a)||(s?h=this._w=i.getPos(t,a)-this._x:o=this._h=e-i.getPos(e,a)-this._y)}return isNaN(h)?h=j(this._widthDim,t):h<0&&(this._x+=h,h=-h),isNaN(o)?o=j(this._heightDim,e):o<0&&(this._y+=o,o=-o),{width:h,height:o}}getPosition(t,e,s,i,r,n,a){let h,o;if(isNaN(h=this._x))switch(h=e,this.align){case Q.CENTER:h+=(i-n)/2+this.offsetX;break;case Q.RIGHT:h+=i-this.offsetX-n;break;default:h+=this.offsetX}if(isNaN(o=this._y))switch(o=s,this.verticalAlign){case J.MIDDLE:o+=(r-a)/2-this.offsetY;break;case J.BOTTOM:o+=r-this.offsetY-a;break;default:o+=this.offsetY}return{x:h,y:o}}update(){this._changed(pe.UPDATED)}_doPrepareRender(t){}}class Te{constructor(t){this._map={},this._items=[],this._visibles=[],this.chart=t.chart}get count(){return this._items.length}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof Le)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t,i){const r=this.chart,n=this._items=[],a=this._map={};s(t)?t.forEach(((t,e)=>{n.push(this.$_loadItem(r,t,e,i))})):e(t)&&n.push(this.$_loadItem(r,t,0,i)),n.forEach((t=>{t.name&&(a[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,s,i){let n=e.type;n||(n=r(e.imageUrl)?"image":r(e.shape)?"shape":"text");const a=t._getAnnotationType(n);if(!a)throw new Error("Invalid annotation type: "+e.type);const h=new a(t,e.name||`annotation ${s+1}`,i);return h.load(e),h.index=s,h}}!function(t){t.AUTO="auto",t.LINE="line"}(be||(be={}));class Ne extends pe{constructor(){super(...arguments),this.minWidth=50}}class Re extends pe{constructor(t){super(t.chart,!0),this.axis=t,this.type=be.AUTO,this.showAlways=!0,this.followPointer=!0,this.numberFormat="#,##0.#",this.timeFormat="yyyy-MM-dd HH:mm",this.flag=new Ne(t.chart,!0),this.visible=!1,this._args={axis:C,pos:C,flag:C}}isBar(){return!this.axis.continuous()&&this.type===be.AUTO}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof Date?jt.getFormatter(this.timeFormat).toStr(new Date(s),this.chart.startOfWeek):At.getFormatter(this.numberFormat).toStr(s)}moved(t,e){this.onChange&&(this._args.pos=t,this._args.flag=e,this.onChange(this._args))}_doLoadSimple(t){return i(t)?(this.visible=!0,this.onChange=t,!0):super._doLoadSimple(t)}}class Me extends pe{constructor(t,e=!0){super(null==t?void 0:t.chart,e),this.axis=t}}class Oe extends Me{constructor(t,e){super(t,e&&t._isX)}_doLoadSimple(t){return this._loadStroke(t)||super._doLoadSimple(t)}}!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(ye||(ye={}));class De extends Me{constructor(){super(...arguments),this.align=ye.MIDDLE,this.offset=0,this.gap=5}get rotation(){return this._rotation}set rotation(t){let e=+t;Number.isNaN(e)||90===e||270===e||-90===e||-270===e||(e=0),this._rotation=e}isVisible(){return this.visible&&!$(this.text)}getRotation(t){return t._isHorz?0:isNaN(this._rotation)?t.position===Se.OPPOSITE?90:270:this._rotation}_doLoadSimple(t){return r(t)?(this.text=t,!0):super._doLoadSimple(t)}}class Be extends Me{getRows(){const t=this.axis,e=this.colors,s=e?e.length:0,i=[];if(this.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let a=1;a<r.length;a++,n++)e[n%s]&&i.push({axis:t,from:r[a-1].value,to:r[a].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doLoadSimple(t){return r(t)?(this.colors=[t,null],!0):s(t)?(this.colors=t,!0):super._doLoadSimple(t)}}class $e extends Me{constructor(t){super(t,null),this.firstVisible=!1,this.rows=new Be(this.axis),this.lastVisible=!t._isX}isVisible(t){return t?!1!==this.visible:null==this.visible?!this.axis._isX:this.visible}}class Ie extends Ce{constructor(t){super(t,!0),this.align=Q.LEFT,this.verticalAlign=J.TOP,this.offsetX=3,this.offsetY=3}getDefaultIconPos(){return fe.LEFT}}!function(t){t.LINE="line",t.RANGE="range",t.AREA="area"}(ve||(ve={}));class Fe extends Me{constructor(t){super(t),this.front=!1,this.zindex=0,this.label=new Ie(t.chart)}canConstainedTo(t,e){if(s(this.col)){for(const t of this.col)if(e==t)return!0;return!1}if(!isNaN(this.col)&&e!=this.col)return!1;if(s(this.row)){for(const e of this.row)if(t==e)return!0;return!1}return!(!isNaN(this.row)&&t!=this.row)}}class ze extends Fe{}class He extends Fe{}class Ge extends Me{constructor(t){super(t,!1),this.length=7,this.gap=3}_doLoadSimple(t){return at.canNumber(t)?(this.length=+t,!0):super._doLoadSimple(t)}}!function(t){t.NONE="none",t.ROTATE="rotate",t.STEP="step",t.ROWS="rows"}(Ve||(Ve={}));class je extends Ce{constructor(t){super(t&&t.chart,!0),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)},this.step=0,this.startStep=0,this.rows=0,this.maxRows=3,this.autoArrange=Ve.ROTATE,this.overflow=we.CLIP,this.numberFormat=null}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){const s=t.index;if(this.textCallback){const e=this.textCallback(this.axis.getTickLabelArgs(s,t.value));if(null!=e)return e}return 0===s?f(this.firstText,this.text):s===e-1?f(this.lastText,this.text):this.text}getLabelStyle(t,s){const i=t.index;if(this.styleCallback){const s=this.styleCallback(this.axis.getTickLabelArgs(i,t.value));if(e(s))return s}return 0===i?this.firstStyle:i===s-1?this.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?fe.TOP:fe.RIGHT}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}!function(t){t.AUTO="auto",t.NORMAL="normal",t.OPPOSITE="opposite",t.BASE="base",t.BETWEEN="between"}(Se||(Se={}));class We extends Me{constructor(t){super(t,!1),this._thickness=10,this._minThumbSize=32,this._gap=3,this._gapFar=3}get thickness(){return this._thickness}set thickness(t){this._thickness=+t||this._thickness}get minThumbSize(){return this._minThumbSize}set minThumbSize(t){this._minThumbSize=+t||this._minThumbSize}get gap(){return this._gap}set gap(t){this._gap=+t||this._gap}get gapFar(){return this._gapFar}set gapFar(t){this._gapFar=+t||this._gapFar}}class Ye{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}resize(t,e,s){if((t=isNaN(t)?this.start:g(this.min,d(this.max,t)))>(e=isNaN(e)?this.end:g(t,d(this.max,e)))){const s=t;t=e,e=s}const i=this.max-this.min;if((t!==this.start||e!==this.end)&&e>t&&(isNaN(s)||(e-t)/i>=s)&&i/(e-t)>1)return this.start=t,this.end=e,!0}}class Xe extends Oe{}class Ue extends pe{constructor(t,e,s){super(t,!0),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this.crosshair=new Re(this),this.scrollBar=new We(this),this.row=0,this.col=0,this.startAngle=0,this.totalAngle=360,this.position=Se.NORMAL,this.reversed=!1,this.marginNear=0,this.marginFar=0,this.tooltipHeader="<b>${name}</b>",this.tooltipRow="${series}:<b> ${yValue}</b>",this.animatable=!0,this._isX=e,this.name=s,this.title=new De(this),this.line=new Oe(this,!0),this.sectorLine=new Xe(this,!0),this.tick=this._createTickModel(),this.label=this._createLabel(),this.grid=this._createGrid()}isEmpty(){return this._series.length<1}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return T+N*this.startAngle}getTotalAngle(){return N*g(0,d(360,m(this.totalAngle,360)))}isArced(){return this.totalAngle>0&&this.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}value2Tooltip(t){return t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[],this._values=[]}collectValues(){this._series.forEach((t=>{t.collectValues(this,this._values)}))}collectRanges(){this._series.forEach((t=>{t.collectRanges(this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}prepareRender(){var t;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&this.position===Se.BETWEEN&&this._isX,this._isOpposite=this.position===Se.OPPOSITE,this._runPos=this.position,this.crosshair._args.axis=this._labelArgs.axis=null===(t=this.chart._proxy)||void 0===t?void 0:t.getChartObject(this),this._doPrepareRender(),this.label.prepareRender();const e=this._series,s=this._values;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!at.equalArrays(e,this._prevSeries)))for(const t of e)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalculateRange(s),this._isX&&e.length>0)if(this.chart.isSplitted()){const t=[e[0]._row];for(let s=1;s<e.length;s++)t.indexOf(e[s]._row)<0&&t.push(e[s]._row);t.forEach((t=>{let s=0,i=0;e.forEach((e=>{e._row==t&&e.clusterable()&&(s+=m(e.groupWidth,1))})),e.forEach((e=>{if(e._row==t&&e.clusterable()){const t=m(e.groupWidth,1)/s;e.setCluster(t,i),i+=t}}))}))}else{let t=0,s=0;e.forEach((e=>{e.clusterable()&&(t+=m(e.groupWidth,1))})),e.forEach((e=>{if(e.clusterable()){const i=m(e.groupWidth,1)/t;e.setCluster(i,s),s+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series}buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t),this._labelArgs.count=this._ticks.length}calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}contains(t){return t>=this._range.min&&t<=this._range.max}resetZoom(){this._zoom&&(this._zoom=null,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new Ye(this),this.buildTicks(this._vlen),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return i.isFull()&&(this._zoom=null),this._changed(),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXValue(t){return t}setPrevRate(t){this._prevRate=t}prev(t){return isNaN(this._prevRate)?t:t*this._prevRate}_doLoadProp(t,i){if("guide"===t||"guides"===t)return this.guides.length=0,s(i)?this.$_loadGuides(i):e(i)&&this.$_loadGuides([i]),!0}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}$_loadGuides(t){for(let e=0;e<t.length;e++){const s=t[e];let i;i="range"===s.type?new He(this):"line"===s.type||isNaN(s.startValue)||isNaN(s.endValue)?new ze(this):new He(this),i.load(s),this.guides.push(i)}}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?O(d(...t)||0):NaN,max:t.length>0?O(g(...t)||0):NaN}}}class Ze{constructor(t,e){this._items=[],this._map=new Map,this.chart=t,this.isX=e}get count(){return this._items.length}get first(){return this._items[0]}get items(){return this._items.slice(0)}internalItems(){return this._items}load(t){const e=this.chart;s(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0))}contains(t){return this._items.indexOf(t)>=0}get(t){return r(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t.prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}$_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e.buildTicks(t)))}connect(t){const e=this._items,s=this.isX?t.xAxis:t.yAxis;let i;return n(s)&&s>=0&&s<e.length?i=e[s]:r(s)&&(i=e.find((t=>t.name===s))),i||(i=e[0]),i&&(i._connect(t),this.isX?t.setCol(m(t.col,i.col)):t.setRow(m(t.row,i.row))),i}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,i){var r;let n=t._getAxisType(e.type);if(!n){let a;if(s(e.categories))a="category";else if(this.isX){const s=t._getSeries().internalItems();if(s.length>0){a="category";for(const t of s)if(!t.canCategorized()){if(e.name&&t.xAxis===e.name){a=C;break}if(t.xAxis===i){a=C;break}if($(t.xAxis)&&0===i){a=C;break}}}}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defaultYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,this.isX,e.name);return a.load(e),a._index=i,a._isPolar=t.isPolar(),a}}class Ke{constructor(){this._axes=[]}isEmpty(){return this._axes.length<1}}class qe{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}buildTicks(t){const e=this.isX;this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()||s.buildTicks(t[e?s.col:s.row])}))}))})),this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()&&s.buildTicks(t[e?s.col:s.row])}))}))}))}calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{const r=s?i.col:i.row;i.calcPoints(t[r],e)}))}))}))}}class Qe extends qe{constructor(t){super(t,!0)}prepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new Ke)}t.forEach((t=>{const s=t.position;let r=t._row;s===Se.OPPOSITE?(r++,t._runPos=s):r<e-1&&s===Se.BETWEEN?(r++,t._runPos=Se.NORMAL):t._runPos=s,i[r][t._col]._axes.push(t)}))}}class Je extends qe{constructor(t){super(t,!1)}prepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new Ke)}t.forEach((t=>{const e=t.position;let r=t._col;e===Se.OPPOSITE?(r++,t._runPos=e):t._col<s-1&&e===Se.BETWEEN?(r++,t._runPos=Se.NORMAL):t._runPos=e,i[t._row][r]._axes.push(t)}))}}!function(t){t.NONE="none",t.X="x",t.Y="y",t.BOTH="both"}(Pe||(Pe={}));let ts=class extends pe{constructor(t){super(t.chart,C),this.body=t}isVisible(){return!1!==this.visible&&this.body.isZoomed()&&this.body.canZoom()}};class es extends pe{constructor(t){super(t.chart,!1),this.body=t,this.size=.5}}class ss extends pe{constructor(t){super(t,!0),this.split=new es(this),this.circular=!0,this.image=new Ee(null,!0),this.zoomType=Pe.NONE,this.zoomButton=new ts(this),this._annotations=new Te(this),this.radius="45%",this.centerX="50%",this.centerY="50%"}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(t,!0))}get centerX(){return this._centerX}set centerX(t){t!==this._centerX&&(this._centerX=t,this._cxDim=H(t,!0))}get centerY(){return this._centerY}set centerY(t){t!==this._centerY&&(this._centerY=t,this._cyDim=H(t,!0))}canZoom(){return this.zoomType===Pe.X||this.zoomType===Pe.Y||this.zoomType===Pe.BOTH}calcRadius(t,e){return j(this._radiusDim,d(t,e))}setPolar(t,e){return this._cx=j(this._cxDim,t),this._cy=j(this._cyDim,e),this._rd=j(this._radiusDim,d(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd}:C}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}_doLoadProp(t,i){if("annotations"===t||"annotation"===t)return s(i)?this.$_loadAnnotations(i):e(i)&&this.$_loadAnnotations([i]),!0}_doPrepareRender(t){this._annotations.prepareRender()}$_loadAnnotations(t){this._annotations.load(t,!0)}}class is extends pe{_doLoad(t){super._doLoad(t)}_doPrepareRender(t){}}class rs extends pe{constructor(t,e){super(t.chart,!0),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}var ns,as,hs;rs.MARKER_SIZE=10,function(t){t.BOTTOM="bottom",t.TOP="top",t.RIGHT="right",t.LEFT="left",t.BODY="body"}(ns||(ns={})),function(t){t.AUTO="auto",t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(as||(as={})),function(t){t.START="start",t.CENTER="center",t.END="end"}(hs||(hs={}));class os extends is{constructor(t){super(t,void 0),this.location=ns.BOTTOM,this.layout=as.AUTO,this.alignBase=et.BODY,this.gap=6,this.itemGap=8,this.markerVisible=!0,this.markerGap=4,this.lineGap=4,this.offsetX=0,this.offsetY=0,this.itemsAlign=hs.CENTER,this.seriesHovering=!0,this.visible=void 0}items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocatiion(){return this._location}getLayout(){if(this.layout!==as.AUTO||this._location===ns.BODY)return this.layout;switch(this._location){case ns.BOTTOM:case ns.TOP:return as.HORIZONTAL;default:return as.VERTICAL}}getMaxWidth(t){return j(this._maxWidthDim,t,t)}getMaxHeight(t){return j(this._maxHeightDim,t,t)}_doLoad(t){super._doLoad(t),this._maxWidthDim=H(this.maxWidth,!0),this._maxHeightDim=H(this.maxHeight,!0)}_doPrepareRender(t){super._doPrepareRender(t),this._location=at.checkEnumValue(ns,this.location,ns.BOTTOM),this._items=this.$_collectItems(),this.reversed&&(this._items=this._items.reverse())}$_collectItems(){return this.chart._getLegendSources().map((t=>new rs(this,t)))}}const ls=Math.pow,cs=Math.sqrt,_s=Math.sin,us=Math.cos,ds=Math.PI,gs=1.70158,ps=1.525*gs,ms=gs+1,ws=2*ds/3,fs=2*ds/4.5,xs=function(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},bs={inQuad:t=>t*t,outQuad:t=>1-(1-t)*(1-t),inOutQuad:t=>t<.5?2*t*t:1-ls(-2*t+2,2)/2,inCubic:t=>t*t*t,outCubic:t=>1-ls(1-t,3),outCubic2:t=>1-ls(1-t,4),inOutCubic:t=>t<.5?4*t*t*t:1-ls(-2*t+2,3)/2,inQuart:t=>t*t*t*t,outQuart:t=>1-ls(1-t,4),inOutQuart:t=>t<.5?8*t*t*t*t:1-ls(-2*t+2,4)/2,inQuint:t=>t*t*t*t*t,outQuint:t=>1-ls(1-t,5),inOutQuint:t=>t<.5?16*t*t*t*t*t:1-ls(-2*t+2,5)/2,inSine:t=>1-us(t*ds/2),outSine:t=>_s(t*ds/2),inOutSine:t=>-(us(ds*t)-1)/2,inExpo:t=>0===t?0:ls(2,10*t-10),outExpo:t=>1===t?1:1-ls(2,-10*t),inOutExpo:t=>0===t?0:1===t?1:t<.5?ls(2,20*t-10)/2:(2-ls(2,-20*t+10))/2,inCirc:t=>1-cs(1-ls(t,2)),outCirc:t=>cs(1-ls(t-1,2)),inOutCirc:t=>t<.5?(1-cs(1-ls(2*t,2)))/2:(cs(1-ls(-2*t+2,2))+1)/2,inBack:t=>ms*t*t*t-gs*t*t,outBack:t=>1+ms*ls(t-1,3)+gs*ls(t-1,2),inOutBack:t=>t<.5?ls(2*t,2)*(7.189819*t-ps)/2:(ls(2*t-2,2)*((ps+1)*(2*t-2)+ps)+2)/2,inElastic:t=>0===t?0:1===t?1:-ls(2,10*t-10)*_s((10*t-10.75)*ws),outElastic:t=>0===t?0:1===t?1:ls(2,-10*t)*_s((10*t-.75)*ws)+1,inOutElastic:t=>0===t?0:1===t?1:t<.5?-ls(2,20*t-10)*_s((20*t-11.125)*fs)/2:ls(2,-20*t+10)*_s((20*t-11.125)*fs)/2+1,inBounce:t=>1-xs(1-t),outBounce:xs,inOutBounce:t=>t<.5?(1-xs(1-2*t))/2:(1+xs(2*t-1))/2},ys=function(t,e,s,i,r,n){const a=null!=s?z(e,s):{},h=z(e,i),o=t.animate([a,h],{duration:r,fill:"none"});return o&&n&&o.addEventListener("finish",n),o};class vs{constructor(){this.delay=0,this.duration=vs.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=d(1,g(0,O(t/this.duration)));this._easing&&(e=this._easing(e));try{this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&window.requestAnimationFrame(this._handler)}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=m(t,vs.DURATION),this.delay=e||0,this._easing=bs[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}var Vs;vs.DURATION=700,vs.SHORT_DURATION=300,function(t){t.CIRCLE="circle",t.DIAMOND="diamond",t.SQUARE="square",t.TRIANGLE="triangle",t.STAR="star",t.ITRIANGLE="itriangle",t.RECTANGLE="rectangle"}(Vs||(Vs={}));const Ss=at.getEnumValues(Vs),Ps=.001,ks=Math.PI;class As{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){return r>0?n>0?(r=d(-i/2,s/2,r),["M",t,e-(n=d(-i/2,s/2,n)),"v",i+n+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",i+(r=d(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:n>0?["M",t,e-(n=d(-i/2,s/2,n)),"v",i+n,"h",s,"v",-i-n,"a",n,n,0,0,1,-n,n,"h",2*n-s,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=d(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static arc(t,e,s,i,r,n,a,h=!1){const o=M(p(n-r)),_=2*ks-o<.01,u=o-ks<.01?0:1,d=a?1:0,g=l(r),m=c(r),w=l(n-=_?d?Ps:-.001:0),f=c(n),x=[];return x.push("M",t+s*g,e+i*m,"A",s,i,0,u,d,t+s*w,e+i*f),_&&x.push("M",t,e),h&&x.push("Z"),x}static sector(t,e,s,i,r,n,a,h){const o=M(p(a-n)),_=2*ks-o<Ps;let u=o-ks<Ps?0:1;const d=h?1:0,g=l(n),m=c(n),w=l(a-=_?d?Ps:-.001:0),f=c(a),x=s*r,b=i*r,y=[];return y.push("M",t+s*g,e+i*m,"A",s,i,0,u,d,t+s*w,e+i*f),_?y.push("M",t+x*w,e+b*f):y.push("L",t+x*w,e+b*f),isNaN(x)||y.push("A",x,b,0,u,1-d,t+x*g,e+b*m),y.push("Z"),y}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,a=e+i/2+(i/2-i/2*c(r+6*Math.PI/5))/2,h=s/2,o=i/2,_=s/4,u=i/4,d=2*Math.PI/5,g=d/2,p=[];p.push("M",n+h*l(r),a+o*c(r));for(let t=0;t<5;t++)p.push("L",n+h*l(r),a+o*c(r),"L",n+_*l(r+g),a+u*c(r+g)),r+=d;return p.push("Z"),p}static setShape(t,e,s,i){let r;switch(e){case Vs.SQUARE:case Vs.DIAMOND:case Vs.TRIANGLE:case Vs.ITRIANGLE:case Vs.STAR:case Vs.RECTANGLE:r=As[e](0,0,2*s,2*i);break;default:r=As.circle(s,i,d(s,i))}t.setPath(r)}}class Cs extends dt{static create(t,e,s,i,r,n,a=0){return new Cs(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=C,s=C){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Es extends ft{constructor(t,e=C){super(t,e)}setBox(t,e,s,i){return this.setPath(As.box(t,e,s,i)),this}}const Ls=function(t){return t&&"object"==typeof t};class Ts extends V{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),s(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let i;i=s(e)?e.slice():r(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}_internalValues(){return this._rows}$_readRow(t){let e={};if(s(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else Ls(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e,s){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&q(k.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class Ns{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const i=t[e];let r;s(i)?r=new Ts({},i):Ls(i)&&s(i.values)&&(r=new Ts(i.options,i.values)),this._map[e]=r}}}let Rs=0;class Ms{constructor(t){this.pid=Rs++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}proxy(){return{pid:this.pid,xValue:this.xValue,yValue:this.yValue,zValue:this.zValue}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null==(e=this.source)||isNaN(e)?this.source:this.source[t];var e}parse(t){const i=this.source;null==i?this.isNull=!0:s(i)?0===i.length?this.isNull=!0:this._readArray(t,i):e(i)?(this._readObject(t,i),(s(i.drillDown)||e(i.drillDown))&&(this.drillDown=i.drillDown)):this._readSingle(i)}getLabel(t){return this.label===C?this.yValue:this.label}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getTooltipPos(){return{x:this.xPos,y:this.yPos}}updateValue(t,e){e?(this.yPrev=this.yValue,this.yNew=t,this.ani=e):this.y=t}cleanValue(){this.y=this.yNew,delete this.yPrev,delete this.yNew}getTooltip(t){var e;return t in this?this[t]:null===(e=this.source)||void 0===e?void 0:e[t]}_assignTo(t){return a(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,source:this.source})}_readArray(t,e){const s=+t.colorField;e.length>1?(this.x=e[m(t.xField,0)],this.y=e[m(t.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=x(t._yFielder(e),e.y,e.value),this.color=f(t._colorFielder(e),e.color)}_readSingle(t){this.y=t}}class Os{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t){if(e(t)){const e=t.pid;for(const t of this._points)if(t.pid===e)return t}else for(const e of this._points)if(e.xValue===t)return e}contains(t){return this._points.indexOf(t)>=0}load(t){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return this._points.splice(e,1),!0}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}getProxies(){return this._points.map((t=>t.assignTo()))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getPoints(t,e){const s=t._zoom;if(s){const e=this._points,i=e.length;let r=s.start,n=s.end;if(t.continuous()){let t,s,a=0;for(s=Number.MIN_VALUE;a<i-1;a++){if(t=e[a],r>=s&&r<t.xValue+(e[a+1].xValue-t.xValue)/2){r=a;break}s=t.xValue}for(r!==a&&(r=i-1),s=Number.MAX_VALUE,a=i-1;a>0;a--){if(t=e[a],n<s&&n>t.xValue-(t.xValue-e[a-1].xValue)/2){n=a;break}s=t.xValue}n!==a&&(n=0),r=g(r-1,0),n=d(n+1,i-1)}else r=g(0,Math.floor(r)),n=d(Math.ceil(n),i-1);return this._points.slice(r,n+1)}return this._points}}class Ds extends Ms{getLabel(t){return this.zValue}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return a(super._assignTo(t),{z:this.z,zValue:this.zValue})}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=e.length>2?1:0;s>0&&(this.x=e[m(t.xField,0)]),this.y=e[m(t.yField,0+s)],this.z=e[m(t.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=f(t._zFielder(e),e.z))}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.zValue=parseFloat(this.z),this.isNull||(this.isNull=isNaN(this.zValue))}}class Bs extends Ms{get highValue(){return this.yValue}labelCount(){return 2}getLabel(t){return 1===t?this.lowValue:this.yValue}_assignTo(t){return a(super._assignTo(t),{low:this.low,lowValue:this.lowValue,highValue:this.yValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[m(t.lowField,0+s)],this.y=e[m(t.yField,1+s)],s>0&&(this.x=e[m(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=f(e[t.lowField],e.low),this.y=x(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}}var $s,Is,Fs;!function(t){t.DEFAULT="default",t.POINT="point",t.EDGE="edge"}($s||($s={}));class zs extends Ge{constructor(){super(...arguments),this.step=1}getPosition(){return this.position===$s.POINT||this.position===$s.EDGE?this.position:this.axis._isX?$s.POINT:$s.EDGE}}class Hs extends je{getTick(t,e){return null!=e?this._getText(e,e,!1,!1):""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}class Gs extends $e{getPoints(){const t=this.axis._pts,e=this.axis._ticks.length,s=[];if(e>0)for(let i=0;i<=e;i++)s.push(t[i+1]);return s}}class js extends Ue{constructor(t,e,s){super(t,e,s),this._map={},this._catPad=0,this.padding=0,this.categoryPadding=.1,this.startOffset=0}getCategories(){return this._cats}getCategory(t){return this._cats[t]}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return(this._zoom?this._zoom.start:this._catMin)+e-2;return-1}getWdith(t,e){return 0}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_createGrid(){return new Gs(this)}_createTickModel(){return new zs(this)}_createLabel(){return new Hs(this)}collectValues(){this.$_collectCategories(this._series),this._series.length>0?super.collectValues():this._values=at.makeIntArray(0,this._categories.length)}getStartAngle(){let t=super.getStartAngle(),e=+this.startOffset;return e>0&&(t-=d(e,1)*this._categories[0].w*L/this._len),t}_doPrepareRender(){this._cats=[],this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=w(this.minPadding,this.padding,0),this._maxPad=w(this.maxPadding,this.padding,0),this._catPad=Math.max(0,Math.min(.5,m(this.categoryPadding,0))))}_doBuildTicks(t,e,s){const i=this.label;let r=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this.tick.step||1,h=[],o=t,l=e;t=this._catMin=Math.floor(t+.5);let c=(e=this._catMax=Math.ceil(e-.5))-t+1;for(let e=-1;e>=t;e--)r.unshift(String(e)),n.unshift(1);for(;r.length<c;)r.push(String(r.length+t)),n.push(1);if(r=this._cats=r.slice(0,c),n=n.slice(0,c),c=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0),c>0){const s=this._pts=[0];let o=this._minPad;for(let i=t;i<=e;i++)s.push(o/c),o+=n[i-t];s.push(o/c),s.push((o+this._maxPad)/c);for(let e=1;e<s.length-2;e+=a){const s=t+e-1,n=this._categories[t+e-1];h.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,n?n.t:r[e-1])})}}else this._pts=[];return this._setMinMax(o,l),h}calcPoints(t,e){super.calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(this._isPolar){if(e>0){const e=this.totalAngle*N;this._pts=s.map((s=>s/t*e))}}else{let t;t=this.tick.getPosition()===$s.EDGE?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1]+(s[i+2]-s[i+1])*(e-Math.floor(e+.5)+.5);return this.reversed?t-r:r}valueAt(t,e){this.reversed&&(e=t-e);for(let t=1;t<this._pts.length-1;t++)if(e>=this._pts[t]&&e<this._pts[t+1])return this._catMin+t-.5}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);return this._pts[s+2]-this._pts[s+1]}getValue(t){return n(t)?t:this._map[t]}getXValue(t){return this._cats[t-this._catMin]||t}$_collectCategories(t){const i=this.categories,r=this._categories=[];if(s(i)&&i.length>0)this._len=0,i.forEach((t=>{const s=null==t?1:m(t.weight,1),i=t&&t.icon;let n,a;null==t?a=n=null:e(t)?(n=f(t.name,t.label),a=f(t.label,t.name)):a=n=String(t),this._len+=s,r.push({c:n,t:a,w:s,i:i})}));else if(s(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)r.find((t=>t.c===e))||r.push({c:e,w:1,t:e})}this._map={},r.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}!function(t){t.AUTO="auto",t.INSIDE="inside",t.OUTSIDE="outside",t.HEAD="head",t.FOOT="foot",t.INSIDE_FIRST="insideFirst",t.OUTSIDE_FIRST="outsideFirst"}(Is||(Is={}));class Ws extends Ce{constructor(t){super(t,C),this._domain={callback:(t,e)=>this._point[e]||this._point.source[e]},this.position=Is.AUTO,this.textAlign=Q.CENTER,this.distance=25,this.visible=C}getTextDomain(t){return this._point=t,this._domain}getText(t){return at.isValidNumber(t)?this._getText(null,t,p(t)>1e3,!0):t}getOffset(){const t=+this.offset;return isNaN(t)?this.position===Is.INSIDE?0:Ws.OFFSET:t}getDefaultIconPos(){return fe.TOP}_doLoadSimple(t){return i(t)?(this.visibleCallback=t,this.visible=!0):super._doLoadSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Ws.OFFSET=4,function(t){t.LINEAR="linear",t.LOGARITHMIC="logarithmic",t.POLYNOMIAL="polynomial",t.POWER="power",t.EXPONENTIAL="exponential",t.MOVING_AVERAGE="movingAverage"}(Fs||(Fs={}));class Ys extends pe{constructor(t){super(t.chart,!1),this.series=t,this.type=Fs.LINEAR,this.resolution=5,this.movingInterval=2}_doPrepareRender(t){const e=this.series,s=this._res=(e._runPoints.length-1)*Math.max(1,this.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._runPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r})));(this["$_"+this.type]||this.$_linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){return!0===this.curved||null==this.curved&&(this.type===Fs.EXPONENTIAL||this.type===Fs.LOGARITHMIC||this.type===Fs.POWER)}$_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const a=e*n-s*s,h=0===a?0:(e*r-s*i)/a;return{m:h,a:(i-h*s)/e}}$_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this.$_calcLine(t);e.push({x:t[0].x,y:i*t[0].x+r}),e.push({x:t[s-1].x,y:i*t[s-1].x+r})}}$_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:m(t.y,0)}))),{m:r,a:n}=this.$_calcLine(i),a=t[0].x,h=t[s-1].x,o=(h-a)/this._res;for(let t=a;t<=h;t+=o){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}$_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this.$_calcLine(i),a=Math.exp(n),h=t[0].x,o=t[s-1].x,l=(o-h)/this._res;for(let t=h;t<=o;t+=l){const s=a*Math.pow(t,r);e.push({x:t,y:s})}}}$_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,a=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),a+=t.x*t.y}));const h=s*i-a*a,o=Math.exp((i*r-a*n)/h);return{m:(s*n-a*r)/h,a:o}}$_exponential(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this.$_calcLine2(i),a=n,h=t[0].x,o=t[s-1].x,l=(o-h)/this._res;for(let t=h;t<=o;t+=l){const s=a*Math.exp(r*t);e.push({x:t,y:s})}}}$_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,a=0;const h=2+1;for(let e=0;e<h;e++){for(let i=0;i<s;i++)n+=Math.pow(t[i].x,e)*t[i].y;i.push(n),n=0;const o=[];for(let i=0;i<h;i++){for(let r=0;r<s;r++)a+=Math.pow(t[r].x,e+i);o.push(a),a=0}r.push(o)}r.push(i);const o=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)p(s[t][r])>p(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,h),l=t[0].x,c=t[s-1].x,_=(c-l)/this._res;for(let t=l;t<=c;t+=_){const s=o.reduce(((e,s,i)=>e+s*Math.pow(t,i)),0);e.push({x:t,y:s})}}}$_movingAverage(t,e){const s=t.length,i=g(1,d(s-1,this.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+m(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}const Xs={x:"xValue",y:"yValue",z:"zValue"};class Us extends vs{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point.ani,this.point.cleanValue()}}_doUpdate(t){return this.point.y=this.point.yPrev+(this.point.yNew-this.point.yPrev)*t,this.series._changed(),!0}}class Zs extends pe{static _loadSeries(t,e,s){return new(t._getSeriesType(e.type)||t._getSeriesType(s||t.type))(t,e.name).load(e)}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return t._xAxisObj.getXValue(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getTooltip(s)}}constructor(t,e){super(t,!0),this._row=0,this._col=0,this.index=-1,this._simpleMode=!1,this.zOrder=0,this.visibleInLegend=!0,this.visibleInNavigator=!1,this.tooltipText="<b>${name}</b><br>${series}:<b> ${yValue}</b>",this.loadAnimation=ne.DEFAULT,this.name=e,this.pointLabel=this._createLabel(t),this.trendline=new Ys(this),this._points=new Os(this),this._pointArgs=this._createPointArgs(),this._initProps()}_initProps(){}_createLabel(t){return new Ws(t)}onDataValueChanged(t,e,s,i,r){if(at.log("onDataValueChanged",e,s,i,r),s===(this.yField||"y")){const t=this._runPoints[e];t&&this.setValueAt(t,i,!0)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){at.log("onDataRowAdded",e),this.addPoint(t.getRow(e),!0)}onDataRowDeleted(t,e){at.log("onDataRowDeleted",e)}onDataChanged(t){at.log("onDataChanged")}getTooltipText(t,e){return this.tooltipText}getTooltipParam(t,e,s){return Zs.getPointTooltipParam(t,e,s)}get data(){return this._data}set data(t){t!==this._data&&(this._data=t,this._dataDirty=!0)}contains(t){return this._points.contains(t)}getPoints(){return this._points}getLabeledPoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}getVisiblePoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}displayName(){return this.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,+e||rs.MARKER_SIZE)),this._legendMarker}legendColor(){return this._calcedColor}legendLabel(){return this.label||this.name}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s}hasMarker(){return!1}setShape(t){}seriesChanged(){return!1}getVisibleSeries(){return[this]}needClip(t){const e=this.group?this.group.noClip:this.noClip;return t?!1===e:!0!==e}setCol(t){this._col=t}setRow(t){this._row=t}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(){let t=this._xAxisObj.getValue(this.xStart);const e=isNaN(t)?this._xAxisObj.getValue(this.chart.options.xStart):t;return this._xAxisObj._zoom?Math.floor(this._xAxisObj._zoom.start):e}getXStep(){return f(this.xStep,this.chart.options.xStep)}prepareRender(){if(this._xAxisObj=this.group?this.group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this.group?this.group._yAxisObj:this.chart._connectSeries(this,!1),this._calcedColor=void 0,this._dataDirty){const t=this._doLoadData(this._data);this._loadPoints(t),this._dataDirty=!1}this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.pointLabel.prepareRender(),super.prepareRender()}prepareAfter(){}collectCategories(t){if(t instanceof js){let e=t.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>r(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart()||0,i=this.getXStep()||1;r(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)&&(i=t.getValue(s.y)),isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectRanges(t){const e=this._visPoints,s=e.length;if(s>0){const t=this._pointArgs;let i=e[0],r=i.xValue,n=r,a=i.yValue,h=a,o=i.zValue,l=o;const c=this.hasZ();i.vindex=0;for(let t=1;t<s;t++)i=e[t],i.vindex=t,isNaN(h)&&!isNaN(i.yValue)?a=h=i.yValue:i.yValue>h?h=i.yValue:i.yValue<a&&(a=i.yValue),isNaN(n)&&!isNaN(i.xValue)?r=n=i.xValue:i.xValue>n?n=i.xValue:i.xValue<r&&(r=i.xValue);if(c)for(let t=1;t<s;t++){const s=e[t].zValue;isNaN(l)&&!isNaN(s)?o=l=s:s>l?l=s:s<o&&(o=s)}if(this._minY=a,this._maxY=h,this._minX=r,this._maxX=n,this.trendline.visible){this.trendline.prepareRender();const t=this.trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,c&&(t.zMin=this._minZ=o,t.zMax=this._maxZ=l)}this.$_prepareViewRanges(e),isNaN(this._minY)||t.push(this._minY,this._maxY)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=st(this.viewRanges,s,i,!1,!1,!0,this.color))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=C}))}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t))),this._visPoints=this._runPoints.filter((t=>t.visible))}reference(t,e){}isVisible(t){return this._xAxisObj.contains(t.x)&&this._yAxisObj.contains(t.y)}getLegendSources(t){!1!==this.visibleInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_createPointArgs(){return{}}_preparePointArgs(t){var e;this._pointLabelCallback=this.pointLabel.textCallback,this._argsPoint=null,t.series=null===(e=this.chart._proxy)||void 0===e?void 0:e.getChartObject(this),t.count=this._points.count}_getPointCallbackArgs(t,e){e!==this._argsPoint&&(this._argsPoint=e).assignTo(t)}getPointText(t,e){if(this._pointLabelCallback){this._getPointCallbackArgs(this._pointArgs,t);const e=this._pointLabelCallback(this._pointArgs);if(null!=e)return e}return e}getPointStyle(t){if(this.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(this.pointLabel.styleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this.pointLabel.styleCallback(this._pointArgs)}pointClicked(t){if(this.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this.onPointClick(this._pointArgs)}getViewRangeAxis(){return this.viewRangeValue||this._defViewRangeValue()}isPointLabelsVisible(){return this.pointLabel.visible||i(this.pointLabel.visibleCallback)}isPointLabelVisible(t){const e=this.pointLabel;return!1!==e.visible&&(e.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t){return r(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}setValueAt(t,e,s){if(t&&(t.ani&&t.yNew!==e||!t.ani&&t.yValue!==e)){const i=s?new Us(this,t):C;return t.ani instanceof Us&&t.ani.stop(),t.updateValue(e,i),this.chart.dataChanged(),i.start(),this._changed(),!0}}findPoint(t){}updateData(t){this._points.load(t),this.chart.dataChanged(),this._changed()}addPoint(t,e){const s=this._doAddPoint(t);return s&&(this._points.add(s),this.chart.dataChanged(),this._changed()),s}removePoint(t){if(t&&this._points.remove(t))return this.chart.dataChanged(),this._doPointRemoved(t),this._changed(),!0}_createPoint(t){return new Ms(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_createFielder(t){return i(t)?e=>t(e):r(t)?e=>e[t]:t=>C}_createFielders(){this._xFielder=this._createFielder(this.xField),this._yFielder=this._createFielder(this.yField),this._zFielder=this._createFielder(this.zField),this._colorFielder=this._createFielder(this.colorField)}_defaultLoadAnimation(){return ne.REVEAL}_doLoad(t){super._doLoad(t),this._createFielders()}_doLoadData(t){if(s(t))return t;if(t){let e;if(t.$_p instanceof Ts?e=t.$_p:t instanceof Ts?e=t:r(t)&&(e=this.chart.data.get(t)),e)return e!==this._cdata&&(this._cdata&&this._cdata.removeListener(this),this._cdata=e,this._cdata&&this._cdata.addListener(this)),e._internalValues()}}_loadPoints(t){this._doLoadPoints(t)}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this.color;let e,i;s(this.pointColors)?e=this.pointColors:r(this.pointColors)?i=this.chart.assets.get(this.pointColors):this._colorByPoint()&&(e=this.chart.colors),i instanceof _e?(i.prepare(),this._runPoints.forEach(((e,s)=>{e.color=e.color||i.getNext()||t}))):e?this._runPoints.forEach(((s,i)=>{s.color=s.color||e[i%e.length]||t})):this._runPoints.forEach(((e,s)=>{e.color=e.color||t})),this._preparePointArgs(this._pointArgs)}_setViewRange(t,e){const s=t[Xs[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=C}_defViewRangeValue(){return"y"}}Zs.LEGEND_MARKER="rct-legend-item-marker";class Ks{constructor(t){this._map={},this._items=[],this._visibles=[],this._series=[],this._visibleSeries=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(){return!this._items.find((t=>!t.isEmpty()))}items(){return this._items.slice(0)}internalItems(){return this._items}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s._row&&e===s._col))}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const i=this.chart,r=this._items=[],n=this._series=[];s(t)?t.forEach(((t,e)=>{r.push(this.$_loadItem(i,t,e))})):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach((t=>{t instanceof oi?n.push(...t.series):t instanceof Zs&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t)))}$_add(t){!this._widget||t instanceof Js||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}add(t){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof Zs?e=t:r(t)&&(e=this._map[t]),e){if(!e.group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),e.name&&delete this._map[e.name],e;if(e.group.remove(e))return e}}updateData(t){}prepareRender(){const t=[];let e=0;this._visibles=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.zOrder||0)-(+e.zOrder||0))),this._series.forEach((s=>{s.visible&&t.push(s),s.hasMarker()&&s.setShape(Ss[e++%Ss.length])})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=this._visibleSeries.filter((t=>t.clusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof ei&&(t._single=1===s)})),this._visibles.forEach((t=>t.prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,i){let r=s(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const s=new r(t);return s.load(e),s.index=i,s}if(r=t._getSeriesType(e.type||t.type),!r)throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t,e.name||`Series ${i+1}`);return n.load(e),n.index=i,n}}class qs extends pe{constructor(t){super(t.chart,!0),this.series=t,this.radius=3}}class Qs extends Ms{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return f(this.x,this.y)}styleLegendMarker(t){}}class Js extends Zs{constructor(){super(...arguments),this.boundsAnimation=!0,this.legendByPoint=!1}getCenter(t,e){return{x:j(this._centerXDim,t),y:j(this._centerYDim,e)}}getLabelPosition(){const t=this.pointLabel.position;return t===Is.AUTO?Is.INSIDE:t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this.legendByPoint?!1!==this.visibleInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_doLoad(t){super._doLoad(t),this._centerXDim=H(x(this.centerX,this.center,Js.CENTER),!0),this._centerYDim=H(x(this.centerY,this.center,Js.CENTER),!0)}}Js.CENTER="50%";class ti extends Js{constructor(){super(...arguments),this.radius=ti.DEF_RADIUS,this.startAngle=0,this.totalAngle=360,this.clockwise=!0}getRadius(t,e){return j(this._radiusDim,d(t,e))}_doLoad(t){super._doLoad(t),this._radiusDim=H(f(this.radius,ti.DEF_RADIUS),!0)}}ti.DEF_RADIUS="40%";class ei extends Zs{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this.pointWidth=1}get groupWidth(){return this.pointWidth}getPointWidth(t){const e=this.group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,s}getPointPos(t){const e=this.group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.groupPadding,s-=s*e.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return t===Is.AUTO?Is.OUTSIDE_FIRST:t}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this.pointPadding)?this._single?.25:this.group?.1:.2:Math.max(0,Math.min(.5,this.pointPadding))}}class si extends ei{constructor(){super(...arguments),this.baseValue=0,this.nullAsBase=!1}_doPrepareRender(){super._doPrepareRender(),this._base=m(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this.baseValue}isBased(t){return t===this._yAxisObj}}class ii extends ei{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}class ri extends ii{}var ni,ai,hi;!function(t){t.DEFAULT="default",t.OVERLAP="overlap",t.STACK="stack",t.FILL="fill"}(ni||(ni={}));class oi extends pe{static collectTooltipText(t,e,s){let i=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,r)=>{s.vindex>=e._visPoints.length||(i&&(i+="<br>"),i+=t.tooltipRow.replace("series","series."+r).replace(/\$\{/g,"${"+r+"."))})),i+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",i}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=+i.substring(0,r);return isNaN(n)||(s=(e=t[n])._visPoints[s.vindex],i=i.substring(r+1)),i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Zs.getPointTooltipParam(e,s,i)}constructor(t){super(t,!0),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1,this.layout=ni.DEFAULT,this.visibleInLegend=!0,this.zOrder=0,this.tooltipHeader="<b>${name}</b>",this.tooltipRow="${series}:<b> ${yValue}</b>",this.layoutMax=100}getTooltipText(t,e){return oi.collectTooltipText(this,this._visibles,e)}getTooltipParam(t,e,s){return oi.inflateTooltipParam(this._visibles,t,e,s)}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(){return this._series.length<1}canCategorized(){return!1}defaultYAxisType(){return"linear"}clusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}setCol(t){this._col=t,this._series.forEach((e=>e.setCol(t)))}setRow(t){this._row=t,this._series.forEach((e=>e.setRow(t)))}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this.layout){case ni.STACK:this.$_collectStack(t,e);break;case ni.FILL:this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t){this._visibles.forEach((e=>{e.collectRanges(t)}))}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){if(!1!==this.visibleInLegend){const e=this._series;if(this._yAxisObj.reversed||this.layout!==ni.FILL&&this.layout!==ni.STACK)e.forEach((e=>e.getLegendSources(t)));else for(let s=e.length-1;s>=0;s--)e[s].getLegendSources(t)}}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return(isNaN(s)||e>s||!this.isBased(t))&&this.layout!==ni.FILL}getVisPoints(t){return this._visibles.map((e=>e._visPoints[t.vindex]))}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),!0}getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e.getVisiblePoints()))),t}_doLoadProp(t,e){if("children"===t)return this.$_loadSeries(this.chart,e),!0}prepareRender(){const t=this._visibles;this._stacked=this.layout===ni.STACK||this.layout===ni.FILL,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.zOrder||0)-(+e.zOrder||0))),this._seriesChanged=!at.equalArrays(t,this._visibles),super.prepareRender()}_doPrepareRender(t){this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),this._visibles.length>0&&(this._visibles.forEach((t=>t.prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,i){const r=this._seriesType();s(i)?i.forEach(((e,s)=>this.$_add(Zs._loadSeries(t,e,r)))):e(i)&&this.$_add(Zs._loadSeries(t,i,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t.group=this,t.index=this._series.length-1}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(p(e.yValue)||0)),0);let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}class li extends oi{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ci extends oi{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this.groupWidth=1,this.groupPadding=.1}clusterable(){return!0}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}class _i extends Zs{}class ui extends pe{constructor(t){super(t,!0),this.text="Title",this.alignBase=et.BODY,this.align=Q.CENTER,this.verticalAlign=J.MIDDLE,this.gap=10}isVisible(){return this.visible&&!$(this.text)}_doLoadSimple(t){return r(t)?(this.text=t,!0):super._doLoadSimple(t)}}!function(t){t.BOTTOM="bottom",t.RIGHT="right",t.LEFT="left",t.TOP="top"}(ai||(ai={}));class di extends ui{constructor(){super(...arguments),this.verticalAlign=J.BOTTOM,this.position=ai.BOTTOM,this.text="",this.titleGap=2}}class gi extends $e{getPoints(t){const e=this.axis;return e.hasBreak()?e._ticks.filter((t=>!e.isBreak(t.value))).map((s=>e.getPos(t,s.value))):e._ticks.map((s=>e.getPos(t,s.value)))}}class pi extends Ge{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1,this.stepPixels=72,this.baseRange=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,i,r=!1){var n,a;let h;return this._strictTicks=this._strictEnds=!1,this._step=NaN,r?h=this._getStepsByPixels(t,m(.85*this.stepPixels,60),e,s,i):Array.isArray(this.steps)?(h=this.steps.slice(0),h.length>0&&isNaN(h[0])&&(h[0]=s),h.length>1&&isNaN(h[h.length-1])&&(h[h.length-1]=i),this._strictTicks=this._strictEnds=!0):h=this._baseAxis instanceof xi?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i,!0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s,i,!1):this._isValidInterval(this.stepInterval)?this._getStepsByInterval(this.stepInterval,e,s,i):this.stepPixels>0?this._getStepsByPixels(t,((null===(n=this.axis)||void 0===n?void 0:n._isPolar)&&!(null===(a=this.axis)||void 0===a?void 0:a._isX)?.5:1)*this.stepPixels,e,s,i):s!==i?[s,i]:[s],h}getNextStep(t,e){return t+e*this._step}_findBaseAxis(){if(null!=this.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this.baseAxis);e!==t&&e instanceof xi&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>h(t/e)*e?t=h(t/e)*e:t<o(t/e)*e&&(t=o(t/e)*e),O(t)}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,a=i-s;let l=a/(t-1);const c=Math.pow(10,Math.floor(Math.log10(l))),_=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&l/c==2.5&&h(t*a/l)==t*a/l?this._step=l:l=this._step=o(l/c)*c:l=a/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,c);else{for(Z(s<e&&i>e,"base error"),t=g(3,t);;){if(!(o((e-s)/l)+o((i-e)/l)+1>t))break;l+=c}s=e-o((e-s)/l)*l}else s=n._fixedMin;_.push(s);for(let e=1;e<t;e++)_.push(O(_[e-1]+l));return _}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=this.$_normalizeMin(s,t),isNaN(e))for(r.push(n=s);n<i;)r.push(n=O(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=O(n-t));for(n=e;n<i;)r.push(n=O(n+t))}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let l=g(1,h(t/e))+1,c=n/(l-1);const _=Math.pow(10,Math.floor(u(c))),d=this._getStepMultiples(_);let p,m=0;if(c/=_,d)if(c>d[m]){for(;m<d.length-1;m++)if(c>d[m]&&c<d[m+1]){c=d[++m];break}}else c=d[m];if(c*=_,isNaN(s))i=this.$_normalizeMin(i,c);else{for(Z(i<=s&&r>=s,"base error"),l=g(3,l);m<d.length;){if(!(o((s-i)/c)+o((r-s)/c)+1>l))break;c=m<d.length-1?d[m+1]*_:2*c,m++}i=s-o((s-i)/c)*c}for(this._step=c,a.push(O(p=i));p<r;)a.push(O(p+=c));return a}}class mi extends je{constructor(){super(...arguments),this.useSymbols=!0}getTick(t,e){return this._getText(null,e,this.useSymbols&&this.axis.tick._step>100,!0)}}class wi extends Me{constructor(){super(...arguments),this.enabled=!0,this.size="30%",this.space=16,this.gridVisible=!0}getSize(t){return j(this._sizeDim,t)}_doLoad(t){super._doLoad(t),this.space=m(this.space,0),this._sizeDim=H(this.size,!1)}}!function(t){t.DEFAULT="default",t.TICK="tick",t.VALUE="value"}(hi||(hi={}));class fi extends Oe{}class xi extends Ue{constructor(t,e,s){super(t,e,s),this.nullable=!0,this.padding=.04,this.startFit=hi.DEFAULT,this.endFit=hi.DEFAULT,this.breaks=[],this.baseLine=new fi(this,!1),this.label.numberFormat="0.##"}getBaseValue(){return this.baseValue}hasBreak(){return null!=this._runBreaks}runBreaks(){return this._runBreaks&&this._runBreaks.slice(0,1)}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.gridVisible&&(t===e.from||t===e.to)}}getStartFit(){return this.startFit===hi.DEFAULT?this._isX?hi.VALUE:hi.TICK:this.startFit}getEndFit(){return this.endFit===hi.DEFAULT?this._isX?hi.VALUE:hi.TICK:this.endFit}continuous(){return!0}contains(t){return!isNaN(t)}isBased(){return!!this.tick._baseAxis}_createGrid(){return new gi(this)}_createTickModel(){return new pi(this)}_createLabel(){return new mi(this)}_doLoadProp(t,e){return"break"===t?(this.$_loadBreaks(e),!0):super._doLoadProp(t,e)}_doPrepareRender(){this._baseVal=parseFloat(this.baseValue),this._unitLen=NaN,this.tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this.tick,r=i._baseAxis instanceof xi;let{min:n,max:a}=this._adjustMinMax(this._calcedMin=t,this._calcedMax=e),h=this._baseVal;isNaN(h)&&n<0&&a>0&&(h=0),r&&i.baseRange&&(n=i._baseAxis.axisMin(),a=i._baseAxis.axisMax());let o=i.buildSteps(s,h,n,a,!1);const l=[];if(i._strictTicks||(o=i._normalizeSteps(o,n,a)),!isNaN(this._fixedMin)||!i._strictEnds&&this.getStartFit()!==hi.TICK)for(;o.length>1&&n>o[0];)o.shift();else{if(!i._strictEnds&&!r){for(;o.length>2&&o[1]<=n;)o.shift();if(!isNaN(i._step))for(;o[0]>n;)o.unshift(i.getNextStep(o[0],-1))}n=o[0]}if(!isNaN(this.strictMax)||!i._strictEnds&&this.getEndFit()!==hi.TICK)for(;a<o[o.length-1]&&o.length>1;)o.pop();else{if(!i._strictEnds&&!r){for(;o.length>2&&o[o.length-2]>=a;)o.pop();if(!isNaN(i._step))for(;o[o.length-1]<a;)o.push(i.getNextStep(o[o.length-1],1))}a=o[o.length-1]}this._setMinMax(n,a),this._runBreaks&&(o=this.$_getBrokenSteps(this._runBreaks,s,n,a));for(let t=0;t<o.length;t++){const e=this._createTick(s,t,o[t]);l.push(e)}return l}_createTick(t,e,s){return{index:e,pos:NaN,value:O(s),label:this.label.getTick(e,s)||String(s)}}calcPoints(t,e){super.calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this.tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],h=this._sects=[];e-=t.reduce(((t,e)=>t+e.space),0),t.forEach((t=>{const s=t.getSize(e),i={from:n,to:t.from,pos:r,len:s};r+=s,h.push(i,t._sect={from:t.from,to:t.to,pos:r,len:t.space}),r+=t.space;this.$_buildBrokenSteps(i).forEach((t=>{t>i.from&&t<=i.to&&a.push(t)})),t.space>0&&a.push(t.to)}));const o=t[t.length-1];if(i>o.to){const t={from:o.to,to:i,pos:r,len:this._vlen-r};h.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=h[h.length-1],a}getPos(t,e){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this.reversed?t-i-s.pos:i+s.pos}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this.reversed?t-s:s}}valueAt(t,e){if(this._isHorz?this.reversed&&(e=t-e):this.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return isNaN(this._unitLen)&&(this._unitLen=this.$_calcUnitLength(t)),this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_adjustMinMax(t,e){let s=this.isZoomed(),i=this.isZoomed(),r=!0,n=!0,a=NaN,h=NaN;this._series.forEach((o=>{const l=o.getBaseValue(this);isNaN(l)||(isNaN(this.minValue)&&l<=t?o.isBased(this)?t=l:a=m(d(a,l),l):isNaN(this.maxValue)&&l>=e&&(o.isBased(this)?e=l:h=m(g(h,l),l))),!s&&r&&o.canMinPadding(this,t)&&(r=!1),!i&&n&&o.canMaxPadding(this,e)&&(n=!1)})),s||(s=r),i||(i=n),this._fixedMin=this._fixedMax=NaN;let o=0,l=0;isNaN(this.strictMin)?this.minValue<t?t=this.minValue:s?this._fixedMin=t:o=w(this.minPadding,this.padding,0):this._fixedMin=t=this.strictMin,isNaN(this.strictMax)?this.maxValue>e?e=this.maxValue:i?this._fixedMax=e:l=w(this.maxPadding,this.padding,0):this._fixedMax=e=this.strictMax;let c=g(0,e-t),_=t-c*(this._minPad=o),u=e+c*(this._maxPad=l);return!isNaN(a)&&a<=t&&_<a&&(_=this._fixedMin=a),!isNaN(h)&&h>=e&&u>h&&(u=this._fixedMax=h),{min:_,max:u}}$_calcUnitLength(t){const e=[];this._series.forEach((t=>{t.visible&&e.push(...t.getVisiblePoints())}));const s=this._isX;let i=e.map((t=>s?t.xValue:t.yValue)).sort(((t,e)=>t-e));for(let t=i.length-1;t>0;t--)i[t]===i[t-1]&&i.splice(t,1);let r=i[1]-i[0];for(let t=2;t<i.length;t++)r=d(r,i[t]-i[t-1]);return t*=r/(this._max-this._min),m(t,1)}$_loadBreak(t){if(e(t)&&"from"in t&&"to"in t)return new wi(this).load(t)}$_loadBreaks(t){if(s(t))for(let e of t){const t=this.$_loadBreak(e);t&&this.breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this.breaks.push(e)}this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.to=e.to}const e=this.breaks.sort(((t,e)=>t.from-e.from)).filter((t=>t.to>t.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(a(new wi(this),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],h=e[r];s=n,h.from<s.to?t(n,h):i.push(a(new wi(this),h))}}var s}}class bi extends xi{_type(){return"linear"}_adjustMinMax(t,e){const s=super._adjustMinMax(t,e),i=this._series;return!this._isX&&1===i.length&&i[0]instanceof oi&&i[0].layout===ni.FILL&&(s.max=i[0].layoutMax),s}}class yi extends pi{constructor(){super(...arguments),this.arrangeDecimals=!0}_getStepMultiples(t){return t<=.1?[1/t]:[1,2,3,4,5,10]}_normalizeSteps(t,e,s){if(!this.arrangeDecimals)return t;for(let e=0;e<t.length;e++){let i=t[e],r=h(i);if(i>0&&i>r)if(i=r+u(10*(i-r)),i<=s)t[e]=i;else if(e>0){if(t[e-1]>=s)break;{const r=_(h(u(t[e]-t[e-1]))),n=t[e],a=n-h(n);if(r<1)for(let t=1;t<10;t++)if(a>u(t)&&a<u(t+1)){const e=h(n)+u(t);if(e>=s){i=e;break}}t[e]=i}}}return t}}const vi=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Vi=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],Si={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Pi extends pi{constructor(){super(...arguments),this["@config stepInerval"]=void 0}getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this.scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_isValidInterval(t){return isNaN(t)?r(t)&&Si.hasOwnProperty(t.charAt(t.length-1))?(t=parseFloat(t),!isNaN(t)&&(t<=-1||t>=1)):void 0:0!=+t}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=vi[e]&&t<vi[e+1]/2)return this.scale=e,Vi[e];this.scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const h=this.axis,o=new Date(h._calcedMin);let l=Math.floor(t/this.stepPixels)+1,c=g(1,Math.floor(a/(l-1)));const _=this._getStepMultiples(c),u=vi[this.scale];if(c/=u,_)if(c>_[0]){let t=0;for(;t<_.length-1;t++)if(c>_[t]&&c<_[t+1]){c=_[t+1];break}}else c=_[0];const d=h.date(i),p=h.date(r);let m,w=d;if(7===this.scale){const t=o.getFullYear();let e=w.getFullYear();this._step=c=Math.ceil(c),w=new Date(e,0),e<t&&e+c>t&&(e=t,w=new Date(e,0));do{n.push(+w),e+=c,w=new Date(e,0)}while(w<=p)}else if(6===this.scale){let t=w.getFullYear(),e=w.getMonth();this._step=c=Math.ceil(c),w=new Date(t,e),w<o&&new Date(t,e+c)>o&&(w=new Date(o.getFullYear(),o.getMonth()));do{n.push(+w),e+=c,w=new Date(t,e)}while(w<=p)}else if(4===this.scale||5===this.scale){let t=w.getFullYear(),e=w.getMonth(),s=w.getDate();const i=5===this.scale?7:1;this._step=c=Math.ceil(c),w=new Date(t,e,s),w<o&&new Date(t,e,s+i*c)>o&&(w=new Date(o.getFullYear(),o.getMonth(),o.getDate()));do{n.push(+w),s+=c*i,w=new Date(t,e,s)}while(w<=p)}else{switch(this._step=c,c*=u,this.scale){case 3:w.setMinutes(0);case 2:w.setSeconds(0);case 1:w.setMilliseconds(0)}m=w.getTime();const t=o.getTime();m<t&&m+c>t&&(m=t);do{n.push(m),m+=c}while(m<=r)}return n}_getStepsByInterval(t,e,s,i){if(r(t)){const r=[],n=t.charAt(t.length-1);let a;if(this._step=parseFloat(t),this.scale=Si[n],t=vi[this.scale],s+=this.axis._offset,isNaN(e))for(r.push(a=s);a<i;)r.push(a=this.getNextStep(a,1));else{for(r.push(a=e);a>s;)r.unshift(a=this.getNextStep(a,-1));for(a=e;a<i;)r.push(a=this.getNextStep(a,1))}return this._step=t,r}return super._getStepsByInterval(t,e,s,i)}}const ki=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd"},{format:"MM-dd",beginningFormat:"yyyy-MM"},{format:"W주 w",beginningFormat:"yyyy-MM"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy"}];class Ai extends je{constructor(){super(...arguments),this.useBeginningFormat=!0}_doLoad(t){super._doLoad(t);const i=r(this.timeFormat)?this.timeFormat:void 0,n=r(this.beginningFormat)?this.beginningFormat:void 0,h=this.timeFormats,o=this.useBeginningFormat;if(this._formatter=i?jt.getFormatter(i):void 0,this._formats=ki.map((t=>a(t))),s(h))for(let t=0;t<h.length;t++){const s=this._formats[t];if(i)s.format=i,s.beginningFormat=n||i;else{const i=h[t];r(i)?(s.format=i,o||(s.beginningFormat=i)):e(i)&&(r(i.format)&&(s.format=i.format),r(i.beginningFormat)?s.beginningFormat=i.beginningFormat:o||(s.beginningFormat=s.format))}}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,a=i.tick.scale;switch(a){case 7:return jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?jt.getFormatter(n[a].beginningFormat).toStr(r,s.startOfWeek):jt.getFormatter(n[a].format).toStr(r,s.startOfWeek)}}}class Ci extends xi{constructor(t,e,s){super(t,e,s),this.baseValue=NaN}_type(){return"time"}_createTickModel(){return new Pi(this)}_createLabel(){return new Ai(this)}_doLoad(t){super._doLoad(t),t&&t.label||this.label.load(null)}collectValues(){this._offset=60*m(this.chart.timeOffset,0)*1e3,super.collectValues()}_adjustMinMax(t,e){return super._adjustMinMax(t,e)}getValue(t){return n(t)?t+this._offset:t instanceof Date?t.getTime():r(t)?new Date(t).getTime():void 0}incStep(t,e){if(!r(e))return t+e;{const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}}}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?NaN:new Date(t)}getXValue(t){return isNaN(t)?NaN:new Date(t)}}class Ei extends is{constructor(t){super(t,!0),this.index=-1,this.size="100%"}get left(){return this._left}set left(t){t!==this._left&&(this._leftDim=H(this._left=t,!0))}get right(){return this._right}set right(t){t!==this._right&&(this._rightDim=H(this._right=t,!0))}get top(){return this._top}set top(t){t!==this._top&&(this._topDim=H(this._top=t,!0))}get bottom(){return this._bottom}set bottom(t){t!==this._bottom&&(this._bottomDim=H(this._bottom=t,!0))}get width(){return this._width}set width(t){t!==this._width&&(this._widthDim=H(this._width=t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._heightDim=H(this._height=t,!0))}get size(){return this._size}set size(t){t!==this._size&&(this._sizeDim=H(this._size=t,!0))}getSize(t,e){return{width:j(this._widthDim||this._sizeDim,t,t),height:j(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return j(this._leftDim,t)}getRight(t){return j(this._rightDim,t)}getTop(t){return j(this._topDim,t)}getBottom(t){return j(this._bottomDim,t)}}class Li extends Ei{constructor(){super(...arguments),this.gindex=-1,this.duration=500}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t,e.name);return r.load(e),r}setGroup(t,e){this.group=t,this.gindex=e}}class Ti extends Ei{constructor(){super(...arguments),this._gauges=[],this._visibles=[],this.minValue=0}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this.minValue,max:this.maxValue}}_doLoadProp(t,e){if("children"===t)return this.$_loadGauges(this.chart,e),!0}prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super.prepareRender(),this._prepareChildren(this._visibles)}_prepareChildren(t){t.forEach(((t,e)=>{this._setGroup(t,e),t.prepareRender()}))}$_loadGauges(t,i){const r=this._gaugesType();s(i)?i.forEach(((e,s)=>this.$_add(Li._loadGauge(t,e,r)))):e(i)&&this.$_add(Li._loadGauge(t,i,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}class Ni{constructor(t){this._map={},this._items=[],this._visibles=[],this._gauges=[],this.chart=t}isEmpty(){return this._items.length<1}get firstGauge(){return this._gauges[0]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof Li)return e}get(t){return r(t)?this._map[t]:this._items[t]}load(t){const i=this.chart,r=this._items=[],n=this._map={};s(t)?t.forEach(((t,e)=>{r.push(this.$_loadItem(i,t,e))})):e(t)&&r.push(this.$_loadItem(i,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof Ti)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t.prepareRender()))}$_loadItem(t,e,i){let r=s(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t,e.name||`Gauge ${i+1}`);return n.load(e),n.index=i,n}}class Ri extends Li{constructor(){super(...arguments),this.minValue=0,this.maxValue=100,this.value=0,this.animatable=!0}updateValue(t,e){t!==this.value&&(this.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.text||(t.prefix||"")+"${value}"+(t.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this.minValue;case"max":return this.maxValue}}calcedMinMax(){return{min:this.minValue,max:this.maxValue}}}class Mi extends pe{constructor(t){super(t.chart,!0),this.scale=t,this.reversed=!1,this.length=7}}class Oi extends Ce{getText(t){return at.isValidNumber(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return fe.LEFT}}class Di extends pe{constructor(t,e=!0){super(t.chart,e),this.gauge=t,this._gap=8,this.position=Bi.DEFAULT,this.stepPixels=48,this.line=new pe(t.chart,!0),this.tick=new Mi(this),this.label=new Oi(t.chart,!0)}get gap(){return this._gap}set gap(t){this._gap=m(t,0)}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=m(s,e);const{min:i,max:r}=this._adjustMinMax(d(e,s),g(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(g(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return isNaN(s.minValue)||(t=s.minValue),isNaN(s.maxValue)||(e=s.maxValue),this._min=d(t,e),this._max=g(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.minValue,i=e.maxValue;return isNaN(s)&&(s=d(...t)),isNaN(i)&&(i=g(...t)),this._min=d(s,i),this._max=g(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){let i;return i=Array.isArray(this.steps)?this.steps.slice(0):this.stepCount>0?this._getStepsByCount(this.stepCount,e,s):this.stepInterval>0?this._getStepsByInterval(this.stepInterval,e,s):this.stepPixels>0?this._getStepsByPixels(t,this.stepPixels,e,s):[e,s],this._min=i[0],this._max=i[i.length-1],i}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(O(e));for(let e=1;e<t;e++)n.push(O(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let a=n/(Math.floor(t/e)+1-1);const h=Math.pow(10,Math.floor(Math.log10(a))),o=this._getStepMultiples(h);let l,c=0;if(a/=h,o)if(a>o[c]){for(;c<o.length-1;c++)if(a>o[c]&&a<o[c+1]){a=o[++c];break}}else a=o[c];for(a*=h,this._step=a,r.push(O(l=s));;){if(l+=a,l>=i){r.push(O(i));break}r.push(O(l))}return r}}var Bi,$i,Ii;!function(t){t.DEFAULT="default",t.OPPOSITE="opposite",t.INSIDE="inside"}(Bi||(Bi={}));class Fi extends pe{}class zi extends pe{constructor(t,e=!1){super(t.chart,e),this.gauge=t,this.position=Bi.DEFAULT,this.gap=5,this.itemGap=0,this.rangeLabel=new Fi(t.chart,!1),this.tickLabel=new pe(t.chart,!0)}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickDim=H(this._thickness=t,!0))}get ranges(){return this.$_internalRanges().slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}getThickness(t){return this._thickDim?j(this._thickDim,t,0):this.position===Bi.INSIDE?t:zi.DEF_THICKNESS}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=st(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}zi.DEF_THICKNESS=7;class Hi extends Ae{constructor(t){super(t,!0),this._domain={callback:(t,e)=>t.getParam(e)},this.animatable=!0}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}class Gi extends Di{}class ji extends Hi{constructor(){super(...arguments),this.offsetX=0,this.offsetY=0}getOffset(t,e){return{x:j(this._offsetXDim,t,0),y:j(this._offsetYDim,e,0)}}load(t){return super.load(t),this._offsetXDim=H(this.offsetX,!0),this._offsetYDim=H(this.offsetY,!0),this}}class Wi{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Yi.DEF_CENTER),this.setCenterY(Yi.DEF_CENTER),this.setRadius(Yi.DEF_RADIUS),this.setInnerRadius(Yi.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=H(f(t,Yi.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=H(f(t,Yi.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(f(t,Yi.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=H(f(t,Yi.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=H(t,!0))}getCenter(t,e){return{x:j(this._centerXDim,t,t/2),y:j(this._centerYDim,e,e/2)}}getExtents(t){const e=j(this._radiusDim,t,t/2),s=d(e,this._innerDim?j(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?j(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=m(t%360,0),i=g(0,d(360,m(e,360)));this._startRad=T+N*s,this._handRad=N*s,this._sweepRad=N*i}}class Yi extends Ri{constructor(t){super(t),this.props=new Wi,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.label=new ji(t)}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getProps(){return this.childProps||this.props}getCenter(t,e){return this.group?this.childProps.getCenter(t,e):this.props.getCenter(t,e)}getExtents(t){return this.group?this.childProps.getExtents(t):this.props.getExtents(t)}labelVisible(){return this.label.visible}setGroup(t,e){super.setGroup(t,e),t&&!this.childProps&&(this.childProps=new Wi)}_doPrepareRender(t){super._doPrepareRender(t),this.label.prepareRender();const e=this.group;e?this.childProps.prepareAngles(e.startAngle,e.sweepAngle):this.props.prepareAngles(this.startAngle,this.sweepAngle)}}Yi.DEF_CENTER="50%",Yi.DEF_RADIUS="40%",Yi.DEF_INNER="80%";class Xi extends Ti{constructor(){super(...arguments),this.props=new Wi,this.startAngle=0,this.sweepAngle=360,this.clockwise=!0,this.itemGap=4,this.labelGap=10}get centerX(){return this.props.centerX()}set centerX(t){this.props.setCenterX(t)}get centerY(){return this.props.centerY()}set centerY(t){this.props.setCenterY(t)}get radius(){return this.props.radius()}set radius(t){this.props.setRadius(t)}get innerRadius(){return this.props.innerRadius()}set innerRadius(t){this.props.setInnerRadius(t)}get valueRadius(){return this.props.valueRadius()}set valueRadius(t){this.props.setValueRadius(t)}getCenter(t,e){return this.props.getCenter(t,e)}getExtents(t){return this.props.getExtents(t)}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t.childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}}class Ui extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this.rangeInclusive=!0}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}isRanged(){const t=this.$_internalRanges();return t&&t.length>0}rangeCount(){const t=this.$_internalRanges();return t?t.length:0}getRange(t){const e=this.$_internalRanges();if(e)for(const s of e)if(t>=s.fromValue&&t<s.toValue)return s}$_internalRanges(){return this._runRanges||(this._runRanges=st(this._ranges,this.gauge.minValue,this.gauge.maxValue,this.rangeInclusive)),this._runRanges}}class Zi extends Ui{constructor(t){super(t),this.segmentGap=0}get segmentThickness(){return this._segmentThickness}set segmentThickness(t){t!==this._segmentThickness&&(this._segmentThickness=t,this._thickDim=H(this.segmentThickness,!0))}getSegmentThickness(t){return j(this._thickDim,t,t)}}class Ki extends Ui{constructor(t){super(t),this.stroked=!1,this.thickness="100%"}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=H(this.thickness,!0))}getThickness(t){return j(this._thickDim,t,t)}}class qi extends pe{constructor(t){super(t.chart,!1)}}class Qi extends pe{constructor(t){super(t.chart,!1),this.radius=3,this.length="100%",this.offset=0}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(t,!0))}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=H(t,!0))}get offset(){return this._offset}set offset(t){t!==this._offset&&(this._offset=t,this._offsetDim=H(t,!0))}getExtents(t){return{radius:j(this._radiusDim,t,0),length:j(this._lengthDim,t,0),offset:j(this._offsetDim,t,0)}}}class Ji extends pe{constructor(t){super(t.chart,!1),this.radius=5}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._radiusDim=H(t,!0))}getRadius(t){return j(this._radiusDim,t,0)}}class tr extends Di{constructor(){super(...arguments),this.stepPixels=72}_getStepMultiples(t){return[1,2,2.5,5,10]}}class er extends Xi{constructor(t){super(t),this.innerRadius="50%"}_type(){return"circlegroup"}_gaugesType(){return"circle"}}class sr extends pe{constructor(t){super(t.chart,!0),this.thickness=7}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=H(this.thickness,!0))}getThickness(t){return j(this._thickDim,t,t)}}class ir extends pe{constructor(t,e,s){super(t.chart,!0),this.thickness=e,this.length=s}get length(){return this._length}set length(t){t!==this._length&&(this._length=t,this._lengthDim=H(t,!0))}getLength(t){return j(this._lengthDim,t,t)}}class rr extends ir{constructor(){super(...arguments),this.animatable=!1,this.duration=200}}class nr extends pe{constructor(t,e){super(t.chart,!0),this.length=e}}class ar extends pe{constructor(t){super(t.chart,!0),this.step=1,this.offset=1}}class hr extends pe{constructor(t,e){super(t.chart,!0),this.raidus=e}}class or extends Ae{constructor(t){super(t.chart,!0),this["@config text"]="RealChart Clock<br>ver1.0",this.position="top",this.text="RealChart Clock<br>ver1.0"}}class lr extends Ms{}class cr extends si{constructor(){super(...arguments),this.colorByPoint=!1}canCategorized(){return!0}_colorByPoint(){return this.colorByPoint}_createPoint(t){return new lr(t)}_getGroupBase(){return this.group?this.group.baseValue:this.baseValue}}class _r extends cr{_type(){return"bar"}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,2)}}class ur extends ci{constructor(){super(...arguments),this.baseValue=0}canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:m(this.baseValue,t.getBaseValue())}_doPrepareSeries(t){if(this.layout===ni.DEFAULT){const e=t.length>1?t.map((t=>t.pointWidth)).reduce(((t,e)=>t+e),0):t[0].pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this.layout,ni.STACK}}class dr extends ur{_type(){return"bargroup"}_seriesType(){return"bar"}_canContain(t){return t instanceof _r}}class gr extends dt{constructor(t,e){super(t,Zs.LEGEND_MARKER),this._size=e,this.add(this._marker=new ft(t)),this.setShape(Vs.CIRCLE,12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){As.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class pr extends gr{constructor(t,e){super(t,e),this.insertFirst(this._line=new ft(t)),this.insertFirst(this._area=new ft(t))}_renderShape(t){super._renderShape(t);const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._area.setPath(s.join(" ")))}_markerOffset(t){return t/2}}class mr extends ft{constructor(t,e=C,s=C){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){at.isNumber(t)?this.setPath(As.line(t,e,s,i)):t&&this.setPath(As.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(As.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(t,e,t,s))}setHLine(t,e,s){this.setPath(As.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(e,t,s,t))}}class wr extends ft{constructor(t,e){super(t,e),this.setFill("none")}setPoints(...t){this.setPath(As.lines(...t))}resetStyles(t){const e=super.resetStyles(t);return this.setFill("none"),e}}class fr extends gr{constructor(t,e){super(t,e),this.insertFirst(this._line=new mr(t))}_renderShape(t){super._renderShape(t),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setHLine(t/2,0,2*t),this._shape&&this._line.setStyle("strokeDasharray",""))}_markerOffset(t){return t/2}}class xr extends Ms{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class br extends qs{constructor(){super(...arguments),this.radius=4}}class yr extends Ws{constructor(){super(...arguments),this.position=Is.HEAD,this.align=Q.CENTER}getAlignOffset(){const t=+this.alignOffset;return isNaN(t)?this.align===Q.LEFT||this.align===Q.RIGHT?yr.ALIGN_GAP:0:t}}yr.ALIGN_GAP=4;class vr extends Zs{constructor(){super(...arguments),this.marker=new br(this),this.nullAsBase=!1}getShape(t){return this.marker.visible?t&&t.shape||this.marker.shape||this._shape:null}getRadius(t){return m(t.radius,this.marker.radius)}prepareLines(t){this._lines=this._doPrepareLines(t)}_createLabel(t){return new yr(t)}_createPoint(t){return new xr(t)}hasMarker(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new fr(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),d(+e||rs.MARKER_SIZE,2*this.marker.radius)),s}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull){let i=0;for(;i<e;){const r=[];for(;t[i].isNull&&i<e;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}($i||($i={}));class Vr extends Ce{constructor(t){super(t.chart,!1),this.series=t,this.offset=8}label(){return this.text||this.series.displayName()}getDefaultIconPos(){return fe.LEFT}}class Sr extends vr{constructor(t,e){super(t,e),this.lineType=re.DEFAULT,this.stepDir=$i.FORWARD,this.baseValue=0,this.connectNullPoints=!1,this.flag=new Vr(this)}backDir(){return this.stepDir===$i.BACKWARD?$i.FORWARD:$i.BACKWARD}_type(){return"line"}getLineType(){return this.group instanceof Cr||this.group instanceof Er?this.group.lineType:this.lineType}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){super._doPrepareRender(),this._base=m(this.baseValue,this._yAxisObj.getBaseValue())}}class Pr extends xr{}class kr extends Sr{constructor(t,e){super(t,e),this.marker.visible=t&&t.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>0){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=m(t[0].yLow,t[0].py),e.push(s)}return e}const e=this.group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}_type(){return"area"}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return new pr(t,e)}_createPoint(t){return new Pr(t)}_doPrepareLines(t){if(this._containsNull&&this.group&&this.group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doPrepareLines(t)}}class Ar extends Pr{get highValue(){return this.yValue}_assignTo(t){return a(super._assignTo(t),{low:this.low,lowValue:this.lowValue,highValue:this.yValue})}_readArray(t,e){const s=e.length>2?1:0;this.low=e[m(t.lowField,0+s)],this.y=e[m(t.yField,1+s)],s>0&&(this.x=e[m(t.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=f(e[t.lowField],e.low),this.y=x(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.lowValue=parseFloat(this.low),this.isNull||(this.isNull=isNaN(this.lowValue))}getTooltipPos(){return{x:this.xPos,y:this.yLow}}}class Cr extends oi{constructor(){super(...arguments),this.lineType=re.DEFAULT,this.baseValue=0}_type(){return"linegroup"}_seriesType(){return"line"}_canContain(t){return t instanceof Sr}getBaseValue(t){return t===this._yAxisObj?m(this.baseValue,t.getBaseValue()):NaN}}class Er extends oi{constructor(){super(...arguments),this.lineType=re.DEFAULT,this.baseValue=0}prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this.layout,ni.STACK}}}_type(){return"areagroup"}_seriesType(){return"area"}_canContain(t){return t instanceof kr}getBaseValue(t){return t===this._yAxisObj?m(this.baseValue,t.getBaseValue()):NaN}}class Lr extends Pr{}class Tr extends Ms{get maxValue(){return this.yValue}labelCount(){return 2}getLabel(t){return 0===t?this.yValue:this.minValue}_assignTo(t){return a(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=e.length>5?1:0;s>0&&(this.x=e[m(t.xField,0)]),this.min=e[m(t.minField,0+s)],this.low=e[m(t.lowField,1+s)],this.mid=e[m(t.midField,2+s)],this.high=e[m(t.highField,3+s)],this.y=e[w(t.maxField,t.yField,4+s)]}}_readObject(t,e){super._readObject(t,e),this.min=f(e[t.minField],e.min),this.low=f(e[t.lowField],e.low),this.mid=f(e[t.midField],e.mid),this.y=x(e[t.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.max=this.y,this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}}class Nr extends Ds{}!function(t){t.WIDTH="width",t.AREA="area"}(Ii||(Ii={}));const Rr=function(t){return isNaN(t)?0:t};class Mr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return n(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return n(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return n(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return n(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(n(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Rr(t[e]),Rr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Rr(t[e].x),Rr(t[e].y));return this}polygon(...t){return n(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}}class Or extends Ms{get highValue(){return this.yValue}_assignTo(t){return a(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=e.length>4?1:0;s>0&&(this.x=e[m(t.xField,0)]),this.low=e[m(t.lowField,0+s)],this.close=e[m(t.closeField,1+s)],this.open=e[m(t.openField,2+s)],this.y=e[w(t.highField,t.yField,3+s)]}}_readObject(t,e){super._readObject(t,e),this.low=f(e[t.lowField],e.low),this.open=f(e[t.openField],e.open),this.close=f(e[t.closeField],e.close),this.y=x(e[t.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.high=this.y,this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}}class Dr extends ri{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"}_type(){return"candlestick"}canCategorized(){return!0}_createPoint(t){return new Or(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Mr;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new ft(t,Zs.LEGEND_MARKER,s.end())}}class Br extends qs{constructor(){super(...arguments),this.radius=4,this.shape=Vs.CIRCLE}}class $r extends Bs{}class Ir extends Ms{}class Fr extends Qs{}class zr extends Js{constructor(t,e){super(t,e),this.width=zr.DEF_WIDTH,this.height=zr.DEF_HEIGHT,this.neckWidth=zr.DEF_NECK_WIDTH,this.neckHeight=zr.DEF_NECK_HEIGHT,this.reversed=!1,this.legendByPoint=!1}getSize(t,e){return{width:g(.1*t,j(this._widthDim,t)),height:g(.1*e,j(this._heightDim,e))}}getNeckSize(t,e){return{width:at.clamp(j(this._neckWidthDim,t),.1*t,t),height:at.clamp(j(this._neckHeightDim,e),.1*e,e)}}_type(){return"funnel"}_createPoint(t){return new Fr(t)}load(t){return super.load(t),this._widthDim=G(this.width,zr.DEF_WIDTH),this._heightDim=G(this.height,zr.DEF_HEIGHT),this._neckWidthDim=G(this.neckWidth,zr.DEF_NECK_WIDTH),this._neckHeightDim=G(this.neckHeight,zr.DEF_NECK_HEIGHT),this}}zr.DEF_WIDTH="85%",zr.DEF_HEIGHT="90%",zr.DEF_NECK_WIDTH="30%",zr.DEF_NECK_HEIGHT="30%";class Hr extends Ds{}class Gr extends Ms{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return a(super._assignTo(t),{min:this.min,max:this.max})}}var jr;!function(t){t.SQURE_ROOT="squreRoot",t.STURGES="struges",t.RICE="rice"}(jr||(jr={}));const Wr={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class Yr extends qs{constructor(){super(...arguments),this.radius=4,this.shape=Vs.CIRCLE}}class Xr extends Ms{}class Ur extends Or{}class Zr extends Ms{}class Kr extends Qs{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=H(t,!0))}parse(t){super.parse(t),this.sliced=this.source.sliced}_assignTo(t){return a(super._assignTo(t),{sliced:this.sliced})}}class qr extends Ce{constructor(){super(null,!0)}getDefaultIconPos(){return fe.LEFT}}class Qr extends Ws{}class Jr extends ti{constructor(){super(...arguments),this.groupSize=1,this.labelDistance=25,this.sliceOffset="7%",this.autoSlice=!0,this.sliceDuration=300,this.borderRadius=0,this.innerText=new qr}hasInner(){return this._innerDim&&this._innerDim.size>0}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return this._sliceDim?j(this._sliceDim,t):0}_type(){return"pie"}_createLabel(t){return new Qr(t)}_createPoint(t){return new Kr(t)}_doLoad(t){super._doLoad(t),this._innerDim=H(this.innerRadius,!0),this._sliceDim=H(this.sliceOffset,!0)}_doPrepareRender(){super._doPrepareRender();let t=m(this.startAngle%360,0),e=g(0,d(360,m(this.totalAngle,360)));this._startRad=T+N*t,this._totalRad=N*e,this._groupPos=NaN}}class tn extends oi{constructor(){super(...arguments),this.polarSize="80%",this.innerSize=0}getPolarSize(t,e){return j(this._polarDim,d(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_type(){return"piegroup"}_seriesType(){return"pie"}needAxes(){return!1}_canContain(t){return t instanceof Jr}_doLoad(t){super._doLoad(t),this._polarDim=H(this.polarSize,!0)||{size:80,fixed:!1},this._innerDim=H(this.innerSize,!0)}_doPrepareSeries(t){const e=t.map((t=>t.groupSize)).reduce(((t,e)=>t+m(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=m(t.groupSize,1)/e}))}}class en extends Ms{}class sn extends Ms{_assignTo(t){return a(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[m(t.xField,0)]),this.y=e[m(t.yField,0+s)],this.id=D(e[m(t.idField,1+s)]),this.group=D(e[m(t.groupField,2+s)])}}_readObject(t,e){super._readObject(t,e),this.id=D(e[t.idField]),this.group=D(e[t.groupField])}}class rn extends pe{constructor(t){super(t.chart,!1),this.level=t,this.floating=!0}}class nn extends pe{constructor(t,e){super(t.chart,!0),this.series=t,this.level=e,this.head=new rn(this)}}class an{constructor(t){this.series=t,this._levels=[]}load(t){const i=this._levels=[];e(t)&&(t=[t]),s(t)&&t.forEach((t=>{e(t)&&t.level>=0&&(i[t.level]=this.$_loadLevel(t))}))}getLevel(t){return this._levels[t]}$_loadLevel(t){const e=new nn(this.series,t.level);return e.load(t),e}}class hn{constructor(t){this.point=t}level(){return this.parent?this.parent.level()+1:0}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}var on,ln,cn,_n;!function(t){t.SQUARIFY="squarify",t.STRIP="strip",t.SLICE="slice",t.SLICE_DICE="sliceDice"}(on||(on={}));class un extends Ms{_assignTo(t){return a(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[m(t.xField,0)]),this.y=e[m(t.yField,0+s)],this.length=e[m(t.lengthField,1+s)],this.angle=e[m(t.angleField,2+s)]}}_readObject(t,e){super._readObject(t,e),this.length=f(e[t.lengthField],e.length),this.angle=f(e[t.angleField],e.angle),this.y=x(t._yFielder(e),e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}}!function(t){t.CENTER="center",t.START="start",t.END="end"}(ln||(ln={})),function(t){t.NONE="none",t.CLOSE="close",t.OPEN="open"}(cn||(cn={}));class dn extends Ms{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class gn extends Hi{constructor(t){super(t),this.maxWidth="30%",this.maxHeight="30%",this.gap=10}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=H(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=H(t,!0))}get maxWidth(){return this._maxWidth}set maxWidth(t){t!==this._maxWidth&&(this._maxWidth=t,this._maxWidthDim=H(t,!0))}get maxHeight(){return this._maxHeight}set maxHeight(t){t!==this._maxHeight&&(this._maxHeight=t,this._maxHeightDim=H(t,!0))}get gap(){return this._gap}set gap(t){t!==this._gap&&(this._gap=t,this._gapDim=H(t,!0))}getWidth(t){return j(this._widthDim,t)}getHeight(t){return j(this._heightDim,t)}getMaxWidth(t){return j(this._maxWidthDim,t)}getMaxHeight(t){return j(this._maxHeightDim,t)}getGap(t){return j(this._gapDim,t,0)}}class pn extends Ri{constructor(t){super(t),this.reversed=!1,this.scale=new Gi(this),this.label=new gn(this.chart)}isVertical(){return this.group?this.group.vertical:this.vertical}scaleVisible(){return!this.group&&this.scale.visible}calcedMinMax(){return this.scale.range()}_doPrepareRender(t){super._doPrepareRender(t),this.label.prepareRender()}}!function(t){t.BAR="bar",t.NEEDLE="needle"}(_n||(_n={}));class mn extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this._args={gauge:null,value:NaN}}getStyle(t){if(this.styleCallback){this._args.gauge=this.chart._proxy.getChartObject(this.gauge),this._args.value=t;return this.styleCallback(this._args)}}}class wn extends pn{constructor(t){super(t),this.valueBar=new mn(this),this.band=new zi(this)}_type(){return"linear"}}class fn extends pe{constructor(){super(...arguments),this.opposite=!1,this.gap=10}}class xn extends Ti{constructor(t){super(t),this.vertical=!1,this.itemLabel=new fn(this.chart,!0),this.scale=new Gi(this),this.itemGap=10,this.label=new gn(t),this.label.gap=10}calcedMinMax(){return this.scale.range()}}class bn extends xn{constructor(){super(...arguments),this.band=new zi(this,!1)}_type(){return"lineargroup"}_gaugesType(){return"linear"}}class yn extends pe{constructor(t){super(t.chart,!0),this.gauge=t,this.vertical=!1,this.rangeInclusive=!0}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this._widthDim=H(t,!0))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this._heightDim=H(t,!0))}get ranges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}set ranges(t){t!==this._ranges&&(this._ranges=t,this._runRanges=null)}$_internalRanges(){return this._runRanges||(this._runRanges=st(this._ranges,this.gauge.minValue,this.gauge.maxValue,this.rangeInclusive)),this._runRanges}}class vn extends pe{constructor(t){super(t.chart,!0)}}class Vn extends mn{}class Sn extends xn{constructor(){super(...arguments),this.rangeInclusive=!0}getRanges(t,e,s){return st(this.ranges,t,e,f(s,this.rangeInclusive))}_type(){return"bulletgroup"}_gaugesType(){return"bullet"}}class Pn extends pe{}class kn extends pe{}const An={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Cn={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},En={minPadding:0,maxPadding:0};class Ln extends pe{constructor(t){super(t,!1),this._thickness=45,this._gap=8,this._gapFar=3,this._dataChanged=!0,this.liveScroll=!0,this.minSize=.05,this.handle=new Pn(t,!0),this.mask=new kn(t,!0),this.borderLine=new pe(t,!0)}get thickness(){return this._thickness}set thickness(t){this._thickness=+t||this._thickness}get gap(){return this._gap}set gap(t){this._gap=+t||this._gap}get gapFar(){return this._gapFar}set gapFar(t){this._gapFar=+t||this._gapFar}isVisible(){return this.visible}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t){super._doLoad(t);const s={};if(e(t.series)){let e=t.series.type;"area"!==e&&"line"!==e&&"bar"!==e&&(e="area"),s.series=a({},t.series,An[e]())}else s.series=An.area();e(t.xAxis)?s.xAxis=a({},t.xAxis,(Cn[t.xAxis.type]||Cn.linear)(),En):s.xAxis=a(Cn.linear(),En),e(t.yAxis)?s.yAxis=a({},t.yAxis,(Cn[t.yAxis.type]||Cn.linear)(),En):s.yAxis=a(Cn.linear(),En),this._naviChart=this.chart._createChart(s)}_doPrepareRender(t){(this._source=t._getSeries().getSeries(this.source)||t.firstSeries)&&this._naviChart.firstSeries._loadPoints(this._source.getPoints().getProxies()),this._vertical=!1,this._naviChart.prepareRender()}}class Tn extends ss{constructor(t){super(t.chart),this.pane=t,this.radius=C,this.centerX=C,this.centerY=C}}class Nn extends pe{constructor(t,e,s){super(t,!0),this.row=e,this.col=s,this.body=new Tn(this)}prepareRender(){this.body.prepareRender()}}class Rn extends pe{constructor(t){super(t,!1),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[],this.gap=0}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(t,e){return this._vpanes[t][e]}getRow(t){return this._vpanes[t]}getColumn(t){return this._vpanes.map((e=>e[t]))}_doLoadSimple(t){return s(t)&&t.length>0?(this.rows=g(1,+t[0]),this.cols=g(1,m(+t[1],this.rows)),this.rows>0&&this.cols>0&&(this.$_parsePanes(this.rows,this.cols),this.visible=!0),!0):super._doLoadSimple(t)}_doLoadProp(t,e){if(["panes","cols","rows"].indexOf(t)>=0)return!0}load(t){return super.load(t),e(t)&&(this.$_parsePanes(this.rows=t.rows,this.cols=t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._xAxes=t._xPaneAxes,this._yAxes=t._yPaneAxes,this._vpanes=this.$_collectPanes(t),this._vpanes.forEach((t=>t.forEach((t=>t.prepareRender()))))}getXLens(t){return new Array(this._vcols).fill(t/this._vcols)}getYLens(t){return new Array(this._vrows).fill(t/this._vrows)}layoutAxes(t,e,s,i){const r=this.getXLens(s?e:t);this._xAxes.buildTicks(r);const n=this.getYLens(s?t:e);this._yAxes.buildTicks(n),this.$_calcAxesPoints(r,n,0)}$_calcAxesPoints(t,e,s){this._xAxes.calcPoints(t,s),this._yAxes.calcPoints(e,s)}calcAxesPoints(t,e){this.$_calcAxesPoints(t,e,1)}calcSizes(t,e){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(e,this._heights)}getAnnotation(t){for(const e in this._panes){const s=this._panes[e].body.getAnnotation(t);if(s)return s}}$_parseSizes(t){let e;return e=s(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(r(t)){const e=t.trim();return{size:"*"===e?1:parseFloat(e)}}return+t||{size:1}}))}$_parsePanes(t,e){this._widths=this.$_parseSizes(e),this._heights=this.$_parseSizes(t),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const i={};return t=s(t)?t:e(t)?[t]:null,s(t)&&t.forEach((t=>{const e=+t.row||0,s=+t.col||0;if(s>=0&&s<this._cols&&e>=0&&e<this._rows){const r=new Nn(this.chart,e,s);r.load(t),i[e+","+s]=r}})),i}$_collectPanes(t){const e=t._getXAxes().internalItems(),s=t._getYAxes().internalItems(),i=[],r=[],n=[];e.concat(s).forEach((t=>{const e=t.row||0,s=t.col||0;t._row=e,t._col=s,s>=0&&s<this._cols&&i.indexOf(s)<0&&i.push(s),e>=0&&e<this._rows&&r.indexOf(e)<0&&r.push(e)})),i.sort(),r.sort();for(let e=0;e<r.length;e++){const s=[];for(let r=0;r<i.length;r++){const i=this._panes[e+","+r]||new Nn(t,e,r);s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}class Mn extends cr{_type(){return"circlebar"}_initProps(){super._initProps(),this.pointLabel.position=Is.INSIDE}}var On;!function(t){t.AUTO="auto",t.SERIES="series",t.GROUP="group",t.AXIS="axis"}(On||(On={}));class Dn extends pe{constructor(t){super(t.chart,!0),this.owner=t,this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)},this.level=On.AUTO,this.offset=8,this.hideDelay=Dn.HIDE_DELAY,this.minWidth=100,this.minHeight=40,this.numberFormat=",#.##",this.timeFormat="yyyy-MM-dd"}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._domain.numberFormatter=t?At.getFormatter(t):C)}get timeFormat(){return this._timeFormat}set timeFormat(t){t!==this._timeFormat&&(this._timeFormat=t,this._domain.timeFormatter=t?jt.getFormatter(t):C)}setTarget(t,e){return this._ctx=this.visible&&this.owner.getTooltipContext(this.level,this._series=t,this._point=e)}getTextDomain(){return this._domain}_doLoadSimple(t){return r(t)?(this.text=t,!0):super._doLoadSimple(t)}}Dn.HIDE_DELAY=700;const Bn={bar:dr,circlebar:class extends ur{_type(){return"circlebargroup"}_seriesType(){return"circlebar"}_canContain(t){return t instanceof Mn}},line:Cr,area:Er,pie:tn,bargroup:dr,circlebargroup:dr,linegroup:Cr,areagroup:Er,piegroup:tn,bump:class extends li{_type(){return"bump"}_seriesType(){return"line"}_canContain(t){return t instanceof Sr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue;let i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e){const s=e[t].sort(((t,e)=>t.yValue-e.yValue));for(let t=s.length-1;t>=0;t--)s[t].label=s[t].yValue,s[t].yValue=s[t].yGroup=t}return at.makeIntArray(0,t.length)}}},$n={area:kr,arearange:class extends vr{constructor(){super(...arguments),this.curved=!1,this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"arearange"}_createPoint(t){return new Ar(t)}getLineType(){return this.curved?re.SPLINE:re.DEFAULT}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doPrepareLines(t){const e=super._doPrepareLines(t),s=[];return e.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}s.push(t,e)})),s}},bar:_r,barrange:class extends ri{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"barrange"}pointLabelCount(){return 2}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,2)}_createFielders(){super._createFielders(),this._lowFielder=this._createFielder(this.lowField)}_createPoint(t){return new Bs(t)}_getBottomValue(t){return t.lowValue}},bellcurve:class extends kr{constructor(){super(...arguments),this.sigmas=3,this.pointsInSigma=5,this.curved=!0}_type(){return"bellcurve"}getLineType(){return this.curved?re.SPLINE:re.DEFAULT}_createPoint(t){return new Lr(t)}_doLoadData(t){const e=super._doLoadData(t);if(s(e))return this.$_loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.name===this.source||t.index===this.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this.$_loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}$_loadTable(t){const e=t.length;if(e<1)return;const s=t.reduce(((t,e)=>t+e),0)/e,i=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-s,2)))/(e-1)),r=i/this.pointsInSigma,n=s-this.sigmas*i,a=s+this.sigmas*i;let h=s;const o=[];for(o.push(this.$_getDenstiy(s,i,h));h>n;)h-=r,o.unshift(this.$_getDenstiy(s,i,h));for(h=s;h<a;)h+=r,o.push(this.$_getDenstiy(s,i,h));return o}$_getDenstiy(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}}},boxplot:class extends ri{constructor(){super(...arguments),this.tooltipText="<b>${name}</b><br>min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"}_type(){return"boxplot"}pointLabelCount(){return 2}_createFielders(){super._createFielders(),this._minFielder=this._createFielder(this.minField),this._lowFielder=this._createFielder(this.lowField),this._midFielder=this._createFielder(this.midField),this._highFielder=this._createFielder(this.highField)}_createPoint(t){return new Tr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,2)}},bubble:class extends _i{constructor(){super(...arguments),this.sizeMode=Ii.AREA,this.minSize=8,this.maxSize="20%",this.colorByPoint=!1,this.tooltipText="x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"}getPixelMinMax(t){return{min:j(this._minDim,t),max:j(this._maxDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return this.sizeMode==Ii.AREA&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_type(){return"bubble"}_createPoint(t){return new Nr(t)}hasZ(){return!0}_colorByPoint(){return this.colorByPoint}load(t){return super.load(t),this._minDim=H(this.minSize,!0),this._maxDim=H(this.maxSize,!0),this}_doPrepareRender(){super._doPrepareRender(),this._zMin=Number.MAX_VALUE,this._zMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{t.isNull||isNaN(t.zValue)||(this._zMin=d(this._zMin,t.zValue),this._zMax=g(this._zMax,t.zValue))})),this._noSize=this._zMin===this._zMax}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}},candlestick:Dr,circlebar:Mn,dumbbell:class extends ei{constructor(){super(...arguments),this.marker=new Br(this)}_type(){return"dumbbell"}canCategorized(){return!0}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+g(0,this.marker.radius)}_createPoint(t){return new $r(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=t.lowValue;!isNaN(s)&&e.push(s)}))}},equalizer:class extends si{constructor(){super(...arguments),this.segmentSize=10,this.segmentGap=4,this.segmented=!1}getSegmentSize(t){return j(this._segmentDim,t)}_type(){return"equalizer"}canCategorized(){return!0}_createPoint(t){return new Ir(t)}_doLoad(t){super._doLoad(t),this._segmentDim=H(this.segmentSize,!1)}_createLegendMarker(t,e){const s=new Mr;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new ft(t,Zs.LEGEND_MARKER,s.end())}},errorbar:class extends ri{constructor(){super(...arguments),this.pointPadding=.3,this.tooltipText="<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"}_type(){return"errorbar"}clusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Bs(t)}_getBottomValue(t){return t.lowValue}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=new Mr;s.vline(e/2,.1,.8*e),s.hline(.1,0,e),s.hline(.9*e,0,e);const i=new ft(t,Zs.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}},funnel:zr,heatmap:class extends Zs{constructor(){super(...arguments),this.tooltipText="x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"}getColor(t){}_type(){return"heatmap"}canMixWith(t){return!1}canCategorized(){return!0}hasZ(){return!0}defaultYAxisType(){return"category"}_createPoint(t){return new Hr(t)}_doPrepareRender(){super._doPrepareRender(),this._heatMin=Number.MAX_VALUE,this._heatMax=Number.MIN_VALUE,this._runPoints.forEach((t=>{isNaN(t.zValue)||(this._heatMin=d(this._heatMin,t.zValue),this._heatMax=g(this._heatMax,t.zValue))}))}},histogram:class extends Zs{constructor(){super(...arguments),this.binsNumber=jr.SQURE_ROOT,this.baseValue=0}getBinCount(t){const e=m(this.binWidth,0);if(e>0)return t/e;return m(this.binsNumber,0)<1?Wr[this.binsNumber||jr.SQURE_ROOT](t):void 0}_type(){return"histogram"}_createPoint(t){return new Gr(t)}_doLoadPoints(t){function i(t){let i;return i=s(t)?t[m(this.yField,0)]:e(t)?x(t[this.yField],t.y,t.value):t,parseFloat(i)}const r=[];let n=[];for(let e=0;e<t.length;e++){const s=i(t[e]);isNaN(s)||n.push(s)}if(n.length>0){n=n.sort(((t,e)=>t-e)),this.minValue<n[0]&&n.unshift(this.minValue),this.maxValue>n[n.length-1]&&n.push(this.maxValue);const t=n.length,e=n[0],s=n[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,o=e,l=o+a;for(let e=0;e<i;e++){let c=0;if(e==i-1)c=t-h;else for(;h<t&&n[h]<l;)c++,h++;r.push({x:o,y:c,min:o,max:e===i-1?s:l}),o=l,l=o+a}}super._doLoadPoints(r)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=m(this.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,2)}},line:Sr,lollipop:class extends si{constructor(){super(...arguments),this.marker=new Yr(this)}_type(){return"lollipop"}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.radius}_createPoint(t){return new Xr(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.radius,e=this.marker.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}},ohlc:class extends Dr{_type(){return"ohlc"}_createPoint(t){return new Ur(t)}_createLegendMarker(t,e){const s=new Mr;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new ft(t,Zs.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}},pareto:class extends vr{constructor(){super(...arguments),this.curved=!1}_type(){return"pareto"}getLineType(){return this.curved?re.SPLINE:re.DEFAULT}_createPoint(t){return new Zr(t)}_referOtherSeries(t){if(t.name===this.source||t.index===this.source)return t.referBy(this),!0}reference(t,e){e._isX||(this.$_loadPoints(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values))}$_loadPoints(t){const e=[],s=t.reduce(((t,e)=>t+m(e.yValue,0)),0);let i=0;t.forEach((t=>{t.isNull||e.push({x:t.xValue,y:i+=100*t.yValue/s})})),this._doLoadPoints(e),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj)}},pie:Jr,scatter:class extends _i{constructor(){super(...arguments),this.jitterX=0,this.jitterY=0,this.radius=5}_type(){return"scatter"}_createPoint(t){return new en(t)}_createLegendMarker(t,e){return new gr(t,e)}setShape(t){this._defShape=t}getShape(t){return this.shape||this._defShape}hasMarker(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),d(+e||rs.MARKER_SIZE,2*this.radius)),s}},treemap:class extends Zs{constructor(){super(...arguments),this._map={},this._levels=1,this.idField="id",this.groupField="group",this.algorithm=on.SQUARIFY,this.alternate=!0,this.groupMode=!0,this.groupLevels=new an(this)}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e})),n=g(n,t.level()+1+1)}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this.startDir||e>t,r=this._leafs=[];let n=1;return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._levels=n,{roots:this._roots,leafs:this._leafs}}_type(){return"treemap"}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new sn(t)}getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new hn(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let h=e.x,o=e.y,l=Number.MAX_VALUE,c=0;const _=[];if(2===t.length){return(1===s?n>a:n>=a)?t.forEach((t=>{t.setArea(h,o,n*t.value/i,a),h+=t.width})):t.forEach((t=>{t.setArea(h,o,n,a*t.value/i),o+=t.height})),0}for(;t.length>0;){let u,d,p,m,w;if(u=t.shift(),c+=u.value,m=c*r/i,1===s?(d=m/a,p=a*u.value/c):(p=m/n,d=n*u.value/c),w=g(d/p,p/d),t.length>0&&w>l)return t.unshift(u),c-=u.value,m=r*c/i,1===s?(p=a,d=m/p):(d=n,p=m/d),_.forEach((t=>{1===s?(t.setArea(h,o,d,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,p),h+=t.width)})),1===s?(e.x+=d,e.width-=d):(e.y+=p,e.height-=p),i-c;if(0===t.length)return m=r*c/i,1===s?(p=a,d=m/p):(d=n,p=m/d),_.push(u),_.forEach((t=>{1===s?(t.setArea(h,o,d,a*t.value/c),o+=t.height):(t.setArea(h,o,n*t.value/c,p),h+=t.width)})),0;l=w,_.push(u)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}},vector:class extends Zs{constructor(){super(...arguments),this.origin=ln.CENTER,this.maxLength=20,this.startAngle=0,this.arrowHead=cn.CLOSE}_type(){return"vector"}_createPoint(t){return new un(t)}_doLoad(t){super._doLoad(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this.maxLength,s=this.origin,i=t.map((t=>t.length)).reduce(((t,e)=>g(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case ln.START:t._off=-t._len/2;break;case ln.END:t._off=t._len/2;break;default:t._off=0}}))}}_createLegendMarker(t,e){const s=.3,i=.7*e,r=[0,-s*e,-.2*e,-s*e,0,-.6*e,.2*e,-s*e,0,-s*e,0,.6*e],n=["M",r[0],r[1]+i];for(let t=2;t<r.length;t+=2)n.push("L",r[t],r[t+1]+i);const a=new ft(t,Zs.LEGEND_MARKER,n);return a.setStyle("strokeWidth","2px"),a.rotation=30,a}},waterfall:class extends ii{constructor(t,e){super(t,e)}_type(){return"waterfall"}canCategorized(){return!0}_createPoint(t){return new dn(t)}_createLegendMarker(t,e){return Cs.create(t,Zs.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,h=r,o=0;for(let l=1,c=t.length;l<c;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<c-1&&!1!==i._intermediate,n=i.save=i.y=r?h:a;i.yGroup=i.yValue=i.y,r?h<0?(o=e.low,s=o-n):(s=e.y,o=s-n):(o=t[0].low,s=o+n),h=0}else e=i.y,e<0?n<0?(s=r+n,o=s+e):(s=r,o=s+e):(o=r,s=o+e),h+=e,a+=e;n=i.y,i.y=r=s,i.low=o}}_getBottomValue(t){return t.y=t.save,NaN}}},In={category:js,linear:bi,time:Ci,date:Ci,log:class extends xi{_type(){return"log"}_createTickModel(){return new yi(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?u(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=u(e.min),e.max=u(e.max),e}_createTick(t,e,s){return super._createTick(t,e,O(_(s)))}}},Fn={circle:class extends Yi{constructor(){super(...arguments),this.band=new zi(this),this.scale=new tr(this,!1),this.rim=new Zi(this),this.valueRim=new Ki(this),this.marker=new qi(this),this.hand=new Qi(this),this.pin=new Ji(this)}_type(){return"circle"}getExtents(t){const e=super.getExtents(t),s=this.scale,i=this.band;let r=e.radius;const n=r-e.inner;if(i.visible)switch(e.bandThick=i.getThickness(n),i.position){case Bi.INSIDE:e.band=r-(n-e.bandThick)/2;break;case Bi.OPPOSITE:e.band=e.inner-i.gap,e.inner=e.band-e.bandThick;break;default:e.band=r+=e.bandThick+i.gap}switch(e.scaleTick=g(1,s.tick.length||0),e.scaleLabel=16,s.position){case Bi.OPPOSITE:e.scale=e.inner-s.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;break;case Bi.INSIDE:default:e.scale=r+s.gap}return e}},linear:wn,bullet:class extends pn{constructor(t){super(t),this.band=new yn(this),this.targetBar=new vn(this),this.valueBar=new Vn(this),this.rangeInclusive=!0}getRanges(t,e,s){return st(this.ranges,t,e,f(s,this.rangeInclusive))}_type(){return"bullet"}_doLoad(t){super._doLoad(t)}},clock:class extends Li{constructor(t){super(t),this._active=!0,this.centerX=Yi.DEF_CENTER,this.centerY=Yi.DEF_CENTER,this.radius=Yi.DEF_RADIUS,this.rim=new sr(this),this.hourHand=new ir(this,7,"60%"),this.minuteHand=new ir(this,5,"85%"),this.secondHand=new rr(this,2,"95%"),this.tick=new nr(this,10),this.minorTick=new nr(this,5),this.tickLabel=new ar(this),this.pin=new hr(this,5),this.label=new or(this)}get active(){return this._active}set active(t){t!==this._active&&(this._active=t,this._changed())}getTime(){return this.time instanceof Date?this.time:r(this.time)?new Date(this.time):isNaN(this.time)?void 0:new Date(this.time)}getExtendts(t,e){const s=d(t,e);return{cx:j(this._centerXDim,t,t/2),cy:j(this._centerYDim,e,e/3),rd:j(this._radiusDim,s,s/2)}}_type(){return"clock"}_doLoad(t){super._doLoad(t),this._centerXDim=H(f(this.centerX,Yi.DEF_CENTER),!0),this._centerYDim=H(f(this.centerY,Yi.DEF_CENTER),!0),this._radiusDim=H(f(this.radius,Yi.DEF_RADIUS),!0)}}},zn={circle:er,linear:bn,bullet:Sn,circlegroup:er,lineargroup:bn,bulletgroup:Sn},Hn={text:class extends Le{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)},this.text="Text"}get numberFormat(){return this._numberFormat}set numberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._domain.numberFormatter=t?At.getFormatter(t):C)}get timeFormat(){return this._timeFormat}set timeFormat(t){t!==this._timeFormat&&(this._timeFormat=t,this._domain.timeFormatter=t?jt.getFormatter(t):C)}isVisible(){return this.visible&&!$(this.text)}_type(){return"text"}_doLoadSimple(t){return r(t)?(this.text=t,!0):super._doLoadSimple(t)}},image:class extends Le{isVisible(){return this.visible&&!$(this.imageUrl)}_type(){return"image"}_doLoadSimple(t){return r(t)?(this.imageUrl=t,!0):super._doLoadSimple(t)}},shape:class extends Le{constructor(t,e){super(t,e),this["@config width"]=64,this["@config height"]=64,this.shape=Vs.SQUARE,this.width=this.height=64}getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}_type(){return"shape"}_doLoadSimple(t){return r(t)?(this.shape=t,!0):super._doLoadSimple(t)}}};class Gn extends pe{constructor(){super(...arguments),this.text="RealChart v1.0",this.url="http://realgrid.com",this.floating=!1,this.align=Q.RIGHT,this.verticalAlign=J.BOTTOM,this.offsetX=2,this.offsetY=1,this.gap=4}isFloating(){return this.floating||this.verticalAlign===J.MIDDLE}}class jn extends pe{constructor(){super(...arguments),this.paletteMode=ie.NORMAL,this.animatable=!0,this.xStart=0,this.xStep=1,this.axisGap=8,this.credits=new Gn(null,!0),this.seriesHovering=!1}}var Wn;!function(t){t.PNG="png",t.JPEG="jpeg",t.SVG="svg",t.PDF="pdf",t.PRINT="print"}(Wn||(Wn={}));class Yn extends V{constructor(t){super(),this._data=new Ns,this._exportOptions={visible:!0,menus:[Wn.PNG,Wn.JPEG],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1},this._params={},this._loadAnimatable=!0,this._dataChanged=!1,this.type="bar",this.gaugeType="circle",this.polar=!1,this.timeOffset=(new Date).getTimezoneOffset(),this.startOfWeek=0,this._assets=new de,this._options=new jn(this,!0),this._title=new ui(this),this._subtitle=new di(this),this._legend=new os(this),this._tooltip=new Dn(this),this._split=new Rn(this),this._series=new Ks(this),this._xAxes=new Ze(this,!0),this._yAxes=new Ze(this,!1),this._xPaneAxes=new Qe(this),this._yPaneAxes=new Je(this),this._gauges=new Ni(this),this._body=new ss(this),this._annotations=new Te(this),this._navigator=new Ln(this),t&&this.load(t)}_createChart(t){return new Yn(t)}animatable(){return!1!==this._options.animatable}loadAnimatable(){return this._loadAnimatable}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries()}getTooltipText(t,e){return oi.collectTooltipText(this.axis,this.series,e)}getTooltipParam(t,e,s){return oi.inflateTooltipParam(this.series,t,e,s)}}if(t===On.AUTO){const s=e.group;!s||s.layout!==ni.OVERLAP&&s.layout!==ni.STACK&&s.layout!==ni.FILL||(t=On.GROUP)}switch(t){case On.AXIS:return new i(e._xAxisObj);case On.GROUP:return e.group;default:return e}}get chart(){return this}get data(){return this._data}get assets(){return this._assets}get options(){return this._options}get exportOptions(){return this._exportOptions}get title(){return this._title}get subtitle(){return this._subtitle}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get legend(){return this._legend}get tooltip(){return this._tooltip}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}get body(){return this._body}get split(){return this._split}get xPaneAxes(){return this._xPaneAxes}get yPaneAxes(){return this._yPaneAxes}get seriesNavigator(){return this._navigator}get config(){return this._config}needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._annotations.getVisibles()}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.seriesCount()>0}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(){return this._series.isEmpty()&&this._gauges.isEmpty()}seriesByName(t){return this._series.getSeries(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items,i=this._yAxes.items;let r;if(this.isInverted())switch(t){case tt.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case tt.RIGHT:r=s.filter((t=>t._isOpposite));break;case tt.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case tt.TOP:r=i.filter((t=>t._isOpposite));break;case tt.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case tt.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case tt.RIGHT:r=i.filter((t=>t._isOpposite));break;case tt.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case tt.TOP:r=s.filter((t=>t._isOpposite));break;case tt.MIDDLE:r=s.filter((t=>t._isBetween))}return r?e?r.filter((t=>t.visible)):r:[]}_getLegendSources(){return this._series.getLegendSources()}$_assignTemplates(t){const e=t.template;if(r(e)){let s=this._templates[e];if(s)return b(s,t)}else s(e)&&e.forEach((e=>{let s=this._templates[e];return s&&(s=b(s,t)),s}));return t}load(t){const e="load chart "+1e6*Math.random();at.LOGGING&&console.time(e),this._config=t,this._data.load(t.data),this.$_loadTemplates(t.templates),["type","gaugeType","polar","inverted"].forEach((e=>{e in t&&(this[e]=t[e])})),this._polar=!0===this.polar,this.type=this.type||"bar",this.gaugeType=this.gaugeType||"circle",this._assets.load(t.assets||t.asset),this._options.load(t.options),Object.assign(this._exportOptions,t.exportOptions),this._title.load(t.title),this._subtitle.load(t.subtitle),this._legend.load(t.legend),this._tooltip.load(t.tooltip),this._split.load(t.split),this._series.load(t.series),this._gauges.load(t.gauges||t.gauge),this._gaugeOnly=this._series.isEmpty()&&!this._gauges.isEmpty(),this._gaugeOnly||(this._xAxes.load(x(t.xAxes,t.xAxis,{})),this._yAxes.load(x(t.yAxes,t.yAxis,{}))),this._body.load(t.body||t.plot),this._annotations.load(t.annotations||t.annotation,!1),this._navigator.load(t.seriesNavigator),at.log("chart-items:",ge),at.LOGGING&&console.timeEnd(e)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}dataChanged(){this._dataChanged=!0}isDataChanged(){return this._dataChanged}prepareRender(){const t=this._xAxes,e=this._yAxes,s=this._split;[t,e].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=s.visible,t.disconnect(),e.disconnect(),this._series.prepareRender(),t.collectValues(),e.collectValues(),t.collectReferentsValues(),e.collectReferentsValues(),e.collectRanges(),t.prepareRender(),e.prepareRender(),this._splitted&&!this._gaugeOnly&&(s.prepareRender(),this._xPaneAxes.prepare(t,s._vrows,s._vcols),this._yPaneAxes.prepare(e,s._vrows,s._vcols)),this._series.prepareAfter(),this._legend.prepareRender(),this._gauges.prepareRender(),this._body.prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator.prepareRender()}afterRender(){this._dataChanged=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes.$_buildTicks(s?e:t),this._yAxes.$_buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t.calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t.calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,1)}update(){}getParam(t,e){return this._params[e]}setParam(t,e,s){s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e}addSeries(t,e){const s=this._series.add(t);return s&&(this.dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this.dataChanged(),this._modelChanged(null),s}$_loadTemplates(t){if(e(t)){const s=this._templates={};for(const i in t){const r=t[i];e(r)&&(s[i]=a({},r))}this.assignTemplates=this.$_assignTemplates.bind(this)}else this.assignTemplates=void 0}_getGroupType(t){return r(t)&&Bn[t.toLowerCase()]}_getSeriesType(t){return r(t)&&$n[t.toLowerCase()]}_getAxisType(t){return r(t)&&In[t.toLowerCase()]}_getGaugeType(t){return r(t)&&Fn[t.toLowerCase()]}_getGaugeGroupType(t){return r(t)&&zn[t.toLowerCase()]}_getAnnotationType(t){return r(t)&&Hn[t.toLowerCase()]}getAxesGap(){return this._options.axisGap||0}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}class Xn extends v{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this.freeAll(),this._owner=null,this._creator=null,super._doDestory()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),this._owner.add(i),i}prepare(t,e,s){const i=this._owner.doc,r=this._pool,n=this._views;for(;n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(i);n.push(e),null==s||s(e,n.length-1,t)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const Un=Object.freeze({x:0,y:0,width:0,height:0}),Zn=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function Kn(t){return{width:t.width,height:t.height}}function qn(t){return t.width<=0||t.height<=0}class Qn{static empty(){return new Qn}static create(t=0,e=0){return new Qn(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new Qn(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}Qn.EMPTY=new Qn;class Jn extends dt{constructor(t,e=C){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Jn.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Jn.IGNORE_ATTRS={width:"",height:""};class ta extends dt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=Un,e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s),!0)}getBBox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}_doSizeChanged(){this._dirty=!0}}class ea extends Jn{constructor(t,e=C){super(t),this.add(this._text=new Zt(t,e)),this._text.anchor=Yt.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.effect;return this._model=e,this._text.setStyleOrClass(e.style),r===me.BACKGROUND?(this._outline&&this._outline.remove(),this._back||(this._back=new Cs(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.backgroundStyle)):r===me.OUTLINE?(this._back&&this._back.remove(),this._outline||(this._outline=new Zt(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new ta(t,!1)),this._icon.url=s,this._icon.width=e.width,this._icon.height=e.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.autoContrast&&this._text.setContrast(t,this._model.darkStyle||"rct-label-dark",this._model.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Wt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._icon;let s=0;const i=this._text.getBBox(),r=i.width,n=i.height;let a=r,h=n,o=0,l=0,c=0,_=0;if(e){const t=e.getBBox();switch(s=m(this._model.iconGap,0),o=t.width,l=t.height,this._model.getIconPos()){case fe.LEFT:case fe.RIGHT:a+=s+o,h=Math.max(l,n);break;default:h+=s+l,a=Math.max(o,r)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);c=parseFloat(t.paddingLeft)||0,_=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+c+(parseFloat(t.paddingRight)||0),h+_+(parseFloat(t.paddingBottom)||0),t.rx),this._back.setStyle("fill","lightgray")}if(e)switch(this._model.getIconPos()){case fe.LEFT:e.trans(c,(h-l)/2),c+=o+s,a-=o+s;break;case fe.RIGHT:e.trans(c+a-o,(h-l)/2),a-=o+s;break;case fe.TOP:e.transX((a-o)/2),_+=l+s;break;case fe.BOTTOM:e.trans((a-o)/2,_+n+s)}switch(t){case Q.CENTER:c+=a/2,this._text.anchor=Yt.MIDDLE;break;case Q.RIGHT:c+=a,this._text.anchor=Yt.END;break;default:this._text.anchor=Yt.START}return this._text.trans(c,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(c,_)),this}}class sa{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new sa(t,t,t,t):new sa(t,t,e,e):new sa(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new sa(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=m(t.paddingLeft,0),this.right=m(t.paddingRight,0),this.top=m(t.paddingTop,0),this.bottom=m(t.paddingBottom,0),this}applyMargin(t){return this.left=m(t.marginLeft,0),this.right=m(t.marginRight,0),this.top=m(t.marginTop,0),this.bottom=m(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}sa.Empty=Object.freeze(new sa),sa.Temp=new sa;class ia extends dt{constructor(t,e=C){super(t,e,"g"),dt.DEBUGGING&&(this.add(this._debugRect=new Cs(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t.style)}setModel(t){t!==this.model&&(this.model=t,this._doModelChanged())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),dt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Cs(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}_doModelChanged(){}}class ra extends ia{constructor(t,e,s){super(t,e),this._margins=new sa,this._paddings=new sa,this.add(this._background=new Cs(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const a=this._paddings;a.applyPadding(n);const h=this._doMeasure(t,e,s,i,r);if(h.width+=a.left+a.right,h.height+=a.top+a.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=h.width+=t.left+t.right,this.mh=h.height+=t.top+t.bottom}return this.mw=h.width,this.mh=h.height,h}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class na extends Jn{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class aa extends ia{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class ha extends vs{constructor(t,e,s,i){super(),this._axis=t,this._prevMin=e,this._prevMax=s,this.endHandler=i,this.start()}_doUpdate(t){if(this._axis.parent){const e=this._prevMax-this._prevMin,s=(this._axis.model.axisMax()-this._axis.model.axisMin())/e;return t=s+(1-s)*t,this._axis.model.setPrevRate(t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(NaN),this._axis=null}}class oa extends ra{constructor(t){super(t,oa.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Zt(t)),this._richText=new se}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation(e.axis),this._richText.setFormat(e.text),this._richText.build(this._textView,s,i,null,null);const n=Kn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=n.width;n.width=n.height,n.height=t}return n}_doLayout(t){this._textView.transY(this._margins.top+this._paddings.top),t?this.rotation=0:this.setRotation(0,this.height/2,this._angle)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}oa.TITLE_CLASS="rct-axis-title";class la extends ia{constructor(t){super(t,ga.TICK_CLASS),this.add(this._lineView=new mr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class ca extends ea{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}setLabel(t,e,s,i,r){if(s){this._richText?this._richText._format!==s&&this._richText.setFormat(s):this._richText=new se(s);const n=t.getIcon(e);this.setModel(this.doc,t,n&&t.getUrl(n),null),this._richText.build(this._text,i,r,t,t._domain),this._outline&&this._richText.build(this._outline,i,r,t,t._domain)}else this._richText&&(this._richText=null,this._text.text="")}rotatedHeight(){const t=this.rotation*N,e=this.getBBox();return p(l(t)*e.height)+p(c(t)*e.width)}}class _a extends dt{constructor(t){super(t,void 0),this.add(this._back=new ft(t,"rct-crosshair-flag")),this.add(this._text=new Zt(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){this._text.text=e;const s=this._text.getBBox(),i=new Mr,r=g(t.flag.minWidth||0,s.width+8);i.rect(0,0,r,s.height+4),this._back.setPath(i.end()),this._text.trans(r/2,2)}}}class ua extends ia{static isThumb(t){return t.classList.contains(ua.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Cs(t,ua.TRACK_CLASS)),this.add(this._thumbView=new Cs(t,ua.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=g(0,e),this._page=d(s,e),this._pos=d(t.min+e-s,g(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.reversed,(t=g(0,d(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e.style),(this._vertical=!e.axis._isHorz)?{width:e.thickness+e.gap+e.gapFar,height:i}:{width:s,height:e.thickness+e.gap+e.gapFar}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=m(e.minThumbSize,32),r=this._len,n=0===this._len,a=this._page,h=n?0:this._pos-s.min;let o=this.width,l=this.height;if(this._vertical){o-=e.gap+e.gapFar,this._trackView.setBounds(e.gap,0,o,l),l-=i;const t=(n||a===r?l:l*a/r)+i;this._reversed,this._thumbView.setBounds(e.gap+1,n?0:this.height-l*h/r-t,o-2,t)}else{l-=e.gap+e.gapFar,this._trackView.setBounds(0,e.gap,o,l),o-=i;const t=(n||a===r?o:o*a/r)+i;this._reversed,this._thumbView.setBounds(n?0:o*h/r,e.gap+1,t,l-2)}}}ua.CLASS_NAME="rct-axis-scrollbar",ua.TRACK_CLASS="rct-axis-scrollbar-track",ua.THUMB_CLASS="rct-axis-scrollbar-thumb";const da=/\${label}.*?/g;class ga extends ia{constructor(t){super(t,ga.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new mr(t,ga.LINE_CLASS)),this.add(this._titleView=new oa(t)),this.add(this._markContainer=new dt(t,"rct-axis-ticks")),this.add(this._labelContainer=new dt(t,"rct-axis-labels")),this._labelViews=new Xn(this._labelContainer,ca,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new ua(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s]):(this._scrollView&&this._scrollView.setVis(!1),0)}checkHeight(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(i)&&(r+=this.$_measureLabelsHorz(i,e)),this._titleView.setVis(i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).height,r+=i.title.gap),r+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),r}checkWidth(t,e,s){const i=this.model;let r=i.tick.visible?i.tick.length:0;return this.$_prepareLabels(i)&&(r+=this.$_measureLabelsVert(i,e)),(this._titleView.visible=i.title.isVisible())&&(r+=this._titleView.measure(t,i.title,e,s,1).width,r+=i.title.gap),r+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),r}prepareGuides(t,e,s,i,r){let n=this.model.guides.filter((t=>!t.front&&t.canConstainedTo(e,s)));i.addAll(t,n,!1),n=this.model.guides.filter((t=>t.front&&t.canConstainedTo(e,s))),r.addAll(t,n,!1)}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new _a(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick.length):(i=s._runPos===Se.OPPOSITE?d(0,this.width-n.width):g(0,this.width-s.tick.length-n.width),r.trans(i,t-n.height/2))}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}checkExtents(){const t=this._prevModel,e=this._prevModel=this.model;if((!t||t===e)&&this.control.loaded){const t=this._prevMin,s=this._prevMax;this._prevMin=e.axisMin(),this._prevMax=e.axisMax(),(!isNaN(s)&&this._prevMax!==s||!isNaN(t)&&this._prevMin!==t)&&e.chart.isDataChanged()&&e.animatable&&new ha(this,t,s,(()=>{this.invalidate()}))}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const a=e._isHorz,h=e._isBetween,o=this._titleView;let l=0;return(this._lineView.visible=e.line.visible)?(this._lineView.setStyleOrClass(e.line.style),h&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new mr(t,ga.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(e.line.style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=e.tick.length||0,this._markLen>0&&(l+=e.tick.gap||0),l+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),h&&(l*=2),this.$_prepareLabels(e)?l+=this._labelSize=a?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i):this._labelSize=0,this._simpleMode?o.setVis(!1):(o.visible&&(l+=a?o.mh:o.mw,l+=+e.title.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(l+=a?this._scrollView.mh:this._scrollView.mw)),Qn.create(a?s:l,a?l:i)}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t._ticks,n=t._markPoints,a=this._labelViews,h=this._markLen,o=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?l:0,0,o):this._lineView.setVLine(s?0:o,0,l),this._lineView2&&(e?this._lineView2.setHLine(l,0,o):this._lineView2.setVLine(0,0,l))),this._markContainer.visible&&(e?this._markViews.forEach(((t,e)=>{t.resize(1,h),t.layout().trans(n[e],s?l-h:0)})):this._markViews.forEach(((t,e)=>{t.resize(h,1),t.layout().trans(s?0:o-h,l-n[e])})));const c=h+(t.tick.gap||0);if(this._labelContainer.visible&&(e?this.$_layoutLabelsHorz(a,r,i,s,o,l,c):this.$_layoutLabelsVert(a,r,i,s,o,l,c)),!this._simpleMode){const i=this._titleView,r=this._scrollView,n=this._labelSize;let a=0,h=0;if(i.visible){const r=+t.title.offset||0,_=+t.title.gap||0;if(i.resizeByMeasured().layout(e),e){if(h+=s?0:c+n+_,t.reversed)switch(t.title.align){case ye.START:a=o-i.width/2-r;break;case ye.END:a=i.width/2+r;break;case ye.MIDDLE:default:a=o/2-r}else switch(t.title.align){case ye.START:a=i.width/2+r;break;case ye.END:a=o-i.width/2-r;break;case ye.MIDDLE:default:a=o/2+r}i.trans(a,h),h+=i.height}else{const e=0===i._angle?i.width:i.height;if(a=s?c+n+_+e/2:o-c-n-_-e/2,t.reversed)if(0===i._angle)switch(t.title.align){case ye.START:h=0+r;break;case ye.END:h=l-i.height-r;break;case ye.MIDDLE:default:h=(l-i.height)/2+r}else switch(t.title.align){case ye.START:h=i.width/2-i.height/2+r;break;case ye.END:h=l-i.width/2-i.height/2-r;break;case ye.MIDDLE:default:h=(l-i.height)/2+r}else if(0===i._angle)switch(t.title.align){case ye.START:h=l-i.height-r;break;case ye.END:h=0+r;break;case ye.MIDDLE:default:h=(l-i.height)/2-r}else switch(t.title.align){case ye.START:h=l-i.width/2-i.height/2-r;break;case ye.END:h=i.width/2-i.height/2+r;break;case ye.MIDDLE:default:h=(l-i.height)/2-r}i.trans(a,h)}}else h+=s?0:c+n;(null==r?void 0:r.visible)&&(e?(r.trans(0,h).resize(this.width,r.mh),r.setScroll(t._zoom,t.reversed)):(r.trans(0,0).resize(r.mw,this.height),r.setScroll(t._zoom,t.reversed)),r.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new la(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s.style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(da)?t.setLabel(s,e,r.replace(da,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,t.setModel(this.doc,s,null,null),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t){const e=t.label;if(this._labelContainer.setVis(e.visible)){const s=t._ticks;return this._labelContainer.setStyleOrClass(e.style),this._labelViews.prepare(s.length,((t,i,r)=>{t.setVis(!0),this._prepareLabel(t,s[i],e,r)})).count}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz(t,e,s,i,r,n){const a=e.length,h=g(1,i)*g(1,r),o=n||0,c=p(o)*N,_=c<35*N;let u=!1;e.forEach((t=>t.rotation=o));for(let i=0;i<a-1;i+=h){let r=0,n=i;for(;n<i+h&&n<a-1;n++)r+=t.getLabelLength(s,e[i].value);if(n===i+h){if(0===o&&e[i].getBBox().width>=r){u=!0;break}if(_&&e[i].getBBox().width*l(c)>=r){u=!0;break}if(0!==o&&e[i].getBBox().height>=r){u=!0;break}}}return u}$_applyStep(t,e,s){const i=t.label,r=g(0,i.startStep||0);e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e){const s=t.label;let i,r=this._labelViews._internalItems(),n=+s.step>>0,a=+s.rows>>0,h=+s.rotation%360,o=this.$_checkOverlappedHorz(t,r,e,n,a,h);if(r.forEach((t=>t.row=0)),this._labelRowPts=[0],o)if(s.autoArrange===Ve.NONE)r=this.$_applyStep(t,r,1);else{switch(n=a=h=0,s.autoArrange){case Ve.ROWS:a=this.$_getRows(r);break;case Ve.STEP:n=this.$_getStep(r);break;default:h=-45}if(n>1){const s=r.slice(0);for(;s.length>1&&(r=this.$_applyStep(t,s,n),this.$_checkOverlappedHorz(t,s,e,n,1,0));)n++}else if(a>1){for(;r.length>a&&(r.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz(t,r,e,1,a,0));)a++;this._labelRowPts=[]}else h=-45,r.forEach(((t,e)=>{t.rotation=h,t.index=e})),this.$_checkOverlappedHorz(t,r,e,n,a,h)&&(this.$_checkOverlappedHorz(t,r,e,n,a,h),n=g(2,n++),r=this.$_applyStep(t,r,n),this.$_checkOverlappedHorz(t,r,e,n,a,0)&&r.forEach(((t,e)=>{t.rotation=h})))}else r=this.$_applyStep(t,r,n||1);if(a>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;a>1&&r.forEach(((t,e)=>t.row=e%a));for(let t=0;t<a;t++)e.push(0);r.forEach((s=>{e[s.row]=g(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(h)||0==h){i=r[0].getBBox().height;for(let t=1;t<r.length;t++)i=g(i,r[t].getBBox().height)}else{i=r[0].rotatedHeight();for(let t=1;t<r.length;t++)i=g(i,r[t].rotatedHeight())}return i}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=g(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let a=0;for(let h=i;h<i+n&&h<r-1;h++)a+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=a)return!0}}$_measureLabelsVert(t,e){const s=t.label;let i=this._labelViews._internalItems(),r=g(1,+s.step>>0);if(this.$_checkOverlappedVert(t,i,e,r)){const s=i.slice(0);for(;s.length>1&&r<s.length/2&&(i=this.$_applyStep(t,s,++r),this.$_checkOverlappedHorz(t,s,e,r,1,0)););}else i=this.$_applyStep(t,i,r);let n=i[0].getBBox().width;for(let t=1;t<i.length;t++)n=g(n,i[t].getBBox().width);return n}$_layoutLabelsHorz(t,e,s,i,r,n,a){const h=this.model,o=Q.CENTER,l=this._labelRowPts;t.forEach((t=>{if(t.visible){const s=t.rotation,r=s*N,_=t.getBBox();let u=h.prev(e[t.index].pos),d=i?n-a-_.height-l[t.row]:a+l[t.row];s<-15&&s>=-90?i?(u-=_.width,d-=c(r)*_.height/2,t.setRotation(_.width,_.height/2,-s)):(u-=_.width,d+=c(r)*_.height/2,t.setRotation(_.width,_.height/2,s)):s>15&&s<=90?i?(d+=c(r)*_.height/2,t.setRotation(0,_.height/2,-s)):(d-=c(r)*_.height/2,t.setRotation(0,_.height/2,s)):(u-=_.width/2,t.setRotation(_.width/2,0,i?-s:s)),t.setContrast(null).layout(o).trans(u,d)}}))}$_layoutLabelsVert(t,e,s,i,r,n,a){const h=this.model,o=i?Q.LEFT:s?Q.CENTER:Q.RIGHT,l=i?a:r-a;t.forEach(((t,a)=>{if(t.visible){const c=t.getBBox(),_=i?l:s?(r-c.width)/2:l-c.width;t.setContrast(null).layout(o).trans(_,n-h.prev(e[a].pos)-c.height/2)}}))}}ga.AXIS_CLASS="rct-axis",ga.LINE_CLASS="rct-axis-line",ga.TICK_CLASS="rct-axis-tick";class pa{static reveal(t,e){new wa(t,e)}static grow(t,e){new xa(t,e)}static spread(t,e){new ba(t,e)}static fadeIn(t){new ma(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class ma extends pa{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:vs.DURATION,fill:"none"})}}class wa extends pa{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:vs.DURATION,fill:"none"}}$_clipRect(t){let e;if(t.model.needClip(!1))e=t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else{const s=t.control;e=t.model.chart.isInverted()?t.clipRect(-s.width(),.1*-t.height,2*s.width(),1.2*t.height):t.clipRect(.1*-t.width,-s.height(),1.2*t.width,2*s.height())}return e}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:B(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:B(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class fa extends vs{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof dt}_stop(){super._stop(),this._series=null}}class xa extends fa{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class ba extends fa{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ya extends fa{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}class va extends ea{constructor(t){super(t,"rct-point-label")}}class Va extends gt{constructor(t){super(t,"rct-point-labels"),this._labels=[new Xn(this,va),new Xn(this,va)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r,n){const a=r.getPointText(i,n.text),h=n.style;e.point=i,e.setModel(t,n,null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(h),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),a?(n.prepareRich(a),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(i.getLabel(s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(s.isPointLabelsVisible()){const r=s.pointLabelCount(),n=this._labels,a=s.getLabeledPoints(),h=this._maps,o=i.style;n[0].prepare(a.length),h[0]={},n[1].prepare(r>1?a.length:0),h[1]={},a.forEach(((r,a)=>{for(let o=0;o<r.labelCount();o++){const l=n[o].get(a);l.setVis(e.isPointVisible(r))&&(this.prepareLabel(t,l,o,r,s,i),h[o][r.pid]=l)}})),this.setStyleOrClass(o)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class Sa extends Jn{constructor(t){super(t),this.add(this._line=new ft(t))}setLine(t){this._line.setPath(t)}}class Pa extends Jn{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Xn(this,Sa)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class ka extends gt{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}class Aa extends aa{constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._valueRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this.add(this._pointContainer=new ka(t,"rct-series-points")),this._labelContainer=new Va(t)}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setValueRate(t){}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e)}_doPointClicked(t){}prepareSeries(t,e){this.setModel(e),this.setData("index",e.index%12),this.setData("pointcolors",e._colorByPoint()?"a":C),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e.style),e.color&&this._setModelColor(e.color),e._calcedColor=getComputedStyle(this.dom)[this._legendColorProp()],this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setFocusPoint(t,e){const s=!!e;t.setBoolData(Aa.DATA_FOUCS,s),this._needFocusOrder()&&(s?this._getPointPool().front(t):this._getPointPool().back(t))}_needFocusOrder(){return!0}_doAttached(t){this.control.loaded&&ys(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new ft(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),Qn.create(s,i)}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new ya(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),e.pointStyle&&t.internalSetStyleOrClass(e.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.isPointLabelsVisible()&&!this._animating()),this._labelContainer.visible?this._labelContainer:C}_getGrowRate(){return m(this._growRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===p(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.23,a={x:0,y:0},h={x:0,y:0},o={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py},c={x:0,y:0},_={x:0,y:0},u={x:0,y:0};let d={x:0,y:0},g=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=g,l.y/=g;let m=t[r+1].px-t[r].px,w=t[r].px,f=t[r].py;for(++r;r!=s;r++){o.x=-l.x,o.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,g=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=g,l.y/=g,l.x<o.x?(d.x=o.x-l.x,d.y=o.y-l.y):(d.x=l.x-o.x,d.y=l.y-o.y);const s=Math.sqrt(d.x*d.x+d.y*d.y);d.x/=s,d.y/=s,o.y*l.y>=0&&(d={x:1,y:0}),a.x=-d.x*m*n,a.y=-d.y*m*n,r===e+1?i.quad(t[r].px+a.x,t[r].py+a.y,t[r].px,t[r].py):(c.x=w+h.x,c.y=f+h.y,_.x=t[r].px+a.x,_.y=t[r].py+a.y,u.x=(c.x+_.x)/2,u.y=(c.y+_.y)/2,i.quad(c.x,c.y,u.x,u.y),i.quad(_.x,_.y,t[r].px,t[r].py)),m=t[r+1].px-t[r].px,h.x=d.x*m*n,h.y=d.y*m*n,w=t[r].px,f=t[r].py}i.quad(w+h.x,f+h.y,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model,s=e._xAxisObj,i=e._yAxisObj,r=i._vlen,n=s._vlen,a=e.trendline._points.map((e=>{let a,h;return t?(h=n-s.getPos(n,e.x),a=i.getPos(r,e.y)):(a=s.getPos(n,e.x),h=r-i.getPos(r,e.y)),{x:a,y:h}}));if(this._trendLineView.setVis(a.length>1)){const t=new Mr;t.move(a[0].x,a[0].y),this.model.trendline.isCurved()?this._drawSpline(a.map((t=>({px:t.x,py:t.y}))),0,-1,t):t.lines(...a),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:a,labelView:h,labelOff:o}=t;if(!h.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;const l=t.reversed?a<=0:a<0,c=h.getBBox();let _=!0;switch(i?n-=c.height/2:r-=c.width/2,t.labelPos){case Is.INSIDE:i?r-=(a+c.width)/2+(t.reversed?o:-o):n+=(a-c.height)/2+(t.reversed?o:-o);break;case Is.HEAD:i?l?r+=c.width-o:r-=c.width+o:l?n-=c.height+o:n+=o;break;case Is.FOOT:i?r-=l?a+c.width+o:a-o:n+=l?a+o:a-c.height-o;break;case Is.OUTSIDE:default:i?l?r-=c.width+o:r+=o:l?n+=o:n-=c.height+o,_=!1}h.setContrast(_&&t.pointView.dom),h.layout(h.textAlign()).trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const a="x"===s,h=a?this.model._xAxisObj:this.model._yAxisObj,o=h.reversed,l=h.getPos(a?t:e,g(h.axisMin(),i.fromValue)),c=h.getPos(a?t:e,d(h.axisMax(),i.toValue));n?a?o?r.setBounds(c,-e,p(c-l),e):r.setBounds(l,-e,p(c-l),e):r.setBounds(0,-g(l,c),t,p(c-l)):a?o?r.setBounds(c,0,p(c-l),e):r.setBounds(l,0,p(c-l),e):r.setBounds(0,e-g(l,c),t,p(c-l))}_setFill(t,s){e(s)&&s[W]?t.internalSetStyle(W,s[W]):r(s)&&t.dom.classList.add(s)}_savePrevs(){}}Aa.POINT_CLASS="rct-point",Aa.DATA_FOUCS="focus",Aa.LEGEND_MARKER="rct-legend-item-marker";class Ca extends ft{constructor(t){super(t,Aa.POINT_CLASS)}savePrevs(){}}class Ea extends Ca{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){super.savePrevs(),this.wSave=this.wPoint,this.xSave=this.x}}let La=class extends Ea{layout(t,e,s,i){this.x=t,this.setPath(As.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Ta extends Jn{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Na extends Aa{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePointViews(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPointViews(t,e)}_runShowEffect(t){t&&pa.grow(this)}_doViewRateChanged(t){this._layoutPointViews(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}}class Ra extends Na{_doPrevRateChanged(t){0==t&&this._layoutPointViews(this.width,this.height),this.invalidate()}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,h=s.pointLabel,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,_=2*l.unitPad(),u=c.prev(i?t:e),d=l.prev(i?e:t),p=i?0:e,w=c.axisMin(),f=c.getPos(u,w),x=s.getBaseValue(c),b=m(c.getPos(u,g(w,x)),f),y=!isNaN(x),v=o&&a(this._labelInfo,{inverted:i,reversed:c.reversed,labelPos:s.getLabelPosition(h.position),labelOff:s.getLabelOff(h.getOffset())});this._getPointPool().forEach(((a,h)=>{const g=a.point;if(a.setVis(!g.isNull)){const m=l.getUnitLen(d,g.xValue)*(1-_);isNaN(m)&&console.log(l.getUnitLen(d,g.xValue)*(1-_));let w=s.getPointWidth(m);const f=c.getPos(u,g.yValue)-b,x=(c.getPos(u,g.yGroup)-b-f)*r,V=f*r;let S=l.getPos(d,g.xValue)-m/2,P=p-c.getPos(u,g.yGroup)*r;isNaN(n+a.wSave)||(w=a.wSave+(w-a.wSave)*n),S+=s.getPointPos(m)+w/2,isNaN(n+a.xSave)||(S=a.xSave+(S-a.xSave)*n),g.xPos=S,g.yPos=P,this._layoutPointView(a,h,S,p-b-x,w,V),i&&(P=d-l.getPos(d,g.xValue)+m/2,S=p,g.yPos=P-=s.getPointPos(m)+w/2,g.xPos=S+=y?c.getPos(u,g.yGroup)*r:c.getPos(u,g.yGroup*r)),v&&(v.labelView=o.get(g,0))&&(v.pointView=a,v.x=S,v.y=P,v.wPoint=w,v.hPoint=V,this._layoutLabel(v,t,e))}}))}}class Ma extends Na{_doPrevRateChanged(t){0==t&&this._layoutPointViews(this.width,this.height),this.invalidate()}_layoutPointViews(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,h=s.pointLabel,o=this._labelViews(),l=s._xAxisObj,c=s._yAxisObj,_=2*l.unitPad(),u=i?t:e,d=i?e:t,g=i?0:e,p=o&&a(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(h.position),labelOff:s.getLabelOff(h.getOffset())});this._getPointPool().forEach(((a,h)=>{const m=a.point;if(a.setVis(!m.isNull)){const w=l.getUnitLen(d,m.xValue)*(1-_);let f=s.getPointWidth(w);const x=(c.getPos(u,m.yValue)-c.getPos(u,this._getLowValue(m)))*r;let b=l.getPos(d,m.xValue)-w/2,y=g-c.getPos(u,m.yGroup)*r;isNaN(n+a.wSave)||(f=a.wSave+(f-a.wSave)*n),b+=s.getPointPos(w)+f/2,isNaN(n+a.xSave)||(b=a.xSave+(b-a.xSave)*n),m.xPos=b,m.yPos=y,this._layoutPointView(a,h,b,y,f,x),i&&(y=d-l.getPos(d,m.xValue)+w/2,b=g,m.yPos=y-=s.getPointPos(w)+f/2,m.xPos=b+=c.getPos(u,m.yGroup)*r),o&&(p.pointView=a,p.hPoint=x,p.x=b,p.y=y,(p.labelView=o.get(m,0))&&(p.hPoint=x,this._layoutLabel(p,t,e)),(p.labelView=o.get(m,1))&&(i?p.x-=x:p.y+=x,p.hPoint=-x,this._layoutLabel(p,t,e)))}}))}}class Oa extends ft{constructor(t){super(t,Aa.POINT_CLASS)}}class Da extends Aa{constructor(t,e){super(t,e),this._markers=new Xn(this._pointContainer,Oa)}_getPointPool(){return this._markers}clipInvertable(){return!1}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBox();e===Is.AUTO&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVis(null!=e)&&(r-=a.width/2,e===Is.INSIDE?t.trans(r,n-a.height/2):e&&t.trans(r,n-i-a.height-s))}}class Ba extends vs{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.invalidate(),this.series=null)}}class $a extends Aa{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Ba(this),this._zombieAni.start()),this.setData("pointcolors","f")}_createPointLegendMarker(t,e,s){return Cs.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,rs.MARKER_SIZE)),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class Ia extends dt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Fa extends ft{setArc(t,e,s,i,r,n){this.setPath(As.arc(t,e,s,s,i,close?i+r:i-r,n))}}class za extends Fa{setPolyline(t){this.setPath(As.lines(...t))}}class Ha extends ft{static create(t,e,s,i,r,n,a,h,o=!0){return new Ha(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:h,clockwise:o})}static createInner(t,e="",s,i,r,n,a,h,o,l=!0){return new Ha(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:h,angle:o,clockwise:l})}constructor(t,e=C,s=C){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return As.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return As.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}class Ga extends aa{constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Cs(t,Ga.PANE_CLASS)),this.add(this._contentContainer=new gt(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Ga.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=a(rt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof qa)return t;t=t.parent}}}Ga.GAUGE_CLASS="rct-gauge",Ga.PANE_CLASS="rct-gauge-pane";class ja extends vs{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class Wa extends Ga{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return n(i)?At.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t.style)}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null),super._doLayout(),this._checkValueAnimation()}_getValue(t){return g(t.minValue,d(t.maxValue,m(this._runValue,t.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.animatable&&t.value!==this._prevValue&&(this._ani=new ja(this,this._prevValue,t.value).start((()=>this._runValue=NaN)),this._prevValue=t.value)}}class Ya extends ea{}class Xa extends ia{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new gt(t,"rct-gauge-scale-ticks")),this._ticks=new Xn(this._tickContainer,mr),this.add(this._labelContainer=new gt(t,"rct-gauge-scale-tick-labels")),this._labels=new Xn(this._labelContainer,Ya)}}class Ua extends Xa{_createLine(t,e){return new mr(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,h=e.label,o=e._steps,l=o.length;let c=a?e.gap:s,_=a?i:e.gap;if(this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.setStyleOrClass(e.tick.style),this._ticks.prepare(l)),a?c+=e.tick.length:_+=e.tick.length,this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.setStyleOrClass(e.label.style),this._labels.prepare(l,(e=>{e.setModel(t,h,null,null)})),l>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.setText(h.getText(o[n?s:l-1-s])),t=g(e.getBBox().width)})),c+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.setText(h.getText(o[n?l-1-s:s])),t=g(e.getBBox().height)})),_+=t}return{width:c,height:_}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=this._line,r=t.tick,n=t._steps;n.length;const a=t.position===Bi.OPPOSITE,h=a?-r.length:r.length;let o,l=a?s-t.gap:t.gap;if(i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setHLine(l,0,e)),this._tickContainer.setVis(r.visible)&&this._ticks.forEach(((s,i)=>{o=t.getRate(n[i])*e,s.setVLine(o,l,l+h)})),this._labelContainer.visible){let s=Number.MIN_SAFE_INTEGER;l=a?0:l+h,this._labels.forEach(((i,r)=>{const a=i.getBBox();o=t.getRate(n[r])*e,i.setVis(o-a.width/2>s)&&(i.layout(Q.CENTER).trans(o-a.width/2,l),s=o+a.width/2)}))}}$_layoutVert(t,e,s){const i=this._line,r=t.tick,n=t._steps;this.height,n.length;const a=t.position===Bi.OPPOSITE,h=a?r.length:-r.length;let o,l=a?t.gap:e-t.gap;if(i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setVLine(l,0,s)),this._tickContainer.setVis(r.visible)&&this._ticks.forEach(((e,i)=>{o=t.getRate(n[i])*s,e.setHLine(o,l,l+h)})),this._labelContainer.visible){a?Yt.START:Yt.END;const i=a?Q.LEFT:Q.RIGHT;l=a?l+h:e-t.gap+h,this._labels.forEach(((e,r)=>{const h=e.getBBox(),c=a?l:l-h.width;o=t.getRate(n[r])*s,e.layout(i).trans(c,o-h.height/2)}))}}}class Za extends Wa{measureLabelSize(t,e,s){const i=t.label,r=this.labelView();return i.setText(t.getLabel(i,t.value)),r.text=i.text,i.buildSvg(r,null,e,s,t,i._domain),Kn(r.getBBox())}_renderGauge(t,e){const s=this.model,i=m(this._runValue,s.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=m(this._runValue,t.value),n=a({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(t,n,r),"top"!==e._runPos&&"bottom"!==e._runPos||(this._rLabel.height=n.height),this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&s.position===Bi.OPPOSITE){const t=i.getBBox();i.ty+t.height>this.height&&i.transY(g(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const h=this._rBand=Zn(0,0,n,a);if(this._vertical=t.group instanceof xn?t.group.vertical:r,e.visible){const r=e._runPos=f(e.position,this._vertical?"top":"left"),o=e._runVert="top"===r||"bottom"===r,l=t.group?t.group.itemLabel.gap:e._runGap=e.getGap(o?a:n);let c=o?n:e.getWidth(n),_=o?e.getHeight(a):a;const u=o?n:e.getMaxWidth(n),d=o?e.getMaxHeight(a):a,p=this._rLabel=Zn(0,0,n,a);s.setStyleOrClass(e.style),e.setText(t.getLabel(e,e.animatable?i:t.value)),s.text=e.text,e.buildSvg(s,null,m(c,u),m(_,d),t,e._domain);const w=s.getBBox();switch(o?(p.height=m(_,w.height),h.height=g(0,h.height-(p.height+l))):(p.width=m(c,w.width),this._wLabel=t.group?t.group._labelWidth:p.width,h.width=g(0,h.width-(this._wLabel+l))),r){case"top":h.y=p.height+l;break;case"bottom":p.y=h.height+l;break;case"right":p.x=h.width+l;break;default:h.x=this._wLabel+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBox();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Yt.START,n+=g(0,(t.height-i.height)/2);break;default:s.anchor=Yt.END,r+=this._wLabel,n+=g(0,(t.height-i.height)/2)}s.trans(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=this._vertical?t.height:t.width;let a,h;if(i._vertical=this._vertical,i._reversed=e.reversed,isNaN(this._runValue)&&i.buildSteps(n,e.value),r.setVis(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,h=t.y,t.width=g(0,t.width-e.width),i.position===Bi.OPPOSITE?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=g(0,t.height-e.height),i.position===Bi.OPPOSITE?s._runVert?(h=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,h=t.y-e.height):h=t.y+t.height),r.resizeByMeasured().layout().trans(a,h)}}}class Ka extends Wa{}class qa extends Ga{_defaultCalss(){return qa.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new gt(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}qa.GAUGE_GROUP_CLASS="rct-gauge-group";class Qa extends Xa{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new Fa(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.sweepAngle?1:0);return this._line.setVis(e.line.visible)&&this._line.internalSetStyleOrClass(e.line.style),this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick.style),this._ticks.prepare(n)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label.style),this._labels.prepare(n,(t=>{}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=e.position===Bi.OPPOSITE?-1:1,n=i.props,a=this._center.x,h=this._center.y,o=this._exts.scale,_=o+this.model.tick.length*r,u=n._sweepRad,d=n._startRad,g=i.maxValue-i.minValue;let p,m,w,f;if(this._line.visible&&this._line.setArc(a,h,o,d,u,!0),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*u+d;p=a+l(n)*o,m=h+c(n)*o,w=a+l(n)*_,f=h+c(n)*_,t.setLine(p,m,w,f)})),this._labelContainer.visible){this._labels.get(0).setText(String(i.maxValue));const t=_+.2*this._labels.get(0).getBBox().height*r;this._labels.forEach(((n,o,_)=>{const p=e.getRate(s[o])*u+d;n.setText(String(O(i.minValue+e.getRate(s[o])*g)));const m=n.getBBox();w=a+l(p)*(t+m.width/2*r)-m.width/2,f=h+c(p)*(t+m.height/2*r)-m.height/2,n.trans(w,f)}))}}}let Ja=class extends ia{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new Xn(this,Ha),this.add(this._labelContainer=new gt(t,"rct-circle-gauge-band-tick-labels")),this._labels=new Xn(this._labelContainer,Zt)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=s.props,n=this._center.x,a=this._center.y,h=this._exts.band,o=s.clockwise,l=1-this._exts.bandThick/h,c=e.ranges,_=r._sweepRad;s.maxValue,s.minValue;let u=r._startRad;this._sectorViews.prepare(c.length).forEach(((t,e)=>{const s=i.getRate(c[e].toValue-c[e].fromValue)*_;t.setSector({cx:n,cy:a,rx:h,ry:h,innerRadius:l,start:u,angle:s,clockwise:o}),t.internalClearStyleAndClass(),t.setFill(c[e].color),c[e].style&&t.addStyleOrClass(c[e].style),u+=s}))}};class th extends ft{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Mr).circle(0,0,s).end())),this.internalSetStyleOrClass(t.style),this}}class eh extends ft{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Mr;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t.style),this}}class sh extends Ka{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new Ha(t,"rct-circle-gauge-rim")),e.add(this._valueView=new Ha(t,"rct-circle-gauge-value")),e.add(this._innerView=new Ha(t,"rct-circle-gauge-inner")),e.add(this._textView=new Zt(t,"rct-circle-gauge-label")),e.add(this._handContainer=new gt(t,void 0)),e.add(this._scaleView=new Qa(t)),e.add(this._bandView=new Ja(t))}_backgroundView(){return this._rimView}_prepareGauge(t,e){this._rimView.setVis(e.rim.visible),this._scaleView.setVis(e.scale.visible),this._bandView.setVis(e.band.visible),this._valueView.setVis(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new eh(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new th(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(e.labelVisible())&&this._textView.setStyleOrClass(e.label.style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(d(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.scale,s=t.getProps(),i=this._getValue(t),r=e.getRate(m(i,0)),n=this._center,a=this._exts,h=t.valueRim.getThickness(a.radiusThick),o=this._textView;if(this._valueView.visible){const e=t.valueRim,o=e.getRange(i),l=a.value+(e.stroked?0:h/2),c=this._valueView;c.setStyleOrClass(e.style),o&&(c.setStyle(e.stroked?"stroke":"fill",o.color),o.style&&c.addStyleOrClass(o.style)),e.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",B(h))),c.setBoolData("stroked",e.stroked),c.setSectorEx({cx:n.x,cy:n.y,rx:l,ry:l,innerRadius:(l-h)/l,start:s._startRad,angle:s._sweepRad*r,clockwise:t.clockwise},t.valueRim.stroked)}if(this._handView){const e=(s._handRad+s._sweepRad*r)*R;this._handView.render(t.hand,a.radius).transp(n).rotate(t.clockwise?e:-e)}if(o.visible)if(t.label.setText(t.getLabel(t.label,t.label.animatable?i:t.value)),o.text=t.label.text,t.label.buildSvg(o,null,NaN,NaN,t,t.label._domain),o.setBoolData("grouped",!!t.group),t.group)this.$_layoutGroupedLabel(t,o,a);else{const e=o.getBBox(),s=t.label.getOffset(this.width,this.height);o.trans(n.x+s.x,n.y-e.height/2+s.y)}}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,t.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:r,angle:i._sweepRad,clockwise:t.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(t.scale.style),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(t.band.style),this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.setStyleOrClass(t.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),h=parseFloat(a.strokeWidth);h>1&&(n-=h/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).trans(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBox(),r=this._rimView.getBBox(),n=+t.group.labelGap||0;e.anchor=Yt.END,e.trans(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class ih extends vs{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class rh extends Ca{}class nh extends ka{}class ah extends Aa{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new nh(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ft(t,"rct-line-series-line")),this._markers=new Xn(this._pointContainer,rh)}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;s._line.setStyle("strokeWidth",e.strokeWidth),s._shape?(s._marker.internalSetStyles(this.model.marker.style),s._line.setStyle("strokeDasharray","")):s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e){e instanceof Sr&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.prepareLines(this._visPoints)}_doAfterLayout(){this._layoutLines()}_runShowEffect(t){this._polar?t&&pa.grow(this):t&&pa.reveal(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines()}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow=t.belowStyle&&t._minY<t.getBaseValue(t._yAxisObj),this._needBelow)return r||(this._lineContainer.insertChild(r=this._lowLine=new ft(this.doc,"rct-line-series-line rct-line-series-line-below"),this._line),this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds(),this._upperClip.setAttr(dt.ASSET_KEY,"1"),this._lowerClip.setAttr(dt.ASSET_KEY,"1")),this._line.setClip(this._upperClip),r.setClip(this._lowerClip),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Xn(this._lineContainer,ft)),i.prepare(e.length);s.length<e.length;){const t=new wt(this.doc);t.setAttr(dt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,-s,e,t):n.setBounds(0,-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,-t,e,t):n.setBounds(0,-s,e,t-s):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof Sr&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker.style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),a=e.length;this._markers.prepare(a*n,((n,h)=>{const o=e[h%a];o.isNull||(n.point=o,r[1]=s&&o.yValue<i?t.belowStyle:null,this._setPointStyle(n,t,o,r))}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,a=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),As.setShape(t,r.getShape(n),a,a),t.setPos(s,i),t.trans(s-=a,i-=a)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r.style,a=this._inverted,h=i.needClip(!1),o=this._getGrowRate(),_=r.visible,u=i.pointLabel,d=u.position,g=u.align,p=u.getAlignOffset(),m=u.textAlign,w=u.getOffset(),f=this._labelViews(),x=i._xAxisObj,b=i._yAxisObj,y=this._polar=i.chart.body.getPolar(x),v=!!y,V=b.prev(a?e:s),S=x.prev(y?y.rd*L:a?s:e),P=a?0:s,k=t.length;t.forEach(((t,i)=>{let u,A;if(y){const e=y.start+x.getPos(S,t.xValue),s=b.getPos(y.rd,t.yGroup)*o;u=t.px=y.cx+s*l(e),A=t.py=y.cy+s*c(e)}else u=t.px=x.getPos(S,t.xValue),A=t.py=P-b.getPos(V,t.yGroup),a&&(u=b.getPos(V,t.yGroup),A=s-x.getPos(S,t.xValue));t.xPos=u,t.yPos=A;const C=this._markers.get(i),E=f&&f.get(t,0);if(C&&C.setVis(!t.isNull&&(v||!h||u>=0&&u<=e&&A>=0&&A<=s))){if(this._layoutMarker(C,n,u,A),C.setStyle("opacity",_||0==i&&!0===r.firstVisible||i===k-1&&!0===r.lastVisible?"1":"0"),E){const t=E.getBBox();switch(E.visible=!0,E.setContrast(null),d){case Is.INSIDE:A-=t.height/2+w;break;case Is.FOOT:A+=w+(_?C._radius:0);break;default:A-=t.height+w+(_?C._radius:0)}switch(g){case Q.LEFT:u-=t.width+(_?C._radius:0)+p;break;case Q.RIGHT:u+=(_?C._radius:0)+p;break;default:u-=t.width/2+p}E.layout(m).trans(u,A)}}else E&&E.setVis(!1)}))}_layoutLines(){const t=this.model;if(!this._lineContainer.setVis(t._lines.length>0))return;const e=this.width,s=this.height,i=this._inverted,r=t instanceof Sr&&this._needBelow,n=this._buildLines2(t._lines,this._polar);if(t._runRanges)this._rangeLines.forEach(((r,a)=>{const h=t._runRanges[a];r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",h.color),r.internalSetStyleOrClass(h.style),rt.setImportantStyle(r.dom.style,W,"none"),r.setClip(this._rangeClips[a]),this._clipRange(e,s,t._runRangeValue,h,this._rangeClips[a],i)}));else{const e=this._line;e.setPath(n),e.internalClearStyleAndClass(),e.internalSetStyle("stroke",t.color),e.internalSetStyleOrClass(t.style),rt.setImportantStyle(e.dom.style,W,"none")}if(r){const r=this._lowLine,a=t._yAxisObj,h=t.getBaseValue(a);i?this.$_resetClips(e,s,a.getPos(e,h),!0):this.$_resetClips(e,s,s-a.getPos(s,h),!1),r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",t.color),r.internalSetStyleOrClass(t.style),r.internalSetStyleOrClass(t.belowStyle),rt.setImportantStyle(r.dom.style,W,"none")}}_buildLine2(t,e,s,i){const r=this.model;e===re.SPLINE?this._drawCurve2(t,s,i):r instanceof Sr&&e===re.STEP?this._drawStep2(t,s,i,s?r.backDir():r.stepDir):this._drawLine2(t,s,i)}_buildLines2(t,e){const s=this.model,i=s.getLineType(),r=new Mr;return i===re.SPLINE?this._drawCurves(t,r):s instanceof Sr&&i===re.STEP?this._drawSteps(t,r,s.stepDir):this._drawLines(t,r),r.end(e)}_drawLine2(t,e,s){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this._drawLine2(t,!1,e)))}_drawStep2(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)i===$i.BACKWARD?(s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py)):(s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py))}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep2(t,!1,e,s)))}_drawCurve2(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),this._drawSpline(t,0,t.length-1,s))}_drawCurves(t,e){t.forEach((t=>this._drawCurve2(t,!1,e)))}_drawCurve(t,e,s){const i=t.length;let r;if(t&&t.length>1){let n=e;for(r=e;r<i;)if(t[r].isNull){r-1>n&&this._drawSpline(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].px,t[r].py),r++)}else r++;r-1>n&&this._drawSpline(t,n,r-1,s)}}_buildAreas(t,e,s){const i=new Mr;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(a,s,!0,i)}return i.end(!0)}}class hh extends ah{constructor(t){super(t,hh.CLASS),this._flagView=new ea(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){super._doLayout();const t=this.model,e=t.flag,s=this._flagView;let i;if(s.setVis(e.visible&&!!(i=e.label()))){s.setText(i),s.setModel(this.doc,e,null,null),s.layout(Q.LEFT);const r=s.getBBox();let n,a;n=this._markers.last.x,a=this._markers.last.y,this._inverted?(t._xAxisObj.reversed?a+=e.offset:a-=e.offset+r.height,n-=r.width/2):(t._xAxisObj.reversed?n-=e.offset+r.width:n+=e.offset,a-=r.height/2),s.trans(n,a)}}}hh.CLASS="rct-line-series";class oh extends ah{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new nh(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new ft(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._areaContainer.add(e=this._lowArea=new ft(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);let s=this._rangeAreas,i=this._rangeAreaClips;if(e){for(s||(s=this._rangeAreas=new Xn(this._areaContainer,ft,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new wt(this.doc);t.setAttr(dt.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,a=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=a-r.getPos(n,s.yGroup-s.yValue)}}_doAfterLayout(){var t;null===(t=this.model.group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar?this._layoutPolar(this._area,this._visPoints):this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model;if(!this._areaContainer.setVis(e._areas.length>0))return;const s=this.width,i=this.height,r=e.chart.isInverted(),n=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,n)=>{const h=e._runRanges[n];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(h.color),this._setFill(t,h.style),h.areaStyle&&t.internalSetStyleOrClass(h.areaStyle),t.setClip(this._rangeAreaClips[n]),this._clipRange(s,i,e._runRangeValue,h,this._rangeAreaClips[n],r)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e.color&&t.internalSetStyle(W,e.color),this._setFill(t,e.style),e.areaStyle&&t.internalSetStyleOrClass(e.areaStyle)),n&&(n.setBoolData("simple",this._simpleMode),n.setPath(a),n.internalClearStyleAndClass(),e.color&&n.internalSetStyle(W,e.color),e.areaStyle&&n.internalSetStyleOrClass(e.areaStyle),this._setFill(n,e.belowStyle),e.belowAreaStyle&&n.internalSetStyleOrClass(e.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s.group,r=s._yAxisObj,n=r instanceof bi?s.getBaseValue(r):NaN,a=this.height;r.getPos(a,at.isNotEmpty(n)?n:r.axisMax());const h=new Mr;if(!i||i.layout!==ni.STACK&&i.layout!==ni.FILL){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);t.setPath(h.end())}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s.color),t.addStyleOrClass(s.style)}}class lh extends Ha{constructor(t){super(t,Aa.POINT_CLASS)}}class ch extends Ra{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePointViews(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.baseValue&&e.belowStyle&&t.addStyleOrClass(e.belowStyle)}_layoutPointViews(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars||(this._bars=this._createBarPool(this._pointContainer)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new Xn(this._pointContainer,lh)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart.body,n=t._xAxisObj,h=t._yAxisObj,o=r.getPolar(n),_=n.getTotalAngle(),u=i&&a(this._labelInfo,{labelPos:t.getLabelPosition(s.position),labelOff:t.getLabelOff(s.getOffset())});this._sectors.forEach(((s,r)=>{const a=s.point,d=h.getPos(o.rd,a.yValue)*e;let g=h.getPos(o.rd,a.yGroup)*e;const p=n.getUnitLen(_,a.xValue),m=t.getPointWidth(p);let w=o.start+n.getPos(_,a.xValue);s.setSector({cx:o.cx,cy:o.cy,rx:g,ry:g,innerRadius:(g-d)/g,start:w-m/2,angle:m,clockwise:!0});const f=a.xPos=s.cx+.7*s.rx*l(w);if(w=s.start+s.angle/2,g=a.yPos=s.cy+.7*s.ry*c(w),i&&(u.labelView=i.get(a,0))){const t=u.labelView.getBBox();u.labelView.layout(Q.CENTER).trans(f-t.width/2,g-t.height/2)}}))}}class _h extends Ta{constructor(t){super(t,Aa.POINT_CLASS+" rct-boxplot-point")}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.minValue,r=e/2;const n=0+s-s*(t.lowValue-t.minValue)/i,a=0+s-s*(t.highValue-t.minValue)/i,h=s*(t.highValue-t.lowValue)/i;t.color&&this._box.setFill(t.color),this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,s),this._min.setHLine(0,e/4,3*e/4),this._max.setHLine(0+s,e/4,3*e/4),this._box.setBox(0,a,e,h),this._mid.setHLine(0+s-s*(t.midValue-t.minValue)/i,0,e)}_doInitChildren(t){this.add(this._stemUp=new mr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new mr(t,"rct-boxplot-point-stem")),this.add(this._box=new Cs(t,"rct-boxplot-point-box")),this.add(this._mid=new mr(t,"rct-boxplot-point-mid")),this.add(this._min=new mr(t,"rct-boxplot-point-min")),this.add(this._max=new mr(t,"rct-boxplot-point-max"))}}let uh=class extends Ta{constructor(t){super(t,Aa.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.lowValue;const r=0+s-s*(d(t.openValue,t.closeValue)-t.lowValue)/i,n=0+s-s*(g(t.openValue,t.closeValue)-t.lowValue)/i,a=d(n,r),h=g(1,p(r-n)),o=t.close<t.open;this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,s),this._body.setBox(-e/2,a,e,h),this.setBoolData("decline",o)}_doInitChildren(t){this.add(this._wickUpper=new mr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new mr(t,"rct-candlestick-point-wick")),this.add(this._body=new Cs(t))}};let dh=class extends Ta{constructor(t){super(t,Aa.POINT_CLASS),this.add(this._line=new mr(t)),this.add(this._hmarker=new ft(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new ft(t,"rct-dumbbell-point-marker"))}layout(){const t=this.point,e=this.width,s=this.height,i=t.radius,r=e/2;t.color&&(this._line.setStyle("stroke",t.color),this._hmarker.setFill(t.color),this._lmarker.setFill(t.color)),this._line.setVLineC(r,0,s),As.setShape(this._hmarker,t.shape,i,i),As.setShape(this._lmarker,t.shape,i,i),this._hmarker.trans(r-i,0-i),this._lmarker.trans(r-i,s-i)}};let gh=class extends Jn{constructor(t){super(t,Aa.POINT_CLASS),this._segments=new Xn(this,ft),this._decimal=0,this.add(this._back=new Cs(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setBounds(e,s-r,i,r),this._segments.forEach(((a,h,o)=>{h===o-1&&this._decimal>0?a.setPath(As.rectangle(e,s-t[2*h],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(As.rectangle(e,s-t[2*h],i,n(-1,t[2*h]-t[2*h+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let ph=class extends Ta{constructor(t){super(t,Aa.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new mr(t)),this.add(this._whiskerUp=new mr(t)),this.add(this._whiskerDown=new mr(t)),this.add(this._back=new Cs(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(){const t=this.width,e=this.height,s=t/2;this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class mh extends Ca{}class wh extends Cs{constructor(t){super(t,Aa.POINT_CLASS)}}let fh=class extends Ea{layout(t,e){this.setPath(As.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class xh extends Jn{constructor(t){super(t,Aa.POINT_CLASS),this.add(this._line=new mr(t)),this.add(this._marker=new ft(t,"rct-lollipop-point-marker"))}layout(){const t=this.point.radius;this._line.setVLineC(0,0,this.height),As.setShape(this._marker,this.point.shape,t,t),this._marker.trans(-t,-t)}savePrevs(){this.xSave=this.tx}}class bh extends Ta{constructor(t){super(t,Aa.POINT_CLASS)}layout(){const t=this.point,e=this.width,s=this.height,i=t.yValue-t.lowValue,r=-e/2;const n=0+s-s*(d(t.openValue,t.closeValue)-t.lowValue)/i,a=0+s-s*(g(t.openValue,t.closeValue)-t.lowValue)/i,h=t.close<t.open;this._back.setBox(r,0,e,s),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,e/2),this._bar.setVLine(0,0,0+s),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._tickOpen=new mr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new mr(t,"rct-ohlc-point-tick")),this.add(this._bar=new mr(t)),this.add(this._back=new Cs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class yh extends Ha{constructor(t){super(t,Aa.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class vh extends Cs{constructor(t){super(t,Aa.POINT_CLASS)}get point(){return this.node.point}render(t){if(1!==t){const e=Object.assign({},this.node);e.width*=t,e.height*=t,e.x+=(this.node.width-e.width)/2,e.y+=(this.node.height-e.height)/2,this.setRect(e)}else this.setRect(this.node)}}class Vh extends Ca{layout(t,e,s,i){const r=this.point._len*i,n=this.point._off*i,a=.5;let h;switch(t){case cn.NONE:h=[0,-.5*r,0,a*r];break;case cn.OPEN:const t=.15,e=.45,s=.2;h=[0,-e*r,-t*r,-s*r,0,-.5*r,t*r,-s*r,0,-e*r,0,a*r];break;default:const i=.1,n=.3;h=[0,-n*r,-i*r,-n*r,0,-.5*r,i*r,-n*r,0,-n*r,0,a*r]}const o=["M",h[0],h[1]+n];for(let t=2;t<h.length;t+=2)o.push("L",h[t],h[t+1]+n);this.rotation=e,this.setPath(o)}}class Sh extends ia{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new Xn(this,Cs),this.add(this._labelContainer=new gt(t,"rct-linear-gauge-band-tick-labels")),this._labels=new Xn(this._labelContainer,Zt)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof wn?n.isVertical():n.vertical,h=e.position,o=this._thick=e.getThickness(a?s:i)+(h===Bi.INSIDE?0:this._gap=m(e.gap,0));let l=a?o:s,c=a?i:o;const _=this._ranges=e.ranges;if(this._labelContainer.setVis(e.tickLabel.visible&&_.length>0)){const t=[_[0].fromValue].concat(_.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel.style),this._labels.prepare(_.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=g(s.getBBox().width)})),l+=e+this._labelGap}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=g(s.getBBox().height)})),c+=e}}return{width:l,height:c}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&e.position!==Bi.INSIDE)&&this.$_layoutLabels(s,r,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&e>0){const t=this._vertical,i=this.model.position===Bi.INSIDE,r=this.model.position===Bi.OPPOSITE,n=this.width,a=this.height,h=t?a:n,o=this._thick;let l=0;return this._barViews.prepare(s.length).forEach(((c,_)=>{const u=s[_],d=h*(u.toValue-u.fromValue)/e;if(t){const t=i||r?0:n-o;c.setBounds(t,a-l-d,o,d)}else{const t=r?a-o:0;c.setBounds(l,t,d,this._thick)}c.internalClearStyleAndClass(),c.setFill(u.color),u.style&&c.addStyleOrClass(u.style),l+=d})),!0}}$_layoutLabels(t,e,s){const i=this.model.position===Bi.OPPOSITE;if(this._vertical){const t=this.height,r=i?Yt.START:Yt.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let a=this._labels.get(0);a.anchor=r,a.trans(n,t-a.getBBox().height/2);for(let i=1;i<=s.length;i++){const h=t-t*s[i-1].toValue/e;a=this._labels.get(i),a.anchor=r,a.trans(n,h-a.getBBox().height/2)}}else{const t=this.width,r=i?0:this._thick;this._labels.get(0).trans(0,r);for(let i=1;i<=s.length;i++){const n=t*s[i-1].toValue/e;this._labels.get(i).trans(n,r)}}}}class Ph extends Za{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new Cs(t,"rct-linear-gauge-background")),e.add(this._bandView=new Sh(t)),e.add(this._scaleView=new Ua(t)),e.add(this._valueView=new Cs(t,"rct-linear-gauge-value")),e.add(this._labelView=new Zt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVis(e.visible)){const i=+e.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?e.position===Bi.INSIDE?s.trans(t.x,t.y):e.position===Bi.OPPOSITE?(s.trans(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.trans(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):e.position===Bi.INSIDE?s.trans(t.x,t.y):e.position===Bi.OPPOSITE?(s.trans(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.trans(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=this._valueView,r=t.reversed,n=t.valueBar,a=t.group?t.group.scale:t.scale;if(i.setVis(!qn(e)&&n.visible&&!a.isEmpty()&&!isNaN(t.value)))if(i.setStyleOrClass(n.style),i.internalSetStyleOrClass(n.getStyle(s)),this._vertical){const t=e.height*a.getRate(s),n=r?e.y:e.y+e.height-t;i.setBounds(e.x,n,e.width,t)}else{const t=e.width*a.getRate(s),n=r?e.x+e.width-t:e.x;i.setBounds(n,e.y,t,e.height)}}}class kh extends qa{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new Ua(t)),e.insertFirst(this._textView=new Zt(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVis(e.label.visible)&&this._textView.setStyleOrClass(e.label.style),this._scaleView.setVis(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale.style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=this._textView,h=Zn(0,0,s,i);if(n.visible){n.text=r.label.text,r.label.buildSvg(n,null,NaN,NaN,r,null);const t=this._textView.getBBox().height+r.label.getGap(i);h.y+=t,h.height-=t,n.trans(this.width/2,0)}r._labelWidth=r._labelHeight=0,this._gaugeViews.forEach(((t,e)=>{const n=t.measureLabelSize(r.get(e),s,i);r._labelWidth=g(r._labelWidth,n.width),r._labelHeight=g(r._labelHeight,n.height)}));const o=(l=h)&&a({},l);var l;const c=r.itemLabel.gap;r.vertical?(o.height-=r._labelHeight+c,r.itemLabel.opposite||(o.y+=r._labelHeight+c)):(o.width-=r._labelWidth+c,r.itemLabel.opposite||(o.x+=r._labelWidth+c)),this._renderScale(r,h,o),r.vertical?this.$_layoutVert(this.doc,r,e,h):this.$_layoutHorz(this.doc,r,e,h)}_renderScale(t,e,s){const i=this._scaleView,r=t.scale,n=t.vertical?e.height:e.width,a=[];let h,o;if(this._gaugeViews.forEach(((e,s)=>{a.push(m(e._runValue,t.get(s).value))})),r.buildGroupSteps(n,a),r._vertical=t.vertical,i.setVis(r.visible)){const n=i.measure(this.doc,r,s.width,s.height,1);if(t.vertical){const t=n.width;s.width-=t,e.width-=t,o=s.y,r.position===Bi.OPPOSITE?h=s.x+s.width:(h=s.x,s.x+=t,e.x+=t)}else{const t=n.height;s.height-=t,e.height-=t,h=s.x,r.position===Bi.OPPOSITE?(o=s.y,s.y+=t,e.y+=t):o=s.y+s.height}i.resizeByMeasured().layout().trans(h,o)}}$_layoutVert(t,e,s,i){const r=i.height,n=(i.width-e.itemGap*(s.count-1))/s.count,a=i.y;let h=i.x;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,r,0),s.resize(n,r),s.layout(),s.trans(h,a),h+=n+e.itemGap}))}$_layoutHorz(t,e,s,i){const r=i.width,n=(i.height-e.itemGap*(s.count-1))/s.count,a=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),r,n,0),s.resize(r,n),s.layout(),s.trans(a,h),h+=n+e.itemGap}))}}class Ah extends Za{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new Cs(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new gt(t,void 0)),this._barViews=new Xn(this._barContainer,Cs),e.add(this._valueView=new Cs(t,"rct-bullet-gauge-value")),e.add(this._targetView=new Cs(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new Ua(t)),e.add(this._labelView=new Zt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.group,r=t.reversed,n=this._vertical,a=i?i.scale:t.scale,h=this._valueView,o=this._targetView;if(this._barContainer.setVis(!qn(e)&&!a.isEmpty())){const s=t.getRanges(a._min,a._max,!1)||(null==i?void 0:i.getRanges(a._min,a._max,!1));s&&(this._barContainer.setRect(e),this._barViews.prepare(s.length),n?this._barViews.forEach(((t,i)=>{const n=s[i],h=e.height*a.getRate(n.toValue-n.fromValue),o=e.height*a.getRate(n.fromValue);t.setBounds(0,r?o:e.height-o-h,e.width,h),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})):this._barViews.forEach(((t,i)=>{const n=s[i],h=e.width*a.getRate(n.toValue-n.fromValue),o=e.width*a.getRate(n.fromValue);t.setBounds(r?e.width-h-o:o,0,h,e.height),t.internalClearStyleAndClass(),t.setFill(n.color),n.style&&t.addStyleOrClass(n.style)})))}if(h.setVis(!a.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(t.valueBar.style),s<t.targetValue&&t.valueBar.belowStyle&&h.internalSetStyleOrClass(t.valueBar.belowStyle),h.internalSetStyleOrClass(t.valueBar.getStyle(s)),n){const t=e.height*a.getRate(s),i=r?e.y:e.y+e.height-t;h.setBounds(e.x+e.width/3,i,e.width/3,t)}else{const t=e.width*a.getRate(s),i=r?e.x+e.width-t:e.x;h.setBounds(i,e.y+e.height/3,t,e.height/3)}if(o.setVis(!a.isEmpty()&&!isNaN(t.targetValue)))if(o.setStyleOrClass(t.targetBar.style),n&&e.width>10){let s=e.height*a.getRate(t.targetValue);s=r?e.y+s:e.y+e.height-s,o.setBounds(e.x+5,s-1,e.width-10,3)}else if(!n&&e.height>10){let s=e.width*a.getRate(t.targetValue);s=r?e.x+e.width-s:e.x+s,o.setBounds(s-1,e.y+5,3,e.height-10)}}}class Ch extends dt{constructor(t,e,s){super(t,Ch.STYLE),this.add(this._back=new Cs(t,Ch.BACK_STYLE)),this.add(this._textView=new Zt(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new sa).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}Ch.STYLE="rct-button",Ch.BACK_STYLE="rct-button-background";class Eh extends ra{constructor(t,e){super(t,Eh.CLASS_NAME+" "+e,"rct-annotation-background")}update(t,e){this.measure(this.doc,this.model,t,e,0),this._layoutView(this.chart().isInverted(),0,0,t,e)}_layoutView(t,e,s,i,r){this.resizeByMeasured();const n=this.model.getPosition(this.chart().isInverted(),e,s,i,r,this.width,this.height);this.layout(n)}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doLayout(t){const e=this.model.rotation;this._background.setBounds(t.x,t.y,this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}setRotation(t,e,s){return this._background.setRotation(t,e,s),this._setRotation(t,e,s),this}_setRotation(t,e,s){}}Eh.CLASS_NAME="rct-annotation";class Lh extends Eh{constructor(t){super(t,Lh.CLASS_NAME),this.add(this._textView=new Zt(t)),this._textView.anchor=Yt.START,this._richText=new se}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i),a=this._textView;this._deflatePaddings(n),this._richText.setFormat(e.text),this._richText.build(a,s,i,null,e._domain);const h=Kn(this._textView.getBBox());return{width:m(n.width,h.width),height:m(n.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(t.x+this._textView.tx,t.y+this._textView.ty),super._doLayout(t)}_setRotation(t,e,s){this._textView.setRotation(t,e,s)}}Lh.CLASS_NAME="rct-text-annotation";class Th extends Eh{constructor(t){super(t,Th.CLASS_NAME),this.add(this._imageView=new ta(t,!1))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),this._imageView.url=this.model.imageUrl,this._imageView.resize(n.width,n.height),Kn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(t.x+this._paddings.left,t.y+this._paddings.top),super._doLayout(t)}_setRotation(t,e,s){this._imageView.setRotation(t,e,s)}}Th.CLASS_NAME="rct-image-annotation";class Nh extends Eh{constructor(t){super(t,Nh.CLASS_NAME),this.add(this._shapeView=new ft(t))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),As.setShape(this._shapeView,e.shape,n.width/2,n.height/2),n}_doLayout(t){this._shapeView.trans(this._paddings.left+t.x,this._paddings.top+t.y),super._doLayout(t)}_setRotation(t,e,s){this._shapeView.setRotation(t,e,s)}}Nh.CLASS_NAME="rct-shape-annotation";class Rh extends Ca{layout(t,e,s){const i=new Mr;i.circle(t,e,s),this.setPath(i.end())}}const Mh={area:oh,arearange:class extends ah{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new nh(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new ft(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new ft(t,"rct-areanrange-series-line")),rt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r.style,a=r.visible,h=this._inverted,o=i._yAxisObj,l=h?e:s,c=h?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-o.getPos(l,s.lowValue)}const _=this._markers;for(let c=0,u=t.length;c<u;c++){const d=t[c],g=_.get(c+u);let p,m;h?(p=o.getPos(l,d.lowValue),m=_.get(c).ty+i.getRadius(d)):(p=d.xPos,m=d.yLow),g&&g.setVis(!d.isNull&&p>=0&&p<=e&&m>=0&&m<=s)&&(this._layoutMarker(g,n,p,m),g.setStyle("opacity",a||0==c&&!0===r.firstVisible||c===u-1&&!0===r.lastVisible?"1":"0"))}}_layoutLines(){super._layoutLines();const t=this._area,e=this.model;if(!this._areaContainer.setVis(e._lines.length>0))return;const s=this._buildAreas(e._lines,e.getLineType());t.setPath(s),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e.color&&t.setFill(e.color),this._setFill(t,e.style),e.areaStyle&&t.internalSetStyleOrClass(e.areaStyle)}},bar:class extends ch{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new Xn(t,La)}needFronting(){var t,e;return(null===(t=this.model.group)||void 0===t?void 0:t._stacked)||(null===(e=this.model.group)||void 0===e?void 0:e.layout)==ni.OVERLAP}_prepareSeries(t,e){super._prepareSeries(t,e),this._rdTop=+e.topRadius||0,this._rdBottom=+e.bottomRadius||0}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}},barrange:class extends Ma{constructor(t){super(t,"rct-barrange-series"),this._bars=new Xn(this._pointContainer,La)}_getPointPool(){return this._bars}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.cornerRadius||0}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n,this._rd,this._rd)}},bellcurve:class extends oh{constructor(t){super(t,"rct-bellcurve-series")}},boxplot:class extends Ma{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Xn(this._pointContainer,_h)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePointViews(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},bubble:class extends Da{constructor(t){super(t,"rct-bubble-series")}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&pa.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){const s=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,i=e.length;t.getPixelMinMax(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];r.shape=t.shape,this._setPointStyle(s,t,r)}))}_getAutoPos(t){return t?Is.OUTSIDE:Is.INSIDE}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.needClip(!1),n=this._getGrowRate(),a=s.pointLabel,h=a.position,o=a.getOffset(),_=this._labelViews(),u=s._xAxisObj,d=s._yAxisObj,g=this._polar=s.chart.body.getPolar(u),p=d.prev(i?t:e),m=u.prev(i?e:t),w=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:f,max:x}=s.getPixelMinMax(w),b=e;let y;this._markers.forEach(((a,w)=>{const v=a.point,V=_&&(y=_.get(v,0));if(a.setVis(!v.isNull&&!isNaN(v.zValue))){const _=(v.radius=s.getRadius(v.zValue,f,x))*n;let w,S,P;if(g){const t=g.start+u.getPos(L,v.xValue),e=d.getPos(g.rd,v.yValue);S=g.cx+e*l(t),P=g.cy+e*c(t)}else S=u.getPos(m,v.xValue),P=b-d.getPos(p,v.yValue),i&&(S=d.getPos(p,v.yGroup),P=b-u.getPos(m,v.xValue));v.xPos=S,v.yPos=P,a.setVis(!r||S>=0&&S<=t&&P>=0&&P<=e)?(w=As.circle(0,0,_),a.setPath(w),a.trans(S,P),V&&(y.setContrast(a.dom),y.layout(Q.CENTER),this._layoutLabelView(y,h,o,_,S,P))):V&&V.setVis(!1)}else V&&V.setVis(!1)}))}},candlestick:class extends Ma{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Xn(this._pointContainer,uh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.declineStyle&&t.addStyleOrClass(e.declineStyle)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}},circlebar:class extends ch{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Xn(t,Rh)}_layoutPointView(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}},dumbbell:class extends Ma{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Xn(this._pointContainer,dh)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},equalizer:class extends Ra{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Xn(this._pointContainer,gh)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(e,s)}_layoutPointViews(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPointViews(t,e)}_layoutPointView(t,e,s,i,r,n){const a=this._prevRate;isNaN(a+t.wSave)||(r=t.wSave+(r-t.wSave)*a),isNaN(a+t.xSave)||(s=t.xSave+(s-t.xSave)*a),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t._yAxisObj.axisMax(),i=t.segmented,r=t.segmentGap||0,n=this._pts=[];let a,h,o=0;for(h=t.maxCount>0?t.maxCount:Math.round(e/(t.getSegmentSize(e)+r/2)),a=(e-r*(h-1))/h;n.length<2*h;)n.push(o,o+a),o+=a+r;n[n.length-1]=e;const l=n.length/2;this._bars.forEach((r=>{const h=r.point;if(r.setVis(!h.isNull)){const o=h.yValue/s;let c=-1,_=0;for(let t=0;t<l-1;t++)if(o>=n[2*t]/e&&o<n[2*(t+1)]/e){c=t+1,_=!i&&o<n[2*t+1]/e?o*e-n[2*t]:a;break}c<0&&(c=l,_=a),r.prepareSegments(l,c,_,t.backStyle)}}))}},errorbar:class extends Ma{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Xn(this._pointContainer,ph)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPointView(t,e,s,i,r,n){t.setBounds(s-r/2,i,r,n),t.layout()}},funnel:class extends $a{constructor(t){super(t,"rct-funnel-series"),this._segments=new Xn(this._pointContainer,mh),this.add(this._lineContainer=new Pa(t))}_getPointPool(){return this._segments}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&pa.reveal(this,{from:this.model.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=O(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=O(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return c?m+(y-m)*(f-t)/(f-v):m+(y-m)*(t-w)/(v-w)}const i=this.model,r=this._labelViews(),n=i.getLabelPosition()===Is.INSIDE,a=i.pointLabel,h=a.getOffset(),o=r&&a.distance||0,l=this._lineContainer,c=i.reversed,_=i.getSize(t,e),u=i.getNeckSize(_.width,_.height),d=new Mr,g=i.getCenter(t,e),m=g.x-_.width/2,w=g.y-_.height/2,f=w+_.height,x=m+_.width/2,b=_.height-u.height,y=m+(_.width-u.width)/2,v=c?f-b:w+b;let V;this._lineContainer.setVis(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVis(!i.isNull)){const a=i.yPos*_.height,g=(i.yPos+i.height)*_.height,m=c?f-a:w+a,S=c?f-g:w+g;let P,k,A,C;if(a>=b?(P=y,k=P+u.width,d.move(P,m).lines(k,m,k,S,P,S),t.ny=t.nx1=NaN):g<b?(P=s(m),k=P+2*(x-P),A=s(S),C=A+2*(x-A),d.move(P,m).lines(k,m,C,S,A,S),t.ny=NaN,t.nx1=A-P,t.nx2=C-P):(P=s(m),k=P+2*(x-P),A=y,C=A+u.width,d.move(P,m).lines(k,m,C,v,C,S,A,S,A,v),t.ny=v-m,t.nx1=A-P,t.nx2=C-P),t.setPath(d.close(!0)),i.xPos=x,i.yPos=m+(S-m)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVis(!n)){const s=t.getBBox();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):p(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/p(t.ny)),this.$_layoutLabel(V,s,e,h,o,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=t.getBBox();n+=e.width/2,s.setLine((new Mr).move(0,0).line(r,0).end()),s.trans(n,a),n+=r+i,t.trans(n,a-h.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBox();t.trans(e-i.width/2,s-i.height/2)}},heatmap:class extends Aa{constructor(t){super(t,"rct-heatmap-series"),this._cells=new Xn(this._pointContainer,wh)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&pa.grow(this)}_doViewRateChanged(t){this.$_layoutCells(this.width,this.height)}$_parepareCells(t,e){const s=new Wt(t._calcedColor),i=[{fill:C}];this._cells.prepare(e.length,((r,n)=>{const a=r.point=e[n];i[0].fill=s.brighten(1-a.zValue/t._heatMax).toString(),this._setPointStyle(r,t,a,i)}))}$_layoutCells(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,o=i?t:e,l=i?e:t,c=i?0:e;at.log("LAYOUT CELLS",r),this._cells.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=a.getUnitLen(l,e.xValue)*r,_=h.getUnitLen(o,e.yValue)*r;let u,d=a.getPos(l,e.xValue)-s/2,g=c-h.getPos(o,e.yValue)-_/2;if(e.xPos=i?c+h.getPos(o,e.yValue):d+s/2,e.yPos=i?l-a.getPos(l,e.xValue)+s/2:g+_/2,t.setBounds(d,g,s,_),n&&(u=n.get(e,0))){const t=u.getBBox();i?(g=l-a.getPos(l,e.xValue)-t.height/2,d=c+h.getPos(o,e.yValue)):(d+=s/2,g+=(_-t.height)/2),d-=t.width/2,u.layout(Q.CENTER).trans(d,g)}}}))}},histogram:class extends Na{constructor(t){super(t,"rct-histogram-series"),this._bars=new Xn(this._pointContainer,fh)}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPointViews(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,h=this._labelViews(),o=s._xAxisObj,l=s._yAxisObj,c=i?t:e,_=i?e:t,u=l.getPos(c,s.getBaseValue(l)),d=i?0:e,g=h&&a(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.position),labelOff:s.getLabelOff(n.getOffset())});this._getPointPool().forEach(((s,n)=>{const a=s.point,p=o.getPos(_,a.min),m=o.getPos(_,a.max),w=l.getPos(c,a.yValue),f=m-p+(m>p?-1:1),x=w-u;let b=p+(m-p)/2,y=d;a.xPos=b,a.yPos=y-=w,this._layoutPointView(s,n,b,y+x,f,x*r),g&&(g.labelView=h.get(a,0))&&(i&&(y=_-b,b=d,a.yPos=y,a.xPos=b+=l.getPos(c,a.yGroup)),g.pointView=s,g.x=b,g.y=y,g.wPoint=f,g.hPoint=x,this._layoutLabel(g,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((a,h)=>{const o=a.point,l=s.getPos(t,o.min),c=s.getPos(t,o.max),_=l+(c-l)/2,u=i.getPos(e,a.point.yValue)*n,d=g(1,c-l-1);o.xPos=_,o.yPos=r-u,a.wPoint=d,a.hPoint=u,a.layout(_,r)}))}},line:hh,lollipop:class extends Ra{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i-n,0,n),t.layout()}$_parepareBars(t,e,s){const i=e.marker.style;this._bars||(this._bars=new Xn(this._pointContainer,xh)),this._bars.prepare(s.length,((t,r)=>{const n=t.point=s[r];this._setPointStyle(t,e,n),i&&t._marker.setStyleOrClass(i)}))}},ohlc:class extends Ma{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Xn(this._pointContainer,bh)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePointViews(t,e,s){this.$_prepareSticks(e,s)}_layoutPointView(t,e,s,i,r,n){t.setBounds(s,i,r,n),t.layout()}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.declineStyle&&t.addStyleOrClass(e.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},pareto:class extends ah{constructor(t){super(t,"rct-pareto-series")}},pie:class extends $a{constructor(t){super(t,"rct-pie-series"),this._sectors=new Xn(this._pointContainer,yh,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Ia(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new ea(t,"rct-pie-series-inner")),this._textView._text.anchor=Yt.MIDDLE,this.add(this._lineContainer=new Pa(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&e.innerText.isVisible())&&(this._textView.setModel(t,e.innerText,null,null),e.innerText.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s.group,r=Math.floor(i?i.getPolarSize(t,e)/2:s.getRadius(t,e)),n=i?i.getInnerRadius(r)*r:s.getInnerRadius(r),a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&pa.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,!0,!1))}))}_doPointClicked(t){if(t instanceof yh){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0),!this.model.autoSlice&&this.invalidate()}}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}getClipContainer(){return null}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getGrowRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=O(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.clockwise,n=this._getGrowRate(),a=i.getCenter(e,s),h=this._cx=a.x,o=this._cy=a.y,_=this._rd,u=this._rdInner,d=i.pointLabel,g=this._labelViews(),m=i.getLabelPosition()===Is.INSIDE,w=d.getOffset(),f=d.distance||0,x=this._lineContainer,b=this._slicedOff=i.getSliceOffset(_)*n;let y;if(this._textView.visible){const t=this._textView.getBBox();this._textView.trans(h,o-t.height/2)}(this._circle.visible=this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const a=t.point;if(a.isNull)t.setVis(!1),g&&(y=g.get(a,0))&&y.setVis(!1),null===(s=x.get(a))||void 0===s||s.setVis(!1);else{const s=a.startAngle;let d=0,v=0;if(a.sliced&&n>=1&&!t.isDomAnimating()){const t=s+a.angle/2;d+=l(t)*b,v+=c(t)*b}t.trans(d,v).setVis(!0);const V=a.startAngle+a.angle/2;if(a.xPos=h+l(V)*(b+.7*_),a.yPos=o+c(V)*(b+.7*_),t.setPieSector(g,null,{cx:h,cy:o,rx:_,ry:_,innerRadius:u,start:s,angle:p(a.angle),clockwise:i.clockwise}),g&&(y=g.get(a,0))){const e=x.get(a);e.setVis(!m)?this.$_layoutLabel(a,y,e,w,f,a.sliced?b:0,r):(e.visible=!1,this.$_layoutLabelInside(a,y,w,0,a.sliced?b:0)),y.setContrast(m&&t.dom).setVis(!0)}else null===(e=x.get(a))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const h=e.getBBox(),o=t.startAngle+t.angle/2;let _=this._cx,u=this._cy,d=this._rd+.8*r,g=l(o)*n,p=c(o)*n,m=_+l(o)*this._rd,w=u+c(o)*this._rd,f=_+l(o)*d,x=u+c(o)*d;const b=f<_;let y;y=b?f-.2*r:f+.2*r,s&&s.setVis(d>0)&&(s.setLine((new Mr).move(0,0).quad(f-m,x-w,y-m,x-w).end()),s.setPos(m,w),!e.isDomAnimating()&&s.trans(m+g,w+p)),b?(y-=h.width+i,x-=h.height/2):(y+=i,x-=h.height/2),e.setPos(y,x),!e.isDomAnimating()&&e.layout(Q.CENTER).trans(y+g,x+p)}$_layoutLabelInside(t,e,s,i,r){const n=e.getBBox(),a=this._rd*this._rdInner,h=(a>0?a+(this._rd-a)/2:.7*this._rd)+s,o=t.startAngle+t.angle/2;let _=this._cx+l(o)*h,u=this._cy+c(o)*h;e.move(_-n.width/2,u-n.height/2),_=this._cx+l(o)*(r+h),u=this._cy+c(o)*(r+h),e.layout(Q.CENTER).trans(_-n.width/2,u-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.autoSlice?i.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2;(n.sliced=e)?t.transEx(l(a)*this._slicedOff,c(a)*this._slicedOff,r):t.transEx(0,0,r);const h=this._labelViews();if(h){const t=i.pointLabel,a=this._lineContainer,o=i.getLabelPosition()===Is.INSIDE,l=h.get(n,0);if(l){const h=!o&&a.get(n);if(s&&(o?this.$_layoutLabelInside(n,l,t.getOffset(),t.distance,this._slicedOff):this.$_layoutLabel(n,l,h,t.getOffset(),t.distance,this._slicedOff,i.clockwise)),e){let t=l.tx,e=l.ty;l.trans(l.x,l.y),l.transEx(t,e,r),h&&(t=h.tx,e=h.ty,h.trans(h.x,h.y),h.transEx(t,e,r))}else l.trans(l.tx,l.ty),l.transEx(l.x,l.y,r),h&&(h.trans(h.tx,h.ty),h.transEx(h.x,h.y,r))}}}},scatter:class extends Da{constructor(t){super(t,"rct-scatter-series")}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,pa.grow(this))}$_prepareMarkers(t,e){const s=t.color,i=e.length;this._pointContainer.setFill(s),this._markers.prepare(i,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return Is.OUTSIDE}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=this._inverted,r=s.needClip(!1),n=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart.body.getPolar(n),o=this._getGrowRate(),_=s.jitterX,u=s.jitterY,d=s.pointLabel,g=d.position,p=d.getOffset(),m=this._labelViews(),w=a.prev(i?t:e),f=n.prev(i?e:t),x=e;let b;this._markers.forEach(((d,y)=>{const v=d.point,V=m&&(b=m.get(v,0));if(d.setVis(!v.isNull)){const m=s.getShape(v),y=s.radius*o,S=at.jitter(v.xValue,_),P=at.jitter(v.yGroup,u);let k,A,C;if(h){const t=h.start+n.getPos(L,S),e=a.getPos(h.rd,P)*o;A=h.cx+e*l(t),C=h.cy+e*c(t)}else A=n.getPos(f,S),C=x-a.getPos(w,P),i&&(A=a.getPos(w,P),C=x-n.getPos(f,S));if(v.xPos=A,v.yPos=C,d.setVis(!!h||!r||A>=0&&A<=t&&C>=0&&C<=e)){switch(m){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":k=As[m](0-y,0-y,2*y,2*y);break;default:k=As.circle(0,0,y)}d.setPath(k),d.trans(A,C),V&&this._layoutLabelView(b,g,p,y,A,C)}else V&&V.setVis(!1)}else V&&V.setVis(!1)}))}},treemap:class extends Aa{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new Xn(this._pointContainer,vh)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._rootView?this.$_renderGroups(t,e):this.$_renderLeafs(t,e)}_runShowEffect(t){t&&pa.grow(this)}_doViewRateChanged(t){this._rootView?this.$_renderGroups(this.width,this.height):this.$_renderLeafs(this.width,this.height)}$_renderLeafs(t,e){const s=this.model,i=s._xAxisObj,r=s._yAxisObj,n=this._inverted,a=this._getGrowRate(),h=this._labelViews(),o=n?t:e,l=n?e:t,{roots:c,leafs:_}=s.buildMap(l,o),u=new Wt(s._calcedColor);let d;null==h||h.prepare(this.doc,this),this._nodeViews.prepare(_.length,((t,e,s)=>{const c=_[e],g=c.point,p=c.parent;let m=u;p&&(!p._color&&p.point.color?m=p._color=new Wt(p.point.color):p._color&&(m=p._color)),t.node=c,t.setFill(m.brighten(c.index/s).toString()),i.reversed&&(c.x=l-c.x-c.width),r.reversed&&(c.y=o-c.y-c.height),n&&(c.y=c.y-o),t.render(a);let w=c.x+c.width/2,f=c.y+c.height/2;if(g.xPos=n?-c.y-c.height/2:w,g.yPos=n?l-c.x-c.width/2:f,h&&(d=h.get(g,0))){const e=d.getBBox();d.setVis(c.width>=e.height&&c.height>=e.height)&&(n?(w=-c.y-c.height/2-e.width/2,f=l-c.x-(c.width+e.height)/2):(w-=e.width/2,f-=e.height/2),d.setContrast(t.dom),d.layout(Q.CENTER).trans(w,f))}}))}$_renderGroups(t,e){}},vector:class extends Aa{constructor(t){super(t,"rct-vector-series"),this._arrows=new Xn(this._pointContainer,Vh)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model;let i=s.startAngle;const r=s.arrowHead,n=s._xAxisObj,a=s._yAxisObj,h=this._inverted,o=h?t:e,l=h?e:t,c=this._getGrowRate(),_=h?0:e,u=n.reversed?-1:1;a.reversed&&(i+=180),this._pointContainer.invert(h,e),this._arrows.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=n.getPos(l,e.xValue),d=_-a.getPos(o,e.yValue);e.xPos=h?_+a.getPos(o,e.yValue):s,e.yPos=h?l-n.getPos(l,e.xValue):d,t.trans(s,d),t.layout(r,i+e.angleValue*u,!1,c)}}))}_runShowEffect(t){t&&pa.fadeIn(this)}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}},waterfall:class extends Ma{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Xn(this._pointContainer,La),this.add(this._lineContainer=new gt(t,"rct-waterfall-series-lines")),this._lines=new Xn(this._lineContainer,mr)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.cornerRadius||0}_preparePointViews(t,e,s){this.$_parepareBars(t,e,s)}_layoutPointView(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd),e>0){const t=this._lines.get(e-1),h=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(h,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPointViews(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPointViews(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}},Oh={circle:sh,linear:Ph,bullet:Ah,clock:class extends Ga{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new Ia(t,"rct-clock-gauge-face")),e.add(this._rimView=new Ha(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Zt(t,"rct-clock-gauge-label")),this._labelView.layout=Xt.MIDDLE,e.add(this._tickContainer=new gt(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new gt(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new ft(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new ft(t,"rct-clock-gauge-minute")),e.add(this._secondView=new ft(t,"rct-clock-gauge-second")),e.add(this._pinView=new Ia(t,"rct-clock-gauge-pin")),this._tickViews=new Xn(this._tickContainer,mr,"rct-clock-gauge-tick"),this._minorTickViews=new Xn(this._tickContainer,mr,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new Xn(this._tickLabelContainer,Zt,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/g(1,Math.floor(e.tickLabel.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=Xt.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtendts(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),p(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim.style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const h=n-a;let o=h-this.model.tick.length,_=T,u=L/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+l(_)*h,r+c(_)*h,i+l(_)*o,r+c(_)*o),_+=u})),!this._minorTickViews.isEmpty){let t=0;o=h-this.model.minorTick.length,_=T,u=L/60,this._minorTickViews.forEach((e=>{t%5==0&&(_+=u,t++),e.setLine(i+l(_)*h,r+c(_)*h,i+l(_)*o,r+c(_)*o),_+=u,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=L/12*t;_=T,this._tickLabelViews.get(0).text="12",o=h-(this.model.tick.length+this.model.tickLabel.offset||0),o-=.5*this._tickLabelViews.get(0).getBBox().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.trans(i+l(_)*o,r+c(_)*o),_+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVis(t.label.visible)&&(s.internalSetStyleOrClass(t.label.style),t.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.label.position?s.trans(i,r+o/2):s.trans(i,r-o/2))}$_getNow(){const t=this.model.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:h,rd:o}=e,l=new Mr;let c,_,u,d;c=t.hourHand,_=this._hourView,_.setVis(c.visible)&&(d=L*(i/12+r/60/12+n/60/60/12),u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*R)),c=t.minuteHand,_=this._minuteView,_.setVis(c.visible)&&(d=L*(r/60+n/60/60),u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*R)),c=t.secondHand,_=this._secondView,_.setVis(c.visible)&&(d=this._secRate<1?L*(this._aniSec+this._secRate)/60:L*n/60,u=c.getLength(o-this._rimThick),l.rect(-c.thickness/2,-u,c.thickness,u),_.internalSetStyleOrClass(c.style),_.setPath(l.close(!0)).trans(a,h).rotate(d*R),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new ih(this);e.duration=this.model.secondHand.duration||200,e.start()}}},circlegroup:class extends qa{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new Xn(t,sh)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.getCenter(s,i),h=n.getExtents(d(s,i));n.setChildExtents(h),s=i=2*h.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.trans(a.x-h.radius,a.y-h.radius)}},lineargroup:class extends kh{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new Sh(t),this._scaleView)}_createPool(t){return new Xn(t,Ph)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVis(r.visible)){const h=+r.gap||0,o=i.measure(this.doc,r,s.width,s.height,1);if(t.vertical){const t=o.width+h;s.width-=t,e.width-=t,a=s.y,r.position===Bi.OPPOSITE?n=s.x+s.width+h:(n=s.x,s.x+=t,e.x+=t)}else{const t=o.height+h;s.height-=t,e.height-=t,n=s.x,r.position===Bi.OPPOSITE?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+h}i.resizeByMeasured().layout().trans(n,a)}}},bulletgroup:class extends kh{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new Xn(t,Ah)}}},Dh={text:Lh,image:Th,shape:Nh};function Bh(t,e){return new(Dh[e._type()])(t)}function $h(t,e){return new(Mh[e._type()])(t)}class Ih extends ia{constructor(t){super(t,"rct-axis-grid"),this._lines=new Xn(this,mr)}_doMeasure(t,e,s,i,r){return Qn.create(s,i)}_doLayout(){const t=this.model,e=t.axis,s=e.reversed,i=this.width,r=this.height,n=t.getPoints(e._isHorz?i:r),a=this._lines.prepare(n.length,(t=>{t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e.grid.style),t.setClass("rct-axis-grid-line")})),h=a.count-1;let o,l;a.forEach(((t,s)=>{t.setBoolData("first",0===s),t.setBoolData("last",n[s]===(e._isHorz?i:r))})),e._isHorz?a.forEach(((a,o)=>{l=0===o?t.firstVisible||!s&&n[o]>0||s&&n[o]<i:o!==h||(t.lastVisible||!s&&n[o]<i||s&&n[o]>0),a.setVis(!0)&&a.setVLine(e.prev(n[o]),0,r)})):a.forEach(((a,c)=>{o=r-n[c],l=0===c?t.firstVisible||!s&&o<r||s&&o>0:c!==h||(t.lastVisible||!s&&o>0||s&&o<r),a.setVis(l)&&a.setHLine(r-e.prev(n[c]),0,i)}))}}class Fh extends dt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new ft(t)),this._mask.setStroke("none"),this.add(this._upLine=new ft(t)),this._upLine.setFill("none"),this.add(this._downLine=new ft(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this._clip?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new Mr;if(s){let t=0,s=0,n=i/2,a=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class zh extends dt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new ea(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.text)&&(this._labelView.setModel(t,e.label,null,null),this._labelView.setStyles(e.label.style))}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,null,null),this._labelView.layout(Q.CENTER)),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class Hh extends zh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?za:mr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this._line.setStyles(e.style)}_doLayout(t,e){const s=this.model,i=s.label,r=this._line,n=this._labelView.setVis(i.visible)&&this._labelView,a=n.getBBox(),h=m(i.offsetX,0),o=m(i.offsetY,0);let l,c;if(this.vertical()){const _=s.axis.getPos(t,s.value);if(n.setVis(r.setVis(!isNaN(_)))&&(r.setVLine(_,0,e),n)){switch(i.align){case Q.CENTER:l=_-a.width/2+h;break;case Q.RIGHT:l=_+h;break;default:l=_-a.width-h}switch(i.verticalAlign){case J.BOTTOM:c=e-a.height-o;break;case J.MIDDLE:c=(e-a.height)/2-o;break;default:c=o}}}else{const _=e-s.axis.getPos(e,s.value);if(n.setVis(r.setVis(!isNaN(_)))&&(r.setHLine(_,0,t),n)){switch(i.align){case Q.CENTER:l=(t-a.width)/2-h;break;case Q.RIGHT:l=t-a.width-h;break;default:l=h}switch(i.verticalAlign){case J.BOTTOM:c=_+o;break;case J.MIDDLE:c=_-a.height/2-o;break;default:c=_-a.height-o}}}n&&n.trans(l,c)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),h=i.axis.getPos(s.rd,i.value);r.setArc(s.cx,s.cy,h,a,i.axis.getTotalAngle(),!1),r.setStyle(W,"none"),n&&n.trans(s.cx+h*l(s.start),s.cy+h*c(s.start))}}class Gh extends zh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Ha:Es)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e),this._box.setStyleOrClass(e.style)}_doLayout(t,e){const s=this.model,i=s.label,r=this._box,n=d(s.startValue,s.endValue),a=g(s.startValue,s.endValue),h=this._labelView.setVis(i.visible)&&this._labelView,o=h.getBBox(),l=m(i.offsetX,0),c=m(i.offsetY,0);if(this.vertical()){const _=s.axis.getPos(t,n),u=s.axis.getPos(t,a);if(!isNaN(_)&&!isNaN(u)&&h.setVis(r.setVis(u!==_))){let s,n;switch(i.align){case Q.CENTER:s=_+(u-_-o.width)/2+l;break;case Q.RIGHT:s=u-o.width-l;break;default:s=_+l}switch(i.verticalAlign){case J.BOTTOM:n=e-o.height-c;break;case J.MIDDLE:n=(e-o.height)/2-c;break;default:n=c}r.setBox(_,0,u,e),h&&h.trans(g(0,d(t,s)),n)}}else{const _=e-s.axis.getPos(e,n),u=e-s.axis.getPos(e,a);if(!isNaN(_)&&!isNaN(u)&&h.setVis(r.setVis(_!==u))){let e,s;switch(i.align){case Q.CENTER:e=(t-o.width)/2-l;break;case Q.RIGHT:e=t-o.width-l;break;default:e=l}switch(i.verticalAlign){case J.BOTTOM:s=_-o.height-c;break;case J.MIDDLE:s=u+(_-u-o.height)/2-c;break;default:s=u+c}h&&h.trans(e,s),r.setBox(0,u,t,_)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),h=i.axis.getPos(s.rd,i.startValue),o=i.axis.getPos(s.rd,i.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:o,ry:o,innerRadius:h/o,start:a,angle:L,clockwise:!0}),n){const t=h+(o-h)/2;n.trans(s.cx+t*l(s.start),s.cy+t*c(s.start))}}}class jh extends gt{constructor(){super(...arguments),this._views=new Xn(this,ft)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e,s){const i=this._rows;this._views.prepare(i.length),this._views.forEach(((s,r)=>{const n=i[r];if(n.axis._isHorz){const i=n.axis.getPos(t,n.from),r=n.axis.getPos(t,n.to);s.setPath(As.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(As.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class Wh extends gt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Gh?this._rangePool.push(e):this._linePool.push(e)}}addAll(t,e,s){e.forEach((e=>{let i;e instanceof He?i=this._rangePool.pop()||new Gh(t,s):e instanceof ze&&(i=this._linePool.pop()||new Hh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Yh extends ft{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,a=n._isHorz,h=new Mr;if(this._bar){const o=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.showAlways&&(l=n.reversed?n.xValueAt(a?i-e:s):n.xValueAt(a?e:r-s)),!isNaN(l)){const t=n.getPos(o,l);let e=n.getUnitLen(o,l);a?h.rect(t-e/2,0,e,r):h.rect(0,r-t-e/2,i,e)}}else(t||this.model.showAlways)&&(a?h.vline(e,0,r):h.hline(s,0,i));this.setPath(h.end())}}class Xh extends Ch{constructor(t){super(t,"Reset Zoom",Xh.CLASS_NAME),this.setVis(!1)}}Xh.CLASS_NAME="rct-reset-zoom";class Uh extends ia{constructor(t,e){super(t,Uh.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._focused=null,this._owner=e,this.add(this._hitTester=new Cs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Cs(t,"rct-body-background")),this.add(this._image=new ta(t,!0,"rct-body-image")),this.add(this._gridRowContainer=new jh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new gt(t,"rct-axis-grids")),this.add(this._baseContainer=new gt(t,"rct-axis-bases")),this.add(this._guideContainer=new Wh(t,"rct-axis-guides")),this.add(this._annotationContainer=new gt(t,"rct-annotations")),this.add(this._seriesContainer=new gt(t,"rct-series-container")),this.add(this._axisBreakContainer=new gt(t,"rct-axis-breaks")),this.add(this._labelContainer=new gt(t,"rct-label-container")),this.add(this._frontGuideContainer=new Wh(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new gt(t,"rct-front-annotations")),this.add(this._feedbackContainer=new gt(t,"rct-feedbacks")),this.add(this._zoomButton=new Xh(t)),this._crosshairViews=new Xn(this._feedbackContainer,Yh)}prepareRender(t,e){this._animatable=ut._animatable&&e.animatable(),this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),this._prepareGauges(t,e,e._getGauges().getVisibles()),this._prepareAnnotations(t,e.body.getAnnotations())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let n,a;if(e instanceof SVGElement&&(e.classList.contains(Aa.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(Aa.POINT_CLASS)))for(let t=this._seriesViews.length-1;t>=0;t--)if(a=this._seriesViews[t].pointByDom(e),a){n=this._seriesViews[t];break}const h=null==e?void 0:e.classList,o=(null==h?void 0:h.value)&&(h.contains("rct-contextmenu-item")||h.contains("rct-contextmenu-list"));return this._zoomRequested||this._crosshairViews.forEach((e=>{e.setVis(r&&!o)&&e.layout(a,t.x,t.y,s,i)})),a?this.$_setFocused(n,a,t):this.$_setFocused(null,null,t),r}hoverSeries(t){const e=this._seriesMap.get(t);this.$_hoverSeries(e)}$_setFocused(t,e,s){if(e!=this._focused||this.model.chart.tooltip.followPointer){let i=this._focusedSeries;e!=this._focused&&(this._focused&&i.setFocusPoint(this._focused,null),e&&t.setFocusPoint(e,s)),this._focused=e,t!==i&&(i&&this.$_focusSeries(i,!1),i=this._focusedSeries=t,i&&this.$_focusSeries(i,!0),this.chart().options.seriesHovering&&this.$_hoverSeries(t)),this._focused?this._owner.showTooltip(t.model,e.point,this,s):this._owner.hideTooltip()}}$_focusSeries(t,e){e?t.model.group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model.group===t.model.group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData("unfocus",t&&e!==t),e._labelContainer.setBoolData("unfocus",t&&e!==t)}))}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesViews.find((e=>e.model===t))}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),a=r.xAxis,h=n?this.height:this.width,o=a.valueAt(h,n?h-i:t),l=a.valueAt(h,n?h-e:s);a.zoom(o,l)&&(this._zoomRequested=!0)}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=e.chart;if(this._polar=n.isPolar(),this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.setStyleOrClass(e.style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)})),this._zoomButton.setVis(e.zoomButton.isVisible())&&this._zoomButton.layout(),Qn.create(s,i)}_clipSeries(t,e,s){t&&t.setClip(this._seriesClip),e&&e.setClip(this._seriesClip)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._inverted?this._seriesClip.setBounds(0,-t,e,t):this._seriesClip.setBounds(0,0,t,e),this._bodyClip.setBounds(0,0,t,e),this._hitTester.resize(t,e),this._background.resize(t,e),s.setVis(s.setImage(this.model.image.url,t,e))&&s.setStyleOrClass(this.model.image.style),this._seriesViews.forEach((s=>{s.model.needClip(!1)&&this._clipSeries(s.getClipContainer(),s.getClipContainer2(),s.clipInvertable()),s.resize(t,e),s.trans(0,0),s.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();for(const s of this._baseViews.values()){const i=s.tag;s.setStyleOrClass(i.baseLine.style),i._isHorz?s.setVLine(i.getPos(t,i.getBaseValue()),0,e):s.setHLine(i.getPos(e,i.getBaseValue()),0,t)}this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.reversed?s.trans(t-i._sect.pos,0):s.trans(i._sect.pos,0):r.reversed?s.trans(0,i._sect.pos):s.trans(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)})),this._guideClip?this._guideClip.resize(t,e):this._guideClip=this.control.clipBounds(0,0,t,e),[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.layout(t,e))),s.setClip(this._guideClip)})),this._gridRowContainer.layout(t,e,!1)}this.$_prepareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().transp(s.getPosition(t,e))})),this._layoutAnnotations(this._inverted,t,e),this._zoomButton.visible&&this._zoomButton.trans(t-this._zoomButton.getBBox().width-10,10)}$_createGaugeView(t,e){return new(Oh[e._type()])(t)}$_prepareGrids(t,e){const s=e.needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,a=this._baseViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.isVisible(!1)||(r.get(t).remove(),r.delete(t));for(const t of a.keys())(!s||!e.containsAxis(t)||t instanceof xi&&!t.baseLine.visible||!t.isBaseVisible())&&(a.get(t).remove(),a.delete(t));s&&[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{if(e.grid.isVisible(!1)&&!r.has(e)){const s=new Ih(t);r.set(e,s),i.add(s)}if(e instanceof xi&&e.baseLine.visible&&e.isBaseVisible()&&!a.has(e)){const s=new mr(t,"rct-axis-baseline");a.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s){const i=this._inverted=e.isInverted(),r=this._seriesMap,n=this._seriesViews;for(const t of r.keys())s.indexOf(t)<0&&r.delete(t);this._series=s,n.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),n.length=0,s.forEach((s=>{const a=r.get(s)||$h(t,s);a._setChartOptions(i,this._animatable,e.loadAnimatable()),a.parent||(this._seriesContainer.add(a),this._labelContainer.add(a._labelContainer)),r.set(s,a),n.push(a),a.prepareSeries(t,s)})),this._seriesContainer.sort(n),n.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&n.delete(t);this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((s=>{const h=n.get(s)||this.$_createGaugeView(t,s);i.add(h),n.set(s,h),a.push(h),h.prepareGauge(t,s),h._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Bh(t,e);(e.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof bi&&r.push(...t.runBreaks()||[])}))));i.length<r.length;){const e=new Fh(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e])}))}_layoutAnnotations(t,e,s){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(t,0,0,e,s),i.setClip(i.model.noClip?C:this._bodyClip)}))}}Uh.BODY_CLASS="rct-body";class Zh extends dt{constructor(t){super(t,Kh.HANDLE_STYLE),this.add(this._back=new Cs(t)),this.add(this._shape=new ft(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*d(t,e);const r=new Mr;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class Kh extends ia{static isHandle(t){return t.parentElement.classList.contains(Kh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Kh.MASK_STYLE)}constructor(t){super(t,Kh.CLASS_NAME),this.add(this._back=new Cs(t,Kh.BACK_STYLE)),this.add(this._container=new gt(t,null)),this.add(this._mask=new Cs(t,Kh.MASK_STYLE)),this.add(this._trackView=new Cs(t,Kh.TRACK_CLASS)),this.add(this._thumbView=new Cs(t,Kh.THUMB_CLASS)),this.add(this._startHandle=new Zh(t)),this.add(this._endHandle=new Zh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let a=s,h=i;return e._vertical?a=e.thickness+e.gap+e.gapFar:h=e.thickness+e.gap+e.gapFar,e._naviChart.layoutAxes(a,h,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis.calcPoints(a,1),e._naviChart.yAxis.calcPoints(h,1),{width:a,height:h}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=this.width,r=this.height;if(this._back.resize(i,r),e._vertical);else{const t=s?(s.start-s.min)*i/s.total():0,e=s?(s.end-s.min)*i/s.total():i;this._mask.setBounds(t,0,e-t,r),this._trackView.setBounds(-2,r,i+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,r,e-t,6),this._startHandle.layout(r/3,r/3,!1),this._startHandle.trans(t,r+3),this._endHandle.layout(r/3,r/3,!1),this._endHandle.trans(e,r+3)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=$h(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new ga(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new ga(t)),i._simpleMode=!0)}}Kh.CLASS_NAME="rct-navigator",Kh.BACK_STYLE="rct-navigator-back",Kh.MASK_STYLE="rct-navigator-mask",Kh.HANDLE_STYLE="rct-navigator-handle",Kh.HANDLE_BACK_STYLE="rct-navigator-handle-back",Kh.TRACK_CLASS="rct-navigator-track",Kh.THUMB_CLASS="rct-navigator-thumb";class qh extends yt{constructor(t){super(),this.chart=t}}class Qh extends qh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._xStart=e-(a.x-n.x),this._yStart=s-(a.y-n.y),this._body.addFeedback(this._feedback=new Cs(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e-=i.y-s.y,this._body.setZoom(0,d(this._yStart,e),this._body.width,g(this._yStart,e))):(t-=i.x-s.x,this._body.setZoom(d(this._xStart,t),0,g(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._vertical?(r-=a.y-n.y,this._feedback.setBounds(0,d(this._yStart,r),this._body.width,p(this._yStart-r))):(i-=a.x-n.x,this._feedback.setBounds(d(this._xStart,i),0,p(this._xStart-i),this._body.height)),!0}}class Jh extends qh{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,a=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y:e-a.x,this._zoomLen=n.model.axis._zoom.length(),!0}_doDrag(t,e,s,i,r){const n=this._view;let a;return n._vertical?(a=n.svgToElement(i,r).y-this._startOff,a=n.getZoomPos(n.height-a-n._thumbView.height),n.model.axis.zoom(a,a+this._zoomLen)):(a=n.svgToElement(i,r).x-this._startOff,a=n.getZoomPos(a),n.model.axis.zoom(a,a+this._zoomLen),console.log(a)),!0}}class to extends qh{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}_doStart(t,e,s,i,r){const n=this._handleView,a=n.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y-n.height/2:e-a.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axis();a._prepareZoom();let h=n.svgToElement(i,r).x-this._startOff;const o=a._zoom.total(),l=a._zoom.min,c=n.model.minSize;return this._handleView._vertical?this._isStart:this._isStart?h>0?a.zoom(h*o/n.width+l,NaN,c):a.zoom(l,NaN,c):h>0&&h<n.width?a.zoom(NaN,h*o/n.width+l,c):h>=n.width&&a.zoom(NaN,a._zoom.max,c),!0}}class eo extends qh{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),a=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-a.y:e-a.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(a*this._totalLen/n.height):this.$_moveZoom(a*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=g(0,d(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class so{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),{x:s,y:i}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const r=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||i<0||i>=e.control.dom().offsetHeight||(r?this.$_doDrag(t,n,s,i):(!this._dragTracker&&(p(this._clickX-s)>3||p(this._clickY-i)>3)||this._dragTracker&&!r)&&this.$_startMove(t,n,s,i))}this._prevX=s,this._prevY=i,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(t.target)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=this._clickElement,i=e.getButton(s);let r,n,a;if(i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof Ms){const t=n.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof $a&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.pageX-e.left,y:t.pageY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return ua.isThumb(t)?new Jh(this._chart,i.getScrollView(t)):Kh.isHandle(t)?new to(this._chart,i._navigatorView,t):Kh.isMask(t)&&r&&r.model.isZoomed()?new eo(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Qh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}$_startDrag(t,e,s,i,r){return this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.isDragging()&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}}class io extends gt{constructor(t){super(t,io.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Zt(t,"rct-history-item");e.anchor=Yt.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Zt(t);e.anchor=Yt.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].transX(n),a<r-1&&(n+=e[a].width+i,s[a].transX(n),n+=s[a].width+i)}}io.TITLE_CLASS="rct-history";class ro extends ia{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Cs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Zt(t,"rct-legend-item-label")),this._label.anchor=Yt.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const n=this._rMarker=this._marker.setVis(e.legend.markerVisible)?this._marker.getBBox():Un,a=Kn(this._label.getBBox());return this._gap=m(e.legend.markerGap,0),Qn.create(n.width+this._gap+a.width,g(n.height,a.height))}_doLayout(t){const e=this._rMarker,s=m(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class no extends ra{constructor(t){super(t,no.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Xn(this,ro)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.items(),a=this._vertical=e.getLayout()===as.VERTICAL;return this._ipr=m(e.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap=e.location!==ns.BODY?m(e.gap,0):0,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,n),this.$_measure(t,e,a,this._ipr,s,i)}_doLayout(){const t=this.model,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,a=t.itemGap||0,h=this._margins,o=this._paddings,l=this._vertical,c=h.left+o.left,_=h.top+o.top;let u,d=c,g=_;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),g=_,r!==hs.CENTER&&r!==hs.END||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1)+h.top+h.bottom+o.top+o.bottom,r===hs.CENTER?g+=(this.height-u)/2:g+=this.height-u),t.forEach((t=>{t.trans(d,g),g+=t.height+a})),d+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),d=c,r!==hs.CENTER&&r!==hs.END||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1)+h.left+h.right+o.left+o.right,r===hs.CENTER?d+=(this.width-u)/2:d+=this.width-u),t.forEach((t=>{t.trans(d,g),d+=t.width+a})),g+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.items(),h=this._itemViews,o=e.itemGap||0,l=e.lineGap||0,c=h.count,_=this._rowViews=[],u=this._sizes=[];let d,p,m,w;h.forEach(((s,i)=>{s.setMarker(a[i].source.legendMarker(t,e.markerSize)),s.measure(t,a[i],r,n,1)}));let f=0,x=0;if(s){for(;f<c;)w=h.get(f),x%i==0?(_.push(m=[w]),p=w.mh,x++,f++):(p+=o+w.mh,p<=n?(m.push(w),x++,f++):x=0);this._wMarkers=[],d=p=0,_.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=g(s,t.mw),r=g(r,t._rMarker.width),t._col=e})),i+=o*(t.length-1),p=g(p,i),d+=s,u.push(s),this._wMarkers.push(r)})),d+=l*(_.length-1)}else{for(;f<c;)w=h.get(f),x%i==0?(_.push(m=[w]),d=w.mw,x++,f++):(d+=o+w.mw,d<=r?(m.push(w),x++,f++):x=0);d=p=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=g(s,t.mh)})),e+=o*(t.length-1),d=g(d,e),p+=s,u.push(s)})),p+=l*(_.length-1)}return Qn.create(d,p)}}no.LEGEND_CLASS="rct-legend";let ao=class extends na{constructor(){super(...arguments),this.views=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views,a=[];for(this.isX=e,s&&s._axes.forEach((t=>{a.push(t)}));n.length<a.length;){const e=new ga(t);this.add(e),n.push(e)}for(;n.length>a.length;)n.pop().remove();if(n.forEach(((e,s)=>{const r=a[s];r._runPos,e.model=a[s],i.forEach((s=>{s.forEach((s=>{s.isConnected(r)&&e.prepareGuides(t,s.row,s.col,s._guideContainer,s._frontGuideContainer)}))}))})),this.axes=a,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((a,h)=>{e+=a.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((a,h)=>{e+=a.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){this.isHorz?this.views.forEach((t=>{t.resize(this.width,t.mh),t.layout()})):this.views.forEach((t=>{t.resize(t.mw,this.height),t.transX(this.width-t.mw),t.layout()}))}};class ho extends na{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new ao(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((n,a)=>{this.isX?(n.row=i,n.col=a):(n.col=i,n.row=a),n.prepare(t,this.isX,r[a],e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):0}checkHeights(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){let n=0,a=0;return this._isHorz?this.sections.forEach((n=>{a=g(a,n.measure(t,e,s,i,r).height)})):this.sections.forEach((a=>{n=g(n,a.measure(t,e,s,i,r).width)})),{width:n,height:a}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height).trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]).trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class oo extends Uh{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(t,e){const s=this.row,i=this.col,r=e.split.getPane(s,i).body,n=e._getSeries().getPaneSeries(s,i),a=e._getGauges().getPaneVisibles(s,i);this._animatable=ut._animatable&&e.animatable(),this._prepareSeries(t,e,n),this._prepareGauges(t,e,a),this._prepareAnnotations(t,r.getAnnotations())}}class lo extends gt{constructor(t,e){super(t,lo.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r,n,a){const h=e.chart,o=this._inverted=e.chart.isInverted(),l=r,c=n;this.$_prepareAxes(t,s,!0),this.$_prepareAxes(t,i,!1),e.layoutAxes(r,n,o,a),o?(r-=this._xContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0),n-=this._yContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0)):(n-=this._xContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0),r-=this._yContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0)),e.layoutAxes(r,n,o,a),this._xContainers.forEach((e=>e.measure(t,h,r,n,a))),this._yContainers.forEach((e=>e.measure(t,h,r,n,a))),r=l,n=c,o?(r-=this._xContainers.reduce(((t,e)=>t+e.mw),0),n-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(n-=this._xContainers.reduce(((t,e)=>t+e.mh),0),r-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),e.layoutAxes(r,n,o,a),this._xContainers.forEach((e=>e.measure(t,h,r,n,a))),this._yContainers.forEach((e=>e.measure(t,h,r,n,a)));const _=e.getXLens(o?n:r),u=e.getYLens(o?r:n);e.calcAxesPoints(_,u)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new Cs(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new gt(t,C)),this.add(this._axisContainer=new gt(t,C)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount(),r=this._bodies,n=this._bodyMap=[];for(;r.length<i;){const e=new oo(t,this._owner);this._bodyContainer.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();for(let t=0;t<e.rowCount();t++){const s=[];for(let i=0;i<e.colCount();i++){const n=r[t*e.colCount()+i];s.push(n),n.row=t,n.col=i}n.push(s)}r.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new ho(t,s);this._axisContainer.add(e),i.push(e)}for(;i.length>r;)i.pop().remove();i.forEach(((s,i)=>{s.prepare(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=new Array(2*(e+1)),n=s-t.reduce(((t,e)=>t+e[i]),0),a=new Array(e);let h=0,o=0;for(o=0;o<e;o++)a[o]=n/e;for(o=0;o<e;o++)r[2*o]=h,r[2*o+1]=h+=t[o][i],h+=a[o];return r[2*o]=h,r[2*o+1]=h+t[o][i],r}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),e,"mw"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),s,"mh")):(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),s,"mh"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),e,"mw"))}$_layoutAxes(t,e,s,i){const r=this._rowPoints,n=this._colPoints,a=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=n[1],e=n[n.length-2]-t;a.forEach(((t,s)=>{t.resize(t.mw,e).trans(r[2*s],i-n[n.length-2]),t.layout(n)}))}else{const t=r[1],e=r[r.length-2]-t;a.forEach(((s,a)=>{s.resize(e,s.mh).trans(t,i-n[2*a+1]),s.layout(r)}))}else if(e){const t=n[1];s=n[n.length-2]-t,a.forEach(((e,a)=>{e.resize(s,e.mh).trans(t,i-r[2*a+1]),e.layout(n)}))}else{const t=r[r.length-2],e=t-r[1];a.forEach(((s,a)=>{s.resize(s.mw,e).trans(n[2*a],i-t),s.layout(r)}))}}$_layoutBodies(t,e,s){t.chart.body;const i=t.rowCount(),r=t.colCount(),n=this._rowPoints,a=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const o=h[e*r+n],l=a[2*n+1],c=a[2*(n+1)];o.measure(this.doc,t.getPane(e,n).body,i-s,c-l,1),o.resize(i-s,c-l).trans(s,this.height-c),o.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],o=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],c=a[2*(n+1)-1],_=a[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,_-c,o-i,1),l.resize(_-c,o-i).trans(c,s-o),l.layout()}}}}lo.STYLE_NAME="rct-panes";class co extends dt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Ia(t))}layout(){}}class _o extends dt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new gt(t,"rct-polar-axis-markers")),this._markViews=new Xn(this._markContainer,co),this.add(this._gridContainer=new dt(t,"rct-polar-axis-grids")),this._labelViews=new Xn(this._labelContainer=s,ca,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this._markLen=e.tick.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s.style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(da)?t.setLabel(s,e,r.replace(da,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(this._labelContainer.setVis(s.visible)){const t=e._ticks;this._labelContainer.setStyleOrClass(s.style),this._labelViews.prepare(t.length,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.front));e.addAll(t,i,!0),i=this._model.guides.filter((t=>t.front)),s.addAll(t,i,!0)}}class uo extends _o{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Xn(this._gridContainer,mr,uo.GRID_CLASS),e.insertFirst(this._startView=new mr(t,uo.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new mr(t,uo.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new za(t,uo.LINE_CLASS))}_doPrepare(t,e,s){let i=this._lineView;this._gridContainer.setVis(t.grid.isVisible(!0))&&this._gridLines.prepare(e.length),i.setVis(t.line.visible)&&(i.setStyleOrClass(t.line.style),i.setFill("none")),this._startView.setVis(s&&t.isArced()&&t.sectorLine.visible)?(this._startView.setStyleOrClass(t.sectorLine.style),this._endView.setVis(!0),this._endView.setStyleOrClass(t.sectorLine.style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const a=t.getStartAngle(),h=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*h/L)),this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const h=r[n].pos,o=e+l(a+h)*i,_=s+c(a+h)*i;t.setLine(e,s,o,_)})),this._labelContainer.visible){const n=this._labelViews.count,h=Math.ceil(9/(360/n)),o=i+t.tick.length,_=Q.CENTER;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%h==0)){const n=r[i],h=t.getBBox(),u=a+n.pos,d=e+l(u)*(o+h.width/2)-h.width/2,g=s+c(u)*(o+h.height/2)-h.height/2;t.layout(_).trans(d,g)}})),n>2&&p(r[n-1].pos-r[n-2].pos)<L/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,a,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+l(a+n)*i,s+c(a+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+l(a)*i,s+c(a)*i),this._endView.setLine(e,s,e+l(a+h)*i,s+c(a+h)*i))}}uo.LINE_CLASS="rct-polar-xaxis-line",uo.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",uo.GRID_CLASS="rct-polar-xaxis-grid-line";class go extends _o{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new Xn(this._gridContainer,za,go.GRID_LINE_STYLE),e.add(this._lineView=new mr(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s,i){this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=t.line.visible)&&this._lineView.setStyleOrClass(t.line.style)}_doLayout(t,e,s,i,r,n){const a=n.getStartAngle(),h=n.getTotalAngle();if(this._gridContainer.visible){const i=this._circular;this._gridLines.forEach(((o,_)=>{const u=r[_].pos;if(i)o.setArc(e,s,u,a,h,!0),o.setFill("none");else if(o instanceof wr){const i=t.getStartAngle(),r=[];n._ticks.forEach((t=>{const n=t.pos;r.push(e+l(i+n)*u,s+c(i+n)*u)})),o.setPoints(...r)}}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const a=e+l(t)*r[n].pos-i.getBBox().width/2,h=s+c(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(a,h)}))}else this._labelViews.forEach(((t,i)=>{t.setContrast(null).trans(e+2,s-r[i].pos-t.getBBox().height/2)}));this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}go.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class po extends Uh{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this.$_prepareAxes(t,n.xAxis,n._getYAxes().items,this.model.circular,n.xAxis.isArced()),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{var r;t.model.needClip(!0)&&(this._polarClip||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(e,s,i),t.getClipContainer().setClip(this._polarClip),null===(r=t.getClipContainer2())||void 0===r||r.setClip(this._polarClip)),t.resize(2*i,2*i),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.layout(this.width,this.height,t.getPolar(e.model.axis))))})),this._layoutAnnotations(!1,this.width,this.height)}$_prepareAxes(t,e,s,i,r){this._axisContainer||(this.insertFirst(this._axisLabelContainer=new gt(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new gt(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new gt(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new go(t,this._lineContainer,this._axisLabelContainer);this._axisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisView||this._axisContainer.add(this._xAxisView=new uo(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class mo extends ra{constructor(t,e){super(t,e?mo.SUBTITLE_CLASS:mo.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Zt(t)),this._richText=new se}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.text),this._richText.build(this._textView,s,i,null,null),Kn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var wo;mo.TITLE_CLASS="rct-title",mo.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(wo||(wo={}));class fo extends dt{constructor(t){super(t,fo.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ft(t,"rct-tooltip-back")),this.add(this._top=new ft(t,"rct-tooltip-top")),this.add(this._textView=new Zt(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+ut.SHADOW_FILTER+")"),this._textView.anchor=Yt.START,this._richText=new se,this.close(!0,!1)}show(t,e,s,i,r){const n=this._model=t.chart.tooltip,a=n.setTarget(t,e);if(!a)return;const h=this.control.contentWidth(),o=this.control.contentHeight(),l=this._textView,c=t.chart.isInverted(),_=t._yAxisObj.reversed;this._richText.setFormat(n.text||a.getTooltipText(t,e)),this._richText.build(l,NaN,NaN,null,n.getTextDomain());const u=l.getBBox();let p=g(n.minWidth||0,u.width+16),m=g(n.minHeight||0,u.height+12)+this._topHeight;this._top.setFill(t._calcedColor);const w="visible"===this.getStyle("visibility")?300:0;let f;const x=n.offset+this._tailSize;if(c){f=i-m/2-g(0,d(i-m/2,o-m));const t=_?wo.LEFT:wo.RIGHT;this.drawTooltip(0,0,p,m,t,f),_?s-=p+x:s+=x,i-=m/2}else{f=s-p/2-g(0,d(s-p/2,h-p));const t=_?wo.BOTTOM:wo.TOP;this.drawTooltip(0,0,p,m,t,f),s-=p/2,_?i+=x:i-=m+x}s=g(0,d(s,h-p)),i=g(0,d(i,o-m)),this.transEx(s,i,w,!1),0===w&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.hideDelay:Dn.HIDE_DELAY))}$_hide(){ys(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const a=this._tailSize,h=this._radius,o=this._topHeight;let l=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];switch(r){case wo.TOP:l=l.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case wo.BOTTOM:l=l.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case wo.LEFT:l=l.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case wo.RIGHT:l=l.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c=r===wo.BOTTOM,_=c?["M",t,e+i-o,"l",s,0,"l",0,o-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,o-h,"l",-s,0,"l",0,h-o,"q",0,-h,h,-h],u=this._textView,d=u.getBBox();t+=(s-d.width)/2,e+=(i-d.height+(c?-o:o))/2,u.trans(t,e),this._top.setPath(_),this._back.setPath(l)}}fo.CLASS_NAME="rct-tooltip";class xo extends na{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new mo(t,!1)),this.add(this.subtitleView=new mo(t,!0))}_doMeasure(t,e,s,i,r){const n=e.title,a=e.subtitle;let h,o=0,l=0,c=0,_=0,u=this.titleView,d=s,p=0,w=0;switch(u.setVis(n.isVisible())?(h=u.measure(t,n,s,i,r),l=this._hTitle=h.height,o=this._wTitle=h.width):u.setModel(n),(u=this.subtitleView).setVis(a.isVisible())?(h=u.measure(t,a,s,i,r),_=this._hSub=h.height,c=this._wSub=h.width,w=+e.subtitle.titleGap||0):u.setModel(a),a.position){case ai.LEFT:case ai.RIGHT:p=g(l,_),d=o+w+c;break;default:p=l+w+_,d=g(d,o+c)}return p>0&&(p+=this.titleView.visible?m(n.gap,0):m(a.gap,0)),{width:d,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.visible?this._wTitle>t.wPlot||i.alignBase===et.CHART?t.wChart:t.wPlot:0,a=r&&r.visible?this._wSub>t.wPlot||r.alignBase===et.CHART?t.wChart:t.wPlot:0;let h=this._wTitle>t.wPlot||i&&i.alignBase===et.CHART?0:t.xPlot,o=this._wSub>t.wPlot||r&&r.alignBase===et.CHART?0:t.xPlot;if(n>0&&a>0){const t=(t,e,s)=>{switch(t.verticalAlign){case J.MIDDLE:return(e-s)/2;case J.BOTTOM:return e-s;default:return 0}},l=()=>{const e=g(this._hTitle,this._hSub);d=g(d,d+t(i,e,this._hTitle)),w=g(w,w+t(r,e,this._hSub))},c=(t,e,s)=>{switch(t.align){case Q.CENTER:return(e-s)/2;case Q.RIGHT:return e-s;default:return 0}},_=()=>{if(p=g(p,p+c(i,n,this._wTitle)),r.alignBase===et.PARENT)switch(r.align){case Q.CENTER:f=p+(this._wTitle-this._wSub)/2;break;case Q.RIGHT:f=p+this._wTitle-this._wSub;break;default:f=p}else f=g(f,f+c(r,a,this._wSub))},u=m(r.titleGap,0);let d=0,p=h,w=0,f=o;switch(i.align){case Q.LEFT:switch(r.position){case ai.LEFT:p=f+this._wSub+u,l();break;case ai.RIGHT:switch(f=p+this._wTitle+u,r.align){case Q.CENTER:f=g(f,f+(a-this._wTitle-this._wSub)/2);break;case Q.RIGHT:f=g(f,o+a-this._wSub)}l();break;case ai.TOP:_(),d=w+this._hSub+u;break;default:_(),w=d+this._hTitle+u}break;case Q.RIGHT:switch(r.position){case ai.LEFT:switch(p+=n-this._wTitle,r.align){case Q.CENTER:f+=(n-this._wTitle-this._wSub)/2;break;case Q.RIGHT:f=p-u-this._wSub}l();break;case ai.RIGHT:f+=a-this._wSub,p=f-u-this._wTitle,l();break;case ai.TOP:_(),d=w+this._hSub+u;break;default:_(),w=d+this._hTitle+u}break;default:switch(r.position){case ai.LEFT:switch(p+=(n-this._wTitle)/2,r.align){case Q.LEFT:break;case Q.CENTER:f+=(p-f-this._wSub)/2;break;case Q.RIGHT:f=p-u-this._wSub}l();break;case ai.RIGHT:switch(p+=(n-this._wTitle)/2,r.align){case Q.LEFT:f=p+this._wTitle+u;break;case Q.CENTER:f=p+this._wTitle+u,f+=(a-f-this._wSub)/2;break;case Q.RIGHT:f+=a-u-this._wSub}l();break;case ai.TOP:_(),d=w+this._hSub+u;break;default:_(),w=d+this._hTitle+u}}e.resizeByMeasured().layout().trans(p,d),s.resizeByMeasured().layout().trans(f,w)}else if(n>0||a>0){const t=n?i:r,l=n?e:s,c=n||a,_=n?this._wTitle:this._wSub;let u=n?h:o;switch(l.resizeByMeasured().layout(),t.align){case Q.LEFT:break;case Q.RIGHT:u+=c-_;break;default:u+=(c-_)/2}l.trans(u,0)}}}class bo extends na{_doInitChildren(t){this.add(this._legendView=new no(t))}_doMeasure(t,e,s,i,r){const n=e.legend,a=this._legendView.measure(t,n,s,i,r),h=this._pos=n.getLocatiion();return h===ns.LEFT||h===ns.RIGHT?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case ns.LEFT:s-=e;break;case ns.RIGHT:s-=e,r+=e;break;case ns.TOP:i-=e;break;default:n+=e,i-=e}t.resize(s,i).trans(r,n),t.layout()}}class yo extends na{constructor(t,e){super(t),this.dir=e,this.views=[],this.visibles=[],this._gap=0}prepare(t,e,s,i){const r=this.views;let n,a=r.length;for(;r.length<e.length;)n=new ga(t),e[a++].visible&&this.add(n),r.push(n);for(;r.length>e.length;)n=r.pop(),n.parent&&n.remove();if(r.forEach(((r,n)=>{r.model=e[n],r.prepareGuides(t,NaN,NaN,s,i)})),this.setVis(r.filter((t=>t.model.visible)).length>0)){const t=r[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,a=0;return[this.views].forEach((e=>{if(e){const h=(this.isX,s),o=(this.isX,i);let l=0,c=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,h,o,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,c+=s.height}})),this.isHorz?c+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=g(n,l),a=g(a,c)}})),Qn.create(n,a)}_doLayout(t){let e=this.width,s=this.height,i=0,r=0;t=+t||0,[this.views].forEach((n=>{if(n){let a=0;n.forEach((t=>{t.visible&&(t.checkExtents(),this.isHorz?t.resize(e,t.mh):t.resize(t.mw,s),t.layout(),this.isHorz?(t.trans(i,this.dir===tt.TOP?s-a-t.mh:a),a+=t.mh+this._gap):(t.trans(this.dir===tt.RIGHT?a:e-a-t.mw,r),a+=t.mw+this._gap))})),this.isHorz?i+=e+t:r+=s+t}}))}}class vo extends ia{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Zt(t)),this._textView.anchor=Yt.START}clicked(t){this.model.url&&window.open(this.model.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.text,this.setCursor(e.url?"pointer":""),this._textView.getBBox()}}class Vo extends gt{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new gt(t,"rct-annotations")),this.add(this._plotContainer=new gt(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Uh(t,this));for(const e in tt){const s=new yo(t,tt[e]);this._plotContainer.add(s),this._axisSectionMap[tt[e]]=s}this.add(this._paneContainer=new lo(t,this)),this.add(this._titleSectionView=new xo(t)),this.add(this._legendSectionView=new bo(t)),this.add(this._frontAnnotationContainer=new gt(t,"rct-front-annotations")),this.add(this._creditView=new vo(t)),this.add(this._navigatorView=new Kh(t)),this.add(this._historyView=new io(t)),this.add(this._tooltipView=new fo(t))}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){const n=this._model=e,a=n.isPolar(),h=n.options.credits,o=n.legend,l=n.seriesNavigator;let c,_=s,u=i;if(this._inverted=n.isInverted(),n.isSplitted()?(this._plotContainer.setVis(!1),this._paneContainer.setVis(!0),this.$_preparePanes(t,n.split)):(this._plotContainer.setVis(!0),this._paneContainer.setVis(!1),this.$_prepareBody(t,a)),this._creditView.setVis(h.visible)&&(c=this._creditView.measure(t,h,_,u,r),h.isFloating()||(u-=c.height+(+h.offsetY||0)+(+h.gap||0))),c=this._titleSectionView.measure(t,n,_,u,r),u-=c.height,this._legendSectionView.setVis(o.isVisible()))switch(c=this._legendSectionView.measure(t,n,_,u,r),o.getLocatiion()){case ns.TOP:case ns.BOTTOM:u-=c.height;break;case ns.RIGHT:case ns.LEFT:_-=c.width}this._navigatorView.setVis(l.isVisible()),this._paneContainer.visible?this._paneContainer.measure(t,n.split,n.xPaneAxes,n.yPaneAxes,_,u,1):a?this.$_measurePolar(t,n,_,u,1):this.$_measurePlot(t,n,_,u,1),this._navigatorView.visible&&(n.seriesNavigator._vertical?u=this._bodyView.mh:_=this._bodyView.mw,this._navigatorView.measure(t,l,_,u,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){const t=this.width,e=this.height;let s=t,i=e;const r=this._model,n=r.isPolar(),a=r.legend,h=r.options.credits,o=this._creditView,l=+h.offsetY||0,c=+h.gap||0;let _=0,u=0,d=0,g=0;o.visible&&(o.resizeByMeasured(),h.isFloating()||(h.verticalAlign===J.TOP?i-=_=o.height+l+c:i-=u=o.height+l+c));const p=this._titleSectionView;let m=0;const w=g+_;p.visible&&(p.resizeByMeasured(),i-=m=p.height),g=e-u;const f=this._navigatorView;let x=0;f.visible&&(f.model._vertical||(f.resize(f.mw,f.mh-f.model.gap-f.model.gapFar),i-=x=f.mh));const b=this._legendSectionView;let y,v,V=0,S=0;if(b.visible)switch(b.resizeByMeasured().layout(),V=b.height,S=b.width,a.getLocatiion()){case ns.TOP:y=m+_,i-=V;break;case ns.BOTTOM:i-=V,y=g-V,g-=V;break;case ns.RIGHT:s-=S,v=t-S;break;case ns.LEFT:s-=S,d+=S,v=0}f.visible&&(g-=x,f.layout().transY(g+f.model.gap));let P,k=0,A=0,C=0,E=0;if(this._paneContainer.visible)this._paneContainer.resize(s,i).trans(d,w+m),this._paneContainer.layout(),C=i,E=s,P=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[tt.CENTER],r=t[tt.MIDDLE];let a;n||(e&&e.visible&&(k=e.mw),r&&r.visible&&(A=r.mh),[tt.LEFT,tt.RIGHT].forEach((e=>{(a=t[e])&&a.visible&&(s-=a.mw)})),[tt.TOP,tt.BOTTOM].forEach((e=>{(a=t[e])&&a.visible&&(i-=a.mh)})),(a=t[tt.LEFT])&&a.visible&&(a.resize(a.mw,i),a.layout(A),d+=a.mw),(a=t[tt.RIGHT])&&a.visible&&(a.resize(a.mw,i),a.layout(A)),k>0&&(e.resize(a.mw,i),e.layout()),(a=t[tt.BOTTOM])&&a.visible&&(a.resize(s,a.mh),a.layout(k),g-=a.mh),(a=t[tt.TOP])&&a.visible&&(a.resize(s,a.mh),a.layout(k)),A>0&&(r.resize(s,a.mh),r.layout())),f.visible&&f.layout().transX(d);const h=this._org={x:d,y:g};this._plotWidth=s,this._plotHeight=i,n||((a=t[tt.LEFT])&&a.visible&&a.trans(h.x-a.mw,h.y-a.height),(a=t[tt.RIGHT])&&a.visible&&a.trans(h.x+s,h.y-a.height),k>0&&e.trans(h.x+(s-k)/2,h.y-e.height),(a=t[tt.BOTTOM])&&a.visible&&a.trans(h.x,h.y),(a=t[tt.TOP])&&a.visible&&a.trans(h.x,h.y-i-a.height),A>0&&r.trans(h.x,h.y-(i-A)/2-A)),C=this._plotHeight-A,E=this._plotWidth-k,d=h.x,g=h.y-this._plotHeight,this._currBody.resize(E,C),this._currBody.layout().trans(d,g),P=this._currBody.getRect(),this._currBody._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(o.visible){const s=+h.offsetX||0,i=l;let r,n;switch(o.layout(),h.verticalAlign){case J.TOP:break;case J.MIDDLE:n=(e-o.height)/2+i;break;default:n=e-u+c}switch(h.align){case Q.LEFT:r=s;break;case Q.CENTER:r=(t-o.width)/2+s;break;default:r=t-o.width-s}o.trans(r,n)}if(E+=k,p.visible&&p.layout({xPlot:d,wPlot:E,wChart:t}).trans(0,w),b.visible){if(a.location===ns.BODY){let t=+a.offsetX||0;switch(a.align){case Q.RIGHT:d+=E-S-t;break;case Q.CENTER:d+=(E-S)/2+t;break;default:d+=t}switch(t=+a.offsetY||0,a.verticalAlign){case J.BOTTOM:g+=C-V-t;break;case J.MIDDLE:g+=(C-V)/2+t;break;default:g+=t}}else if(isNaN(y)){const t=+a.offsetY||0;if(d=v,a.alignBase===et.CHART){switch(a.verticalAlign){case J.TOP:g=t;break;case J.BOTTOM:g=e-V-t;break;default:g=(e-V)/2+t}g+V>e&&(g=(e-V)/2)}else switch(a.verticalAlign){case J.TOP:g+=t;break;case J.BOTTOM:g=g+i-V-t;break;default:g=g+(i-V)/2+t}g+V>e&&(g=(e-V)/2),g<0&&(g=0)}else{const e=+a.offsetX||0;if(g=y,a.alignBase===et.CHART)switch(a.align){case Q.LEFT:d=e;break;case Q.RIGHT:d=t-S-e;break;default:d=(t-S)/2+e}else switch(a.align){case Q.LEFT:d+=e;break;case Q.RIGHT:d=d+s-S-e;break;default:d+=(s-S)/2+e}d+S>t&&(d=(t-S)/2),d<0&&(d=0)}b.trans(d,g)}this.$_layoutAnnotations(this._inverted,t,e,P),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:n}=e.getTooltipPos(),a=this._model.chart.tooltip.followPointer,h=a?i.x+s.tx:r+s.tx,o=a?i.y+s.ty:n+s.ty;this._tooltipView.show(t,e,h,o,!0)}hideTooltip(){this._tooltipView.close(!1,!0)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._paneContainer.visible?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){const i=s,r=this._model&&this.bodyOf(s),n=null==i?void 0:i.classList,a=(null==n?void 0:n.value)&&(n.contains("rct-contextmenu-item")||n.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,r){const n=r.controlToElement(t,e),o=r.pointerMoved(n,s);for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model.crosshair,s=t.model._isHorz?r.width:r.height,i=t.model._isHorz?n.x:n.y,h=o&&e.visible&&!a&&e.flag.visible&&!e.isBar()&&e.getFlag(s,i);h?(t.showCrosshair(i,h),t.model.crosshair.moved(i,h)):t.hideCrosshiar()}));if(!this._hoverItem&&this._legendSectionView._legendView.contains(i)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(i);t&&t.legend.seriesHovering&&t.source&&r.hoverSeries(t.source)}h instanceof rs&&!(this._hoverItem instanceof rs)&&r.hoverSeries(null)}}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in tt){const s=this._axisSectionMap[tt[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody.width,this._currBody.height))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new po(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e.needAxes(),a=this._axisSectionMap;for(const s in a){const h=a[s];n?h.prepare(t,e.getAxes(s,!1),i,r):h.visible=!1}s.prepare()}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap;if(this._navigatorView.visible){const t=e.seriesNavigator;t._vertical?s-=t.thickness+t.gap+t.gapFar:i-=t.thickness+t.gap+t.gapFar}const a=s,h=i;let o=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[tt.LEFT].checkWidths(t,s,i),s-=n[tt.RIGHT].checkWidths(t,s,i),i-=n[tt.BOTTOM].checkHeights(t,s,i),i-=n[tt.TOP].checkHeights(t,s,i),this._inverted?s-=o=n[tt.CENTER].checkWidths(t,s,i):i-=l=n[tt.MIDDLE].checkHeights(t,s,i),s-=o,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&h.measure(t,e,s,i,r)}s=a,i=h,o=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===tt.LEFT||t===tt.RIGHT?s-=e.mw:t!==tt.BOTTOM&&t!==tt.TOP||(i-=e.mh),this._inverted?t===tt.CENTER&&(s-=o=e.mw):t===tt.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r);for(const a in n){const h=n[a];h.visible&&(h.measure(t,e,s,i,r),h.prepareGridRows(t,this._bodyView._gridRowContainer))}s=a,i=h,o=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===tt.LEFT||t===tt.RIGHT?s-=e.mw:t!==tt.BOTTOM&&t!==tt.TOP||(i-=e.mh),this._inverted?t===tt.CENTER&&(s-=o=e.mw):t===tt.MIDDLE&&(i-=l=e.mh))}e.axesLayouted(s,i,this._inverted),this._bodyView.measure(t,e.body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e.body.calcRadius(s,i),a=2*Math.PI*n,h=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(a,h,!1,r),e.axesLayouted(a,h,!1),this._polarView.measure(t,e.body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Bh(t,e);(e.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,a,h,o;this._annotationViews.forEach((i=>{if(i.model.scope===xe.CONTAINER)n=-r.left,a=-r.top,h=e+r.left+r.right,o=s+r.top+r.bottom;else n=a=0,h=e,o=s;i._layoutView(t,n,a,h,o)}))}}class So extends ut{constructor(t,e){super(t,e),this.addElement(this._chartView=new Vo(t)),this.setPointerHandler(new so(this))}onModelChanged(t,e,s){e instanceof Le&&s===pe.UPDATED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}get model(){return this._model}set model(t){t!==this._model&&(this._model&&(this._model.assets.unregister(this.doc(),this),this._model.removeListener(this)),this._model=t,this._model&&(this._model.addListener(this),this._model.assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout())}chartView(){return this._chartView}load(t,e=!1){this.clearAssetDefs(),this.model=new Yn(t),this.model._loadAnimatable=e}refresh(t){t?this._render():this.invalidateLayout()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}_doRender(t){const e=this._model,s=this._chartView;this.clearTemporaryDefs(),e&&(this.setData("theme",e.options.theme,!0),this.setData("palette",e.options.palette),e.prepareRender()),this.loaded||s.clean(),s.measure(this.doc(),e,t.width,t.height,1),s.setRect(t),s.layout(),e&&e.afterRender()}_doRenderBackground(t,s,i,r){if(this._model){const i=this._model.options.style;if(e(i))for(const e in i)e.startsWith("padding")?s.setStyle(e,i[e]):t.style[e]=i[e]}}}class Po{constructor(t){this._doInit(this.$_p=t)}_createObjects(...t){for(const e of t)this["_"+e]=new Po(this.$_p[e])}_doInit(t){}get(t){const e=this.$_p.getProp(t);if(e instanceof pe){const e=this[t];return e instanceof Po?e:void 0}return e}set(t,e,s=!0){return this.$_p.setProp(t,e,s),this}setAll(t,e=!0){return this.$_p.setProps(t,e),this}toggle(t,e=!0){return this.$_p.setProp(t,!this.$_p.getProp(t),e),this}_changed(){this.$_p.chart._modelChanged(this.$_p)}}class ko extends Po{_doInit(t){this._createObjects("title","line","grid","tick","label","crosshair")}get xy(){return this.$_p._isX?"x":"y"}get isX(){return this.$_p._isX}get title(){return this._title}get line(){return this._line}get grid(){return this._grid}get tick(){return this._tick}get label(){return this._label}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get isEmpty(){return this.$_p.isEmpty()}resetZoom(){this.$_p.resetZoom()}zoom(t,e){this.$_p.zoom(t,e)}}class Ao extends Po{get name(){return this.$_p.name}}class Co extends Ao{_doInit(t){this._createObjects("pointLabel","trendline","tooltip")}get pointLabel(){return this._pointLabel}get trendLine(){return this._trendLine}get tooltip(){return this._tooltip}get pointCount(){return this.$_p._runPoints.length}get visiblePointCount(){return this.$_p._visPoints.length}getPointAt(t){const e=this.$_p.getPointAt(t);return e&&e.proxy()}findPoint(t){const e=this.$_p.findPoint(t);return e&&e.proxy()}getValueAt(t){const e=this.$_p.getPointAt(t);return e?e.yValue:C}setValueAt(t,e,s=!0){const i=this.$_p.getPointAt(t);return!!i&&!!this.$_p.setValueAt(i,e,s)}addPoint(t,e=!0){const s=this.$_p.addPoint(t,e);return s&&s.proxy()}removePoint(t){return!!this.$_p.removePoint(this.$_p.getPointAt(t))}addPoints(t){}removePoints(t){}updateData(t){this.$_p.updateData(t)}}class Eo extends Ao{}class Lo extends Ao{setValue(t,e=!0){this.$_p.updateValue(t,e)}}class To extends Ao{}class No extends Ao{update(){this.$_p.update()}}class Ro extends Po{}class Mo extends Po{}class Oo extends Po{}class Do extends Po{}function Bo(t,e){if(e){let s=t.get(e);return s||(e instanceof Zs?s=new Co(e):e instanceof Ue?s=new ko(e):e instanceof Li?s=new Lo(e):e instanceof Le?s=new No(e):e instanceof ui?s=new Ro(e):e instanceof di?s=new Mo(e):e instanceof os?s=new Oo(e):e instanceof ss&&(s=new Do(e)),t.set(e,s)),s}}class $o{constructor(t){this._objects=new Map,this._proxy={getChartObject:t=>Bo(this._objects,t)},this.$_p=t}load(t,e){this.$_p.load(t,e);const s=this.$_p.model;s._proxy=this._proxy;const i=window.RealChartExporter,r=s.exportOptions.visible;i&&r&&(this._exporter=i.render(this.$_p.doc(),this.$_p.dom(),s.exportOptions)),this._objects.clear()}render(t=!1){this.$_p.refresh(t),this._exporter&&this._exporter.render(this.$_p.model.exportOptions)}get xAxis(){return Bo(this._objects,this.$_p.model.xAxis)}getXAxis(t){return Bo(this._objects,this.$_p.model.getXAxis(t))}get yAxis(){return Bo(this._objects,this.$_p.model.yAxis)}getYAxis(t){return Bo(this._objects,this.$_p.model.getYAxis(t))}get series(){return Bo(this._objects,this.$_p.model.firstSeries)}getSeries(t){return Bo(this._objects,this.$_p.model.seriesByName(t))}get gauge(){return Bo(this._objects,this.$_p.model.firstGauge)}getGauge(t){return Bo(this._objects,this.$_p.model.gaugeByName(t))}getAnnotation(t){return Bo(this._objects,this.$_p.model.annotationByName(t))}get title(){return Bo(this._objects,this.$_p.model.title)}get subtitle(){return Bo(this._objects,this.$_p.model.subtitle)}get legend(){return Bo(this._objects,this.$_p.model.legend)}get body(){return Bo(this._objects,this.$_p.model.legend)}get type(){return this.$_p.model.type}get gaugeType(){return this.$_p.model.gaugeType}get inverted(){return this.$_p.model.inverted}get polar(){return this.$_p.model.polar}scroll(t,e){this.$_p.scroll(t.$_p,e)}setParam(t,e,s){this.$_p.model.setParam(t,e,s)}addSeries(t,e=!0){const s=this.$_p.model.addSeries(t,e);return s&&Bo(this._objects,s)}removeSeries(t,e=!0){const s=this.$_p.model.removeSeries(t instanceof Co?t.$_p:t,e);if(s){return Bo(this._objects,s)}}}class Io{constructor(t){this.$_p=t}get rowCount(){return this.$_p._rows.length}getValue(t,e){return this.$_p.getValue(t,e)}setValue(t,e,s){this.$_p.setValue(t,e,s)}getValues(t,e=0,s=-1){return this.$_p.getValues(t,e,s)}getRow(t){return this.$_p.getRow(t)}addRow(t,e=-1){this.$_p.addRow(t,e)}deleteRow(t=-1){this.$_p.deleteRow(t)}}class Fo{static getVersion(){return"0.9.34"}static setLocale(t,e){e&&A(t,e),(t=>{k=S[P=t],k||(k=S[P="ko"])})(t)}static registerLocale(t,e){A(t,e)}static setDebugging(t){dt.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static setAnimatable(t){ut._animatable=t}static createChart(t,e,s,i=!0){const r=new $o(new So(t,e));return r.load(s,!0),r}static createData(t,e){return new Io(new Ts(t||{},e))}}const zo=Fo.getVersion,Ho=Fo.setDebugging,Go=Fo.setLogging,jo=Fo.setAnimatable,Wo=Fo.createChart,Yo=Fo.createData;export{No as RcAnnotation,Do as RcBody,ko as RcChartAxis,$o as RcChartControl,Io as RcChartData,Lo as RcChartGauge,Po as RcChartObject,Co as RcChartSeries,To as RcGaugeGroup,Oo as RcLegend,Ao as RcNamedObject,Eo as RcSeriesGroup,Mo as RcSubtitle,Ro as RcTitle,Wo as createChart,Yo as createData,zo as getVersion,jo as setAnimatable,Ho as setDebugging,Go as setLogging};
|